erosion: erosion is used for shrinking of element a by using element b one of the simplest uses of...
TRANSCRIPT
![Page 1: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/1.jpg)
Erosion:
Erosion:
• Erosion is used for shrinking of element A by using element B
• One of the simplest uses of erosion is for eliminating irrelevant details from a binary image.
![Page 2: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/2.jpg)
Erosion
![Page 3: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/3.jpg)
Typical Uses of Erosion
1. Removes isolated noisy pixels.
2. Smoothes object boundary(removes spiky edges).
3. Removes the outer layer of object pixels:
- Object becomes slightly smaller.
- Sets contour pixels of object to background value
![Page 4: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/4.jpg)
Erosion Example
![Page 5: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/5.jpg)
Erosion explained pixel by pixel
•
•
•
•
••••
••
B
A BA
• •••
![Page 6: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/6.jpg)
Structuring Element in Erosion Example
Image Structuring Element Result
![Page 7: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/7.jpg)
How It Works?
During erosion, a pixel is turned on at the image pixel under the structuring element origin only when the pixels of the structuring element match the pixels in the image
Both ON and OFF pixels should match. This example erodes regions horizontally from the
right.
![Page 8: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/8.jpg)
Image Structuring Element Result
Structuring Element in Erosion Structuring Element in Erosion ExampleExample
![Page 9: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/9.jpg)
Image Structuring Element Result
Structuring Element in Erosion Structuring Element in Erosion ExampleExample
![Page 10: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/10.jpg)
Image Structuring Element Result
Structuring Element in Erosion Structuring Element in Erosion ExampleExample
![Page 11: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/11.jpg)
Image Structuring Element Result
Structuring Element in Erosion Structuring Element in Erosion ExampleExample
![Page 12: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/12.jpg)
Image Structuring Element Result
Structuring Element in Erosion Structuring Element in Erosion ExampleExample
![Page 13: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/13.jpg)
Image Structuring Element Result
Structuring Element in Erosion Structuring Element in Erosion ExampleExample
![Page 14: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/14.jpg)
Mathematical Definition of Erosion
1. Erosion is the morphological dual to dilation.
2. It combines two sets using the vector subtraction of set elements.
3. Let denotes the erosion of A by BBA
){
},,{
BbeveryforAbxxx
baxAaanexistBbeveryforxBA
![Page 15: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/15.jpg)
Erosion explained pixel by pixel
•
•
•
•
••••
••
BA BA
• •••
(1,1) – (0,0)= (1,1)(1,2) – (0,0)= (1,2)(1,3) – (0,0)= (1,3)(1,4) – (0,0)= (1,4)(0,4) – (0,0)= (0,4)(2,4) – (0,0)= (2,4)(3,4) – (0,0)= (3,4)(4,4) – (0,0)= (4,4)
(1,1) – (1,0)= (0,1)(1,2) – (1,0)= (0,2)(1,3) – (1,0)= (0,3)(1,4) – (1,0)= (0,4)(0,4) – (1,0)= (-1,4)(2,4) – (1,0)= (1,4)(3,4) – (1,0)= (2,4)(4,4) – (1,0)= (3,4)
![Page 16: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/16.jpg)
Properties of Erosion
Erosion is not commutative!
Linearity
Decomposition of structuring element
)()()( CBCACBA
)()()( CABACBA
ABBA
![Page 17: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/17.jpg)
Erosion
![Page 18: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/18.jpg)
In MATLAB Codesstrel:This function creates amorphological structuring element.
SE=strel(‘shape’,parameters)
Erosion image:
imerode: This function erosion the image.
I2=imerode(‘image’,SE)
shape parameters
‘disk’ R
‘line’ Len,deg
‘square’ w
‘rectangle’ [m n]
![Page 19: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/19.jpg)
CodesA = imread(‘Image.tif');
figure,imshow(A);
se = strel('disk',3);
A2 = imerode(A, se);
figure,imshow(A2);
se = strel('disk',5);
A3 = imerode(A, se);
figure,imshow(A3);
se = strel('disk',10);
A4 = imerode(A, se);
figure,imshow(A4);
![Page 20: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/20.jpg)
Pablo Picasso, Pass with the Cape, 1960
Structuring
Element
Example of Erosions Example of Erosions with various sizes of with various sizes of structuring elementsstructuring elements
![Page 21: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/21.jpg)
Erosion and Dilation summary
![Page 22: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/22.jpg)
Boundary Extraction
![Page 23: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/23.jpg)
Boundary Extraction
First, erode A by B, then make set difference between A and the erosion
The thickness of the contour depends on the size of constructing object – B
![Page 24: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/24.jpg)
Boundary Extraction
![Page 25: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/25.jpg)
Edge detectionDilate - originaloriginal Dilate
![Page 26: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/26.jpg)
Opening & Closing
Opening and Closing are two important operators from mathematical morphology
They are both derived from the fundamental operations of erosion and dilation
They are normally applied to binary images
![Page 27: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/27.jpg)
OPENINGOPENING•Opening of A by B, is simply erosion of A by B, followed by dilation of the result by B.
•We use opening for: o Smoothes object boundarieso Eliminates noise (isolated pixels) o Maintains object size
BBABA )(
![Page 28: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/28.jpg)
Opening is defined as an erosion followed by a dilation using the same structuring element
The basic effect of an opening is similar to erosion but Less destructive than erosion
Does not significantly change an object’s size
OPENINGOPENING
![Page 29: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/29.jpg)
Opening Example
Original What combination of
erosion and dilation gives:o cleaned binary image
o object is the same size as in original
![Page 30: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/30.jpg)
Opening Example Cont
Erode original image.
Dilate eroded image.
Smoothes object boundaries, eliminates noise (isolated pixels) and maintains object size.
DilateOriginal Erode
![Page 31: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/31.jpg)
•Closing of A by B, is dilation followed by erosion (opposite to opening).
•We use Closing for: oSmoothes object boundaries oEliminates noise (small holes), fills gaps in contours and close up cracks in objects. o Maintains object size.
CLOSINGCLOSING
BBABA )(
![Page 32: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/32.jpg)
Close Dilation followed by erosion Serves to close up cracks in objects and holes
due to pepper noise Does not significantly change object size
![Page 33: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/33.jpg)
More examples of Closing
Original What combination of
erosion and dilation gives:o cleaned binary image
o object is the same size as in original
![Page 34: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/34.jpg)
More examples of Closing cont
Dilate original image.
Erode dilated image.
Smoothes object boundaries, eliminates noise (holes) and maintains object size.
ErodeDilateOriginal
![Page 35: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/35.jpg)
Open and CloseClose = Dilate next ErodeOpen = Erode next Dilate
OpenClose
Original image dilated
eroded
dilated
eroded
![Page 36: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/36.jpg)
Spatial Filtering
Closing o Opening & Opening o Closing
![Page 37: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/37.jpg)
Use of opening and closing for morphological filtering
![Page 38: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/38.jpg)
Open and Close
Original image; opening; opening followed by closing
![Page 39: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/39.jpg)
Codes
f = imread('noisy-fingerprint.tif');
figure,imshow(f);
se = strel('square', 3);
fo = imopen(f,se);
figure,imshow(fo);
foc = imclose(fo,se);
figure,imshow(foc);
![Page 40: Erosion: Erosion is used for shrinking of element A by using element B One of the simplest uses of erosion is for eliminating irrelevant details from a](https://reader036.vdocument.in/reader036/viewer/2022062305/5697c0041a28abf838cc474c/html5/thumbnails/40.jpg)
Possible problems with Morphological Operators
Erosion and dilation clean image but leave objects either smaller or larger than their original size.
Opening and closing perform same functions as erosion and dilation but object size remains the same.