Unit 4 - Image Segmentation
Unit 4 - Image Segmentation
Contents
● Image Segmentation
● Region Based Segmentation
● Threshold Based Segmentation
Image Segmentation
● Segmentation is a process of partitioning a digital image into
multiple regions and extracting the meaningful region which is
known as Region of Interest (ROI).
● ROI vary with applications.
● Therefore many segmentation algorithms need to apply and pick
that algorithm which performs the best for the given requirement.
Image Segmentation Algorithm are based on:
● Similarity Principle (Region Approach): Objective is to group
pixel based on common property to extract a coherent region.
● Discontinuity Principle (Boundary Approach): Objective is to
extract regions that differ in properties like intensity, color, texture,
etc.
Definition of Image Segmentation
An image can be partitioned into many regions R1, R2, R3,.., Rn
Example:
Characteristics of Segmentation Process
Region based segmentation
● A region can be classified as a group of connected pixels exhibiting
similar properties. The similarity between pixels can be in terms of
intensity, color, etc. In this type of segmentation, some predefined
rules are present which have to be obeyed by a pixel in order to be
classified into similar pixel regions. Region-based segmentation
methods are preferred over edge-based segmentation methods in
case of a noisy image. Region-Based techniques are further
classified into 2 types based on the approaches they follow.
● Region growing method
● Region splitting and merging method
Region Growing
● In the case of the Region growing method, we start with some pixel as the
seed pixel and then check the adjacent pixels.
● If the adjacent pixels abide by the predefined rules, then that pixel is
added to the region of the seed pixel and the following process continues
till there is no similarity left.
● This method follows the bottom-up approach.
● In case of a region growing, the preferred rule can be set as a threshold.
● For example: Consider a seed pixel of 2 in the given image and a threshold
value of 3, if a pixel has a value greater than 3 then it will be considered
inside the seed pixel region. Otherwise, it will be considered in another
region. Hence 2 regions are formed in the following image based on a
threshold value of 3.
Region Splitting and Merging Technique
● In Region splitting, the whole image is first taken as a single region.
● If the region does not follow the predefined rules, then it is further
divided into multiple regions (usually 4 quadrants) and then the
predefined rules are carried out on those regions in order to decide
whether to further subdivide or to classify that as a region.
● The following process continues till there is no further division of
regions required i.e every region follows the predefined rules.
Region Splitting and Merging Technique
● In Region merging technique, we consider every pixel as an
individual region.
● We select a region as the seed region to check if adjacent regions
are similar based on predefined rules.
● If they are similar, we merge them into a single region and move
ahead in order to build the segmented regions of the whole image.
● Both region splitting and region merging are iterative processes.
● Usually, first region splitting is done on an image so as to split an
image into maximum regions, and then these regions are merged in
order to form a good segmented image of the original image.
Region Splitting and Merging Technique
● In case of Region splitting, the following condition can be checked in
order to decide whether to subdivide a region or not.
● If the absolute value of the difference of the maximum and
minimum pixel intensities in a region is less than or equal to a
threshold value decided by the user, then the region does not
require further splitting.
Region Splitting and Merging Technique
Thresholding
● Thresholding is an important technique for image segmentation. It produces uniform
regions based on the threshold criteria, T.
● Key parameter of thresholding process is the choice of threshold value.
● If thresholding operation depends upon only grey scale value it is known as Global
Thresholding.
● In case neighbourhood properties (or some local properties) is also taken into account,
method is known as Local Thresholding.
● If case T depends on pixel coordinates also, it is known as Dynamic or Adaptive
Thresholding.
● Thresholding is a function of:
○ Spatial Coordinates i.e., (x,y)
○ Gray level of pixel i.e., f(x,y)
○ Some local property of the image i.e., A(x,y)
0 if f(x,y) <=T
Types of Thresholding
● Global Thresholding: T is constant
● Variable Thresholding: T changes over an image
● Local or Regional Thresholding: In variable thresholding if the value
of T at any point (x,y) in an image depends on the properties of a
neighbourhood of (x,y)
● Dynamic or adaptive thresholding: In variable thresholding, if the
value of T depends on the spatial coordinates (x,y)
Types of Thresholding
● Single Level Thresholding: The objects can be extracted by
comparing pixel values with a Threshold T
● Multi Level Threshold: It is also possible to extract objects that have
a specific intensity range using multiple thresholds.
Global Thresholding
● In bimodal images, histogram have two distinct peaks separated by
a valley between them.
● Valley point is chosen as Threshold (T)
● Then pixels of given image are compared with threshold.
Procedure for Global Thresholding to obtain T
1. Select an initial estimate for T. (This value should be greater than the minimum and
less than the maximum intensity level in the image. It is better to choose the
average intensity of an image.)
2. Segment the image using T. This will 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 G1and G2.
4. Compute a new threshold value