Вы находитесь на странице: 1из 12

Segmentation 268

Segmentation

Image Processing & Computer Vision Lecture

268 디지털
디지털영상처리
영상처리교재
교재편집위원회
편집위원회

Introduction Segmentation 269

-. Introduction
-. Automatic Thresholding Methods
-. Region Representation
-. Split and Merge
-. Region Growing

269 Image Processing & Computer Vision 디지털


디지털영상처리
영상처리교재
교재편집위원회
편집위원회

1
Introduction (cont.) Segmentation 270

n Segmentation problem
– Partition an image I into homogeneous regions.

n Description:
– Given an image I and a homogeneity predicate P(), find a partition S of
the image I into a set of N regions Ri such that
N

U R = I (exhaustive partitioning)
i
i= 1

Ri I R j = 0, for ∀ i ≠ j (exclusive partitioning)

P ( Ri ) = True , ∀i 
 (homogenei ty property)
P( Ri U R j ) = False , ∀i ≠ j

270 Image Processing & Computer Vision 디지털


디지털영상처리
영상처리교재
교재편집위원회
편집위원회

Introduction (cont.) Segmentation 271

n Attributes or P()
– Intensity, texture, color, motion, etc.

n Qualitative guideline
– Uniform & homogeneous
– Simple region interior
– Significantly different adjacent regions
– Simple and accurate boundary

n Techniques
– Threshold-based segmentation
– Region-based segmentation
– Boundary extraction

271 Image Processing & Computer Vision 디지털


디지털영상처리
영상처리교재
교재편집위원회
편집위원회

2
Threshold-based segmentation Segmentation 272

n P-tile segmentation method Histogram


– Simply use the size information of h
the object T
– Suppose the object occupies about
p% of the image area, then set
threshold to assign p% of the pixels
to the object x
P%
Intensity
255

∑ h(x ) = p × (entireimage area )


x=T

n Mode method
h
– Assume Gaussian distribution for
the object and background with T
similar size
– Then, detect the peaks and the
valleys, and set the threshold by
the valley point x
gi gk gj
– Bayes decision theory

272 Image Processing & Computer Vision 디지털


디지털영상처리
영상처리교재
교재편집위원회
편집위원회

Threshold-based segmentation Segmentation 273

– Peakness detection algorithm for


threshold selection:
• Find two local maxima gi and gj
which are some distance apart
• Find the lowest point gk between
gi and gj
• Determine the peakness defined
as min(h(gi ),h(gj ))/h(gk )
• Find the highest peakness
combination (gi , gj , gk), and set
the threshold T= gk

Segmentation result with T=90

273 Image Processing & Computer Vision 디지털


디지털영상처리
영상처리교재
교재편집위원회
편집위원회

3
Threshold-based segmentation (cont.) Segmentation 274

n Practical problems of global


thresholding techniques
– Noise
– Uneven illumination problem

Original Text Threshold=90

Threshold=150 Threshold=230

Uneven illumination problem

274 Image Processing & Computer Vision 디지털


디지털영상처리
영상처리교재
교재편집위원회
편집위원회

Threshold-based segmentation (cont.) Segmentation 275

n Iterative threshold selection method


– Refines the threshold iteratively using the statistics of the segmented
regions in the previous iteration.

– Algorithm:
1. Set initial threshold T (the average intensity of the image)
2. Partition the image into two regions R 1 and R2 using T
3. Determine the meansµ1 and µ2 of R 1 and R2, respectively.
4. Update new threshold T= (µ1 + µ2 )/2.
5. Repeat steps 2-4, until the meansµ1 and µ2 in successive iterations do not
change.

275 Image Processing & Computer Vision 디지털


디지털영상처리
영상처리교재
교재편집위원회
편집위원회

4
Threshold-based segmentation (cont.) Segmentation 276

n Adaptive thresholding method


– Partition the image into mxm
subimages
– Select a threshold Tij for each
subimage based on its histogram
– Threshold levels for each pixel are
determined by interpolation
between the block centers

276 Image Processing & Computer Vision 디지털


디지털영상처리
영상처리교재
교재편집위원회
편집위원회

Threshold-based segmentation (cont.) Segmentation 277

n Variable thresholding
(background normalization)
– Approximate the background
intensity by simple function
such as plane or biquadratic

I = a +bx+cy+ dx2 + exy+ fy2


– Then normalize the
background by subtracting
the fitted function to the
image
– Now, a global thresholding
technique can be applied to
segment the normalized
image

277 Image Processing & Computer Vision 디지털


디지털영상처리
영상처리교재
교재편집위원회
편집위원회

5
Threshold-based segmentation (cont.) Segmentation 278

n Double Thresholding
– Single threshold segmentation fails
when the same intensities belong to
either objects or the background.
– Save marginal histogram region for
these intensities and decide
assignment by considering
geometric properties.

– Double thresholding algorithm


1. Select two thresholds T1 and T2
2. Partition the image into three regions
R1, R2 and R3 using T1 and T2
3. For each pixel in the middle region
R2, assign it to R1 if it is a neighbor
of R1
4. Repeat until no changes in
reassigning
5. Reassign any pixel left in R2 to R3
Double thresholding example

278 Image Processing & Computer Vision 디지털


디지털영상처리
영상처리교재
교재편집위원회
편집위원회

Threshold-based segmentation (cont.) Segmentation 279

n Ostu’s method (N=2)


– Determine threshold T which minimizes the within-class variation while
maximizes the between-class variation s.t.,

Minimize J = σ W2 / σ B2
where
σW2 = ω0 σ02 + ω1σ12
σB2 = ω0ω1 ( µ1 − µ0 )
T −1
 T −1 
T −1
µ0 = ∑ xh( x)  ∑ h ( x )
σ 02 = ∑ (x − µ0 ) 2 p( x ) ω 0 x=0  x=0 
x =0
255
 255 
µ1 = ∑ xh( x ) ∑ h( x) 
255
σ = ∑ ( x − µ1 ) p ( x) ω1
1
2 2
x =T  x= T 
x =T
T −1 255
ω0 = ∑ p ( x )
x=0
p ( x) = h ( x) ∑ h( x )
x =0

σT2 = σB2 + σW2


255
ω1 = ∑ p ( x )
x= T

279 Image Processing & Computer Vision 디지털


디지털영상처리
영상처리교재
교재편집위원회
편집위원회

6
Region-based Segmentation Segmentation 280

n Quad Tree representation of


regions
– Tree-structure representation
of recursive subregions

280 Image Processing & Computer Vision 디지털


디지털영상처리
영상처리교재
교재편집위원회
편집위원회

Region-based Segmentation Segmentation 281

n Region Adjacency Graphs (RAG)


– represent region and mutual relationships
– node: regions
– arcs: boundary between regions

281 Image Processing & Computer Vision 디지털


디지털영상처리
영상처리교재
교재편집위원회
편집위원회

7
Region-based Segmentation Segmentation 282

n Region Split and Merge


– The basic idea: break the image into a
set of disjoint regions which are
R1 R2
coherent within themselves
R
– Top-down approach
R3 R4
– Algorithmic Steps:
Whole image First split

1. Start with the entire image as a single


region.
2. For each region Ri . If P(Ri )=FALSE, R1 R2 R1 R2
then split Ri into four subregions.
3. If for any adjacent subregions Rj and R41 R42 R41 R42
Rk , P(Rj U Rk )=TRUE, then merge R3 R3
R43 R44 R43
them into a single region.
4. Repeat until no further split and merge Second split Merge
take place.

282 Image Processing & Computer Vision 디지털


디지털영상처리
영상처리교재
교재편집위원회
편집위원회

Region-based Segmentation (cont.) Segmentation 283

n Region Split and Merge (Cont.)

– Modified quadtree structure.


– Each non-terminal node in the tree
has at most four descendants, R
although it may have less due to
merging.
R1 R2 R3 R4

R41 R42 R43

Corresponding quadtree

283 Image Processing & Computer Vision 디지털


디지털영상처리
영상처리교재
교재편집위원회
편집위원회

8
Region-based Segmentation (cont.) Segmentation 284

n Similarity measures between regions


– Mean intensity comparison
• If |µ1 - µ2 | < Th, then similar. Otherwise dissimilar.
– Statistical hypothesis testing
• Consider Two regions R 1,R2 with m1 and m2 pixels, respectively
• Then, two hypotheses H0 and H1 are possible
H0: Both regions belong to the same region
– Intensities are from a single Gaussian distribution with (µ 0,σ0)
– The joint pdf under H0 becomes
m1 + m 2

p ( g1 , g 2 ,..., g m 1 +m2
| H0) = ∏ p( g
i =1
i | H0 )

− ( gi − µ 0 )2
m1 + m 2
1
= ∏ 2πσ0
e 2σ 02

i= 1


m1 + m2
− ( g i −µ0 ) 2
i=1
1
= e 2σ 20

( 2πσ0 ) m + m 1 2

− ( m1+ m2 )
1
= e 2

( 2πσ0 ) m + m 1 2

284 Image Processing & Computer Vision 디지털


디지털영상처리
영상처리교재
교재편집위원회
편집위원회

Region-based Segmentation (cont.) Segmentation 285

n Similarity measures between regions (cont.)


H1 : Two regions are different:
– Intensities of each regions are from different Gaussian distribution
with (µ 1,σ1) and (µ 2,σ2)
– The joint pdf becomes
− m1 −m2
1 1
p ( g 1 , g 2 ,..., g m1 , g m1 +1 ,..., g m1 +m2 | H1 ) = e 2
e 2
( 2πσ1 ) m1 ( 2πσ2 ) m2
−( m1 + m2 )
1
= e 2
2 π ) m1 +m2 σ1 1σ2 2
m m
– Define the likely-hood ratio (

p ( g1 , g 2 ,..., g m + m | H 1 ) σ0 m + m 1 2

L= 1 2
=
σ1 σ2
m m
p( g1 , g 2 ,..., g m + m | H 0 )
1 2
1 2

– Then, decide to merge if L< Th. Otherwise, do not merge.

285 Image Processing & Computer Vision 디지털


디지털영상처리
영상처리교재
교재편집위원회
편집위원회

9
Region-based Segmentation (cont.) Segmentation 286

n Removing Weak Edges (Boundaries)

4 Approach 1: 4 Approach 2:

Merge R1 and R2 if Merge R1 and R2 if


W W
>τ >τ
S S
W: length of the weak boundary W: length of the weak
S = min(S1,S2) S = common boundary
τ: threshold (τ =0.5) τ: threshold (τ =0.75)

S1
S
w w

S2

Not merge Merge Not merge Merge

286 Image Processing & Computer Vision 디지털


디지털영상처리
영상처리교재
교재편집위원회
편집위원회

Region-based Segmentation (cont.) Segmentation 287

n Region Split and Merge Examples

Split and Merge Example

original segmentation

287 Image Processing & Computer Vision 디지털


디지털영상처리
영상처리교재
교재편집위원회
편집위원회

10
Region-based Segmentation (cont.) Segmentation 288

n Region Growing
– Basic Idea: the opposite of the split and merge approach
• An initial set of small areas are iteratively merged according to
similarity constraints.
• A bottom up method.

– Algorithmic Steps:

1. Start by choosing an arbitrary seed pixel and compare it with


neighbouring pixels.
2. Region is grown from the seed pixel by adding in neighboring pixels
that are similar, increasing the size of the region.
3. When the growth of one region stops we simply choose another seed
pixel which does not yet belong to any region and start again.
4. This whole process is continued until all pixels belong to some region.

288 Image Processing & Computer Vision 디지털


디지털영상처리
영상처리교재
교재편집위원회
편집위원회

Region-based Segmentation (cont.) Segmentation 289

n Region Growing (Cont.)

– Region growing methods often


give very good segmentations
that correspond well to the
observed edges.
– However, starting with a
particular seed pixel and
letting this region grow
completely before trying other
seeds biases the
segmentation in favor of the
regions which are segmented
first.

289 Image Processing & Computer Vision 디지털


디지털영상처리
영상처리교재
교재편집위원회
편집위원회

11
Region-based Segmentation (cont.) Segmentation 290

n Region Growing (cont.)

– Undesirable effects:
• Current region dominates the growth process -- ambiguities around edges
of adjacent regions may not be resolved correctly.
• Different choices of seeds may give different segmentation results.
• Problems can occur if the (arbitrarily chosen) seed point lies on an edge.

– simultaneous region growing techniques


• Similarities of neighbouring regions are taken into account in the growing
process.
• No single region is allowed to completely dominate the proceedings. .

290 Image Processing & Computer Vision 디지털


디지털영상처리
영상처리교재
교재편집위원회
편집위원회

Region-based Segmentation (cont.) Segmentation 291

n Region Growing (cont.)


– Simultaneous region growing technique (cont.)
• A number of regions are allowed to grow at the same time.
• Similar regions will gradually coalesce into expanding regions.
• Easy and efficient to implement on parallel computers

Segmentation results by region growing

291 Image Processing & Computer Vision 디지털


디지털영상처리
영상처리교재
교재편집위원회
편집위원회

12

Вам также может понравиться