Morphological Filtering
Morphological Filtering Spatial Filtering Morphological operators: are used to change image data to reflect new geometric structure. Basics of Morphological Filtering To kinds : Binary Morphology Grey Level Morphology
Libraries of Structuring Elements Application specific structuring elements created by the user
Binary Morphology Binary images often suffer from noise (specifically salt- and-pepper noise) Binary regions also suffer from noise (isolated black pixels in a white region). Can also have cracks, picket fence , etc. Dilation and erosion are two binary morphological operations that can assist with these problems.
Dilation Dilation is used for expanding an element A by using structuring element B. The dilation operator takes two pieces of data as input A binary image, which is to be dilated A structuring element (or kernel), which determines the behavior of the morphological operation
Main Applications of Dilation Expand shapes Fills in holes, crack, valleys between spiky regions Smoothes object boundaries. Adds an extra outer ring of pixels onto object boundary, ie, object becomes slightly larger. (sets background pixels adjacent to object's contour to object's value) smoothes small negative grey level regions
Main Applications of Dilation
Dilation – A More interesting Example cracks
Dilation
Dilation fills holes Fills in holes. Smoothes object boundaries. Adds an extra outer ring of pixels onto object boundary, ie, object becomes slightly larger.
Dilation example
Dilation explained pixed by pixel • • • Denotes origin of B i.e. its (0,0) Denotes origin of A i.e. its (0,0)
Dilation explained by shape of A Shape of A repeated without shift B • • • Shape of A repeated with shift A
Structuring Element for Dilation Length 6 Length 5
Structuring Element for Dilation
Structuring Element for Dilation Single point in Image replaced with this in the Result
Structuring Element for Dilation
Illustration of Extensitivity of Dilation • • B • Replaced with
Definition of Dilation: Mathematically Let A and B are subsets in 2-D space. A: image undergoing analysis, B: Structuring element, denotes dilation
Dilation explained pixed by pixel • • • (0,1) + (0,0)= (0,1) (1,2) + (0,0)= (1,2) (1,3) + (0,0)= (1,3) (1,4) + (0,0)= (1,4) (2,2) + (0,0)= (2,2) (0,1) + (1,0)= (1,1) (1,2) + (1,0)= (2,2) (1,3) + (1,0)= (2,3) (1,4) + (1,0)= (2,4) (2,2) + (1,0)= (3,2)
Mathematical Properties of Dilation Commutative Associative Linearity Containment Decomposition of structuring element
More Properties of Dilation Translation Invariance Linearity Containment Decomposition of structuring element
Dilation Question: Suppose that the structuring element is a 3x3 square with the origin at its center evaluate the new image 1 { (-1,-1), (0,-1), (1,-1), (-1,0), (0,0), (1,0), ( 1,1), (0,1), (1,1) } B = A =
Dilation
In MATLAB Codes Dilation image: strel:This function creates amorphological structuring element. SE=strel(‘shape’,parameters) Dilation image: imdilate: This function Dilate the image. I2=imerode(‘image’,SE) shape parameters ‘disk’ R ‘line’ Len,deg ‘square’ w ‘rectangle’ [m n]
Codes Example1: A = imread(‘Image.tif'); figure,imshow(A); se = strel('disk',3); A2 = imdilate(A, se); imshow(A), figure,imshow(A2); Example 2: A = imread('broken-text.tif'); B = [0 1 0; 1 1 1; 0 1 0]; A2 = imdilate(A,B); imshow(A),figure,imshow(A2)
Example of Dilation with various sizes of structuring elements Pablo Picasso, Pass with the Cape, 1960