27
The Orange Objects Classification

The Orange Objects Classification. My process Get the image from the robot Mark the position of the ball in each image Calculate all 7 attributes –Width

Embed Size (px)

Citation preview

The Orange Objects Classification

My process

• Get the image from the robot

• Mark the position of the ball in each image

• Calculate all 7 attributes

– Width– Height– Area– Perimeter– Form Factor

– Distance– Eigen Value

Original Image

Mark the position of the ball

HUE color model

Orange objects in HUE

Discard Big objects

Find interested attribute

• Width, Height, and Area

Width

HeightArea

• Perimeter = ( * # of Diagonal lines)

+ # of Straight lines

From this image:

# of Diagonal line

= 45 lines

# of Straight line

= 80 lines

Perimeter = 143.6396

Find interested attributes

2

• Perimeter

= 18* +28

= 53.4558

2

W H A P FF. Eig Dist.A P FF. Eig Dist.

Find interested attributes

• Form Factor (FF.) = where

A = area, and P = perimeter

If FF. is or close to 1 the circle object

P

A4

Form Factor (FF.)

Blue Yellow

Area 121 121

Perim. 40 44

FF. 0.975 0.886

How to calculate the perimeter

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

= 1 diagonal line and 1 straight line

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

= 1 diagonal line

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

= 2 diagonal lines

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

= 1 straight line

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

= 2 straight lines

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

1 2 3

6 7 8

11 12 X

5

10

14

4

9

13

15 16 17 1918

20 21 22 2423

Old Eigen Value

We set the threshold value as

EigVal1> (0.75*EigVal2) It’s a ball

New Eigen Value (let C4.5 learn it)

• Eigen Value ratio (Eig)

Eig = 1st Eigen value / 2nd Eigen value

EigEig

Find interested attributes

• Centroids and Distance

C4.5 result

1st combination

2nd combination

986 986

1545

986 986

1545

New training Data New test Data

Training DataTest Data

Decision tree (7 attributes)size after pruning: 59 nodes

FF

Eig W

nb Dis

W Dis

nb FF

nb H

Eig A

nb b nb b

H FF

nb FF

nb H

b W

b nb

nb Dis

nb Eig

b Eig

nb b

Dis Dis

nb FF

b Dis

nb H

Dis W

nb b A Dis

b A

b nb

nb b

b Dis

b nb

<=306.358 >306.358

<=29 >29

>14

<=0.8879

<=0.4753 >0.4753

<=0.7965 >0.7965

<=64 >64

<=0.5609 >0.5609 <=4468 >4468

<=357.142 >357.142

<=10 >10

<=0.8379 >0.8379

>13 <=13

<=14

<=0.8812 >0.8812

>380.495 <=380.495

<=0.5262 >0.5262

<=0.6013 >0.6013

>0.8879

<=16 >16

<=338.956 >338.956

>0.9053 <=0.9053

>379.228 <=379.228

<=9 >9

<=376.788 >376.788 <=13 >13

>85 <=85

<=80 >80

<=364.569 >364.569

<=362.988 >362.988

<=370.901 >370.901

Conclusion

• Gained more experiment with machine learning, C4.5

• More practice with Matlab

• Perimeter

= 18* +28

= 53.4558

2

W H A P FF. Eig Dist.A P FF. Eig Dist.