Elaborazione delle Immagini Informazione multimediale - Immagini Raffaella Lanzarotti
MATHEMATICAL MORPHOLOGY 2
Definitions Morphology: branch of biology studying shape and structure of plants and animals Matematical morphology: Technique to represent and describe region shape (e.g. boundary, skeleton, connected surface). Pre e post-processing (morphological filtering, thinning, pruning) 3
Morphological operators erosion and dilation are the basic operators in the mathematical morphology other operators can be defined combining erosion and dilation 4
Structural elements (S.E.) Def: (small) set of pixel in given positions, correlated by a point of application, called origin Elaborazione delle Immagini I 5
Erosion X B = {z (B) z X} X B = {z (B) z \ X c =?} 6
Erosion Set of all points z s.t. B translated in z is completely in X Effect: delete small regions and filaments Reduce systematically the region dimensions 7
Dilation X B = {z ( ˆB) z \ X 6=?} 8
Dilation Set of all z s.t. B(reflex) intersect with X in at least one element Effect: close small holes and small inlet Augment systematically the region dimensions 9
Example original image and its erosion with circular S.E. with radius 11, 15, 45 Elaborazione delle Immagini I 10
Opening A B =(A B) B = [{(B) z (B) z A} Effect: Contours more homogeneous delete filaments or small regions Maintain the region original dimensions 11
Closing A B =(A B) B = [{w (B) z \ A 6=?, 8w (B) z } Effect: Contours more homogeneous Delete small holes Join small regions together Maintain the region original dimensions 12
Hit-or-Miss Objective: find the position of specific shapes (e.g. D) Observation: it is necessary to define the «local background» (W-D) 13
Step of the Hit-or-Miss Erosion of A with the element D we are looking for: Result: elements of D 14
Steps of Hit-or-Miss Erosion of A C with the local background W-D Result: elements of D 15
Steps ofhit-or-miss Intersection between the two erosions find the elements = D C A( ) B = ( AΘ D) A Θ( W D) & $% #!" 16
Boundary extraction β ( A) = A ( AΘB) 17
Example (S.E. = B) 18
Fill in empty regions Given a set of points A 8-connected corresponding to the boundary of a close region given a point p within this region We determine all the points within the region: X k =(X k 1 B) \ A c, k =1, 2, 3,... where X0=p Stop when Xk=Xk-1 19
Fill in empty regions X k =(X k 1 B) \ A c, k =1, 2, 3,... The region is the union between A and the last X k 20
Example Sv: it requires to know the seed position p 21
Skeleton Why: images of objects with linea structure complex shapes and ramifications for the shape representations use the skeleton 22
MAT: Median Axis Transformation Explanation via MAT: Think to set fire to a field (simultaneously from all the boundary points ) Boundary rectangular boundary fire line filre line median axis of the skeleton median axis of the skeleton In case of rectangular fields, we have points reached by the fire line simultaneously horizontally and vertically, and placed at the minima equidistance from at least two boundary points The set of points with this characteristic constitute the median axis of the skeleton 23
More precisely A point p of an object belong to the median axis ( skeleton ) if, called d the minimum distance between p and the figure boundary, they exist at least two points in the boundary placed at distance d from p. The MAT is defined is defined in the points belonging to the median axis, and tis value is given by the minimum distance from the point to the boundary. 24
Examples 25
Computing the MAT measure of the distance d(p,c) of each point P from the boundary points C. The distances d are local maxima (skeleton) if d(p,c) d(q,c) for each pixel Q in the neighborhood of P. The distance value is computed working on a window 3 3. Positioning the window in each pixel of the binary image of the image f(p). The distance g(p) of the central pixel is worked out adding to the value of the current pixel f(p) the minimum value of its four neighbors (sono i pixel Nord, Sud, Est, Ovest) g 0 (i,j) = f(i,j) g k (i,j) = g 0 (i,j)+min[g k-1 (u,v)] k=1,2... Elaborazione delle Immagini I 26
Example DT: distance from the boundary, Skeleton: points with local maximal distance; MAT: values of DT in such points 27
Example 28
Example NB: detect noise/blemish: 29
morphological skeleton 30
morphological skeleton Skeleton of A S(A): points z s.t. If z is in S(A) and (D) z is the largest disk centered on z and contained in A the disk (D) z touch the boundary of A in at least two points 31
morphological skeleton Skeleton: sequence of erosion and opening: Where B is the structural element and k indicates a sequence of k erosion of A 32
morphological skeleton K is the last iteration before the skeleton becomes empty We can demonstrate that A can be reconstructed from S(A): 33
Example 34