cis581 presentation morphological operations
DESCRIPTION
CIS581 Presentation Morphological Operations. Presented by: Xueyan Li Supervised by: Longin Jan Lateckie. Presentation Outline. Terminology and properties of Morphology Operations Structure element Four morphological Principles Iterative Morphological Operations - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: CIS581 Presentation Morphological Operations](https://reader033.vdocuments.mx/reader033/viewer/2022050623/5681352a550346895d9c930f/html5/thumbnails/1.jpg)
CIS581 PresentationCIS581 PresentationMorphological OperationsMorphological Operations
Presented by: Xueyan Li
Supervised by: Longin Jan Lateckie
![Page 2: CIS581 Presentation Morphological Operations](https://reader033.vdocuments.mx/reader033/viewer/2022050623/5681352a550346895d9c930f/html5/thumbnails/2.jpg)
Presentation OutlinePresentation Outline
Terminology and properties of Morphology Operations Structure element Four morphological Principles Iterative Morphological Operations Matlab Programs and results images for each operation
![Page 3: CIS581 Presentation Morphological Operations](https://reader033.vdocuments.mx/reader033/viewer/2022050623/5681352a550346895d9c930f/html5/thumbnails/3.jpg)
Introduction---Introduction---Morphology OperationsMorphology Operations
Terminology
Morphology: a broad set of image processing operations that process images based on shapes.
Morphological operations apply a structuring elements to an input image, creating an output image of the same size.
Properties
Morphological operations simplify images, and quantify and preserve the main shape characteristics of objects.
![Page 4: CIS581 Presentation Morphological Operations](https://reader033.vdocuments.mx/reader033/viewer/2022050623/5681352a550346895d9c930f/html5/thumbnails/4.jpg)
Four morphological principlesFour morphological principles
Dilation Erosion Opening Closing
![Page 5: CIS581 Presentation Morphological Operations](https://reader033.vdocuments.mx/reader033/viewer/2022050623/5681352a550346895d9c930f/html5/thumbnails/5.jpg)
Relationship of four operationsRelationship of four operations
Dilation and Erosion are the basic operations, can be combined into more complex sequences.
Erosion and dilation are not invertible operations ---if an image is eroded and dilated, the original image is not re-obtained.
The combination of Erosion and dilation constitutes new operations ----opening and closing. They are the most useful morphological filtering.
![Page 6: CIS581 Presentation Morphological Operations](https://reader033.vdocuments.mx/reader033/viewer/2022050623/5681352a550346895d9c930f/html5/thumbnails/6.jpg)
Structuring elementStructuring element
Morphological operations can be customized for an application by the proper selection of the structuring element, which determines exactly how the object will be dilated or eroded.
matlab function strel() can create many kinds of structuring element:
dish-shaped, diamond-shaped, ball-shaped, squareflat linear with length LENarbitrary flat or a nonflat with the specified neighborhood
![Page 7: CIS581 Presentation Morphological Operations](https://reader033.vdocuments.mx/reader033/viewer/2022050623/5681352a550346895d9c930f/html5/thumbnails/7.jpg)
Dilation Dilation
Dilation allows objects to expand, then potentially filling in small holes and connecting disjoint object.
Performance: laying the structuring element on the image and sliding it across the image.
1) If the origin of the structuring element coincides with a ‘0’ in the image, there is no change; move to the next pixel.
2) If the origin of the structuring element coincides with a ‘1’ in the images, perform the OR logic operation on all pixels within the structuring element.
![Page 8: CIS581 Presentation Morphological Operations](https://reader033.vdocuments.mx/reader033/viewer/2022050623/5681352a550346895d9c930f/html5/thumbnails/8.jpg)
My input imagesMy input images
![Page 9: CIS581 Presentation Morphological Operations](https://reader033.vdocuments.mx/reader033/viewer/2022050623/5681352a550346895d9c930f/html5/thumbnails/9.jpg)
Matlab programming ---dilationMatlab programming ---dilation
%Read image
I = imread(‘ford.tiff');
figure('Name', 'original');
imshow(I);
%create structuring elements
% 11-by-11 square
se1 = strel('square',11);
%Apply dilation operation
figure('Name', 'Dilate');
Idilate1 = imdilate(I,se1);
%Show the result image
subplot(1,1,1), imshow(Idilate1), title('11x11 square');
original image (above)
Image after dilation (below)
![Page 10: CIS581 Presentation Morphological Operations](https://reader033.vdocuments.mx/reader033/viewer/2022050623/5681352a550346895d9c930f/html5/thumbnails/10.jpg)
Erosion Erosion
Erosion shrinks objects by etching away (eroding) their boundaries.
Performance:
1) If the origin of the structuring element coincides with a ‘0’ in the image, there is no change; move to the next pixel.
2) If the origin of the structuring element coincides with a ‘1’ in the image, and any of the ‘1’ pixels in the structuring element extend beyond the object (‘1’ pixels) in the image, then change the ‘1’ pixel in the image to a ‘0’;
![Page 11: CIS581 Presentation Morphological Operations](https://reader033.vdocuments.mx/reader033/viewer/2022050623/5681352a550346895d9c930f/html5/thumbnails/11.jpg)
Matlab programming ---erosionMatlab programming ---erosion
%Read image
I = imread(‘ford.tiff');
figure('Name', 'original');
imshow(I);
%create structuring elements
% 11-by-11 square
se1 = strel('square',11);
%Apply erosion operation
figure('Name', 'Erode');
Ierode1 = imerode(I,se1);
%Show the result image
subplot(1,1,1), imshow(Ierode1), title('11x11 square');
original image (above)
Image after erosion (below)
![Page 12: CIS581 Presentation Morphological Operations](https://reader033.vdocuments.mx/reader033/viewer/2022050623/5681352a550346895d9c930f/html5/thumbnails/12.jpg)
OpeningOpening
Opening consists of an erosion followed by a dilation and can be used to eliminate all pixels in regions that are to small to contain the structuring element.
In this case the structuring element is often called a probe, because it is probing the image looking for small objects to filter out of the image.
![Page 13: CIS581 Presentation Morphological Operations](https://reader033.vdocuments.mx/reader033/viewer/2022050623/5681352a550346895d9c930f/html5/thumbnails/13.jpg)
Matlab programming--- openingMatlab programming--- opening
%Read image
I = imread(‘ford.tiff');
figure('Name', 'original');
imshow(I);
%create structuring elements
% 11-by-11 square
se1 = strel('square',11);
%Apply the open opration
figure('Name', 'Open');
Iopen1 = imopen(I,se1);
%Show the result image
subplot(1,1,1), imshow(Iopen1), title('11x11 square');
original image (above)
Image after opening (below)
![Page 14: CIS581 Presentation Morphological Operations](https://reader033.vdocuments.mx/reader033/viewer/2022050623/5681352a550346895d9c930f/html5/thumbnails/14.jpg)
ClosingClosing
Closing consists of a dilation followed by an erosion and connects objects that are close to each other. It can be used to fill in holes and small gaps.
![Page 15: CIS581 Presentation Morphological Operations](https://reader033.vdocuments.mx/reader033/viewer/2022050623/5681352a550346895d9c930f/html5/thumbnails/15.jpg)
Matlab programming ---closingMatlab programming ---closing
%Read image
I = imread(‘ford.tiff');
figure('Name', 'original');
imshow(I);
%create structuring elements
% 11-by-11 square
se1 = strel('square',11);
%Apply close operation
figure('Name', ‘Close');
Iclose1 = imclose(I,se1);
%Show the result image
subplot(1,1,1), imshow(Iclose1), title('11x11 square');
original image (above)
Image after closing (below)
![Page 16: CIS581 Presentation Morphological Operations](https://reader033.vdocuments.mx/reader033/viewer/2022050623/5681352a550346895d9c930f/html5/thumbnails/16.jpg)
Iterative Morphological OperationsIterative Morphological Operations
We can apply one or several operations to an image iteratively.
InputImage ---(apply an operation) outputImage1
---(apply the operation again) outputImage2
…and so on…..until get your desired image
![Page 17: CIS581 Presentation Morphological Operations](https://reader033.vdocuments.mx/reader033/viewer/2022050623/5681352a550346895d9c930f/html5/thumbnails/17.jpg)
Matlab program Matlab program iterative operation of dilation (1)iterative operation of dilation (1)
Original image after 1 dilation
after 5th dilations after inf dilations
![Page 18: CIS581 Presentation Morphological Operations](https://reader033.vdocuments.mx/reader033/viewer/2022050623/5681352a550346895d9c930f/html5/thumbnails/18.jpg)
Matlab program Matlab program iterative operation of dilation (2)iterative operation of dilation (2)
Original image after 1 dilation
after 5th dilations after inf dilations
![Page 19: CIS581 Presentation Morphological Operations](https://reader033.vdocuments.mx/reader033/viewer/2022050623/5681352a550346895d9c930f/html5/thumbnails/19.jpg)
Matlab program Matlab program iterative operation of erosion (1)iterative operation of erosion (1)
Original image after 1 erosion
after 5th erosions after inf erosions
![Page 20: CIS581 Presentation Morphological Operations](https://reader033.vdocuments.mx/reader033/viewer/2022050623/5681352a550346895d9c930f/html5/thumbnails/20.jpg)
Matlab program Matlab program iterative operation of erosion (2)iterative operation of erosion (2)
Original image after 1 erosion
after 5th erosions after inf erosions
![Page 21: CIS581 Presentation Morphological Operations](https://reader033.vdocuments.mx/reader033/viewer/2022050623/5681352a550346895d9c930f/html5/thumbnails/21.jpg)
Matlab program Matlab program iterative operation of opening (1)iterative operation of opening (1)
Original image after 1 opening
after 5th openings after inf openings
![Page 22: CIS581 Presentation Morphological Operations](https://reader033.vdocuments.mx/reader033/viewer/2022050623/5681352a550346895d9c930f/html5/thumbnails/22.jpg)
Matlab program Matlab program iterative operation of opening (2)iterative operation of opening (2)
Original image after 1 opening
after 5th openings after inf openings
![Page 23: CIS581 Presentation Morphological Operations](https://reader033.vdocuments.mx/reader033/viewer/2022050623/5681352a550346895d9c930f/html5/thumbnails/23.jpg)
Matlab program Matlab program iterative operation of closing (1)iterative operation of closing (1)
Original image after 1 closing
after 5th closings after inf closnings
![Page 24: CIS581 Presentation Morphological Operations](https://reader033.vdocuments.mx/reader033/viewer/2022050623/5681352a550346895d9c930f/html5/thumbnails/24.jpg)
Matlab program Matlab program iterative operation of closing (2)iterative operation of closing (2)
Original image after 1 closing
after 5th closings after inf closings
![Page 25: CIS581 Presentation Morphological Operations](https://reader033.vdocuments.mx/reader033/viewer/2022050623/5681352a550346895d9c930f/html5/thumbnails/25.jpg)
Morphological operations Morphological operations on gray-level imageon gray-level image
Original image Image after dilation Image after erosion
![Page 26: CIS581 Presentation Morphological Operations](https://reader033.vdocuments.mx/reader033/viewer/2022050623/5681352a550346895d9c930f/html5/thumbnails/26.jpg)
My programming filesMy programming files
1. morphor.m
2. bwmorhpr.m
If you are more interested in this topic, you can try to play the source code with a updated Matlab. I’m sure a lot of fun there!
![Page 27: CIS581 Presentation Morphological Operations](https://reader033.vdocuments.mx/reader033/viewer/2022050623/5681352a550346895d9c930f/html5/thumbnails/27.jpg)
Thank you !