電腦視覺 computer and robot vision i

61
電電電電 Computer and Robot Vision I Chapter3 Binary Machine Vision: Region Analysis Instructor: Shih-Shinh Huang 1

Upload: nardo

Post on 24-Feb-2016

81 views

Category:

Documents


0 download

DESCRIPTION

電腦視覺 Computer and Robot Vision I. Chapter3 Binary Machine Vision: Region Analysis Instructor: Shih- Shinh Huang. Contents. Region Properties Simple Global Properties Extremal Points Spatial Moments Mixed Spatial Gray Level Moments Signature Properties - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: 電腦視覺 Computer  and Robot Vision I

1

電腦視覺Computer and Robot Vision

I

Chapter3Binary Machine Vision:

Region Analysis

Instructor: Shih-Shinh Huang

Page 2: 電腦視覺 Computer  and Robot Vision I

2

Contents

Region Properties Simple Global Properties Extremal Points Spatial Moments Mixed Spatial Gray Level Moments

Signature Properties

Contour-Based Shape Representation

Page 3: 電腦視覺 Computer  and Robot Vision I

3

Computer and Robot Vision I

Region Properties

Introduction

Page 4: 電腦視覺 Computer  and Robot Vision I

4

Introduction

Region Description Region is a segment produced by connected

component labeling or signature segmentation.

The computation of region properties can be the input for further classification.• Gray-Level Value Analysis

• Shape Property Analysis

Region Properties

Page 5: 電腦視覺 Computer  and Robot Vision I

5

Simple Global Properties

Region Area

Centroid

Region Properties

11

11

1 1 11

11

111 1 1

1 111 0 0

00

0 00 0

00

0000

0

1 2 3 4 5 6

123456

0 00 000000

0

00

0 0

0 00 000 0 0

000000

7

7

0

0

11

Rcr

A),(

1

A

),( cr

Rcr

rA

r),(

1

Rcr

cA

c),(

1

A=21r=3.476 c=4.095

Page 6: 電腦視覺 Computer  and Robot Vision I

6

Simple Global Properties

Perimeter Description It is a sequence of its interior border pixels. Border pixels are the pixels that have some

neighboring pixel outside the region.

Types of Perimeter 4-Connected Perimeter : Use 8-Connectivity

to determine the border pixel. 8-Connected Perimeter :Use 4-Connectivity

to determine the border pixel.

Region Properties

4P

8P

Page 7: 電腦視覺 Computer  and Robot Vision I

7

Simple Global Properties

4-Connected Perimeter 4P

}),(|),{( 84 RcrNRcrP

4)1,2( P 4)2,2( P

)}2,3(),3,2(),2,2(),1,2(),2,1{(4 P

Region Properties

Page 8: 電腦視覺 Computer  and Robot Vision I

8

Simple Global Properties

8-Connected Perimeter 8P

}),(|),{( 48 RcrNRcrP

8)1,2( P 8)2,2( P

)}2,3(),3,2(),1,2(),2,1{(8 P

Region Properties

Page 9: 電腦視覺 Computer  and Robot Vision I

9

Simple Global Properties

Perimeter Representation It is a sequences of border pixels in or

• are neighborhood•

Region Properties

P8P4P

4P 8P

),),....(,(),,( 111100 KK crcrcrP

),(),,( 11 kkkk crcr

),(),( 1100 KK crcr

Page 10: 電腦視覺 Computer  and Robot Vision I

10

Simple Global Properties

Perimeter Length

Region Properties

|| P Vertical or Horizontal Line

Diagonal Line

8|| 4 P 24|| 8 P

Page 11: 電腦視覺 Computer  and Robot Vision I

11

Simple Global Properties

Compactness Measure

It is used as a measure of a shape’s compactness. Its smallest value is not for the digital circularity,

but it would for continuous planar shapes• Octagons

• Diamonds

Region Properties

AP /|| 2

Page 12: 電腦視覺 Computer  and Robot Vision I

12

Simple Global Properties

Circularity Measure Boundary Pixels

Region Properties

RR /

K

kkkR crcr

K 0

||),(),(||1

K

kRkkR crcr

K 0

22 ||),(),(||1

),( cr

),( 00 cr

),( 11 cr

),),....(,(),,( 111100 KK crcrcrP

),( 22 cr

),( 33 cr

Page 13: 電腦視覺 Computer  and Robot Vision I

13

Simple Global Properties

Circularity Measure Properties

• Digital shape circular, increases monotonically.

• It is similar for similar digital/continuous shapes

• It is orientation and area independent.

Polygon Side Estimation

Region Properties

RR /

RR /

4724.0

41111.1

R

RN

Page 14: 電腦視覺 Computer  and Robot Vision I

14

Simple Global Properties

Gray-Level Mean

Gray-Level Variance

Region Properties

Acr

crIA ),(

),(1

Acr Acr

crIA

crIA ),(

2

),(

222 ),(1),(1

Right hand equation lets us compute variance with only one pass

Page 15: 電腦視覺 Computer  and Robot Vision I

15

Simple Global Properties

Microtexture Properties Co-occurrence Matrix

• S : a set of all pairs of pixels that are in some defined spatial relationship (4-neighbors)

Region Properties

(.,.)P

SgcrIgcrIScrcr

ggP jjiijjii

#),(,),(|)],(),,[(#

),( 2121

Page 16: 電腦視覺 Computer  and Robot Vision I

16

Simple Global PropertiesRegion Properties

(.,.)P

DC & CV Lab.CSIE NTU

0

1,0P 2,2P

0,1P

0123

0 1 2 3

Page 17: 電腦視覺 Computer  and Robot Vision I

17

Simple Global Properties

Microtexture Properties Texture Second Moment

Texture Entropy

Texture Homogeneity

Region Properties

M

21 ,

212 ),(

gg

ggPM

E

21 ,2121 ),(log),(

gg

ggPggPE

H

21 , 21

21

||),(

gg ggkggPH

Page 18: 電腦視覺 Computer  and Robot Vision I

18

Simple Global Properties

Microtexture Properties Contrast

Correlation

Region Properties

21 ,

212

21 ),(||gg

ggPggC

C

2

,2121 /),())((

21

gg

ggPgg

Page 19: 電腦視覺 Computer  and Robot Vision I

19

Extremal Points

Definition of Extremal Points It has an extremal coordinate value in either its row

or column coordinate position They can be as many as eight distinct extermal

points.

Region Properties

Page 20: 電腦視覺 Computer  and Robot Vision I

20

Extremal PointsRegion Properties

Page 21: 電腦視覺 Computer  and Robot Vision I

21

Extremal PointsRegion Properties

Different extremal points may be coincident

Page 22: 電腦視覺 Computer  and Robot Vision I

22

Extremal Points

Definition of Extremal Coordinate

Region Properties

Topmost }),(|min{min21 Rcrrrrr

Bottommost }),(|max{max65 Rcrrrrr

Leftmost }),(|min{min87 Rcrcccc

Rightmost }),(|max{max43 Rcrcccc

Topmost

BottommostLeftmost Rightmost

Page 23: 電腦視覺 Computer  and Robot Vision I

23

Extremal Points

Definition of Extremal Coordinate

Region Properties

Topmost Left }),(|min{,{),( minmin11 Rcrcrcr

Topmost Left

}),(|max{,{),( minmin22 Rcrcrcr Topmost Right

Topmost Right

Page 24: 電腦視覺 Computer  and Robot Vision I

24

Extremal Points

Respective Axes (M1, M2, M3, M4) Form by each pair of opposite extremal points

• M1: Topmost Left & Bottommost Right

• M2: Topmost Right & Bottommost Left

• M3: Rightmost Top & Leftmost Bottom

• M4: Rightmost Bottom&Leftmost Top.

Properties• Length • Orientation

Region Properties

Page 25: 電腦視覺 Computer  and Robot Vision I

25

Extremal PointsRegion Properties

Page 26: 電腦視覺 Computer  and Robot Vision I

26

Extremal Points

Length of Respective Axes

: one end point of respective axes : the other point of respective axes

Region Properties

)()()( 22 QccrrM jiji

),( ii cr

),( jj cr

Quantization ErrorCompensation Term

Page 27: 電腦視覺 Computer  and Robot Vision I

27

Extremal Points

Orientation of Respective Axes Orientation of a line segment is taken as

counterclockwise with respect to column axis.

Region Properties

)()(

tan 1

ji

ji

ccrr

45|||sin|

1

45|||cos|

1

)(

Q

Quantization ErrorCompensation Term

Page 28: 電腦視覺 Computer  and Robot Vision I

28

Extremal Points

Properties of Line-like Region Major Axis : the axis with the largest length.

The length and orientation of major axis stands for the same thing for this region.

Region Properties

*M

},,,max{ 4321* MMMMM

Page 29: 電腦視覺 Computer  and Robot Vision I

29

Extremal PointsRegion Properties

3,21, MMM

4M

• Properties of Line-like Region

Page 30: 電腦視覺 Computer  and Robot Vision I

30

Extremal Points

Properties of Triangular Shapes Apex Selection: Find the extremal point having

the greatest sum of its two largest distances.

• Extremal Point Distance

• Objective Function

Region Properties

22 )()( jijiij ccrrM

}max{arg),,(3121

*3

*2

*1 kkkk MMkkk

Page 31: 電腦視覺 Computer  and Robot Vision I

31

Extremal Points

Properties of Triangular Shapes Side Length

Base Length

Altitude Height

Region Properties

L

2/)( 3121 kkkk MML L

B

B

32kkMB

h

22 2/BLh

h

Page 32: 電腦視覺 Computer  and Robot Vision I

32

Extremal PointsRegion Properties

h

B

Page 33: 電腦視覺 Computer  and Robot Vision I

33

Spatial Moments

Second-Order Spatial Moments Row Moment

Mixed Moment

Column Moment

Region Properties

rr

rc

cc

Rcr

rr rrA ),(

2)(1

Rcr

rc ccrrA ),(

))((1

Rcr

cc ccA ),(

2)(1

Page 34: 電腦視覺 Computer  and Robot Vision I

34

Spatial Moments

Second-Order Spatial Moments They have value meaning for a region of any shape Similarly, the covariance matrix has value and

meaning for any two-dimensional pdf.

Example: An ellipse A whose center is the origin.

Region Properties

}12|),{( 22 fcercdrcrR

rrrc

rccc

rcccrrfeed

)(41

2

Page 35: 電腦視覺 Computer  and Robot Vision I

35

Mixed Spatial Gray Level Moments

Description A property that mixes up two properties.

• Spatial Properties: Region Shape, Position• Intensity properties

Two Second-order Mixed Spatial Gray Properties

Region Properties

Rcr

rg crIrrA ),(

)),()((1

Rcr

cg crIccA ),(

)),()((1

Page 36: 電腦視覺 Computer  and Robot Vision I

36

Mixed Spatial Gray Level Moments

Application: Determine the least-square, best-fit gray level intensity plane.

Unknowns Variables:

Objective Function

Region Properties

)()(),( ccrrcrI

2

),,(minarg)ˆ,ˆ,ˆ(

2)],()()([ crIccrr

,,

Page 37: 電腦視覺 Computer  and Robot Vision I

37

Mixed Spatial Gray Level Moments

Application: Determine the least-square, best-fit gray level intensity plane Take partial derivative of with respect to

Region Properties

2

),,(minarg)ˆ,ˆ,ˆ(

Rcr

Rcr

Rcr

RcrRcrRcr

RcrRcrRcr

RcrRcrRcr

crI

crIcc

crIrr

ccrr

ccccccrr

rrccrrrr

),(

),(

),(

),(),(),(

),(),(

2

),(

),(),(),(

2

),(

)),()((

)),()((

1)()(

)()())((

)())(()(

Least Square Method

2 ),,(

Page 38: 電腦視覺 Computer  and Robot Vision I

38

Mixed Spatial Gray Level Moments

Application: Determine the least-square, best-fit gray level intensity plane

Region Properties

Rcr

Rcr

Rcr

RcrRcrRcr

RcrRcrRcr

RcrRcrRcr

crI

crIcc

crIrr

ccrr

ccccccrr

rrccrrrr

),(

),(

),(

),(),(),(

),(),(

2

),(

),(),(),(

2

),(

)),()((

)),()((

1)()(

)()())((

)())(()(

Rcr

rr),(

0)(

Rcr

cc),(

0)(

Rcr

Rcr

Rcr

RcrRcr

RcrRcr

crI

crIcc

crIrr

A

ccccrr

ccrrrr

),(

),(

),(

),(

2

),(

),(),(

2

),(

),()(

),()(

00

0)())((

0))(()(

Rcr

crIA ),(

),(1

Page 39: 電腦視覺 Computer  and Robot Vision I

39

Mixed Spatial Gray Level MomentsRegion Properties

Rcr

Rcr

Rcr

RcrRcr

RcrRcr

crI

crIcc

crIrr

A

ccccrr

ccrrrr

),(

),(

),(

),(

2

),(

),(),(

2

),(

),()(

),()(

00

0)())((

0))(()(

cg

rg

ccrc

rcrr

A0000

ccrc

rcrr

cccg

rcrg

ccrc

rcrr

cgrc

rgrr

Page 40: 電腦視覺 Computer  and Robot Vision I

40

Computer and Robot Vision I

Signature Properties

Introduction

Page 41: 電腦視覺 Computer  and Robot Vision I

41

Introduction

Signature Review

Signature Properties

Remark: Signature analysis is important

because of easy, fast implementation in pipeline hardware

Page 42: 電腦視覺 Computer  and Robot Vision I

42

Signature Computation

Centroid

Second-Order Moment

Signature Properties

),( cr

r r

HRcrcr RcrcRcr

rrPA

rA

rA

rA

r )(11111}),|({}),|({),(

r r

VRcrrc RcrrRcr

ccPA

cA

cA

cA

c )(11111}),|({}),|({),(

)( rr

r RcrcRcr

rr rrA

rrA }),|({

2

),(

2 )(1)(1

r r

HRcrc

rPrrA

rrA

)()(11)(1 2

}),|({

2

Page 43: 電腦視覺 Computer  and Robot Vision I

43

Signature Computation

Second-Order Moment

Signature Properties

)( cc

r RcrcRcr

cc ccA

ccA }),|({

2

),(

2 )(1)(1

r r

VRcrc

cPccA

ccA

)()(11)(1 2

}),|({

2

Page 44: 電腦視覺 Computer  and Robot Vision I

44

Circle Center Determination

Description We can determine the center position of circular

region from signature analysis.

Signature Properties

xDCBAx

cos||

x

y

yDCBAy

cos||

xcosycos

Page 45: 電腦視覺 Computer  and Robot Vision I

45

Circle Center Determination

Derivation

Signature Properties

2sin21)2(

21 2 rdrA

sin22

21 2

rdrA

sincos2221 2 rA

2sin221 2 rA

BArrBA

2

Page 46: 電腦視覺 Computer  and Robot Vision I

46

Circle Center Determination

Derivation

Signature Properties

2sin221 2 rA

BAr

2sin22

BAA

Compute by a table-look-up technique

coscos BArd

Page 47: 電腦視覺 Computer  and Robot Vision I

47

Circle Center Determination

Algorithm

Step 1: Partition the circuit into four quadrants formed by two orthogonal lines intersecting inside the circle.

Step 2: Using signature analysis to compute the areas A, B, C, and, D.

Step 3: Compute using the derived equation.

yx ,

x

y

xDCBAx

cos||

Page 48: 電腦視覺 Computer  and Robot Vision I

48

Computer and Robot Vision I

Contour-Based Shape Representation

Introduction

Page 49: 電腦視覺 Computer  and Robot Vision I

49

Chain Code

Description It describes an object by a sequence of unit-size

line segment with a given orientation. The first element must bear information about its

position to permit region reconstruction.

Chain Code: 3, 0, 0, 3, 0, 1, 1, 2, 1, 2, 3, 2

Page 50: 電腦視覺 Computer  and Robot Vision I

50

Chain Code

Matching Requirement It must be independent of the choice of the first

border pixel in the sequence. It requires the normalization of chain code

• Interpret the chain code as a base 4 number.

• Find the pixel in the border sequence which results in the minimum integer number.

Chain Code: (300301121232)4

Chain Code: (003011212323)4

Page 51: 電腦視覺 Computer  and Robot Vision I

51

Curvature

Description Curvature is defined as the rate of change of slope

in the continuous case. The evaluation algorithm in the discrete case is

based on the detection of angles between two lines.

Values of the curvature at all boundary pixels can be represented by a histogram for matching.

Page 52: 電腦視覺 Computer  and Robot Vision I

52

Curvature

b: sensitivity to local changes.

Page 53: 電腦視覺 Computer  and Robot Vision I

53

Signature

Description The signature is a sequence of normal contour

distances. It can be calculated for each boundary elements as

a function of the path length.

Page 54: 電腦視覺 Computer  and Robot Vision I

54

Chord Distribution

Description Chord is a line joining any two points of the region

boundary. The distribution of lengths and angles of all chords

may be used for shape description. Definition of Chord Distribution

: contour points : all other points

1),( yxb

0),( yxb

i j

yjxibjibyxh ),(),(),(

Page 55: 電腦視覺 Computer  and Robot Vision I

55

Chord Distribution

i j

yjxibjibyxh ),(),(),(

rdyxhrhr ),()(2/

2/

Rotation-Independent Radial Distribution

22 yxr

)/(sin 1 ry

Page 56: 電腦視覺 Computer  and Robot Vision I

56

Segment Sequence

Description It is a way to represent the boundary using

segments with specified properties. Recursive Boundary Splitting

Page 57: 電腦視覺 Computer  and Robot Vision I

57

Segment Sequence

Structure Description Curves are segmented into several types

• Circular Arcs

• Straight Line

Segments are considered as primitives for syntactic shape recognition

Chromosomes Representation.

Page 58: 電腦視覺 Computer  and Robot Vision I

58

Scale-Space Image

Description Sensitivity of shape descriptors to scale (image

resolution) is an undesirable feature. Some curve segmentation points exist in one

resolution and disappear in others. Approach Properties

Only new segmentation points can appear at higher resolution.

No existing segmentation points can disappear.

Page 59: 電腦視覺 Computer  and Robot Vision I

59

Scale-Space Image

Approach Description It is based on application of a unique Gaussian

smoothing kernel to a one-dimensional signal. The zero-crossing of the second derivative is

detected to determine the peak of curvature. The positions of zero-crossing give the positions of

curve segmentation points.

Page 60: 電腦視覺 Computer  and Robot Vision I

60

Scale-Space Image

Page 61: 電腦視覺 Computer  and Robot Vision I

61

Computer and Robot Vision I

The End