Lecture 2 Binary Image Processing 1 Gray Scale

Lecture 2 Binary Image Processing 1

Gray Scale and Color Image Gray = 0. 299 * R + 0. 587 * G + 0. 114 * B 2

Gray Scale and Color Image 3

Histogram 4

Thresholding 5

Thresholding using Histogram 6

Thresholding by Photoshop l Figure / Ground Separation l แยกรป (Figure) ออกจากพนหลง (background( Algorithm for Threshold if(pixel[row][column]. color >=100) pixel[row][column]. color = 255 else pixel[row][column]. color = 0 7

Properties of Binary Image (1) l Area 0 means white (background) 8

Properties of Binary Image (2) l Position of Object 9

Properties of Binary Image (2) l Position of Object X= 2(1)+3(3)+4(3)+5(8)+6(5)+7(5)+8(2) = 2+9+12+40+30+35+16=144/27 = 5. 33 = 5 Y= 2(1)+3(4)+4(5)+5(4)+6(3)+7(6)+8(3)+9(1) = 2+12+20+20+18+42+24+9 = 147/27 = 5. 44 = 5 Position of object = (5, 5( 10

Properties of Binary Image (3) l Projection 11

Properties of Binary Image (3) l Projection 12

Blob Coloring (region segment) 13

Neighboring System 14

Neighboring System 15

Line Segment Labeling mask 16

Blob coloring example mask Equivalent set 17

Run length encoding Binary image Start and length of 1 runs : row 1 = (1, 3) (7, 2) (12, 4) (17, 2) (20, 3) row 2 = (5, 13) (19, 4) row 3 = (1, 3) (17, 6) Length of 1 and 0 runs : row 1 = (1, 3) (0, 3) (1, 2) (0, 3) (1, 4) (0, 1) (1, 2) (0, 1) (1, 3) row 2 = (0, 4) (1, 13) (0, 1) (1, 4) row 3 = (1, 3) (0, 13) (1, 6) 18



Chain Code) Example( Edge Contour สามารถสรป Chain code ดงน Chain Code 6(2), 5(3), 4(1), 3(1), 5(5), 7(1), 6(1), 5(2), 7(1), 6(1), 8(1), 7(2), 1(1), 2(2), 8(2), 1(2), 2(1), 4(1), 2(1), 1(2), 8(4), 2(3), 4(1), 2(1), 4(1), 3(2), 5(2) 21


- Slides: 23