You are on page 1of 14

Hole Filling

Morphology

 Morphology commonly denotes a branch of biology


that deals with the form and structure of animals and
plants

 Mathematical Morphology used to extract image


components that are useful in the representation and
description of region shape, such as
 boundaries extraction
 skeletons
 convex hull

2
Mathematic Morphology

mathematical framework used for:


 pre-processing
 noise filtering, shape simplification, ...
 enhancing object structure
 Skeletonization , convex hull...
 Segmentation
 watershed,…
 quantitative description
 area, perimeter, ...

3
Z2 and Z3
 set in mathematic morphology represent objects in an
image
 binary image (0 = white, 1 = black) : the element of the set is
the coordinates (x,y) of pixel belong to the object  Z2
 gray-scaled image : the element of the set is the
coordinates (x,y) of pixel belong to the object and the
gray levels  Z3

4
Basic Set Theory

5
Structuring element (SE)

 small set to probe the image under study

 for each SE, define origo

 shape and size must be adapted to geometric


properties for the objects

6
Basic morphological operations

 Erosion

 Dialation

7
Dilation

 dilation of a set A by structuring element B: all z in A such


that B hits A when origin of B=z

A  B  {z|(Bˆ )z  A  Φ}

 grow the object

 Useful : filling of holes of certain shape and size, given by SE

8
Hole Filling

 A hole can be defined as a background region


surrounded by a connected border of
foreground pixels

 Algorithms used for hole filling – set dilation,


complementation and intersection
Hole Filling Algorithm
Step 1: Let denote by A a set whose elements are 8-connected
boundaries

Step 2: Let X0 be an initial point at that boundry

Step 3: Region filling can be defined as


X k  ( X k 1  B)  A c
k  1,2,3,...
where B is the symmetric structuring element.
• Algorithm terminates when Xk = Xk-1
• The set Xk then contains all the filled holes
• The union of Xk and A contains all the filled holes and their
boundaries.
 The dilation would fill the entire area if left unchecked.

 However, the intersection at each step with the


complement of A limits the result to inside the region of
interest.

 This is an example of how a morphological process can be


conditioned to meet a desired property. In the current
application, it can be called a conditional dilation.
Example
 An image that could result from thresholding to 2 levels a scene
containing polished spheres (ball bearings).

 Dark spots could be results of reflections. The objective is to


eliminate reflections by hole filling…

13
Thank You!!

You might also like