Computer and Robot Vision I Chapter 3 Binary
Computer and Robot Vision I Chapter 3 Binary Machine Vision: Region Analysis Presented by: 傅楸善 & 陳弘毅 0922489262 r 04922099@ntu. edu. tw 指導教授: 傅楸善 博士 Digital Camera and Computer Vision Laboratory Department of Computer Science and Information Engineering National Taiwan University, Taipei, Taiwan, R. O. C.
3. 0 Outline l l Region properties Signature segmentation properties DC & CV Lab. CSIE NTU
3. 2 Map of Region Properties 1. 2. 3. 4. Basic properties Extremal Points Spatial Moments Mixed Spatial Gray Level Moments DC & CV Lab. CSIE NTU
3. 2 Map of Region Properties l DC & CV Lab. CSIE NTU
3. 2 Map of Region Properties 1. l 1) 2) 3) 4) 5) Basic properties Microtexture properties ( Co-occurrence) texture second moment texture entropy texture contrast texture homogeneity texture correlation DC & CV Lab. CSIE NTU
3. 2 Region Properties l l l bounding rectangle: smallest rectangle circumscribes the region 0 1 2 area: centroid: 0 1 0 0 0 0 1 0 2 0 0 1 1 1 0 3 0 0 1 1 1 4 0 0 1 1 1 1 1 0 0 0 0 0 5 6 7 DC & CV Lab. CSIE NTU 3 4 5 6 7 0 0 0
3. 2 Region Properties (cont’) l l l border pixel: has some neighboring pixel outside the region : 4 -connected perimeter: if 8 -connectivity for inside and outside : 8 -connected perimeter: if 4 -connectivity for inside and outside DC & CV Lab. CSIE NTU
3. 2 Region Properties (cont’) ( 1, 0 ) N 8(r, c) R DC & CV Lab. CSIE NTU
3. 2 Region Properties (cont’) ( 1, 1 ) N 8(r, c) R DC & CV Lab. CSIE NTU
3. 2 Region Properties (cont’) ( 1, 0 ) N 4(r, c) R DC & CV Lab. CSIE NTU
3. 2 Region Properties (cont’) ( 1, 1 ) N 4(r, c) R DC & CV Lab. CSIE NTU
3. 2 Region Properties (cont’) l length of perimeter successive pixels neighbors l where k+1 is computed modulo K i. e. DC & CV Lab. CSIE NTU ,
3. 2 Region Properties (cont’) P 4 DC & CV Lab. CSIE NTU
3. 2 Region Properties (cont’) P 8 DC & CV Lab. CSIE NTU
3. 2 Region Properties (cont’) length of perimeter where k+1 is computed modulo K |P 8| K = 0, 1, 2, 3, DC & CV Lab. CSIE NTU
3. 2 Region Properties (cont’) l mean distance R from the centroid to the shape boundary l standard deviation R of distances from centroid to boundary DC & CV Lab. CSIE NTU
3. 2 Region Properties (cont’) DC & CV Lab. CSIE NTU
3. 2 Region Properties (cont’) DC & CV Lab. CSIE NTU
3. 2 Region Properties (cont’) DC & CV Lab. CSIE NTU
3. 2 Region Properties (cont’) DC & CV Lab. CSIE NTU
3. 2 Region Properties (cont’) l Haralick shows that has properties: 1. digital shape circular, increases monotonically 2. similar for similar digital/continuous shapes 3. orientation (rotation) and area (scale) independent DC & CV Lab. CSIE NTU
3. 2 Region Properties (cont’) l Average gray level (intensity) l Gray level (intensity) variance DC & CV Lab. CSIE NTU
3. 2 Region Properties (cont’) l l l microtexture properties: A function of cooccurrence matrix S: set of pixels in designated spatial relationship e. g. 4 -neighbors Define the region’s co-occurrence matrix P by DC & CV Lab. CSIE NTU
3. 2 Region Properties (cont’) DC & CV Lab. CSIE NTU
3. 2 Region Properties (cont’) DC & CV Lab. CSIE NTU
3. 2 Region Properties (cont’) 0 0 1 2 3 0 DC & CV Lab. CSIE NTU
DC & CV Lab. CSIE NTU
3. 2 Region Properties (cont’) l texture second moment (Haralick, Shanmugam, and Dinstein, 1973) DC & CV Lab. CSIE NTU GLCM: Grey-Level Co-Occurrence Matrix
l texture entropy DC & CV Lab. CSIE NTU
3. 2 Region Properties (cont’) l texture contrast DC & CV Lab. CSIE NTU
3. 2 Region Properties (cont’) l texture homogeneity where k is some small constant DC & CV Lab. CSIE NTU
l texture correlation where DC & CV Lab. CSIE NTU
3. 2 Map of Region Properties 2. l 1) 2) 3) 4) Extremal Points Definition points axes length orientation Four cases linelike shape Triangular shape square and rectangular shape octagonal shape DC & CV Lab. CSIE NTU
3. 2. 1 Extremal Points l Eight distinct extremal pixels: 1) topmost left 2) topmost right 3) rightmost top 4) rightmost bottom 5) bottommost right 6) bottommost left 7) leftmost bottom 8) leftmost top DC & CV Lab. CSIE NTU
3. 2. 1 Extremal Points (cont’) DC & CV Lab. CSIE NTU
3. 2. 1 Extremal Points (cont’) l different extremal points may be coincident DC & CV Lab. CSIE NTU
3. 2. 1 Extremal Points (cont’) l association of the name of the eight extremal points with their coordinates DC & CV Lab. CSIE NTU
3. 2. 1 Extremal Points (cont’) l association of the name of an external coordinate with its definition DC & CV Lab. CSIE NTU
3. 2. 1 Extremal Points (cont’) l directly define the coordinates of the extremal points: DC & CV Lab. CSIE NTU
3. 2. 1 Extremal Points (cont’) l extremal points occur in opposite pairs: • • topmost left bottommost right topmost right bottommost left rightmost top leftmost bottom rightmost bottom leftmost top l each opposite extremal point pair: defines an axis l axis properties: length, orientation DC & CV Lab. CSIE NTU
3. 2. 1 Extremal Points (cont’) l the length covered by two pixels horizontally adjacent 1: distance between pixel centers 2: from left edge of left pixel to right edge of right pixel DC & CV Lab. CSIE NTU
3. 2. 1 Extremal Points (cont’) l distance calculation: add a small increment to the Euclidean distance DC & CV Lab. CSIE NTU
3. 2. 1 Extremal Points (cont’) l length going from left edge of left pixel to right edge of right pixel x θ DC & CV Lab. CSIE NTU
3. 2. 1 Extremal Points (cont’) l orientation taken counterclockwise w. r. t. column (horizontal) axis DC & CV Lab. CSIE NTU
3. 2. 1 Extremal Points (cont’) l l orientation for the axes paired: with and DC & CV Lab. CSIE NTU with
DC & CV Lab. CSIE NTU
3. 2. 1 Extremal Points (cont’) l calculation of the axis length and orientation of a linelike shape DC & CV Lab. CSIE NTU
3. 2. 1 Extremal Points (cont’) l distance between ith and jth extremal point l average value of - 1. 12 = 1. 12, largest error 0. 294 = DC & CV Lab. CSIE NTU
l calculations for length of sides base and altitude for a triangle DC & CV Lab. CSIE NTU
l calculations for length of sides base and altitude for a triangle l DC & CV Lab. CSIE NTU
l calculation for the orientation of an example rectangle DC & CV Lab. CSIE NTU
l calculation for the orientation of an example rectangle DC & CV Lab. CSIE NTU
3. 2. 1 Extremal Points (cont’) l axes and their mates that arise from octagonal-shaped regions DC & CV Lab. CSIE NTU
3. 2. 1 Extremal Points (cont’) DC & CV Lab. CSIE NTU
3. 2 Map of Region Properties 3. 1) 2) 3) 4) Spatial Moments Second-order row moment Second-order mixed moment Second-order column moment Second-order mixed gray level spatial moment DC & CV Lab. CSIE NTU
3. 2. 2 Spatial Moments(矩) l Second-order row moment l Second-order mixed moment l Second-order column moment DC & CV Lab. CSIE NTU
l If a region R is an ellipse whose center is the origin l A relationship given by DC & CV Lab. CSIE NTU
3. 2. 3 Mixed Spatial Gray Level Moments (cont’) l l region properties: position, shape, gray level properties Second-order mixed gray level spatial moments DC & CV Lab. CSIE NTU
3. 2. 3 Mixed Spatial Gray Level Moments l The mixed gray level spatial moments can be used to determine the least-squares gray level intensity planes to the observed gray level spatial pattern of the region R DC & CV Lab. CSIE NTU
3. 2. 3 Mixed Spatial Gray Level Moments (cont’) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 connected components labeling of the image in Fig 2. 2 01 02 03 04 05 06 07 08 09 10 11 12 13 l DC & CV Lab. CSIE NTU
3. 2. 3 Mixed Spatial Gray Level Moments (cont’) l all the properties measured from each of the regions DC & CV Lab. CSIE NTU
3. 2. 3 Mixed Spatial Gray Level Moments (cont’) DC & CV Lab. CSIE NTU
3. 3 Signature Properties Signature or Projection Area Centroid Second moment Bounding rectangle DC & CV Lab. CSIE NTU Rectangle: orientation & position Circle: position
3. 3 Signature Properties l vertical projection l horizontal projection l diagonal projection from lower left to upper right l diagonal projection from upper left to lower right DC & CV Lab. CSIE NTU
3. 3 Signature Properties DC & CV Lab. CSIE NTU
3. 3 Signature Properties (cont’) l Compute properties from projections l l Area, centroid of the region, second moments area DC & CV Lab. CSIE NTU
3. 3 Signature Properties (cont’) l rmin: top row of bounding rectangle l rmax; bottom row of bounding rectangle l cmin: leftmost column of bounding rectangle l cmax: rightmost column of bounding rectangle DC & CV Lab. CSIE NTU
3. 3 Signature Properties (cont’) l row centroid l column centroid l diagonal centroid l another diagonal centroid DC & CV Lab. CSIE NTU
3. 3 Signature Properties (cont’) l second row moment from horizontal projection l second column moment from vertical projection l second diagonal moment DC & CV Lab. CSIE NTU
3. 3 Signature Properties (cont’) DC & CV Lab. CSIE NTU
3. 3 Signature Properties DC & CV Lab. CSIE NTU
3. 3 Signature Properties (cont’) l second diagonal moment related to l second mixed moment can be obtained from projection l second diagonal moment related to DC & CV Lab. CSIE NTU
3. 3 Signature Properties (cont’) l second mixed moment can be obtained from projection l mixed moment obtained directly from DC & CV Lab. CSIE NTU and
3. 3. 1 Signature Analysis to Determine the Center and Orientation of a Rectangle l l signature analysis: important because of easy, fast implementation surface mount device (SMD) inspection: position and orientation of parts DC & CV Lab. CSIE NTU
3. 3. 1 Signature Analysis to Determine the Center and Orientation of a Rectangle (cont’) l determine center of rectangle by corner location side lengths w, h orientation angle DC & CV Lab. CSIE NTU
l geometry for determining the translation of the center of a rectangle -w/2 h/2 DC & CV Lab. CSIE NTU
l l partition rectangle into six regions formed by two vertical lines a known distance g apart and one horizontal line DC & CV Lab. CSIE NTU
3. 3. 1 Signature Analysis to Determine the Center and Orientation of a Rectangle (cont’) DC & CV Lab. CSIE NTU
DC & CV Lab. CSIE NTU
3. 3. 1 Signature Analysis to Determine the Center and Orientation of a Rectangle (cont’) l where rotation angle DC & CV Lab. CSIE NTU
3. 3. 2 Using Signature to Determine the Center of a Circle (cont’) l circle projected onto the four quadrants of the projection index image DC & CV Lab. CSIE NTU
DC & CV Lab. CSIE NTU
DC & CV Lab. CSIE NTU
3. 3. 2 Using Signature to Determine the Center of a Circle (cont’) l l l each quadrant area from histogram of the masked projection positive if A + B > C + D negative otherwise where positive if B + D > A + C, negative otherwise DC & CV Lab. CSIE NTU
3. 4 Summary l region properties from connected components or signature analysis DC & CV Lab. CSIE NTU
Histogram Equalization (Homework) l l l a method in image processing of contrast adjustment using the image's histogram pixel transformation r, s: original, new intensity, T: transformation T( r ) single-valued, monotonically increasing for DC & CV Lab. CSIE NTU
DC & CV Lab. CSIE NTU
Histogram Equalization (Homework) l histogram equalization histogram linearization l number of pixels with intensity l l j n: total number of pixels for every pixel if DC & CV Lab. CSIE NTU then
Histogram Equalization (Homework) l l Project due Oct. 20 Write a program to do histogram equalization DC & CV Lab. CSIE NTU
End DC & CV Lab. CSIE NTU
- Slides: 90