region segmentation - ucf crcvcrcv.ucf.edu/gauss/regions.ppt.pdforientation of the region e=...
TRANSCRIPT
1
Region Segmentation
Segmentation
2
3
Initial Segmentation
Segmentation
• Partition f(x,y) into sub-images: R1, R2, ….,Rn such thatthe following constraints are satisfied:–
–
– Each sub-mage satisfies a predicate or set of predicates• All pixels in any sub-image musts have the same gray levels.
• All pixels in any sub-image must not differ more than somethreshold
• All pixels in any sub-image may not differ more than somethreshold from the mean of the gray of the region
• The standard deviation of gray levels in any sub-image must besmall.
jiRR ji ≠= ,fI
),(1
yxfRi
n
i
==U
4
Simple Segmentation
ÁÁË
Ê <=
Otherwise0
),( if1),(
TyxfyxB
ÁÁË
Ê <<=
Otherwise0
),( if 1),( 21 TyxfT
yxB
ÁÁË
Ê Œ=
Otherwise 0
),( if 1),(
ZyxfyxB
HistogramHistogram graphs the number of pixels in an image with a Particular gray level as a function of the image of gray levels.
For (I=0, I<m, I++) For (J=0, J<m, J++) histogram[f(I,J)]++;
imhist
5
Example
Segmentation Using Histogram
ÁÁË
Ê <<=
Otherwise0
),(0if 1),( 1
1
TyxfyxB
ÁÁË
Ê <<=
Otherwise0
),( if 1),( 21
2
TyxfTyxB
ÁÁË
Ê <<=
Otherwise0
),( if 1),( 32
3
TyxfTyxB
6
Realistic Histogram
Peakiness Test
˜̃¯
ˆÁÁË
Ê-˜
¯
ˆÁË
Ê +-=
).(1.
2
)(1
PW
N
P
VVPeakiness ba
7
Connected Component
˙˙˙˙˙˙
˚
˘
ÍÍÍÍÍÍ
Î
È
01010
01100
00000
11011
01000
˙˙˙˙˙˙
˚
˘
ÍÍÍÍÍÍ
Î
È
000
000
00000
0
0000
cd
cc
aabb
a
4
Connectedness
8
Connected Component
˙˙˙˙˙˙
˚
˘
ÍÍÍÍÍÍ
Î
È
01010
01100
00000
11011
01000
˙˙˙˙˙˙
˚
˘
ÍÍÍÍÍÍ
Î
È
000
000
00000
0
0000
cc
cc
aabb
a
8
Recursive Connected ComponentAlgorithm
9
Sequential
˙˙˙˙˙˙
˚
˘
ÍÍÍÍÍÍ
Î
È
01110
01100
00000
11011
01000
˙˙˙˙˙˙
˚
˘
ÍÍÍÍÍÍ
Î
È
00
000
00000
0
0000
ccd
cc
aabb
a
d=c
Sequential ConnectedComponent Algorithm
10
Recursive
˙˙˙˙˙˙
˚
˘
ÍÍÍÍÍÍ
Î
È
01110
01100
00000
11011
01000
˙˙˙˙˙˙
˚
˘
ÍÍÍÍÍÍ
Î
È
00
000
00000
0
0000
ccc
cc
aabb
a
Steps in Segmentation UsingHistogram
1. Compute the histogram of a given image.2. Smooth the histogram by averaging peaks and
valleys in the histogram.3. Detect good peaks by applying thresholds at the
valleys.4. Segment the image into several binary images
using thresholds at the valleys.5. Apply connected component algorithm to each
binary image find connected regions.
11
Example: Detecting Fingertips
Example-II
93 peaks
12
Smoothed Histograms
Smoothed histogram (averaging using mask Of size 5)54 peaks (once)After peakiness 18
Smoothed histogram21 peaks (twice)After peakiness 7
Smoothed histogram11 peaks (three times)After peakiness 4
Regions
(0,40) (40, 116)
13
Regions
(116,243) (243,255)
Geometrical Properties
ÂÂ= =
=m
x
n
y
yxBA0 0
),(
A
yxyB
yA
yxxB
x
m
x
n
y
m
x
n
yÂÂÂÂ
= == = == 0 00 0
),(
,
),(
Area
Centroid
14
Perimeter & Compactness
A
PC
p4
2
=
Perimeter: The sum of its border points of the region. A pixel which has at least one pixel in its neighborhood from the background is called a border pixel.
Compactness
Circle is the most compact, has smallest value
Area decreases
Orientation of the Region
dxdyyxBrE ),(2ÚÚ=
Least second moment
0cossin =+- rqq yx
)cos,sin( qrqr-
qqr
qqr
sincos
cossin
0
0
sy
sx
+=
+-=
Minimize
15
Orientation of the Region
dxdyyxByxE ),()cossin( 2ÚÚ +-= rqq
22 )cossin( rqq +-= yxr
Substitute r in E and differentiate Wrt to and equate it to zeror
0)cossin( =+- rqq yxA),( yx is the centroid
qqqq 22 coscossinsin cbaE +-=
qq 2sin2
12cos)(
2
1)(
2
1bcacaE ---+= ydxdyxByc
ydxdyxByxb
ydxdyxBxa
¢¢¢=
¢¢¢¢=
¢¢¢=
ÚÚÚÚÚÚ
),(
),(
),(
2
2
dxdyyxBrE ),(2ÚÚ=
yyyxxx -=¢-=¢ ,
Substitute value of r
Orientation of the Region
ca
b
-=q2tan
ydxdyxByc
ydxdyxByxb
ydxdyxBxa
¢¢¢=
¢¢¢¢=
¢¢¢=
ÚÚÚÚÚÚ
),(
),(
),(
2
2
22
22
),(
),(2
),(
yAyxByc
yxAyxxyBb
xAyxBxa
-=
-=
-=
 Â
 Â
 Â
qq 2sin2
12cos)(
2
1)(
2
1bcacaE ---+=
22
22
)(2cos
)(2sin
cab
ca
cab
b
-+
-±=
-+±=
q
q
Differentiating this wrt q
yyyxxx -=¢-=¢ ,
16
Moments
dxdyyxByxm qppq ),(Ú Ú=
General Moments
ÂÂÂÂ= == =
==m
x
n
yy
m
x
n
yx yxyBMyxxBM
0 0
1
0 0
1 ),( ,),(
ÂÂÂÂÂÂ= == == =
===m
x
n
yxy
m
x
n
yy
m
x
n
yx yxxyBMyxByMyxBxM
0 0
2
0 0
22
0 0
22 ),( ,),( ,),(
Discrete
Half size, mirrorRotated 2, rotated 45
17
Hu moments