11
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

Region filling

Embed Size (px)

Citation preview

Page 1: Region filling

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

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

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

A Ac

Morphological Region Filling

Page 5: Region filling

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

1( ) ( ) 1, 2,3,...ck kX X B A k

Morphological Region Filling

Page 7: Region filling

Morphological Region Filling

Page 8: Region filling

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

output

Page 10: Region filling

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

THANK YOU!