region segmentation - ucf crcvcrcv.ucf.edu/gauss/regions.ppt.pdforientation of the region e=...

17
1 Region Segmentation Segmentation

Upload: others

Post on 13-Mar-2021

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Region Segmentation - UCF CRCVcrcv.ucf.edu/gauss/Regions.ppt.pdfOrientation of the Region E= ÚÚ(xsinq-ycosq+r)2B(x,y)dxdy r2=(xsinq-ycosq+r)2 Substitute r in E and differentiate

1

Region Segmentation

Segmentation

Page 2: Region Segmentation - UCF CRCVcrcv.ucf.edu/gauss/Regions.ppt.pdfOrientation of the Region E= ÚÚ(xsinq-ycosq+r)2B(x,y)dxdy r2=(xsinq-ycosq+r)2 Substitute r in E and differentiate

2

Page 3: Region Segmentation - UCF CRCVcrcv.ucf.edu/gauss/Regions.ppt.pdfOrientation of the Region E= ÚÚ(xsinq-ycosq+r)2B(x,y)dxdy r2=(xsinq-ycosq+r)2 Substitute r in E and differentiate

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

Page 4: Region Segmentation - UCF CRCVcrcv.ucf.edu/gauss/Regions.ppt.pdfOrientation of the Region E= ÚÚ(xsinq-ycosq+r)2B(x,y)dxdy r2=(xsinq-ycosq+r)2 Substitute r in E and differentiate

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

Page 5: Region Segmentation - UCF CRCVcrcv.ucf.edu/gauss/Regions.ppt.pdfOrientation of the Region E= ÚÚ(xsinq-ycosq+r)2B(x,y)dxdy r2=(xsinq-ycosq+r)2 Substitute r in E and differentiate

5

Example

Segmentation Using Histogram

ÁÁË

Ê <<=

Otherwise0

),(0if 1),( 1

1

TyxfyxB

ÁÁË

Ê <<=

Otherwise0

),( if 1),( 21

2

TyxfTyxB

ÁÁË

Ê <<=

Otherwise0

),( if 1),( 32

3

TyxfTyxB

Page 6: Region Segmentation - UCF CRCVcrcv.ucf.edu/gauss/Regions.ppt.pdfOrientation of the Region E= ÚÚ(xsinq-ycosq+r)2B(x,y)dxdy r2=(xsinq-ycosq+r)2 Substitute r in E and differentiate

6

Realistic Histogram

Peakiness Test

˜̃¯

ˆÁÁË

Ê-˜

¯

ˆÁË

Ê +-=

).(1.

2

)(1

PW

N

P

VVPeakiness ba

Page 7: Region Segmentation - UCF CRCVcrcv.ucf.edu/gauss/Regions.ppt.pdfOrientation of the Region E= ÚÚ(xsinq-ycosq+r)2B(x,y)dxdy r2=(xsinq-ycosq+r)2 Substitute r in E and differentiate

7

Connected Component

˙˙˙˙˙˙

˚

˘

ÍÍÍÍÍÍ

Î

È

01010

01100

00000

11011

01000

˙˙˙˙˙˙

˚

˘

ÍÍÍÍÍÍ

Î

È

000

000

00000

0

0000

cd

cc

aabb

a

4

Connectedness

Page 8: Region Segmentation - UCF CRCVcrcv.ucf.edu/gauss/Regions.ppt.pdfOrientation of the Region E= ÚÚ(xsinq-ycosq+r)2B(x,y)dxdy r2=(xsinq-ycosq+r)2 Substitute r in E and differentiate

8

Connected Component

˙˙˙˙˙˙

˚

˘

ÍÍÍÍÍÍ

Î

È

01010

01100

00000

11011

01000

˙˙˙˙˙˙

˚

˘

ÍÍÍÍÍÍ

Î

È

000

000

00000

0

0000

cc

cc

aabb

a

8

Recursive Connected ComponentAlgorithm

Page 9: Region Segmentation - UCF CRCVcrcv.ucf.edu/gauss/Regions.ppt.pdfOrientation of the Region E= ÚÚ(xsinq-ycosq+r)2B(x,y)dxdy r2=(xsinq-ycosq+r)2 Substitute r in E and differentiate

9

Sequential

˙˙˙˙˙˙

˚

˘

ÍÍÍÍÍÍ

Î

È

01110

01100

00000

11011

01000

˙˙˙˙˙˙

˚

˘

ÍÍÍÍÍÍ

Î

È

00

000

00000

0

0000

ccd

cc

aabb

a

d=c

Sequential ConnectedComponent Algorithm

Page 10: Region Segmentation - UCF CRCVcrcv.ucf.edu/gauss/Regions.ppt.pdfOrientation of the Region E= ÚÚ(xsinq-ycosq+r)2B(x,y)dxdy r2=(xsinq-ycosq+r)2 Substitute r in E and differentiate

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.

Page 11: Region Segmentation - UCF CRCVcrcv.ucf.edu/gauss/Regions.ppt.pdfOrientation of the Region E= ÚÚ(xsinq-ycosq+r)2B(x,y)dxdy r2=(xsinq-ycosq+r)2 Substitute r in E and differentiate

11

Example: Detecting Fingertips

Example-II

93 peaks

Page 12: Region Segmentation - UCF CRCVcrcv.ucf.edu/gauss/Regions.ppt.pdfOrientation of the Region E= ÚÚ(xsinq-ycosq+r)2B(x,y)dxdy r2=(xsinq-ycosq+r)2 Substitute r in E and differentiate

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)

Page 13: Region Segmentation - UCF CRCVcrcv.ucf.edu/gauss/Regions.ppt.pdfOrientation of the Region E= ÚÚ(xsinq-ycosq+r)2B(x,y)dxdy r2=(xsinq-ycosq+r)2 Substitute r in E and differentiate

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

Page 14: Region Segmentation - UCF CRCVcrcv.ucf.edu/gauss/Regions.ppt.pdfOrientation of the Region E= ÚÚ(xsinq-ycosq+r)2B(x,y)dxdy r2=(xsinq-ycosq+r)2 Substitute r in E and differentiate

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

Page 15: Region Segmentation - UCF CRCVcrcv.ucf.edu/gauss/Regions.ppt.pdfOrientation of the Region E= ÚÚ(xsinq-ycosq+r)2B(x,y)dxdy r2=(xsinq-ycosq+r)2 Substitute r in E and differentiate

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 -=¢-=¢ ,

Page 16: Region Segmentation - UCF CRCVcrcv.ucf.edu/gauss/Regions.ppt.pdfOrientation of the Region E= ÚÚ(xsinq-ycosq+r)2B(x,y)dxdy r2=(xsinq-ycosq+r)2 Substitute r in E and differentiate

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

Page 17: Region Segmentation - UCF CRCVcrcv.ucf.edu/gauss/Regions.ppt.pdfOrientation of the Region E= ÚÚ(xsinq-ycosq+r)2B(x,y)dxdy r2=(xsinq-ycosq+r)2 Substitute r in E and differentiate

17

Hu moments