580 likes | 882 Views
Chapter 6 Skeleton & Morphological Operation. Image Processing for Pattern Recognition. Acquisition. Preprocessing. Scaling Centering Enhancement Filtering (Transform) Binarization (Thresholding) Edge detection Thinning. Feature Extraction. Classification. Post Processing.
E N D
Image Processing for Pattern Recognition Acquisition Preprocessing Scaling Centering Enhancement Filtering (Transform) Binarization (Thresholding) Edge detection Thinning Feature Extraction Classification Post Processing
Pattern Skeleton • An important step in representing the structural shape of a OOI (object of interest) is to reduce it to a graph composed of lines or arc patterns . e.g. characters, fingerprints, circuit diagram, drawing etc. This reduction is most commonly achieved by reducing the region to its skeleton. • The skeleton of the objects can be obtained by • (a) Medial axis transform • (b) Thinning
Skeletonization & Thinning • Skeletonization is a process for reducing foreground regions in a binary image to a skeletal remnant that largely preserves the extent and connectivity of the original region while throwing away most of the original foreground pixels. • Under this definition it is clear that thinning produces a sort of skeleton.
Medial Axis Transform (MAT) • The terms medial axis transform (MAT) and skeletonization are often used interchangeably but we will distinguish between them slightly. The skeleton is simply a binary image showing the simple skeleton. • The MAT on the other hand is a gray-level image where each point on the skeleton has an intensity which represents its distance to a boundary in the original object.
2 1 1.4 1 1 1 2 1.4 1 1 1 1 0 0 0 1 1 1 1.4 1 2 1 1 1 1.4 2 1 Euclidean= City block= Chessboard= Medial Axis Transform (MAT) • Every point is specified by giving its distance from the nearest boundary point
Medial Axis Transform (MAT) The skeleton is defined as the set of points whose distance from the nearest boundary is locally maximum.
MAT Algorithm - Perform distance transform: starting from original image k=1,2,… where distance between (m,n) and (i,j) - Repeat until k=max. thickness of the region.
MAT Algorithm - Skeleton is given by the set of points: - The original object can be recovered by remembering the skeleton and also the distance from the nearest boundary.
Thinning - The thinned version consists of one pixel width. - Lie roughly along their medial axes. - Requirement: connectedness must be preserved.
Algorithm:(SPTA) • N.J.Naccache & R.Shinghal,”SPTA:A proposed algorithm for thinning binary patterns”,IEEE Transf. On Systems,Man & Cybernetics,Vol.SMC-14,No.13,May/June 1984.pp.409-418.
Some definitions: 1. Cross point: 2. End-point: only 1 black 8-neighbour:
Some definitions: 3. Break point: Match one of the following: “-” one or more of these point contain black pixel.
The Algorithm consists of 2 phases: (a) Smoothing: Remove irregularities and salt-and-pepper noise Remove p in and
(b) Thinning - During each iteration, “flag” those edge points that are not end-point or break-point (preserve connectedness). - At the end of iteration, all flagged point removed.
Consider 4 types of edge points: Left edge point : n4 = white(0) Right edge point: n0 = white(0) Top edge point: n2 = white(0) Left edge point: n6 =white(0) • A point can be more than one type of edge point.
Consider left edge point (without lost of generality): if a pixel matches one of the following, the pixel not flagged. X,Y = don’t care
For (a), (b), (c): (1) if all X’s are white, p is an end-point. (2) if at least one of X’s is dark – break point. For (d), if at least 1 X and at least 1 Y are dark, then p is a break point. Otherwise, assume all X=0, at least 1Y is dark, then p is a either end-point or break-point.
w1,w2,w3 - p is an end point ; w4 - p is a break point; w5,w6 - may cause excessive erosion if deleted. (especially for slant edge) w7,w8 – containing meaningful feature, such as or ◆. [Note that noise is removed in the 1st phase already]
A left safe point is a left edge point which matches any one of (a) to (d), or the following expression s4 is false. Where ni is TRUE if it is dark and unflagged.
Similarly, A right safe point: Top safe point: Bottom safe point:
Each iteration consists of 2 pass: .1st pass - flag left edge point & right edge point .2nd pass – flag top edge point & bottom edge point.
You can use morphological opening to remove small objects from an image while preserving the shape and size of larger objects in the image.
This example uses open to filter out the smaller objects in an image.
This examples closes an image to merge together the small features in the image that are close together.
The boundary of a set A, denoted , can be obtained by first eroding A with B, where B is a suitable structuring element, and then performing the set difference between A and its erosion. That is Typically, B would be a matrix of 1s.
The skeleton of a set can be expressed in terms of erosions and openings. Thus, it can be shown that where B is a structuring element, indicates k successive erosions of A, and K is the last iterative step before A erodes to an empty set.
Gray-value morphological processing • The techniques of morphological filtering can be extended to gray-level images. • To simplify matters we will restrict our presentation to structuring elements, B, that comprise a finite number of pixels and are convex and bounded, ex. disc SE. Now, however, the structuring element has gray values associated with every coordinate position.