You are on page 1of 20

IMAGE

SEGMENTATION-
THRESHOLDING
DR. J.N. SWATHI
ASSOCIATE PROFESSOR GRADE2
SCHOOL OF COMPUTER SCIENCE AND ENGINEERING
VELLORE INSTITUTE OF TECHNOLOGY, VELLORE
THRESHOLDING
Assumption: the range of intensity levels covered
by objects of interest is different from the
background.
 Image, f (x, y), composed of light objects on a dark
background.
 object and background pixels have intensity values
grouped into two dominant modes

2
Dr.J.N. Swathi, SCOPE,VIT
THRESHOLDING
 Obvious way to extract the objects from the background is to
select a threshold, T.
 Any point (x, y) in the image at which f (x, y) > T is called an
object point point.
 The segmented image, denoted by g(x, y), is given by

T is a constant - global thresholding


T changes over an image - variable thresholding
In variable thresholding, if the value of T at any point (x, y) in an image depends
on properties of a neighborhood of (x, y) - local or regional thresholding
In variable thresholding, if the value of T depends on the spatial coordinates (x,
y), - dynamic or adaptive thresholding

3
Dr.J.N. Swathi, SCOPE,VIT
THRESHOLDING
A histogram with three dominant modes ( two types of light
objects on a dark background)

4
Dr.J.N. Swathi, SCOPE,VIT
ROLE OF NOISE IN IMAGE
THRESHOLDING

Fig (c) - Trivial task to find threshold Fig(d) – depth of the valley helps in
finding threshold Fig (e) finding a suitable threshold is difficult for segmenting
this image.

5
Dr.J.N. Swathi, SCOPE,VIT
BASIC GLOBAL
THRESHOLDING TO
OBTAIN T
1. Select an initial estimate for T. (The initial threshold must be
chosen greater than the minimum and less than the
maximum intensity level in the image or better to choose
average intensity of an image as initial estimate)
2. Segment the image using T. This well produce two groups of
pixels: G1 consisting of all pixels with gray level values>T
and G2 consisting of pixels with values <=T.
3. Compute the average gray level values 1 and 2 for the
pixels in regions G1 and G2.
4. Compute a new threshold value : T = ½[1 + 2 ]
5. Repeat step 2 through 4 until the difference in T in successive
iterations is smaller than a predefined parameter To.
 Algorithm works well in situations where there is a reasonably clear valley
between the modes of the histogram related to objects and background.

6
Dr.J.N. Swathi, SCOPE,VIT
GLOBAL THRESHOLDING
EXAMPLE

7
Dr.J.N. Swathi, SCOPE,VIT
ADAPTIVE
THRESHOLDING
EXAMPLE

8
Dr.J.N. Swathi, SCOPE,VIT
ADAPTIVE
THRESHOLDING
EXAMPLE

We can simulate the effect with the following steps:


1. Convolve the image with a suitable statistical operator,
i.e. the mean or median.
2. Subtract the original from the convolved image.
3. Threshold the difference image with C.
4. Invert the threshold image.

Note: Invert is performed by a negative operation

9
Dr.J.N. Swathi, SCOPE,VIT
REGION BASED
SEGMENTATION
 Edges and thresholds sometimes do not
give good results for segmentation.
 Region-based segmentation is based on the
connectivity of similar pixels in a region.
 Each region must be uniform.
 Connectivity of the pixels within the region is very
important.
 There are two main approaches to region-
based segmentation: region growing and
region splitting.

10
Dr.J.N. Swathi, SCOPE,VIT
BASIC FORMULATION

11
Dr.J.N. Swathi, SCOPE,VIT
BASIC FORMULATION

12
Dr.J.N. Swathi, SCOPE,VIT
REGION BASED
SEGMENTATION- REGION
GROWING
 Fig. (b) shows the histogram of Fig. (a).
 Difficult to segment the defects by thresholding
methods.
 Applying region growing methods are better in this
case

Figure (a) Figure (b)

13
Dr.J.N. Swathi, SCOPE,VIT
REGION BASED
SEGMENTATION-
REGION GROWING

14
Dr.J.N. Swathi, SCOPE,VIT
REGION-GROWING
ALGORITHM

15
Dr.J.N. Swathi, SCOPE,VIT
REGION BASED
SEGMENTATION- REGION
SPLITTING AND MERGING
 The main problem with region splitting is
determining where to split a region.
 One method to divide a region is to use a
quadtree structure.
 Quadtree: a tree in which nodes have exactly
four descendants.

16
Dr.J.N. Swathi, SCOPE,VIT
SPLITTING AND MERGING
SEGMENTATION ALGORITHM
REGION BASED
SEGMENTATION- REGION
SPLITTING AND MERGING

The split and merge procedure:


• Split into four disjoint quadrants any region Ri for which P(Ri)
= FALSE.
• Merge any adjacent regions Rj and Rk for which P(RjURk) =
TRUE. (the quadtree structure may not be preserved)
• Stop when no further merging or splitting is possible.

18
Dr.J.N. Swathi, SCOPE,VIT
DISCLAIMER
The material for the presentation has been compiled from
various sources such as prescribed text book by Rafael C.
Gonzalez and team, tutorials, lecture notes and other
resources available on internet. The information contained in
this lecture/ presentation is for educational purpose only.

19
Dr.J.N. Swathi, SCOPE,VIT
THANK YOU

20
Dr.J.N. Swathi, SCOPE,VIT

You might also like