250 likes | 448 Views
Lecture 7. Generalized Hough Transform Texture Segmentation. Generalized Hough Transform. Any fixed shape 2 parts: 1. Learn shape properties 2. Search for shape (target) in image. Learn Shape - “measurements”. 1) Choose an arbitrary “center” point
E N D
Lecture 7 Generalized Hough Transform Texture Segmentation
Generalized Hough Transform Any fixed shape 2 parts: 1. Learn shape properties 2. Search for shape (target) in image
Learn Shape - “measurements” 1) Choose an arbitrary “center” point 2) At some edge points, draw line to center a - angle with x-axis r - distance to center q - gradient from edge detector
q r1, a1 r2, a2 r3, a3 r4, a4 r5, a5 0...19 15, 180 15, 179 16, 177 13,176 14,175 20...39 17, 160 14, 159 18, 161 15, 162 14, 163 30…49 19, 165 20, 170 22, 167 18, 159 21, 161 … … … … … … 340...359 23, 105 24, 103 21,102 22, 104 20, 103 GHT: R-table From a relationship between q, (a,r)
Search for Shapes For each edge element 1. Use q to find all (ai,ri) for that q 2. For each (ai,ri) xc = x + r cos (a) yc = y + r sin (a) 3. Look for Max (xc,yc) the object is there
Search For Shape 180-a xc – x = r cos (a) and yc – y = r sin (a)
Search for Shape 1. Array A[xcmin..xcmax, ycmin…ycmax] initialized to 0 2. For each edge point with gradient q(x,y) find each (a,r) from R-Table xc = x + r cos (a) yc = y + r sin (a) A[xc,yc]++; 3. Look for peaks in A each peak means object is there
Case when target is scaled/rotated Scale factor S rotation factorb Create A of 4-dimension A[xc, yc, S, b] 0..359 b = 180 0.3,0.4,0.5,0.6,0.7,0.8,0.9,1,1.1,1.2,1.3,1.4,1.5 xc = x + r S cos (a+b) yc = y + r S sin (a+b) xc = x + r cos (a) yc = y + r sin (a)
Case when target is scaled/rotated For each (a,r) from R-Table *For each S = .3 to 1.5 step .1 *For each b = 0 to 359 step 1 xc = x + r S cos (a+b) yc = y + r s sin (a+b) A[xc,yc,A,b]++; Look for peaks in 4-D Array Impractical!!
Modified Genearlized Hough Transform Reduced 4D to 2D Allow Scale & Rotation
Dq r1, a1, q1, L1 r2, a2, q2, L2 r3, a3, q3, L3 r4, a4, q4, L4 0...19 15,180,195,99 9,179,219,101 8,177,216,102 9,176,198,100 20...39 17,160,23,5 14,159,38,7 18,161,175,62 15,162,195,95 30…49 19,165,31,53 20,170,8,52 22,167,15,52 18,159,158,12 … … … … … 340..359 23,105,346,11 24,103,165,11 21,102,346,18 22,104,195,24 Modified Genearlized Hough Transform Gradient Direction is perpendicular to edge direction Dq (a, r, L, q)
MGHT: Rotation/Scale Invariant Rotated Object Smaller Object Dqis constant bring out a, r, L, q LT - L of target Rotation factor = qT-q = b xc = x + r S cos (a+b) yc = y + r s sin (a+b) Scale factor = LT/L = S
Image Querying Database Search for Circle shape Search for bulb shape
Segmentation Group pixels that belong to same region with 4-connected color
Texture Segmentation Segment images into texture regions
Texture Segmentation Texture : - Statistical distribution of gray scale - Change in distribution change in texture Spatial Gray Level Distributed Matrix (SGLD) - Co-occurrence Matrix Given a direction, it gives probability distribution of gray scale in that direction
Texture Segmentation (0,0) d = (1,1) Total=27 (0,1) (1,0) (1,1) P(0,0) = 6/27; P(0,1) = 0 P(1,0) = 6/27; P(1,1) = 15/27
Texture Segmentation j x 16 i Gray-level co-occurrence matrix for d = (1,1) 5 x 5 image with three gray levels
Texture Segmentation j j x (1/56) i i x (1/49) 8 x 8 checkerboard image Gray-level co-occurrence matrix for d = (1,0) Gray-level co-occurrence matrix for d = (1,1)
Use of Texture 1) Segmentation 2) Search Split and Merge
หา Co-occurrencematrixที่ d[3,3]และ d[-3,3] กรองเฉลี่ย LoG Food Inspection: Texture