image segmentation - sjtubcmi.sjtu.edu.cn/~luhongtao/dip/res/dip10-sut.pdf · digital image...
TRANSCRIPT
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Image Segmentation:– Definition
– Importance
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Detection of Discontinuities:
9
1i i
i
R w z=
=∑
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
R T≥• Point Detection:
1. A Mask
2. Thresholding
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Line Detection:– A Suitable Mask in desired direction
– Thresholding: ,i jLine i R R j≥ ∀
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Example:
Thresholding-45º Mask
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Edge Detection:– Two Mathematical model
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
f
x
∂∂
2
2
f
x
∂∂
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
( )0,0N
( )0,0.1N
( )0,1N
( )0,10N
f
x
∂∂
2
2
f
x
∂∂
f
• Noise Problem:
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Gradient Operators:
( )
1 222
1, tan
x
y
y
x
fG x
ffG
y
f f f ff
x y x y
Gx y
Gα
≈
−
∂ ∂ ∇ = = ∂ ∂ ∂ ∂ ∂ ∂ ∇ = + → + ∂ ∂ ∂ ∂
=
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Gradient Operators:– Roberts Cross Gradients:
– Prewitt Operators:
( ) ( )
( ) ( )9 5 8 6
1 22 2
9 5 8 6
9 5 8 6 :
x yG z z G z z
f z z z z
f z z z z Roberts Cross Gradient
= − = −
∇ ≈ − + − ∇ ≈ − + − −
( ) ( )( ) ( )
( ) ( )( ) ( )
7 8 9 1 2 3 7 8 9 1 2 3variation
3 6 9 1 4 7 3 6 9 1 4 7
2 2
2 2
x x
y y
G z z z z z z G z z z z z z
G z z z z z z G z z z z z z
= + + − + + = + + − + + → = + + − + + = + + − + +
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
Gradients Operators
Y-Direction X-Direction
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
Diagonal Edge
45-Direction -45-Direction
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
OriginalxG
yG x yG G+
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
OriginalxG
yG x yG G+
Pre-Smoothing
5×5
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
0 1 2
1 0 1
2 1 0
− − − 2 1 0
1 0 1
0 1 2
− − − 45º and -45º lines
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Laplacian as an isotropic Detector:
• Discrete Implementation:
2 22
2 2
f ff
x y
∂ ∂∇ = +∂ ∂
( )( )
25 2 4 6 8
25 1 2 3 4 6 7 8 9
4N's: 4
8N's: 4
f z z z z z
f z z z z z z z z z
∇ = − + + +
∇ = − + + + + + + +
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
2
2
2 2 22
4 2
( ) exp2
( ) exp2
rh r
r rh r
σ
σσ σ
= − − −∇ = − − • Laplacian of Gaussian (LoG):
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
OriginalSobel
GLPF Laplacian
LoG LoG>T ZC Zero Crossing:
•Thinner Edge
•Easy to compute
•Noise Reduction capability
•Spaghetti Effect (isolated circles)
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
( ) ( )( ) ( )
0 0
0 0
, ,
, ,
f x y f x y E
x y x y Aα α
∇ − ∇ ≤
− ≤
xG
yG
• Edge Linking (Local Processing)
Results
Input
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Global Edge Linking by the Hough Transform:
( )
( ) ( )
, &
All , 's on a line intersect each other at a,b
i i i i
i i
i i
x y y ax b y ax b
b x a y
x y
= + ⇒ = += − +
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Hough Transform in Cartesian
( )1 11 11 11 1x ,yx ,yx ,yx ,y
( )2 22 22 22 2x ,yx ,yx ,yx ,y
( )3 33 33 33 3x ,yx ,yx ,yx ,y( )4 44 44 44 4x ,yx ,yx ,yx ,y
( )a,ba,ba,ba,b
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Hough Transform in Polar– Problem with Vertical line (a=∞)( )( )
( ) ( )
, & cos sin cos sin
,
All , 's on a sin intersect each other at ,
i i i i
i i
i i i i
x y x y x y
x y
θ θ ρ θ θ ρρ θ
ρ θ
+ = ⇒ + =
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Hough Transform
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Hough Transform for circle:
• Extract each circle (independent of radius):
( ) ( ) ( ) ( ) ( )( ) ( )
2 2 2 22 21 2 3 1 2 3
1 2 3
, &
All , 's on a spherical surface intersect each other at , ,
i i i i
i i
x y x p y p p x p y p p
x y p p p
− + − = ⇒ − + − =
1 12 1
2 2
cos costan tan
sin sini i
i ii i
x p r p x rp p x y
y p r p y r
θ θθ θ
θ θ= + = − ⇒ ⇒ = − + = + = −
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Hough Transform for circle:
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Hough Transform for circle:
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Hough Transform Implementation:– Discrete Accumulator
• Smoothing
• Find Local Maxima
1
1
1
21
12
15
22
111
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
Original Thr-Grad.
H-TLinked
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Thresholding:– F(x,y)>T then (x,y) is belong to object, else (x,y) is belong
to background.• Bi-level (T)
• Multi-level (T1,T2,…, Tn)
• Threshold image:
– Threshold Estimation :• Histogram
( ) ( )( )
1 ,,
0 ,
f x y Tg x y
f x y T
>= ≤
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
Thresholds
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Role of illumination
• Histogram Distortion
• Broadness• Homomorphic Process
( ) ( ) ( ), , ,f x y i x y r x y=
( ),r x y
( ),i x y( )rP r
( ) ( ), ,i x y r x y ( )fP f
( ) ( ) ( )( ) ( )( ) ( ) ( )
, , ,
, ln ,
, , ,
f x y i x y r x y
z x y f x y
z x y i x y r x y
=
=′ ′= +
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Basic Global Thresholding:
min
2
MAXT
+=
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• How to select T:– A Heuristic approach:
1. Initial guess on T
2. Segment image to G1(>T) and G2(≤T)
3. Compute average value of G1(Ψ1) and G2(Ψ2)
4. Set T be average of Ψ1 andΨ2
5. Repeat 2-4 until small changed in successive T values.
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
Convergence0 1250 .4fT T= → =
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Adaptive Thresholding:– Local Thresholding:
• Subdivide the images into smaller block.
– Optimal Global Thresholding:• Determine best value when no evidence valley.
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
Global Thr.
Local Thr.Mosaic
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
Good Subimage
Bad Subimage
• Sub-image selection effect
Further block-ing
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
( )( ) ( )
( )
2 21 22 21 22 2
1 2
2
2 21 2
2 21 2 2 1
2 2 2 2 2 2 1 21 2 2 1 1 2
2 1
22 2 1 2 21 2
1 2 2
exp exp
0
2
2 ln
for ln2
z z
P z P P
AT BT C
A
B
PC
P
PT
P
µ µσ σ
σ σ
µ σ µ σ
σσ µ σ µ σ σσ
µ µ σσ σµ µ
− −− −
= +
∴ + + == −
= − = − + += ⇒ = + −
• Optimal Global-Adaptive Thresholding:– Gaussian Histogram
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
( ) ( ) ( )
( ) ( )
( ) ( )
1 1 2 2
1 2
2 1 1 2
1 1 2 2
1
minT
TT
p z P p z P p z
P P
P p z dz P p z dz
P p T P p T
+∞
−∞
= ++ =
+ ∴ =
∫ ∫
• Optimal Global-Adaptive Thresholding:– Histogram Modeling
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Example:– Preprocessing
• Log function( radiological absorption)
• Digital Subtraction (Pre and Post images)
• Image summation in order to reduce noise.
Before After
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Example:– Optimal Thresholding:
• Subdivide images to 7×7 sub-block (50% overlap)
• Histogram Estimation
• Test of bimodality and Gaussian fitting and …
BimodalUnimodal
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Example:– Thresholding
– Segmentation
– Boundary Detection
– Superimposing
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• How to improve the former methods:– Consider pixels near boundary for histogram.
– Use of gradient/Laplacian to estimate boundary:
– 0: Not on Edge
– +1:Dark side of edge
– -1: Bright side of edge
( ) 2
2
0
, 1 and 0
1 and 0
f T
S x y f T f
f T f
∇ <= + ∇ ≥ ∇ ≥− ∇ ≥ ∇ <
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Example:
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
Histogram of Gradient
(Those with G>5)
S(x,y) with T=midpoint
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Segmentation with Multiple Variables:– RGB/Multi-Channel data
– Cluster of point in 3D
Original (Color) Facialtones REDchannel
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Region Based Segmentation:
( )( )
1
are connected regions.
,
TRUE
FALSE
n
ii
i
i j
i
i j
R
R
R R i j
P R
P R R
=
•
•
• = ∅ ≠
• =
• =
∪
∩
∪
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Region Growing:– Select a start (seed) point
– Grow the point based on a certain property• Connectivity should be considered.
– Seed point selection:• Handy
• Highlighted point (Due to specific property)
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Region Growing:
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Region Growing (Example):– Determine seed points to maximum gray level.
– Growing criteria:• Gray level value difference (with respect to S.P.) less
than a threshold.
• Each candidate pixel should be N8 of region.
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Region Growing: Seed Point High Value (255) Points
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Multimodal Histogram
Threshold
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Splitting and Merging:– Define a criteria for each region to be a valid
segment.
– Split each region which is not satisfy the criteria.
– Merge two neighbor region based on criteria.
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Splitting and Merging
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Splitting-Merging Algorithm– Criteria:
• 80% of all pixels satisfy: 2j i iz m σ− ≤
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• The Use of Motion in Segmentation:– Spatial Domain
– Frequency Domain
• Spatial Domain:– Main idea: Compare pixel by pixel (difference)
( ) ( ) ( ) Dynamic Objec1 , , , ,,
0 O.W
t
Static Object.
i jij
f x y t f x y t Td x y
− > →=
→
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Accumulative Difference Image (ADI):– Consider and as reference
frame. – ADI compare reference frame with incoming frame.– Increment counter of each pixel when a difference
detected.
– ADI alternative:• Absolute• Positive• Negative
( ){ }1
, ,n
i if x y t
=( )1, ,f x y t
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Accumulative Difference Image (ADI):
( ) ( ) ( ) ( )( )
( ) ( ) ( ) ( )( )
( ) ( ) ( ) ( )( )
1 1
1
1 1
1
1 1
1
, 1 , , , ,,
, O.W.
, 1 , , , ,,
, O.W.
, 1 , , , ,,
, O.W.
k k
k
k
k k
k
k
k k
k
k
A x y f x y t f x y t TA x y
A x y
P x y f x y t f x y t TP x y
P x y
N x y f x y t f x y t TN x y
N x y
−
−
−
−
−
−
+ − >= + − > = + − < − =
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• ADI Example
Absolute Positive Negative
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Establishing a Reference Images:– Difference will erase static object:
• When a dynamic object move out completely from its position, the back ground in replaced.
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Frequency Domain Methods:– A Static/black background
– A Dynamic single pixel
( ) ( )
( ) ( )
( ) ( )
( ) ( )
1
2
1
2
1 12
10 0
1 12
20 0
12 /
1 1 1 10
12 /
2 1 20
, , , , 0,1,2, , 1
, , , , 0,1,2, , 1
1, , , 0,1,2, , 1
1, , , 0,1
M Nj a x t
xx y
N Mj a y t
yy x
Kj u t K
x xt
Kj u t K
y y yt
g t a f x y t e t K
g t a f x y t e t K
G u a g t a e u KK
G u a g t a e uK
π
π
π
π
− −∆
= =
− −∆
= =
−−
=
−−
=
= = − = = −
= = −
= =
∑ ∑∑ ∑∑∑
⋯⋯⋯1 1 1 2 2 2
, 2, , 1
,
K
u a v u a v
−
= =
⋯
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• An Example:
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
• Intensity Plot
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed. www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10Image Segmentation
Chapter 10Image Segmentation