Im Seg 04
Im Seg 04
histogram spaces
color space
texture space
Homework 8:
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
Color Image - bimodal
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