You are on page 1of 59

DIGITAL IMAGE PROCESSING

Group#7
PRESENTED BY

• Rida Shoukat 1923110034


• Sania Saeed 1923110038
• Saba Hanif 1923110035
• Eman Khalid 1923110013

PRESENTED TO
MA’AM FIZZA JAHANGIR
Digital Image
Processing
Segmentation By Region Growing and By
Region Splitting And Merging, clustering
and superpixels.
Introduction
Image Segmentation
Region growing
Basic concepts of seed point
Important issues
Advantages and Disadvantages
Procedure for region growing
Region splitting and merging
Procedure for region splitting and merging
Definition of cluster
Region segmentation by clustering k- mean Algorithm
Definition of super pixels
Region segmentation by super pixels (SLIC Algorithm)
Definition of graph cuts
Segmentation by using graph cuts
What is image Segmentation?
• Image Segmentation is the process of
partitioning a digital image into multiple
segments.
• Image Segmentation is typically used to
locate objects and boundaries(lines ,
curves etc) in images.
Image segmentation
Image Segmentation
Techniques
• Image segmentation heavily rely on one of
the two properties of intensity values.
• Discontinuity
Partition based on abrupt change in
intensity. e.g. edge in an image

• Similarity
Partition based on intensity similarity,
e.g. thresholding, region growing,
region splitting and merging.
Image Segmentation
techniques
Region Growing
• Region growing is a simple region-based image
segmentation method. It is also classified as a pixel-
based image segmentation method since it involves
the selection of initial seed points.
• Edges and thresholds sometimes do not give good result
for segmentation .
• Region based segmentation is based on the connectivity
of similar pixels in a region.
• There are two main approaches to region based
segmentation:
region-splitting
region-merging
Region Growing
• is a simple region-based image segmentation method. It
is also classified as a pixel-based image segmentation
method since it involves the selection of initial 
seed points.
• The main goal of segmentation is to partition an image
into regions. Some segmentation methods such as 
thresholding achieve this goal by looking for the
boundaries between regions based on discontinuities in 
grayscale or color properties.
• Region-based segmentation is a technique for
determining the region directly.
Region Growing
Why we use region growing
segmentation?
• The fundamental drawback of
histogram-based region detection is
that histograms provide no spatial
information (only the distribution of
gray levels).
• Region-growing approaches exploit the
important fact that pixels which are
close together have similar gray values.
Basic concepts Of Seed Points
• The first step in region growing is to select a set of
seed points. Seed point selection is based on some
user criterion (for example, pixels in a certain
grayscale range, pixels evenly spaced on a grid,
etc.). The initial region begins as the exact location
of these seeds.
• The regions are then grown from these seed points
to adjacent points depending on a region
membership criterion. The criterion could be pixel,
intensity, grayscale texture or colour.
Basic Concepts of seed points

• One can use 4-connected neighborhood to grow from the


seed points. An alternative for pixels adjacent
• relationship is the 8-connected neighborhood. Pixels
adjacent to the seed points are examined and classified
into the seed points if they have the same intensity value.
It is an iterated process until there are no change in two
successive iterative stages. Other criteria can be chosen
the main goal is to classify the similarity of the image into
regions.
Important Issues
• Suitable selection of seed points:
The selection of seed points is depending on
the users. For example, in a grayscale lightning image, we
may want to segment the lightning from the background.
Then probably, we can examine the histogram and choose
the seed points from the highest range of it.
• More information of the image is better:
Obviously, the connectivity or pixel adjacent
information is helpful for us to determine the threshold and
seed points.
• Minimum area threshold:
No region in region growing method result
will be smaller than this threshold in the segmented image.
Important Issues
• Similarity threshold value:
If the difference of pixel-value or the difference value of
average grayscale of a set of pixels less than “Similarity
threshold value”, the regions will be considered as a
same region.
The criteria of similarities or so called homogeneity we
choose are also important. It usually depends on the
original image and the segmentation result we want.
Some criteria often used are grayscale (average intensity
or variance), color, and texture or shape.
Advantages and Disadvantages
Advantages:
• Can correctly separate the regions that have the same
properties we define.
• Can provide the original images which have clear edges
with good segmentation results.
• Simple concept: only need a small number of seed points
to represent the property we want, then grow the region.
• Can determine the seed points and the criteria we want
to make.
• Can choose the multiple criteria at the same time.
• Theoretical very efficient due to visiting each pixel by a
limited bound of times.
Advantages and Disadvantages
Disadvantages:
• Unless image has had a threshold function
applied, a continuous path of points related
to color may exist, which connects any two
points in the image.
• Practically random memory access slows
down the algorithm, so adaption might be
needed
Procedure for Region-growing
Questions
Question#1
Question#2
Region splitting and merging
• An alternative is to sub-divided an image initially into a set of
disjoint regions then merge and split the region.
• In this technique we sub divide the image into smaller and
smaller subquadrant region. We subdivide that quadtrant into
sub-quadrants and so on.
• This splitting technique has a convenient representation in the
form od so-called quadtrees.
• The image corressponding to the nodes of a quadtree
sometimes are called quadregions / quadimages.
Real-time example of region
splitting and merging
Procedure for region splitting
and merging
Questions
Question#1
NEXT TOPICS:
 Definition of Cluster
 Region Segmentation by Clustering K- Mean
Algorithm
 Definition of Super Pixels
 Region Segmentation by Super Pixels
 SLIC Algorithm
 Definition of Graph Cuts
 Segmentation by using Graph Cuts
Definition of Cluster:
• Clustering:
• This Technique group the Unlabelled dataset.
• A way of grouping the data points into different clusters,
Consisting of similar data points.
• The objects with possible similarities remain in a group
that has less on similarities with another group.
• It is used by Amazon, Netflix in its recommendation pace
system to provide recommendations as per the past
search. of products, movies respectively.
Region Segmentation by Clustering K- Mean
Algorithm:
K Means Clustering:
What is a SuperPixel?
• A SuperPixel can be defined as a group of
pixels that share common characteristics
(like pixel intensity).

• SuperPixel are becoming useful in many


Computer Vision and Image processing
algorithms like Image Segmentation,
Semantic labeling, Object detection and
tracking etc.
because of the following-
 They carry more information than pixels.

 Super pixel have a perceptual meaning since pixels


belonging to a given super pixel share similar
visual properties.

 They provide a convenient and compact


representation of images that can be very useful for
computationally demanding problems.
Example:
a) image size is 600×480(480000) pixels
b) b)image composed of 4,000 super pixels Hence boundaries are not
part of the data
Region Segmentation by Super Pixels:
• The idea behind Super Pixels is to Replace the
Standard Pixels grid by Grouping Pixels into Primitive
Regions that are more individual Pixels.

• The Most Popular Super pixel Method is the Simple


Linear Iterative Clustering (SLIC) technique.

• This technique is simple and is a powerful tool for


generating meaningful image regions.
Definition:
Specifying the Distance measure:

• Where Ck is super pixel.


• A single Super Pixel is a group of five values Composite
by In RGB Pixel and also x and y Coordinates.
• In Original Version They use CIELAB instead of RGB color
space.
• But we use RGB to simply 1tok Super Pixels composed
by the file values.
Specifying the Distance
measure:
• We also have some equation to compute the
distance by its super pixel.
• Using 1st formula calculate Distance of RGB
coordinates
• Using 2nd formula calculate Distance of xy
Example:

• Here N is no of
pixels as input
image.
• K is super pixels used
to segments the
input image.
• S is distance
between centers.
Example:
• Find distance between
P1 to P2 and P1 to P3
Using formula
• here we have black
and white Pixels
Given: Find P1 to P2:
• In P1 we have RGB (0,0,0) are
components xy is column and row
which is (0,0)
• In P2 have RGB (1,1,1) are components
and xy is (0,1)
Find P1 to P3:
• In P3 have RGB (0,0,0) are components and xy
is (3,3)
ALGORITHM:
• Initialize the Algorithm
(sampling image at regular grid steps)

• Assign samples to Cluster centers


(use distance formula)

• Update the Cluster Centers


(place right distance values we get)

• Test for convergence


(compute between current and previous steps)

• Post process the Super pixels regions


(replace the super pixels in each region by average values)
Definition of Graph cuts:

• Set of edges whose removal


makes a graph disconnected.

• Cost of cut: Sum of


weights of cut edges.

• A graph cut gives us a


segmentation as we cut A and B
Graph it become A,B segments
For A "good" graph cut:
• Find minimum graph cuts
Definition of minimum Graph cuts:

• Min cut algorithm that


allow u to find that
segmentation which is not
to complex

Problem with min cut:


• Weight of cut proportional to
number of edges in the cut

• Tends to produce small, isolated


components
Graph Cut Segmentation algorithm:
Compute Minimal Graph Cuts:
• Let K denote the number of nodes in V and define a K
dimensional indicator vector x, whose element xi has the
property xi=1 If node ni of V is in A and xi=-1 if it is B Let:
di=Σ w(i,j)

• Be the sum of the weights from node ni to all others nodes in


V. Using these definitions we can write eq as:

The objective is to find a vector x, that minimizes


Ncut(A,B)
eigenvalue-system expression:

• Where D is a K×K diagonal matrix with main diagonal elements di,


where i=1,2.....K
• Where W is a K×K weight matrix with elements w (i,j) defined
Earlier.
• We can convert the preceding generalized eigen value
formulation into standard eigen value problem by writing as:
JAZAK ALLAH

You might also like