region filling
TRANSCRIPT
![Page 1: Region filling](https://reader036.vdocument.in/reader036/viewer/2022062412/58f2d1aa1a28abdf0f8b45bf/html5/thumbnails/1.jpg)
A Mini project on:Morphological Region Filling
C. K. PITHAWALA COLLEGE OF ENGINEERING AND TECHNOLOGY
Prepared by:Sr. no. Name of student Enrollment
1. Hetvi Naik 130090111055
2. Vatsal Champaneria 140093111005
Guided by:Dr. Mita Paunwala Prof. Mayna shah
![Page 2: Region filling](https://reader036.vdocument.in/reader036/viewer/2022062412/58f2d1aa1a28abdf0f8b45bf/html5/thumbnails/2.jpg)
1( ) 1, 2,3,...ck kX X B A k
Morphological Region Filling
o This algorithm is based on a set of dilations, complementation and intersections.
o Task: Given a binary image X and a (seed) point p, fill the region surrounded by the pixels of X and contains p.
o A: An image where only the boundary pixels are labeled 1 and others are labeled 0
o Ac: The Complement of Ao We start with an image X0 where only the seed point p is 1 and others are
0. Then we repeat the following steps until it converges
![Page 3: Region filling](https://reader036.vdocument.in/reader036/viewer/2022062412/58f2d1aa1a28abdf0f8b45bf/html5/thumbnails/3.jpg)
Contd….
o The process stops when X(k) = X(k-1)o The result that given by union of A and X(k), is a set contains
the filled set and the boundary.
![Page 4: Region filling](https://reader036.vdocument.in/reader036/viewer/2022062412/58f2d1aa1a28abdf0f8b45bf/html5/thumbnails/4.jpg)
A Ac
Morphological Region Filling
![Page 5: Region filling](https://reader036.vdocument.in/reader036/viewer/2022062412/58f2d1aa1a28abdf0f8b45bf/html5/thumbnails/5.jpg)
Morphological Region Fillingo The boundary of an object A denoted by δ(A) can be
obtained by first eroding the object and then subtracting the eroded image from the original image.
( )A A A B
A
![Page 6: Region filling](https://reader036.vdocument.in/reader036/viewer/2022062412/58f2d1aa1a28abdf0f8b45bf/html5/thumbnails/6.jpg)
1( ) ( ) 1, 2,3,...ck kX X B A k
Morphological Region Filling
![Page 7: Region filling](https://reader036.vdocument.in/reader036/viewer/2022062412/58f2d1aa1a28abdf0f8b45bf/html5/thumbnails/7.jpg)
Morphological Region Filling
![Page 8: Region filling](https://reader036.vdocument.in/reader036/viewer/2022062412/58f2d1aa1a28abdf0f8b45bf/html5/thumbnails/8.jpg)
Program code:
%reading into workspaceI = imread('coins.png');figure imshow(I) title('Original Image')
%Convert image to binary image BW = imbinarize(I); figure imshow(BW) title('Original Image Converted to Binary Image')
%Fill holes in the binary image and display the result.BW2 = imfill(BW,'holes'); figure imshow(BW2) title('Filled Image')
![Page 9: Region filling](https://reader036.vdocument.in/reader036/viewer/2022062412/58f2d1aa1a28abdf0f8b45bf/html5/thumbnails/9.jpg)
output
![Page 10: Region filling](https://reader036.vdocument.in/reader036/viewer/2022062412/58f2d1aa1a28abdf0f8b45bf/html5/thumbnails/10.jpg)
Syntax
Syntax:o I = imread('coins.png');reads a grayscale or color image from the file
specified by the string filename. If the file is not in the current folder, or in a folder on the MATLAB path, specify the full pathname.
o imshow(I) displays the image I in a Handle Graphics figure, where I is a grayscale, RGB (true color), or binary image. For binary images, imshow displays pixels with the value 0 (zero) as black and 1 as white
o BW = imbinarize(I); creates a binary image from image I by replacing all values above a globally determined threshold with 1s and setting all other values to 0s. By default, imbinarize uses Otsu's method, which chooses the threshold value to minimize the intraclass variance of the thresholded black and white pixels
o BW2 = imfill(BW,'holes'); fills holes in the input binary image BW. In this syntax, a hole is a set of background pixels that cannot be reached by filling in the background from the edge of the image.
![Page 11: Region filling](https://reader036.vdocument.in/reader036/viewer/2022062412/58f2d1aa1a28abdf0f8b45bf/html5/thumbnails/11.jpg)
THANK YOU!