Digital Image Processing Lecture 20 Representation Description Prof

  • Slides: 21
Download presentation
Digital Image Processing Lecture 20: Representation & Description Prof. Charlene Tsai * Materials from

Digital Image Processing Lecture 20: Representation & Description Prof. Charlene Tsai * Materials from Gonzales chapter 11 1

Representation n n After segmentation, we get pixels along the boundary or pixels contained

Representation n n After segmentation, we get pixels along the boundary or pixels contained in a region. Representing a region involves two choices: q q Using external characteristics, e. g. boundary Using internal characteristics, e. g. color and texture 2

Common Representation n Common external representation methods are: q q q n Chain code

Common Representation n Common external representation methods are: q q q n Chain code Polygonal approximation Signature Boundary segments Skeleton (medial axis) We’ll discuss the first 3. 3

Method 1: Chain Codes n n Represent a boundary by a connected sequence of

Method 1: Chain Codes n n Represent a boundary by a connected sequence of straight-line segments of specified length and direction. Directions are coded using the numbering scheme 4 -connectivity 8 connectivity 4

Generation of Chain Codes n n Walking along the boundary in clockwise direction, for

Generation of Chain Codes n n Walking along the boundary in clockwise direction, for every pair of pixels assign the direction. Problems: q q n Long chain Sensitive to noise Remedies? q Resampling using larger grid spacing. 5

Resampling for Chain Codes 0033… 01 (4 -directional) 0766… 12 (8 -directional) Spacing of

Resampling for Chain Codes 0033… 01 (4 -directional) 0766… 12 (8 -directional) Spacing of the sampling grid affect the accuracy of the representation 6

Normalization for Chain Codes n With respect to starting point: q q q n

Normalization for Chain Codes n With respect to starting point: q q q n For rotation: q q n Make the chain code a circular sequence Redefine the starting point which gives an integer of minimum magnitude E. g. 101003333222 normalized to 003333222101 Using first difference (FD) obtained by counting the number of direction changes in counterclockwise direction E. g FD of a 4 -direction chain code 10103322 is 3133030 For scaling: q Altering the size of the resampling grid. 7

Method 2: Polygonal Approximation n n Approximate a digital boundary with arbitrary accuracy by

Method 2: Polygonal Approximation n n Approximate a digital boundary with arbitrary accuracy by a polygon. Goal: to capture the “essence” of the boundary shape with the fewest possible polygonal segments. 8

Minimum Perimeter Polygons n Two techniques: merging & splitting 9

Minimum Perimeter Polygons n Two techniques: merging & splitting 9

Merging Technique n Repeat the following steps: q q q n n Merging unprocessed

Merging Technique n Repeat the following steps: q q q n n Merging unprocessed points along the boundary until the least-square error line fit exceed the threshold. Store the parameters of the line Reset the LS error to 0 Intersections of adjacent line segments form vertices of the polygon. Problem: vertices of the polygon do not always correspond to inflections (e. g. corners) in the original boundary. 10

Splitting Technique n n Subdivide a segment successively into two parts until a specified

Splitting Technique n n Subdivide a segment successively into two parts until a specified criterion is met. For example 11

Method 3: Signature n n Reduce the boundary representation to a 1 D function

Method 3: Signature n n Reduce the boundary representation to a 1 D function For example, distance vs. angle 12

(con’d) n For the signature just described q q q Invariant to translation (everything

(con’d) n For the signature just described q q q Invariant to translation (everything w. r. t. the centroid) Depending on rotation and scaling How to remove the dependence on rotation? n n n q Selecting point farthest from the centroid Farthest point on the eigen axis (more robust) Using the chain code How to remove the dependence on scaling? n n Scale all functions to span the range, say, [0, 1] (not very robust) Normalize by the variance 13

Descriptors n Boundary information can be used directly, or converted into features that describe

Descriptors n Boundary information can be used directly, or converted into features that describe properties of a region, such as q q q Length of the boundary Orientation of straight line joining its extreme points Number of concavities in the boundary 14

Boundary Descriptors (Properties) n Length: approximated by the # of pixels Diameter: n Basic

Boundary Descriptors (Properties) n Length: approximated by the # of pixels Diameter: n Basic rectangle: defined by n q q n Major axis: the line giving the diameter Minor axis: the line perpendicular to major axis Eccentricity: ratio of the 2 axes 15

Fourier Descriptor n n Given a set of boundary points (x 0, y 0),

Fourier Descriptor n n Given a set of boundary points (x 0, y 0), (x 1, y 1), (x 2, y 2), …, . (x. K-1, y. K-1). Represent the sequence of coordinates as s(k)=[xk, yk], for k=0, 1, 2, …, K-1. Using complex representation for each point: s(k) = xk + jyk Advantage: reducing 2 D to 1 D problem 16

1 D Fourier (Review) n DFT of s(k) is n The complex coefficients a(u),

1 D Fourier (Review) n DFT of s(k) is n The complex coefficients a(u), for u=0, 1, 2, …, K-1, are called the Fourier descriptor of the boundary The inverse Fourier restores s(k) n 17

Fourier Approximation n Using only the first P coefficients (a(u)=0 for u>P) n Please

Fourier Approximation n Using only the first P coefficients (a(u)=0 for u>P) n Please note that k still ranges from 0 to K-1 The smaller P becomes, the more detail that is lost on the boundary There are ways to make the descriptor insensitive to translation, rotation, and scale changes. Please refer to Gonzalez pg 658 -659 for details. n n 18

Example 19

Example 19

Region Descriptors n Simple descriptors: q q q Area: # of pixels in the

Region Descriptors n Simple descriptors: q q q Area: # of pixels in the region Perimeter: length of its boundary Compactness: (perimeter)2/area n q n Q: What shape gives the minimal compactness Mean and median of the gray levels. Topological descriptors: q q # of holes # of connected components 20

Summary n Common external representation methods are: q q q n Chain code Polygonal

Summary n Common external representation methods are: q q q n Chain code Polygonal approximation Signature Descriptors q q q Boundary descriptor Fourier descriptor Region descriptor 21