Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Segmentation

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 51

MODULE 4

IMAGE SEGMENTATION
IMAGE SEGMENTATION
• Segmentation divides an image into its constituent
regions or objects.
Image Segmentation= divide image into
(continuous) regions or sets of pixels
• process in which regions or features sharing similar
characteristics are identified and grouped together
• Segmentation allows to extract objects in image
• Segmentation should stop when the objects of
interest in an application have been isolated.
• Still under research
SEGMENTATION
• purpose to partition an image into meaningful
regions with respect to a particular application
• goal is to simplify and/or change the representation
of an image into something that is more meaningful
and easier to analyze
• used to locate objects and boundaries (lines,
curves, etc.) in images
• Based on shape, texture, and color, objects can be
identified
• Image segmentation techniques are extensively
used in similarity searches
Applications
• Content-based image
retrieval
• Machine vision
• Medical imaging
• Object detection
• Recognition Tasks
• Traffic control systems
• Video surveillance
Segmentation Techniques

• Segmenting sub images • segmenting a whole image


which are small windows on
whole image • No of pixels available for
• No of pixels available for segmentation is greater
segmentation is lower • Segments consists of larger
• Segments consists of lesser no of pixels
no of pixels • Estimated parameters are
• Must be frugal in demands more robust
for pixel data
Approaches
1) Region Based- Each pixel is assigned to a particular
region
2) Boundary Based- locate the boundaries between
regions directly
3) Edge Based –identified edges are linked together to
form boundaries
REGION APPROACH
• Region ---- Group of
pixels with similar
properties
• Segmentation techniques
are
1. Region growing
2. Region splitting
3. Region splitting and
merging
Region growing
• A simple approach to image segmentation is to start
from some pixels (seeds) representing distinct
image regions and to grow them, until they cover
the entire image
• Approach in which neighbouring pixels are
examined and added to a new region if no edges
are detected
• Process is iterated for each boundary pixel
• If adjacent regions are found a merging algorithm is
used (weak edges are dissolved and strong edges
are left intact)
Segmentation process
o Begin with a seed that would be a region or a single
pixel
o Assimilate as many as possible neighbouring pixels
that meet the homogeneity criterion
o Grow a new segment from the seed by this way
o Remove this resultant segment from the process
o Choose a new seed from remaining pixels and
continue this process
o Stop when all pixels are allocated to a segment
o As pixels are aggregated the parameters for each
segment should be updated
• Homogeneity of regions is used as the main
segmentation criterion in region growing
• The criteria for homogeneity:
gray level ,colour, texture, shape, model
• Selection of homogeneity criteria depends on
1. Problem under consideration
2. Type of image
• Selection of region growing algorithm depends on
1. Criteria used to decide whether a pixel should
be included or not
2. Connectivity type used to determine neighbours
3. Strategy used to visit neighbouring pixels
EXAMPLES
Advantages
• It is guaranteed to produce coherent regions.
• It works from the inside out, instead of the outside in.
• Algorithm is stable with respect to noise
• Borders found by this method is perfectly thin and connected
Disadvantages
• Different sets of initial seed-point cause different segmented
result
• Time-consuming problem
• Decisions about region membership are often more difficult
• It can’t find objects that span multiple disconnected regions
Region splitting
• Top – down approach
• Begins with a whole image
• Divides it up such that segregated parts are more
homogeneous
• to break the image into a set of disjoint regions,
which are coherent within themselves
Examples
Splitting
• If the original image is square N x N, having
dimensions that are powers of 2
• All regions produced by the splitting algorithm
are squares having dimensions M x M ,
where M is a power of 2 as well.
• Since the procedure is recursive, it produces
an image representation that can be described
by a tree whose nodes have four sons each
• Such a tree is called a Quadtree
Split

Quadtree

R0 R1
R0

R3
R2 R1

R00 R01 R02 R04


Drawback
• In splitting, final segmentation would probably
contain many neighbouring regions that have
identical or similar properties. Splitting severely
limits the shapes of segments. Therefore a
merging phase is required after splitting

Split and Merge algorithm


Region splitting and merging
• If two adjacent pixels are similar, merge them into a single
region. If two adjacent regions are collectively similar enough,
merge them likewise.
• This collective similarity is usually based on comparing the
statistics of each region.
• This method will converge when no further such merging are
possible.
• Pure merging methods are computationally expensive because
they start from such small initial regions
• We can make this more efficient by recursively splitting the
image into smaller and smaller regions until all individual
regions are coherent, then recursively merging these to produce
larger coherent regions
• Technique that takes spatial information into
consideration
• Split image into regions using a Quad Tree
representation.
• Merge "leaves" of the Quad Tree which are
neighbouring and "similar".
Splitting and Merging
• Let R represent entire image
• Select a predicate ,P
• Divide the image into smaller
and smaller quadrant regions
• The final partition contain
adjacent regions with identical
properties
• Merge adjacent regions whose
pixels satisfy the predicate, P
• example
Example
Clustering techniques
• Clustering is the assignment of data objects
(records) into groups (called clusters) so that
data objects from the same cluster are more
similar to each other than objects from
different clusters
Clustering technique

• Goal …. To determine the intrinsic grouping in


a set of unlabeled data.
• Procedure …. Assign each pixel to the class of
nearest cluster mean
• Two types
1. Hierarchical clustering
2. Partitional clustering
Applications
• Marketing: finding groups of customers with similar behavior given a
large database of customer data containing their properties and past
buying records
• Biology: classification of plants and animals given their features
• Libraries: book ordering
• Insurance: identifying groups of motor insurance policy holders with
a high average claim cost; identifying frauds;
• City-planning: identifying groups of houses according to their house
type, value and geographical location;
• Earthquake studies: clustering observed earthquake epicenters to
identify dangerous zones;
• WWW: document classification; clustering weblog data to discover
groups of similar access patterns
Hierarchical clustering
• This method works by grouping data objects(records) into a tree
of clusters.
• Based on proximity matrix indicating similarity between every
pair of data.
• Result will be produced as internal nodes of a tree ,where root
node is for entire dataset and leaf nodes are for individual data
samples
• Quality of result depends upon how the dissimilarity
measurement is defined
• Two classes of algorithms
1. Agglomerative Hierarchical Clustering
2. Divisive Hierarchical Clustering

• Eg: COBWEB,CURE,CHAMELEON
Agglomerative Hierarchical Clustering
• Seek to merge clusters to be larger and larger by
starting with N single point clusters
• Data objects are grouped in a bottom-up fashion.
• Initially each data object is in its own cluster.
• Then merge these atomic clusters into larger and
larger clusters, until all of the objects are in a single
cluster or until certain termination conditions are
satisfied.
• Termination condition can be specified by the user,
as the desired number of clusters.
• Three classes
1. Single –link algorithm
2. Complete link algorithm
3. Minimum variance algorithm
• Single –link algorithm
 merges two cluster according to minimum distance between
the data samples from two clusters
Produce clusters with elongated shapes
• Complete link algorithm
Incorporates maximum distance between data samples in
clusters
Results in compact clusters
• Minimum variance algorithm
Combines two clusters in the sense of minimizing cost of
function
Forms a cluster with minimum increase in cost
Application in vector quantization(pair-wise nearest
neighbourhood algorithm)
Single –link algorithm steps
1. “Every point is its own cluster”
2. Find “most similar” pair of clusters
3. Merge it into a parent cluster
4. Repeat
Divisive Hierarchical Clustering

• Follows reverse clustering strategy


• In this data objects are grouped in a top down
manner
• Initially all objects(entire dataset) are in one cluster
• Then the cluster is subdivided into smaller and
smaller pieces, until each object(data point) forms a
cluster on its own or until it satisfies certain
termination conditions as the desired number of
clusters is obtained
• On each node this performs a full search for all
possible pairs of clusters
Hierarchical Clustering
• Advantages
– Dendograms are great for visualization
– Provides hierarchical relations between clusters
– Shown to be able to capture concentric clusters
• Disadvantages
– Not easy to define levels for clusters
– Experiments showed that other clustering
techniques outperform hierarchical clustering
Partitional clustering
• Procedure aims at minimizing objective function ,f
• F measures the goodness of clustering
• Two steps
1. Partition each pattern into its closest cluster
2. Compute cluster centroids
• Procedure starts from initial solution with known number of
clusters
• Two classes
1. Partitioning relocation algorithm
i. Probabilistic clustering
ii. K- Medoids
iii. K- Means
2 . Density based partitioning algorithm
DBSCAN,OPTICS DBCLAS,DENCLUE
K- Means Clustering
• Simplest technique in unsupervised learning
method
• Do not require training data
• Iterative procedure
• Clusters data by iteratively computing mean
intensity for each class
• Segmenting the image by classifying each pixel with
closest mean
Steps
1. Choose K initial clusters z1(I),z2(I),…….zk(I) .
2. At the Kth iterative step ,distribute the samples x among K clusters using the
relation

for i = 1,2,......K ,i≠j where Cj(k) = set of samples whose cluster centre is Zj(k)
3. Compute new cluster centres Zj(k + 1),j =1,2,....k Such that sum of squared
distance from all points in Cj(k) to the new cluster is minimized. The measure
which minimizes this is the sample mean of Cj(k). Thus new cluster centre is

Where Nj = no of samples in Cj(k).


4. If Zj(k + 1),j =1,2,....k, the algorithm has converged and the procedure is
terminated.
Otherwise go to step 2.
10
10
9
9
8
8
7
7 6
6 5

5 4

4 3

3 2

1
2
0
1
0 1 2 3 4 5 6 7 8 9 10
0
0 1 2 3 4 5 6 7 8 9 10

10
10
9
9
8
8
7
7
6
6
5
5
4
4
3
3
2
2
1
1
0
0
0 1 2 3 4 5 6 7 8 9 10
0 1 2 3 4 5 6 7 8 9 10
K- Means Clustering
Pros
• Simple
• Fast for low dimensional data
• It can find pure sub clusters if large number of clusters
is specified

Cons
• K-Means cannot handle non-globular data of different
sizes and densities
• K-Means will not identify outliers
• K-Means is restricted to data which has the notion of a
center (centroid
Fuzzy clustering
• Depending on whether a pattern data belongs
to a single cluster or several clusters with
different degrees
Fuzzy clustering
• Represent the relationship between input pattern
data and clusters naturally
• Seeks to minimize a heuristic global cost function by
assigning some graded membership for each
pattern data in each cluster
• Allows each pattern for multiple assignments of
clusters
• Superior to hard clustering
Fuzzy clustering
• Pros:
– Allows a data point to be in multiple clusters
– A more natural representation of the behavior of
genes

• Cons:
– Need to define the number of clusters
– Need to determine membership cutoff value
– Clusters are sensitive to initial assignment of
centroids
Segmentation based on thresholding
• Produce pixels with similar intensities
• Technique to establish boundaries in images that
contain solid objects resting on a contrasting
background
• Requires an object with homogeneous intensity and
background with different intensity level, then
simple thresholding is used
Global thresholding
• simplest
• Thresholding is usually the first step in any segmentation
approach
• Single value thresholding can be given mathematically as
follows
• f(m,n) = 1 , if f(m,n) ≥ T
0 , else
• No indication to select T
• Should select in an optimal manner
• Simple thresholding schemes compare each pixels gray level
with a single global threshold. This is referred to as Global
Tresholding.
• If T depends on both gray level function and some local
function then it is referred as Local Thresholding.
Problem associated
• Pixels from different segments will overlap in their
use of intensities
• Reasons
1) noise
• Minimum error method estimate cluster
parameters
• Choose T to reduce classification error
2) variation in illumination across the image
• Variable thresholding
Example
Procedure
1.Select an initial estimate for T (typically the average grey level
in the image)
2.Segment the image using T to produce two groups of pixels:
G1 consisting of pixels with grey levels >T and G2 consisting
pixels with grey levels ≤ T
3.Compute the average grey levels of pixels in G1 to give μ1 and
G2 to give μ2
4.Compute a new threshold value:

T = μ1 + μ2 / 2

5.Repeat steps 2 – 4 until the difference in T in successive


iterations is less than a predefined limit T∞
Adaptive thresholding
• Threshold gray level – slowly varying function of
position in image
• Global Thresholding - object should have uniform
gray level and should rest on a background of
relatively uniform gray level
• Images having uneven illumination makes it difficult
to segment using histogram, this approach is to
divide the original image into sub images and use
the thresholding process to each of the sub images
• In cases where background is not constant and
object contrast varies within the image
• Therefore uses adaptive thresholding
Histogram based thresholding
• bimodal histogram is
just a histogram with
two data peaks.
• The major drawback to threshold-based approaches is that
• they often lack the sensitivity and specificity needed for accurate
• classification.
• • The problem gets severe in case of multi-modal histograms
• with no sharp or well-defined boundaries.
• • It is often difficult to define functional and statistical measures
• only on the basis of gray level value (histogram).
• Solution:
• Region Growing based segmentation techniques,

You might also like