Successfully reported this slideshow.
Upcoming SlideShare
×

# Region filling

1,341 views

Published on

mini project on morphological region-filling image processing operation

Published in: Engineering
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

### Region filling

1. 1. 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
2. 2. 1( ) 1,2,3,...c k 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 A o 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
3. 3. 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.
4. 4.   A Ac Morphological Region Filling
5. 5. Morphological Region Filling o 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
6. 6. ( ) ( ) 1,2,3,...c X X B A k    Morphological Region Filling
7. 7. Morphological Region Filling
8. 8. Program code: %reading into workspace I = 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')
9. 9. output
10. 10. 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.
11. 11. THANK YOU!