ImSeg 10 11 18
ImSeg 10 11 18
Image Segmentation
• Segmentation divides an image into its
constituent regions or objects.
• Segmentation of images is a difficult task in
image processing. Still under research.
• Segmentation allows to extract objects in
images.
• Segmentation is unsupervised learning.
• Model based object extraction, e.g., template
matching, is supervised learning.
What it is useful for
• After a successful segmenting the image, the
contours of objects can be extracted using edge
detection and/or border following techniques.
• Shape of objects can be described.
• Based on shape, texture, and color objects can be
identified.
• Image segmentation techniques are extensively
used in similarity searches, e.g.:
Segmentation Algorithms
• Segmentation algorithms are based on one
of two basic properties of color, gray values,
or texture: similarity and discontinuity .
• First category(similarity) is based on
partitioning an image into regions that are
similar according to a predefined criteria.
Histogram thresholding & Region based
approaches fall under this category.
• Second category(discontinuity) is to
partition an image based on abrupt changes
in intensity, such as edges in an image.
Domain spaces
spatial domain (row-column (rc) space)
histogram spaces
color space
texture space
1.5
0.5
0
0 50 100 150 200 250 300
Gray Scale Image Example
I = imread('pout.tif');
figure, imshow(I);
figure, imhist(I) %look at the hist to get a threshold, e.g., 110
BW=roicolor(I, 110, 255); % makes a binary image
figure, imshow(BW) % all pixels in (110, 255) will be 1 and white
% the rest is 0 which is black
• A method based on
Discrete Curve Evolution
to find thresholds in the histogram.
Histogram of lena
Segmented Image
Image after segmentation – we get a outline of her face, hat, shadow etc
Split and Merge
• The goal of Image Segmentation is to
find regions that represent objects or
meaningful parts of objects. Major
problems of image segmentation are
result of noise in the image.
• An image domain X must be segmented
in N different regions R(1),…,R(N)
• The segmentation rule is a logical
predicate of the form P(R)
Introduction
• Image segmentation with respect to
predicate P partitions the image X into
subregions R(i), i=1,…,N such that
X = i=1,..N U R(i)
R(i) ∩ R(j) = 0 for I ≠ j
P(R(i)) = TRUE for i = 1,2,…,N
P(R(i) U R(j)) = FALSE for i ≠ j
Introduction
• The segmentation property is a logical
predicate of the form P(R,x,t)
• x is a feature vector associated with
region R
• t is a set of parameters (usually
thresholds). A simple segmentation
rule has the form:
P(R) : I(r,c) < T for all (r,c) in R
Introduction
• In the case of color images the feature
vector x can be three RGB image
components (R(r,c),G(r,c),B(r,c))
• A simple segmentation rule may have
the form:
P(R) : (R(r,c) <T(R)) && (G(r,c)<T(G))&&
(B(r,c) < T(B))
Region Growing (Merge)
• 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
• For region growing we need a rule
describing a growth mechanism and a
rule checking the homogeneity of the
regions after each growth step
Region Growing
• The growth mechanism – at each stage
k and for each region Ri(k), i = 1,…,N,
we check if there are unclassified pixels
in the 8-neighbourhood of each pixel of
the region border
• Before assigning such a pixel x to a
region Ri(k),we check if the region
homogeneity:
P(Ri(k) U {x}) = TRUE , is valid
Region Growing Predicate
The arithmetic mean m and standard deviation std of a
region R having n =|R| pixels:
1 1
m( R ) I ( r , c ) std ( R ) ( I ( r , c ) m ( R )) 2
n ( r ,c )R n 1 ( r ,c )R
The predicate
P: |m(R1) – m(R2)| < k*min{std(R1), std(R2)},
is used to decide if the merging
of the two regions R1, R2 is allowed, i.e.,
if |m(R1) – m(R2)| < k*min{std(R1), std(R2)},
two regions R1, R2 are merged.
Split
• The opposite approach to region growing is
region splitting.
• It is a top-down approach and it starts with
the assumption that the entire image is
homogeneous
• If this is not true, the image is split into four
sub images
• This splitting procedure is repeated
recursively until we split the image into
homogeneous regions
Split
• If the original image is square N x N, having
dimensions that are powers of 2(N = 2n):
• All regions produced but 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
Homework 8: