121
Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email: [email protected] Tel: 0929621000 授課教授:傅楸善 博士

Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

  • Upload
    others

  • View
    10

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

Computer and Robot Vision I

Chapter 11

Arc Extraction and Segmentation

Presented by 王柏川

Email d08922016ntuedutw

Tel 0929621000

授課教授傅楸善博士

111 Introduction

In some image sets lines curves and

circular arcs are more useful than regions or

helpful in addition to regions

object recognition

stereo matching

document analysis

DC amp CV Lab

CSIE NTU

111 Introduction

In this Ch we discuss techniques for

extracting sequences of pixels that belong to

the same curve

Source a segmented or

labeled image

DC amp CV Lab

CSIE NTU

111 Introduction

Grouping Operation

After edge labeling or image segmentation

To extract sets or sequences of labeled or

border pixel positions

The extracted pixelrsquos positions

belong to the same curve (group)

sequence of pixels group features

DC amp CV Lab

CSIE NTU

111 Introduction

DC amp CV Lab

CSIE NTU

Labeling

edge detection label each pixel as edge or not

additional properties edge direction gradient

magnitude edge contrasthellip

Grouping

grouping operation edge pixels participating in

the same region boundary are grouped together

into a sequence

boundary sequence simple pieces

analytic descriptions shape-matching

112 Extracting Boundary Pixels

from a Segmented Image

Regions have been determined by

segmentation or connected components

boundary of each region can be extracted

Boundary extraction for small-sized images

1 scan through the image first border of

each region

2 first border of each region follow the

border of the connected component around in

a clockwise direction until reach itselfDC amp CV Lab

CSIE NTU

112 Extracting Boundary Pixels

from a Segmented Image

Boundary extraction for small-sized images

memory problems for large-sized one simple boarder-tacking algo

may result in excessive IO to storage

4K UHD ndash (3840thinsptimesthinsp2160) ~= 83M pixel

Many techniques like down-sampling

It may be a problem back to 1992 how about TODAY

Border-tracking algorithm border1 Input symbolic image

2 Output a clockwise-ordered list of the coordinates of its border pixels

3 In one left-right top-bottom scan through the image

4 During execution

there are 3 sets of regions current past futureDC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

Past region null

Current region 2

Future region 1

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

Past region 1

Current region 2

Future region null

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(active)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(active) CHAINSET (1) -gt (32)

(32) NEIGHB (33) (42)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(active) CHAINSET (1) -gt (32)

- (33) NEIGHB (32)(34)(43)

- (active) CHAINSET (1) -gt (32) -gt (33)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (2 6)

(active) CHAINSET (1) -gt (32) -gt (33)

- (34) NEIGHB (33)(44)

- (active) CHAINSET (1) -gt (32) -gt (33) -gt (34)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(Inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

(35) NEIGHB (25) (36) (45)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

- (36) NEIGHB (26) (35) (46)

- active CHAINSET change (clockwise-ordered)

- (active) CHAINSET (2) -gt (25) -gt (26) -gt (36)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(active) CHAINSET (1) -gt (42)

(42) NEIGHB (33)(43)(52)

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

(active) CHAINSET (1) -gt (42)

1122 Border-Tracking Algorithm

helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

CHAINSET

(1)(32)(33)(34)(44)(54)

(1)(42)(52)(53)

(2)(25)(26)(36)(46)(56)(66)

(2)(35)(45)(55)(65)

CHAINSET

(1)(32)(33)(34)(44)(54)(53)(52)(42)

(2)(25)(26)(36)(46)(56)(66)(65)(55)

(45)(35)

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

Border tracking each border bounded a closed

region NO point would be split into two or

more segments

Tracking symbolic edge (line) segments more

complex

value1 edge 0 non-edge

not necessary for edge pixels to bound closed regions

segments consist of connected edge pixels that go from

endpoint corner or junction to endpoint corner or junction

-gt pixeltype() is more complexDC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

INLIST OUTLIST

113 Linking One-Pixel-Wide

Edges or Lines

pixeltype() determines a pixel point

isolated point

starting point of an new segment

interior pixel of an old segment

ending point of an old segment

junction

corner

Instead of past current future regions there

are past current future segmentsDC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 2: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

111 Introduction

In some image sets lines curves and

circular arcs are more useful than regions or

helpful in addition to regions

object recognition

stereo matching

document analysis

DC amp CV Lab

CSIE NTU

111 Introduction

In this Ch we discuss techniques for

extracting sequences of pixels that belong to

the same curve

Source a segmented or

labeled image

DC amp CV Lab

CSIE NTU

111 Introduction

Grouping Operation

After edge labeling or image segmentation

To extract sets or sequences of labeled or

border pixel positions

The extracted pixelrsquos positions

belong to the same curve (group)

sequence of pixels group features

DC amp CV Lab

CSIE NTU

111 Introduction

DC amp CV Lab

CSIE NTU

Labeling

edge detection label each pixel as edge or not

additional properties edge direction gradient

magnitude edge contrasthellip

Grouping

grouping operation edge pixels participating in

the same region boundary are grouped together

into a sequence

boundary sequence simple pieces

analytic descriptions shape-matching

112 Extracting Boundary Pixels

from a Segmented Image

Regions have been determined by

segmentation or connected components

boundary of each region can be extracted

Boundary extraction for small-sized images

1 scan through the image first border of

each region

2 first border of each region follow the

border of the connected component around in

a clockwise direction until reach itselfDC amp CV Lab

CSIE NTU

112 Extracting Boundary Pixels

from a Segmented Image

Boundary extraction for small-sized images

memory problems for large-sized one simple boarder-tacking algo

may result in excessive IO to storage

4K UHD ndash (3840thinsptimesthinsp2160) ~= 83M pixel

Many techniques like down-sampling

It may be a problem back to 1992 how about TODAY

Border-tracking algorithm border1 Input symbolic image

2 Output a clockwise-ordered list of the coordinates of its border pixels

3 In one left-right top-bottom scan through the image

4 During execution

there are 3 sets of regions current past futureDC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

Past region null

Current region 2

Future region 1

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

Past region 1

Current region 2

Future region null

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(active)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(active) CHAINSET (1) -gt (32)

(32) NEIGHB (33) (42)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(active) CHAINSET (1) -gt (32)

- (33) NEIGHB (32)(34)(43)

- (active) CHAINSET (1) -gt (32) -gt (33)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (2 6)

(active) CHAINSET (1) -gt (32) -gt (33)

- (34) NEIGHB (33)(44)

- (active) CHAINSET (1) -gt (32) -gt (33) -gt (34)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(Inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

(35) NEIGHB (25) (36) (45)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

- (36) NEIGHB (26) (35) (46)

- active CHAINSET change (clockwise-ordered)

- (active) CHAINSET (2) -gt (25) -gt (26) -gt (36)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(active) CHAINSET (1) -gt (42)

(42) NEIGHB (33)(43)(52)

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

(active) CHAINSET (1) -gt (42)

1122 Border-Tracking Algorithm

helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

CHAINSET

(1)(32)(33)(34)(44)(54)

(1)(42)(52)(53)

(2)(25)(26)(36)(46)(56)(66)

(2)(35)(45)(55)(65)

CHAINSET

(1)(32)(33)(34)(44)(54)(53)(52)(42)

(2)(25)(26)(36)(46)(56)(66)(65)(55)

(45)(35)

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

Border tracking each border bounded a closed

region NO point would be split into two or

more segments

Tracking symbolic edge (line) segments more

complex

value1 edge 0 non-edge

not necessary for edge pixels to bound closed regions

segments consist of connected edge pixels that go from

endpoint corner or junction to endpoint corner or junction

-gt pixeltype() is more complexDC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

INLIST OUTLIST

113 Linking One-Pixel-Wide

Edges or Lines

pixeltype() determines a pixel point

isolated point

starting point of an new segment

interior pixel of an old segment

ending point of an old segment

junction

corner

Instead of past current future regions there

are past current future segmentsDC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 3: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

111 Introduction

In this Ch we discuss techniques for

extracting sequences of pixels that belong to

the same curve

Source a segmented or

labeled image

DC amp CV Lab

CSIE NTU

111 Introduction

Grouping Operation

After edge labeling or image segmentation

To extract sets or sequences of labeled or

border pixel positions

The extracted pixelrsquos positions

belong to the same curve (group)

sequence of pixels group features

DC amp CV Lab

CSIE NTU

111 Introduction

DC amp CV Lab

CSIE NTU

Labeling

edge detection label each pixel as edge or not

additional properties edge direction gradient

magnitude edge contrasthellip

Grouping

grouping operation edge pixels participating in

the same region boundary are grouped together

into a sequence

boundary sequence simple pieces

analytic descriptions shape-matching

112 Extracting Boundary Pixels

from a Segmented Image

Regions have been determined by

segmentation or connected components

boundary of each region can be extracted

Boundary extraction for small-sized images

1 scan through the image first border of

each region

2 first border of each region follow the

border of the connected component around in

a clockwise direction until reach itselfDC amp CV Lab

CSIE NTU

112 Extracting Boundary Pixels

from a Segmented Image

Boundary extraction for small-sized images

memory problems for large-sized one simple boarder-tacking algo

may result in excessive IO to storage

4K UHD ndash (3840thinsptimesthinsp2160) ~= 83M pixel

Many techniques like down-sampling

It may be a problem back to 1992 how about TODAY

Border-tracking algorithm border1 Input symbolic image

2 Output a clockwise-ordered list of the coordinates of its border pixels

3 In one left-right top-bottom scan through the image

4 During execution

there are 3 sets of regions current past futureDC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

Past region null

Current region 2

Future region 1

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

Past region 1

Current region 2

Future region null

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(active)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(active) CHAINSET (1) -gt (32)

(32) NEIGHB (33) (42)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(active) CHAINSET (1) -gt (32)

- (33) NEIGHB (32)(34)(43)

- (active) CHAINSET (1) -gt (32) -gt (33)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (2 6)

(active) CHAINSET (1) -gt (32) -gt (33)

- (34) NEIGHB (33)(44)

- (active) CHAINSET (1) -gt (32) -gt (33) -gt (34)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(Inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

(35) NEIGHB (25) (36) (45)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

- (36) NEIGHB (26) (35) (46)

- active CHAINSET change (clockwise-ordered)

- (active) CHAINSET (2) -gt (25) -gt (26) -gt (36)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(active) CHAINSET (1) -gt (42)

(42) NEIGHB (33)(43)(52)

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

(active) CHAINSET (1) -gt (42)

1122 Border-Tracking Algorithm

helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

CHAINSET

(1)(32)(33)(34)(44)(54)

(1)(42)(52)(53)

(2)(25)(26)(36)(46)(56)(66)

(2)(35)(45)(55)(65)

CHAINSET

(1)(32)(33)(34)(44)(54)(53)(52)(42)

(2)(25)(26)(36)(46)(56)(66)(65)(55)

(45)(35)

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

Border tracking each border bounded a closed

region NO point would be split into two or

more segments

Tracking symbolic edge (line) segments more

complex

value1 edge 0 non-edge

not necessary for edge pixels to bound closed regions

segments consist of connected edge pixels that go from

endpoint corner or junction to endpoint corner or junction

-gt pixeltype() is more complexDC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

INLIST OUTLIST

113 Linking One-Pixel-Wide

Edges or Lines

pixeltype() determines a pixel point

isolated point

starting point of an new segment

interior pixel of an old segment

ending point of an old segment

junction

corner

Instead of past current future regions there

are past current future segmentsDC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 4: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

111 Introduction

Grouping Operation

After edge labeling or image segmentation

To extract sets or sequences of labeled or

border pixel positions

The extracted pixelrsquos positions

belong to the same curve (group)

sequence of pixels group features

DC amp CV Lab

CSIE NTU

111 Introduction

DC amp CV Lab

CSIE NTU

Labeling

edge detection label each pixel as edge or not

additional properties edge direction gradient

magnitude edge contrasthellip

Grouping

grouping operation edge pixels participating in

the same region boundary are grouped together

into a sequence

boundary sequence simple pieces

analytic descriptions shape-matching

112 Extracting Boundary Pixels

from a Segmented Image

Regions have been determined by

segmentation or connected components

boundary of each region can be extracted

Boundary extraction for small-sized images

1 scan through the image first border of

each region

2 first border of each region follow the

border of the connected component around in

a clockwise direction until reach itselfDC amp CV Lab

CSIE NTU

112 Extracting Boundary Pixels

from a Segmented Image

Boundary extraction for small-sized images

memory problems for large-sized one simple boarder-tacking algo

may result in excessive IO to storage

4K UHD ndash (3840thinsptimesthinsp2160) ~= 83M pixel

Many techniques like down-sampling

It may be a problem back to 1992 how about TODAY

Border-tracking algorithm border1 Input symbolic image

2 Output a clockwise-ordered list of the coordinates of its border pixels

3 In one left-right top-bottom scan through the image

4 During execution

there are 3 sets of regions current past futureDC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

Past region null

Current region 2

Future region 1

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

Past region 1

Current region 2

Future region null

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(active)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(active) CHAINSET (1) -gt (32)

(32) NEIGHB (33) (42)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(active) CHAINSET (1) -gt (32)

- (33) NEIGHB (32)(34)(43)

- (active) CHAINSET (1) -gt (32) -gt (33)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (2 6)

(active) CHAINSET (1) -gt (32) -gt (33)

- (34) NEIGHB (33)(44)

- (active) CHAINSET (1) -gt (32) -gt (33) -gt (34)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(Inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

(35) NEIGHB (25) (36) (45)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

- (36) NEIGHB (26) (35) (46)

- active CHAINSET change (clockwise-ordered)

- (active) CHAINSET (2) -gt (25) -gt (26) -gt (36)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(active) CHAINSET (1) -gt (42)

(42) NEIGHB (33)(43)(52)

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

(active) CHAINSET (1) -gt (42)

1122 Border-Tracking Algorithm

helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

CHAINSET

(1)(32)(33)(34)(44)(54)

(1)(42)(52)(53)

(2)(25)(26)(36)(46)(56)(66)

(2)(35)(45)(55)(65)

CHAINSET

(1)(32)(33)(34)(44)(54)(53)(52)(42)

(2)(25)(26)(36)(46)(56)(66)(65)(55)

(45)(35)

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

Border tracking each border bounded a closed

region NO point would be split into two or

more segments

Tracking symbolic edge (line) segments more

complex

value1 edge 0 non-edge

not necessary for edge pixels to bound closed regions

segments consist of connected edge pixels that go from

endpoint corner or junction to endpoint corner or junction

-gt pixeltype() is more complexDC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

INLIST OUTLIST

113 Linking One-Pixel-Wide

Edges or Lines

pixeltype() determines a pixel point

isolated point

starting point of an new segment

interior pixel of an old segment

ending point of an old segment

junction

corner

Instead of past current future regions there

are past current future segmentsDC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 5: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

111 Introduction

DC amp CV Lab

CSIE NTU

Labeling

edge detection label each pixel as edge or not

additional properties edge direction gradient

magnitude edge contrasthellip

Grouping

grouping operation edge pixels participating in

the same region boundary are grouped together

into a sequence

boundary sequence simple pieces

analytic descriptions shape-matching

112 Extracting Boundary Pixels

from a Segmented Image

Regions have been determined by

segmentation or connected components

boundary of each region can be extracted

Boundary extraction for small-sized images

1 scan through the image first border of

each region

2 first border of each region follow the

border of the connected component around in

a clockwise direction until reach itselfDC amp CV Lab

CSIE NTU

112 Extracting Boundary Pixels

from a Segmented Image

Boundary extraction for small-sized images

memory problems for large-sized one simple boarder-tacking algo

may result in excessive IO to storage

4K UHD ndash (3840thinsptimesthinsp2160) ~= 83M pixel

Many techniques like down-sampling

It may be a problem back to 1992 how about TODAY

Border-tracking algorithm border1 Input symbolic image

2 Output a clockwise-ordered list of the coordinates of its border pixels

3 In one left-right top-bottom scan through the image

4 During execution

there are 3 sets of regions current past futureDC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

Past region null

Current region 2

Future region 1

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

Past region 1

Current region 2

Future region null

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(active)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(active) CHAINSET (1) -gt (32)

(32) NEIGHB (33) (42)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(active) CHAINSET (1) -gt (32)

- (33) NEIGHB (32)(34)(43)

- (active) CHAINSET (1) -gt (32) -gt (33)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (2 6)

(active) CHAINSET (1) -gt (32) -gt (33)

- (34) NEIGHB (33)(44)

- (active) CHAINSET (1) -gt (32) -gt (33) -gt (34)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(Inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

(35) NEIGHB (25) (36) (45)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

- (36) NEIGHB (26) (35) (46)

- active CHAINSET change (clockwise-ordered)

- (active) CHAINSET (2) -gt (25) -gt (26) -gt (36)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(active) CHAINSET (1) -gt (42)

(42) NEIGHB (33)(43)(52)

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

(active) CHAINSET (1) -gt (42)

1122 Border-Tracking Algorithm

helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

CHAINSET

(1)(32)(33)(34)(44)(54)

(1)(42)(52)(53)

(2)(25)(26)(36)(46)(56)(66)

(2)(35)(45)(55)(65)

CHAINSET

(1)(32)(33)(34)(44)(54)(53)(52)(42)

(2)(25)(26)(36)(46)(56)(66)(65)(55)

(45)(35)

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

Border tracking each border bounded a closed

region NO point would be split into two or

more segments

Tracking symbolic edge (line) segments more

complex

value1 edge 0 non-edge

not necessary for edge pixels to bound closed regions

segments consist of connected edge pixels that go from

endpoint corner or junction to endpoint corner or junction

-gt pixeltype() is more complexDC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

INLIST OUTLIST

113 Linking One-Pixel-Wide

Edges or Lines

pixeltype() determines a pixel point

isolated point

starting point of an new segment

interior pixel of an old segment

ending point of an old segment

junction

corner

Instead of past current future regions there

are past current future segmentsDC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 6: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

112 Extracting Boundary Pixels

from a Segmented Image

Regions have been determined by

segmentation or connected components

boundary of each region can be extracted

Boundary extraction for small-sized images

1 scan through the image first border of

each region

2 first border of each region follow the

border of the connected component around in

a clockwise direction until reach itselfDC amp CV Lab

CSIE NTU

112 Extracting Boundary Pixels

from a Segmented Image

Boundary extraction for small-sized images

memory problems for large-sized one simple boarder-tacking algo

may result in excessive IO to storage

4K UHD ndash (3840thinsptimesthinsp2160) ~= 83M pixel

Many techniques like down-sampling

It may be a problem back to 1992 how about TODAY

Border-tracking algorithm border1 Input symbolic image

2 Output a clockwise-ordered list of the coordinates of its border pixels

3 In one left-right top-bottom scan through the image

4 During execution

there are 3 sets of regions current past futureDC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

Past region null

Current region 2

Future region 1

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

Past region 1

Current region 2

Future region null

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(active)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(active) CHAINSET (1) -gt (32)

(32) NEIGHB (33) (42)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(active) CHAINSET (1) -gt (32)

- (33) NEIGHB (32)(34)(43)

- (active) CHAINSET (1) -gt (32) -gt (33)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (2 6)

(active) CHAINSET (1) -gt (32) -gt (33)

- (34) NEIGHB (33)(44)

- (active) CHAINSET (1) -gt (32) -gt (33) -gt (34)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(Inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

(35) NEIGHB (25) (36) (45)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

- (36) NEIGHB (26) (35) (46)

- active CHAINSET change (clockwise-ordered)

- (active) CHAINSET (2) -gt (25) -gt (26) -gt (36)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(active) CHAINSET (1) -gt (42)

(42) NEIGHB (33)(43)(52)

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

(active) CHAINSET (1) -gt (42)

1122 Border-Tracking Algorithm

helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

CHAINSET

(1)(32)(33)(34)(44)(54)

(1)(42)(52)(53)

(2)(25)(26)(36)(46)(56)(66)

(2)(35)(45)(55)(65)

CHAINSET

(1)(32)(33)(34)(44)(54)(53)(52)(42)

(2)(25)(26)(36)(46)(56)(66)(65)(55)

(45)(35)

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

Border tracking each border bounded a closed

region NO point would be split into two or

more segments

Tracking symbolic edge (line) segments more

complex

value1 edge 0 non-edge

not necessary for edge pixels to bound closed regions

segments consist of connected edge pixels that go from

endpoint corner or junction to endpoint corner or junction

-gt pixeltype() is more complexDC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

INLIST OUTLIST

113 Linking One-Pixel-Wide

Edges or Lines

pixeltype() determines a pixel point

isolated point

starting point of an new segment

interior pixel of an old segment

ending point of an old segment

junction

corner

Instead of past current future regions there

are past current future segmentsDC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 7: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

112 Extracting Boundary Pixels

from a Segmented Image

Boundary extraction for small-sized images

memory problems for large-sized one simple boarder-tacking algo

may result in excessive IO to storage

4K UHD ndash (3840thinsptimesthinsp2160) ~= 83M pixel

Many techniques like down-sampling

It may be a problem back to 1992 how about TODAY

Border-tracking algorithm border1 Input symbolic image

2 Output a clockwise-ordered list of the coordinates of its border pixels

3 In one left-right top-bottom scan through the image

4 During execution

there are 3 sets of regions current past futureDC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

Past region null

Current region 2

Future region 1

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

Past region 1

Current region 2

Future region null

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(active)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(active) CHAINSET (1) -gt (32)

(32) NEIGHB (33) (42)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(active) CHAINSET (1) -gt (32)

- (33) NEIGHB (32)(34)(43)

- (active) CHAINSET (1) -gt (32) -gt (33)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (2 6)

(active) CHAINSET (1) -gt (32) -gt (33)

- (34) NEIGHB (33)(44)

- (active) CHAINSET (1) -gt (32) -gt (33) -gt (34)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(Inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

(35) NEIGHB (25) (36) (45)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

- (36) NEIGHB (26) (35) (46)

- active CHAINSET change (clockwise-ordered)

- (active) CHAINSET (2) -gt (25) -gt (26) -gt (36)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(active) CHAINSET (1) -gt (42)

(42) NEIGHB (33)(43)(52)

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

(active) CHAINSET (1) -gt (42)

1122 Border-Tracking Algorithm

helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

CHAINSET

(1)(32)(33)(34)(44)(54)

(1)(42)(52)(53)

(2)(25)(26)(36)(46)(56)(66)

(2)(35)(45)(55)(65)

CHAINSET

(1)(32)(33)(34)(44)(54)(53)(52)(42)

(2)(25)(26)(36)(46)(56)(66)(65)(55)

(45)(35)

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

Border tracking each border bounded a closed

region NO point would be split into two or

more segments

Tracking symbolic edge (line) segments more

complex

value1 edge 0 non-edge

not necessary for edge pixels to bound closed regions

segments consist of connected edge pixels that go from

endpoint corner or junction to endpoint corner or junction

-gt pixeltype() is more complexDC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

INLIST OUTLIST

113 Linking One-Pixel-Wide

Edges or Lines

pixeltype() determines a pixel point

isolated point

starting point of an new segment

interior pixel of an old segment

ending point of an old segment

junction

corner

Instead of past current future regions there

are past current future segmentsDC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 8: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

Past region null

Current region 2

Future region 1

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

Past region 1

Current region 2

Future region null

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(active)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(active) CHAINSET (1) -gt (32)

(32) NEIGHB (33) (42)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(active) CHAINSET (1) -gt (32)

- (33) NEIGHB (32)(34)(43)

- (active) CHAINSET (1) -gt (32) -gt (33)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (2 6)

(active) CHAINSET (1) -gt (32) -gt (33)

- (34) NEIGHB (33)(44)

- (active) CHAINSET (1) -gt (32) -gt (33) -gt (34)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(Inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

(35) NEIGHB (25) (36) (45)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

- (36) NEIGHB (26) (35) (46)

- active CHAINSET change (clockwise-ordered)

- (active) CHAINSET (2) -gt (25) -gt (26) -gt (36)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(active) CHAINSET (1) -gt (42)

(42) NEIGHB (33)(43)(52)

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

(active) CHAINSET (1) -gt (42)

1122 Border-Tracking Algorithm

helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

CHAINSET

(1)(32)(33)(34)(44)(54)

(1)(42)(52)(53)

(2)(25)(26)(36)(46)(56)(66)

(2)(35)(45)(55)(65)

CHAINSET

(1)(32)(33)(34)(44)(54)(53)(52)(42)

(2)(25)(26)(36)(46)(56)(66)(65)(55)

(45)(35)

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

Border tracking each border bounded a closed

region NO point would be split into two or

more segments

Tracking symbolic edge (line) segments more

complex

value1 edge 0 non-edge

not necessary for edge pixels to bound closed regions

segments consist of connected edge pixels that go from

endpoint corner or junction to endpoint corner or junction

-gt pixeltype() is more complexDC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

INLIST OUTLIST

113 Linking One-Pixel-Wide

Edges or Lines

pixeltype() determines a pixel point

isolated point

starting point of an new segment

interior pixel of an old segment

ending point of an old segment

junction

corner

Instead of past current future regions there

are past current future segmentsDC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 9: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

Past region 1

Current region 2

Future region null

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(active)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(active) CHAINSET (1) -gt (32)

(32) NEIGHB (33) (42)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(active) CHAINSET (1) -gt (32)

- (33) NEIGHB (32)(34)(43)

- (active) CHAINSET (1) -gt (32) -gt (33)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (2 6)

(active) CHAINSET (1) -gt (32) -gt (33)

- (34) NEIGHB (33)(44)

- (active) CHAINSET (1) -gt (32) -gt (33) -gt (34)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(Inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

(35) NEIGHB (25) (36) (45)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

- (36) NEIGHB (26) (35) (46)

- active CHAINSET change (clockwise-ordered)

- (active) CHAINSET (2) -gt (25) -gt (26) -gt (36)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(active) CHAINSET (1) -gt (42)

(42) NEIGHB (33)(43)(52)

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

(active) CHAINSET (1) -gt (42)

1122 Border-Tracking Algorithm

helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

CHAINSET

(1)(32)(33)(34)(44)(54)

(1)(42)(52)(53)

(2)(25)(26)(36)(46)(56)(66)

(2)(35)(45)(55)(65)

CHAINSET

(1)(32)(33)(34)(44)(54)(53)(52)(42)

(2)(25)(26)(36)(46)(56)(66)(65)(55)

(45)(35)

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

Border tracking each border bounded a closed

region NO point would be split into two or

more segments

Tracking symbolic edge (line) segments more

complex

value1 edge 0 non-edge

not necessary for edge pixels to bound closed regions

segments consist of connected edge pixels that go from

endpoint corner or junction to endpoint corner or junction

-gt pixeltype() is more complexDC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

INLIST OUTLIST

113 Linking One-Pixel-Wide

Edges or Lines

pixeltype() determines a pixel point

isolated point

starting point of an new segment

interior pixel of an old segment

ending point of an old segment

junction

corner

Instead of past current future regions there

are past current future segmentsDC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 10: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(active)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(active) CHAINSET (1) -gt (32)

(32) NEIGHB (33) (42)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(active) CHAINSET (1) -gt (32)

- (33) NEIGHB (32)(34)(43)

- (active) CHAINSET (1) -gt (32) -gt (33)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (2 6)

(active) CHAINSET (1) -gt (32) -gt (33)

- (34) NEIGHB (33)(44)

- (active) CHAINSET (1) -gt (32) -gt (33) -gt (34)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(Inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

(35) NEIGHB (25) (36) (45)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

- (36) NEIGHB (26) (35) (46)

- active CHAINSET change (clockwise-ordered)

- (active) CHAINSET (2) -gt (25) -gt (26) -gt (36)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(active) CHAINSET (1) -gt (42)

(42) NEIGHB (33)(43)(52)

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

(active) CHAINSET (1) -gt (42)

1122 Border-Tracking Algorithm

helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

CHAINSET

(1)(32)(33)(34)(44)(54)

(1)(42)(52)(53)

(2)(25)(26)(36)(46)(56)(66)

(2)(35)(45)(55)(65)

CHAINSET

(1)(32)(33)(34)(44)(54)(53)(52)(42)

(2)(25)(26)(36)(46)(56)(66)(65)(55)

(45)(35)

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

Border tracking each border bounded a closed

region NO point would be split into two or

more segments

Tracking symbolic edge (line) segments more

complex

value1 edge 0 non-edge

not necessary for edge pixels to bound closed regions

segments consist of connected edge pixels that go from

endpoint corner or junction to endpoint corner or junction

-gt pixeltype() is more complexDC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

INLIST OUTLIST

113 Linking One-Pixel-Wide

Edges or Lines

pixeltype() determines a pixel point

isolated point

starting point of an new segment

interior pixel of an old segment

ending point of an old segment

junction

corner

Instead of past current future regions there

are past current future segmentsDC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 11: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(active)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(active) CHAINSET (1) -gt (32)

(32) NEIGHB (33) (42)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(active) CHAINSET (1) -gt (32)

- (33) NEIGHB (32)(34)(43)

- (active) CHAINSET (1) -gt (32) -gt (33)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (2 6)

(active) CHAINSET (1) -gt (32) -gt (33)

- (34) NEIGHB (33)(44)

- (active) CHAINSET (1) -gt (32) -gt (33) -gt (34)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(Inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

(35) NEIGHB (25) (36) (45)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

- (36) NEIGHB (26) (35) (46)

- active CHAINSET change (clockwise-ordered)

- (active) CHAINSET (2) -gt (25) -gt (26) -gt (36)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(active) CHAINSET (1) -gt (42)

(42) NEIGHB (33)(43)(52)

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

(active) CHAINSET (1) -gt (42)

1122 Border-Tracking Algorithm

helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

CHAINSET

(1)(32)(33)(34)(44)(54)

(1)(42)(52)(53)

(2)(25)(26)(36)(46)(56)(66)

(2)(35)(45)(55)(65)

CHAINSET

(1)(32)(33)(34)(44)(54)(53)(52)(42)

(2)(25)(26)(36)(46)(56)(66)(65)(55)

(45)(35)

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

Border tracking each border bounded a closed

region NO point would be split into two or

more segments

Tracking symbolic edge (line) segments more

complex

value1 edge 0 non-edge

not necessary for edge pixels to bound closed regions

segments consist of connected edge pixels that go from

endpoint corner or junction to endpoint corner or junction

-gt pixeltype() is more complexDC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

INLIST OUTLIST

113 Linking One-Pixel-Wide

Edges or Lines

pixeltype() determines a pixel point

isolated point

starting point of an new segment

interior pixel of an old segment

ending point of an old segment

junction

corner

Instead of past current future regions there

are past current future segmentsDC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 12: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(active)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(active) CHAINSET (1) -gt (32)

(32) NEIGHB (33) (42)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(active) CHAINSET (1) -gt (32)

- (33) NEIGHB (32)(34)(43)

- (active) CHAINSET (1) -gt (32) -gt (33)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (2 6)

(active) CHAINSET (1) -gt (32) -gt (33)

- (34) NEIGHB (33)(44)

- (active) CHAINSET (1) -gt (32) -gt (33) -gt (34)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(Inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

(35) NEIGHB (25) (36) (45)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

- (36) NEIGHB (26) (35) (46)

- active CHAINSET change (clockwise-ordered)

- (active) CHAINSET (2) -gt (25) -gt (26) -gt (36)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(active) CHAINSET (1) -gt (42)

(42) NEIGHB (33)(43)(52)

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

(active) CHAINSET (1) -gt (42)

1122 Border-Tracking Algorithm

helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

CHAINSET

(1)(32)(33)(34)(44)(54)

(1)(42)(52)(53)

(2)(25)(26)(36)(46)(56)(66)

(2)(35)(45)(55)(65)

CHAINSET

(1)(32)(33)(34)(44)(54)(53)(52)(42)

(2)(25)(26)(36)(46)(56)(66)(65)(55)

(45)(35)

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

Border tracking each border bounded a closed

region NO point would be split into two or

more segments

Tracking symbolic edge (line) segments more

complex

value1 edge 0 non-edge

not necessary for edge pixels to bound closed regions

segments consist of connected edge pixels that go from

endpoint corner or junction to endpoint corner or junction

-gt pixeltype() is more complexDC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

INLIST OUTLIST

113 Linking One-Pixel-Wide

Edges or Lines

pixeltype() determines a pixel point

isolated point

starting point of an new segment

interior pixel of an old segment

ending point of an old segment

junction

corner

Instead of past current future regions there

are past current future segmentsDC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 13: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(active)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(active) CHAINSET (1) -gt (32)

(32) NEIGHB (33) (42)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(active) CHAINSET (1) -gt (32)

- (33) NEIGHB (32)(34)(43)

- (active) CHAINSET (1) -gt (32) -gt (33)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (2 6)

(active) CHAINSET (1) -gt (32) -gt (33)

- (34) NEIGHB (33)(44)

- (active) CHAINSET (1) -gt (32) -gt (33) -gt (34)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(Inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

(35) NEIGHB (25) (36) (45)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

- (36) NEIGHB (26) (35) (46)

- active CHAINSET change (clockwise-ordered)

- (active) CHAINSET (2) -gt (25) -gt (26) -gt (36)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(active) CHAINSET (1) -gt (42)

(42) NEIGHB (33)(43)(52)

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

(active) CHAINSET (1) -gt (42)

1122 Border-Tracking Algorithm

helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

CHAINSET

(1)(32)(33)(34)(44)(54)

(1)(42)(52)(53)

(2)(25)(26)(36)(46)(56)(66)

(2)(35)(45)(55)(65)

CHAINSET

(1)(32)(33)(34)(44)(54)(53)(52)(42)

(2)(25)(26)(36)(46)(56)(66)(65)(55)

(45)(35)

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

Border tracking each border bounded a closed

region NO point would be split into two or

more segments

Tracking symbolic edge (line) segments more

complex

value1 edge 0 non-edge

not necessary for edge pixels to bound closed regions

segments consist of connected edge pixels that go from

endpoint corner or junction to endpoint corner or junction

-gt pixeltype() is more complexDC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

INLIST OUTLIST

113 Linking One-Pixel-Wide

Edges or Lines

pixeltype() determines a pixel point

isolated point

starting point of an new segment

interior pixel of an old segment

ending point of an old segment

junction

corner

Instead of past current future regions there

are past current future segmentsDC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 14: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(active) CHAINSET (1) -gt (32)

(32) NEIGHB (33) (42)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(active) CHAINSET (1) -gt (32)

- (33) NEIGHB (32)(34)(43)

- (active) CHAINSET (1) -gt (32) -gt (33)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (2 6)

(active) CHAINSET (1) -gt (32) -gt (33)

- (34) NEIGHB (33)(44)

- (active) CHAINSET (1) -gt (32) -gt (33) -gt (34)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(Inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

(35) NEIGHB (25) (36) (45)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

- (36) NEIGHB (26) (35) (46)

- active CHAINSET change (clockwise-ordered)

- (active) CHAINSET (2) -gt (25) -gt (26) -gt (36)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(active) CHAINSET (1) -gt (42)

(42) NEIGHB (33)(43)(52)

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

(active) CHAINSET (1) -gt (42)

1122 Border-Tracking Algorithm

helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

CHAINSET

(1)(32)(33)(34)(44)(54)

(1)(42)(52)(53)

(2)(25)(26)(36)(46)(56)(66)

(2)(35)(45)(55)(65)

CHAINSET

(1)(32)(33)(34)(44)(54)(53)(52)(42)

(2)(25)(26)(36)(46)(56)(66)(65)(55)

(45)(35)

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

Border tracking each border bounded a closed

region NO point would be split into two or

more segments

Tracking symbolic edge (line) segments more

complex

value1 edge 0 non-edge

not necessary for edge pixels to bound closed regions

segments consist of connected edge pixels that go from

endpoint corner or junction to endpoint corner or junction

-gt pixeltype() is more complexDC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

INLIST OUTLIST

113 Linking One-Pixel-Wide

Edges or Lines

pixeltype() determines a pixel point

isolated point

starting point of an new segment

interior pixel of an old segment

ending point of an old segment

junction

corner

Instead of past current future regions there

are past current future segmentsDC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 15: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(active) CHAINSET (1) -gt (32)

- (33) NEIGHB (32)(34)(43)

- (active) CHAINSET (1) -gt (32) -gt (33)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (2 6)

(active) CHAINSET (1) -gt (32) -gt (33)

- (34) NEIGHB (33)(44)

- (active) CHAINSET (1) -gt (32) -gt (33) -gt (34)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(Inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

(35) NEIGHB (25) (36) (45)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

- (36) NEIGHB (26) (35) (46)

- active CHAINSET change (clockwise-ordered)

- (active) CHAINSET (2) -gt (25) -gt (26) -gt (36)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(active) CHAINSET (1) -gt (42)

(42) NEIGHB (33)(43)(52)

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

(active) CHAINSET (1) -gt (42)

1122 Border-Tracking Algorithm

helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

CHAINSET

(1)(32)(33)(34)(44)(54)

(1)(42)(52)(53)

(2)(25)(26)(36)(46)(56)(66)

(2)(35)(45)(55)(65)

CHAINSET

(1)(32)(33)(34)(44)(54)(53)(52)(42)

(2)(25)(26)(36)(46)(56)(66)(65)(55)

(45)(35)

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

Border tracking each border bounded a closed

region NO point would be split into two or

more segments

Tracking symbolic edge (line) segments more

complex

value1 edge 0 non-edge

not necessary for edge pixels to bound closed regions

segments consist of connected edge pixels that go from

endpoint corner or junction to endpoint corner or junction

-gt pixeltype() is more complexDC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

INLIST OUTLIST

113 Linking One-Pixel-Wide

Edges or Lines

pixeltype() determines a pixel point

isolated point

starting point of an new segment

interior pixel of an old segment

ending point of an old segment

junction

corner

Instead of past current future regions there

are past current future segmentsDC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 16: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (2 6)

(active) CHAINSET (1) -gt (32) -gt (33)

- (34) NEIGHB (33)(44)

- (active) CHAINSET (1) -gt (32) -gt (33) -gt (34)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(Inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

(35) NEIGHB (25) (36) (45)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

- (36) NEIGHB (26) (35) (46)

- active CHAINSET change (clockwise-ordered)

- (active) CHAINSET (2) -gt (25) -gt (26) -gt (36)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(active) CHAINSET (1) -gt (42)

(42) NEIGHB (33)(43)(52)

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

(active) CHAINSET (1) -gt (42)

1122 Border-Tracking Algorithm

helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

CHAINSET

(1)(32)(33)(34)(44)(54)

(1)(42)(52)(53)

(2)(25)(26)(36)(46)(56)(66)

(2)(35)(45)(55)(65)

CHAINSET

(1)(32)(33)(34)(44)(54)(53)(52)(42)

(2)(25)(26)(36)(46)(56)(66)(65)(55)

(45)(35)

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

Border tracking each border bounded a closed

region NO point would be split into two or

more segments

Tracking symbolic edge (line) segments more

complex

value1 edge 0 non-edge

not necessary for edge pixels to bound closed regions

segments consist of connected edge pixels that go from

endpoint corner or junction to endpoint corner or junction

-gt pixeltype() is more complexDC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

INLIST OUTLIST

113 Linking One-Pixel-Wide

Edges or Lines

pixeltype() determines a pixel point

isolated point

starting point of an new segment

interior pixel of an old segment

ending point of an old segment

junction

corner

Instead of past current future regions there

are past current future segmentsDC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 17: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(Inactive) CHAINSET (2) -gt (25) -gt (26)

(Inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

(35) NEIGHB (25) (36) (45)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

- (36) NEIGHB (26) (35) (46)

- active CHAINSET change (clockwise-ordered)

- (active) CHAINSET (2) -gt (25) -gt (26) -gt (36)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(active) CHAINSET (1) -gt (42)

(42) NEIGHB (33)(43)(52)

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

(active) CHAINSET (1) -gt (42)

1122 Border-Tracking Algorithm

helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

CHAINSET

(1)(32)(33)(34)(44)(54)

(1)(42)(52)(53)

(2)(25)(26)(36)(46)(56)(66)

(2)(35)(45)(55)(65)

CHAINSET

(1)(32)(33)(34)(44)(54)(53)(52)(42)

(2)(25)(26)(36)(46)(56)(66)(65)(55)

(45)(35)

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

Border tracking each border bounded a closed

region NO point would be split into two or

more segments

Tracking symbolic edge (line) segments more

complex

value1 edge 0 non-edge

not necessary for edge pixels to bound closed regions

segments consist of connected edge pixels that go from

endpoint corner or junction to endpoint corner or junction

-gt pixeltype() is more complexDC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

INLIST OUTLIST

113 Linking One-Pixel-Wide

Edges or Lines

pixeltype() determines a pixel point

isolated point

starting point of an new segment

interior pixel of an old segment

ending point of an old segment

junction

corner

Instead of past current future regions there

are past current future segmentsDC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 18: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(active) CHAINSET (2) -gt (35)

- (36) NEIGHB (26) (35) (46)

- active CHAINSET change (clockwise-ordered)

- (active) CHAINSET (2) -gt (25) -gt (26) -gt (36)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(active) CHAINSET (1) -gt (42)

(42) NEIGHB (33)(43)(52)

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

(active) CHAINSET (1) -gt (42)

1122 Border-Tracking Algorithm

helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

CHAINSET

(1)(32)(33)(34)(44)(54)

(1)(42)(52)(53)

(2)(25)(26)(36)(46)(56)(66)

(2)(35)(45)(55)(65)

CHAINSET

(1)(32)(33)(34)(44)(54)(53)(52)(42)

(2)(25)(26)(36)(46)(56)(66)(65)(55)

(45)(35)

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

Border tracking each border bounded a closed

region NO point would be split into two or

more segments

Tracking symbolic edge (line) segments more

complex

value1 edge 0 non-edge

not necessary for edge pixels to bound closed regions

segments consist of connected edge pixels that go from

endpoint corner or junction to endpoint corner or junction

-gt pixeltype() is more complexDC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

INLIST OUTLIST

113 Linking One-Pixel-Wide

Edges or Lines

pixeltype() determines a pixel point

isolated point

starting point of an new segment

interior pixel of an old segment

ending point of an old segment

junction

corner

Instead of past current future regions there

are past current future segmentsDC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 19: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(active) CHAINSET (1) -gt (42)

(42) NEIGHB (33)(43)(52)

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

(active) CHAINSET (1) -gt (42)

1122 Border-Tracking Algorithm

helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

CHAINSET

(1)(32)(33)(34)(44)(54)

(1)(42)(52)(53)

(2)(25)(26)(36)(46)(56)(66)

(2)(35)(45)(55)(65)

CHAINSET

(1)(32)(33)(34)(44)(54)(53)(52)(42)

(2)(25)(26)(36)(46)(56)(66)(65)(55)

(45)(35)

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

Border tracking each border bounded a closed

region NO point would be split into two or

more segments

Tracking symbolic edge (line) segments more

complex

value1 edge 0 non-edge

not necessary for edge pixels to bound closed regions

segments consist of connected edge pixels that go from

endpoint corner or junction to endpoint corner or junction

-gt pixeltype() is more complexDC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

INLIST OUTLIST

113 Linking One-Pixel-Wide

Edges or Lines

pixeltype() determines a pixel point

isolated point

starting point of an new segment

interior pixel of an old segment

ending point of an old segment

junction

corner

Instead of past current future regions there

are past current future segmentsDC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 20: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

(inactive) CHAINSET (2) -gt (25) -gt (26) -gt (36)

(inactive) CHAINSET (1) -gt (32) -gt (33) -gt (34)

(inactive) CHAINSET (2) -gt (35)

(active) CHAINSET (1) -gt (42)

1122 Border-Tracking Algorithm

helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

CHAINSET

(1)(32)(33)(34)(44)(54)

(1)(42)(52)(53)

(2)(25)(26)(36)(46)(56)(66)

(2)(35)(45)(55)(65)

CHAINSET

(1)(32)(33)(34)(44)(54)(53)(52)(42)

(2)(25)(26)(36)(46)(56)(66)(65)(55)

(45)(35)

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

Border tracking each border bounded a closed

region NO point would be split into two or

more segments

Tracking symbolic edge (line) segments more

complex

value1 edge 0 non-edge

not necessary for edge pixels to bound closed regions

segments consist of connected edge pixels that go from

endpoint corner or junction to endpoint corner or junction

-gt pixeltype() is more complexDC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

INLIST OUTLIST

113 Linking One-Pixel-Wide

Edges or Lines

pixeltype() determines a pixel point

isolated point

starting point of an new segment

interior pixel of an old segment

ending point of an old segment

junction

corner

Instead of past current future regions there

are past current future segmentsDC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 21: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

1122 Border-Tracking Algorithm

helliphelliphelliphelliphelliphelliphelliphelliphelliphelliphellip

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

CHAINSET

(1)(32)(33)(34)(44)(54)

(1)(42)(52)(53)

(2)(25)(26)(36)(46)(56)(66)

(2)(35)(45)(55)(65)

CHAINSET

(1)(32)(33)(34)(44)(54)(53)(52)(42)

(2)(25)(26)(36)(46)(56)(66)(65)(55)

(45)(35)

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

Border tracking each border bounded a closed

region NO point would be split into two or

more segments

Tracking symbolic edge (line) segments more

complex

value1 edge 0 non-edge

not necessary for edge pixels to bound closed regions

segments consist of connected edge pixels that go from

endpoint corner or junction to endpoint corner or junction

-gt pixeltype() is more complexDC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

INLIST OUTLIST

113 Linking One-Pixel-Wide

Edges or Lines

pixeltype() determines a pixel point

isolated point

starting point of an new segment

interior pixel of an old segment

ending point of an old segment

junction

corner

Instead of past current future regions there

are past current future segmentsDC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 22: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

CHAINSET

(1)(32)(33)(34)(44)(54)

(1)(42)(52)(53)

(2)(25)(26)(36)(46)(56)(66)

(2)(35)(45)(55)(65)

CHAINSET

(1)(32)(33)(34)(44)(54)(53)(52)(42)

(2)(25)(26)(36)(46)(56)(66)(65)(55)

(45)(35)

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

Border tracking each border bounded a closed

region NO point would be split into two or

more segments

Tracking symbolic edge (line) segments more

complex

value1 edge 0 non-edge

not necessary for edge pixels to bound closed regions

segments consist of connected edge pixels that go from

endpoint corner or junction to endpoint corner or junction

-gt pixeltype() is more complexDC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

INLIST OUTLIST

113 Linking One-Pixel-Wide

Edges or Lines

pixeltype() determines a pixel point

isolated point

starting point of an new segment

interior pixel of an old segment

ending point of an old segment

junction

corner

Instead of past current future regions there

are past current future segmentsDC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 23: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

1122 Border-Tracking Algorithm

CHAINSET

(1)(32)(33)(34)(44)(54)

(1)(42)(52)(53)

(2)(25)(26)(36)(46)(56)(66)

(2)(35)(45)(55)(65)

CHAINSET

(1)(32)(33)(34)(44)(54)(53)(52)(42)

(2)(25)(26)(36)(46)(56)(66)(65)(55)

(45)(35)

DC amp CV Lab

CSIE NTU

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

Border tracking each border bounded a closed

region NO point would be split into two or

more segments

Tracking symbolic edge (line) segments more

complex

value1 edge 0 non-edge

not necessary for edge pixels to bound closed regions

segments consist of connected edge pixels that go from

endpoint corner or junction to endpoint corner or junction

-gt pixeltype() is more complexDC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

INLIST OUTLIST

113 Linking One-Pixel-Wide

Edges or Lines

pixeltype() determines a pixel point

isolated point

starting point of an new segment

interior pixel of an old segment

ending point of an old segment

junction

corner

Instead of past current future regions there

are past current future segmentsDC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 24: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

1122 Border-Tracking Algorithm

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

Border tracking each border bounded a closed

region NO point would be split into two or

more segments

Tracking symbolic edge (line) segments more

complex

value1 edge 0 non-edge

not necessary for edge pixels to bound closed regions

segments consist of connected edge pixels that go from

endpoint corner or junction to endpoint corner or junction

-gt pixeltype() is more complexDC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

INLIST OUTLIST

113 Linking One-Pixel-Wide

Edges or Lines

pixeltype() determines a pixel point

isolated point

starting point of an new segment

interior pixel of an old segment

ending point of an old segment

junction

corner

Instead of past current future regions there

are past current future segmentsDC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 25: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

113 Linking One-Pixel-Wide

Edges or Lines

Border tracking each border bounded a closed

region NO point would be split into two or

more segments

Tracking symbolic edge (line) segments more

complex

value1 edge 0 non-edge

not necessary for edge pixels to bound closed regions

segments consist of connected edge pixels that go from

endpoint corner or junction to endpoint corner or junction

-gt pixeltype() is more complexDC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

INLIST OUTLIST

113 Linking One-Pixel-Wide

Edges or Lines

pixeltype() determines a pixel point

isolated point

starting point of an new segment

interior pixel of an old segment

ending point of an old segment

junction

corner

Instead of past current future regions there

are past current future segmentsDC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 26: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

INLIST OUTLIST

113 Linking One-Pixel-Wide

Edges or Lines

pixeltype() determines a pixel point

isolated point

starting point of an new segment

interior pixel of an old segment

ending point of an old segment

junction

corner

Instead of past current future regions there

are past current future segmentsDC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 27: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

113 Linking One-Pixel-Wide

Edges or Lines

pixeltype() determines a pixel point

isolated point

starting point of an new segment

interior pixel of an old segment

ending point of an old segment

junction

corner

Instead of past current future regions there

are past current future segmentsDC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 28: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 29: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 30: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 31: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 32: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 33: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 34: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 35: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 36: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 37: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 38: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 39: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 40: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 41: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 42: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 43: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

113 Linking One-Pixel-Wide

Edges or Lines

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 44: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

114 Edge and Line Linking Using

Directional Information

Previous edge_track no directional

information

In this section assume each pixel is marked

to indicate whether it is an edge (line)

Yes there is an associated angular direction

pixels that have similar enough directions can form

connected chains and be identified as an arc segment

The arc has a good fit to a simple curvelike line

No

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 45: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

114 Edge and Line Linking Using

Directional Information

The linking process -gt scan the labeled edge

image in top-down left-right and if a labeled

pixel has

No previous labeled neighbors

It begins a new group

One previous labeled neighbors

T-test

Two or more previous labeled neighbors

T-test

Merge testDC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 46: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

114 Edge and Line Linking Using

Directional Information

No previous labeled neighbors

initialize the scatter of group -gt

priori variance

of pixels

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 47: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

114 Edge and Line Linking Using

Directional Information

If an encountered label pixel has previously

encountered labeled neighbors Measure t-

statistic

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 48: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

114 Edge and Line Linking Using

Directional Information

If the pixel is added to the group

the mean and scatter of the group are

updated

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 49: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

114 Edge and Line Linking Using

Directional Information

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 50: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

114 Edge and Line Linking Using

Directional Information

If there are two or more previously

encountered labeled neighbors

DC amp CV Lab

CSIE NTU

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 51: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

114 Edge and Line Linking Using

Directional Information

then merge two groups

Create a new group having

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 52: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

115 Segmentation of Arcs into

Simple Segments

Arc segmentation partition

extracted digital arc sequence digital arc

subsequences (each is a maximal sequence

that can fit a straight or curve line)

Simple arc segment straight-line or curved-

arc segment

The endpoints of the subsequences are

called corner points or dominant points

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 53: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

115 Segmentation of Arcs into

Simple Segments

Identification of all locations

(a) have sufficiently high curvature

(b) are enclosed by different lines and curves

techniques iterative endpoint fitting and

splitting using tangent angle deflection or

high curvature as basis of the segmentation

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 54: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

To segment a digital arc sequence into

subsequences that are sufficiently straight

one distance threshold d

L=(rc)| αr+βc+γ=0 where |(αβ)|=1 The straight line composed by 2 endpoints of this arc

di=| αri+βci+γ | |(αβ)| = | αri+βci+γ | The length of the perpendicular line composed by any single

pixel of this arc and L

dm=max(di)

If dmgt d then split at the point (rmcm)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 55: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 56: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 57: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

1151 Iterative Endpoint Fit and

Split

L

dm=max(di)

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 58: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

1151 Iterative Endpoint Fit and

Split

Circular arc sequence

initially split by two points apart in any direction

Sequence only composed of two line

segments

Golden section search

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 59: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

To identify the locations where two line

segments meet and form an angle

an(k)=(rn-k ndash rn cn-k - cn)

bn(k)=(rn ndash rn+k cn ndashcn+k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 60: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 61: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 62: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

(rn-k ndash rn cn-k - cn)

(rn ndash rn+k cn ndashcn+k)

an(k)

bn(k)

||)(|| ||)(||

)()()](cos[

kbka

kbkak

nn

T

nnn

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 63: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

1152 Tangential Angle Deflection

At a place where two line segments meet

the angle will be larger cosθn(kn) smaller

A point at which two line segments meet

cosθn(kn) lt cosθi(ki) for all i|n-i| ≦ kn2

k=

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 64: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

1153 Uniform Bounded-Error

Approximation

segment arc sequence into maximal pieces

whose points deviate le given amount

optimal algorithms excessive computational

complexity

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 65: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

1153 Uniform Bounded-Error

Approximation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 66: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

1154 Breakpoint Optimization

after an initial segmentation shift breakpoints

to produce a better arc segmentation

first shift odd final point (ie even beginning

point) and see whether the max error is

reduced by the shift

If reduced then keep the shifted breakpoints

then shift even final point (ie odd beginning

point) and do the same things

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 67: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

1154 Breakpoint Optimization

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 68: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

1155 Split and Merge

first split arc into segments with the error

sufficiently small

second merge successive segments if

resulting merged segment has sufficiently

small error

third try to adjust breakpoints to obtain a

better segmentation

repeat until all three steps produce no further

change

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 69: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

1155 Split and Merge

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 70: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

Iterative Self-organizing Data Analysis

Techniques Algorithm

iterative isodata line-fit clustering procedure

determines line-fit parameter

then each point assigned to cluster whose

line fit closest to the point

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 71: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 72: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 73: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

1156 Isodata Segmentation

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 74: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

1157 Curvature

The curvature is defined at a point of arc

length s along the curve by

Δs the change in arc length

Δθ the change in tangent angle

ss

s

0lim)(

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 75: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

1157 Curvature

natural curve breaks curvature maxima and

minima

curvature passes through zero local shape

changes from convex to concave

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 76: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

1157 Curvature

surface elliptic when limb in line drawing is

convex

surface hyperbolic when its limb is concave

surface parabolic wherever curvature of limb

zero

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 77: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

1157 Curvature

Nalwa A Guided Tour of Computer Vision

Fig 414 1048576

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 78: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

116 Hough Transform

Hough Transform method for detecting

straight lines and curves on gray level

images

Hough Transform template matching

The Hough transform algorithm requires an

accumulator array whose dimension

corresponds to the number of unknown

parameters in the equation of the family of

curves being soughtDC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 79: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(11)

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 80: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 81: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

Finding Straight-Line Segments

Line equation y=mx+b

point (xy)

slope m intercept b

DC amp CV Lab

CSIE NTU

x

y

b

m

1=m+b

(22)

(11)

2=2m+b

(10)

y=1x+0

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 82: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 83: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

Example

DC amp CV Lab

CSIE NTU

x

y

b

m

(11)

(11)

(10)

(01) (21)

(32)

(10)

(21)

(32)

(01)

(01)

(1-1)

y=1

y=x-1

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 84: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

Finding Straight-Line Segments

Vertical lines m=infin doesnrsquot work

d perpendicular distance from line to origin

θ the angle the perpendicular makes with the

x-axis (column axis)

DC amp CV Lab

CSIE NTU

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 85: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

(dsinθdcosθ)

(rc)

cossin crd

ΘΘ

Θ

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 86: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

c

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 87: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 88: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 89: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

Example

DC amp CV Lab

CSIE NTU

y

(11)

(10)

(01) (21)

(32)

cossin crd x

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 90: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

Example

DC amp CV Lab

CSIE NTU

cossin crd

r

(11)

(01)

(10) (12)

(23)

c-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 91: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

-45deg 0deg 45deg 90deg

(01) 0707 1 0707 0

(10) -0707 0 0707 1

(11) 0 1 1414 1

(12) 0707 2 2121 1

(23) 0707 3 3535 2

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 92: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 93: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

Example

DC amp CV Lab

CSIE NTU

accumulator array

-0707 0 0707 1 1414 2 2121 3 3535

-45deg 1 1 3 - - - - - -

0deg - 1 - 2 - 1 - 1 -

45deg - - 2 - 1 - 1 - 1

90deg - 1 - 3 - 1 - - -

r

(11)

(01)

(10) (12)

(23)

c

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 94: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

Finding Straight-Line Segments

DC amp CV Lab

CSIE NTU

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 95: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

Finding Circles

row

column

row-coordinate of the center

column-coordinate of the center

radius

implicit equation for

a circle

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 96: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

Finding Circles

DC amp CV Lab

CSIE NTU

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 97: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

Extensions

The Hough transform method can be

extended to any curve with analytic equation

of the form where denotes an

image point and is a vector of parameters

DC amp CV Lab

CSIE NTU

0)( axf

x

a

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 98: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

117 Line Fitting

points before noise perturbation

lie on the line

noisy observed value

independent and identically

distributed with mean 0 and variance 2

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 99: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

117 Line Fitting

procedure for the least-squares fitting of line to

observed noisy values

principle of minimizing the squared residuals

under the constraint that

Lagrange multiplier form

1ˆˆ subject to ˆˆˆˆˆ min 22

1

22

N

n

nn )γcβrα(

1ˆˆ 22

N)γcβrα()γcβrα(N

n

nn

N

n

nn )1ˆˆ( - ˆˆˆˆˆ)]1ˆˆ(- ˆˆˆˆˆ[ 22

1

222

1

22

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 100: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

117 Line Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 101: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 102: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The principal-axis curve fit is obviously a

generalization of the line-fitting idea

The curve

eg conics

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

022 feydxcybxyax2

32

2

1 )()()( yyxfxyyxfxyxf

1)()()( 654 yxfyyxfxyxf

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 103: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

1172 Principal-Axis Curve Fit

The curve

minimize

K

1k

2

1

1 )()(0 k

K

k

kk crfcrf

KN

n

nn crf1k

2

k

1

2 1ˆ subject to )ˆˆ(

)1()ˆˆ( min1

2

1

2

K

k

kn

N

n

n crf

)1(])([1

2

1 1

K

k

k

N

n

K

k

nnkk crf

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 104: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

118 Region-of-Support

Determination

region of support too large fine features

smoothed out

region of support too small many corner

points or dominant points produced

k=

DC amp CV Lab

CSIE NTU

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 105: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

118 Region-of-Support

Determination

Teh and Chin

Calculate until

Region of support

DC amp CV Lab

CSIE NTU

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 106: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

119 Robust Line Fitting

Fit insensitive to a few outlier points

Give a least-squares formulation first and then

modify it to make it robust

1 subject to

ˆ

ˆ

ˆ2

minarg

pp t

p

pA

p

cr

cr

cr

A

NxNN

ˆ

ˆ

ˆ

1ˆˆ

1ˆˆ

1ˆˆ

3

22

11

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 107: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

In the weighted least-squares sense

otherwise 0

constantc ofmedian Z 1)( if ])(1[

22

1

1

iii

i

N

k

ecZ

e

cZ

e

w

w

w

W

119 Robust Line Fitting

1 subject to

ˆ

ˆ

ˆ

minarg

pWWp t

p

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 108: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Determine the parameters of the curve that

minimize the sum of the squared distances

between the noisy observed points and the

curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 109: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 110: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

N

n

nn wcrf1

2)ˆˆ( min

)ˆˆ( nn cr )( nn cr

0)( wcrf nn

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 111: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

1110 Least-Squares Curve

Fitting

DC amp CV Lab

CSIE NTU

rarr

rarr

rarr

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 112: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

1110 Least-Squares Curve

Fitting

Distance d between and the curve

0)( subject to )ˆ()ˆ( min 22

1

wcrfccrr nnnn

N

n

nn

22

)ˆˆ()ˆˆ(

)ˆˆ(

wcrfc

wcrfr

wcrfd

nnnn

nn

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)ˆˆ( nn cr

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 113: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

11101 Gradient Descent

DC amp CV Lab

CSIE NTU

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 114: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

11101 Gradient Descent

First-order iterative technique in minimization

problem

Initial value

(t+1)-th iteration

First-order Taylor series expansion around

should be in the negative gradient direction

0w

www tt

1

)()()()()( 222

1

2

t

T

ttt wwwwww

tw

w

22

2

22

)(

)()(

t

tt

w

www

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 115: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

11102 Newton Method

Second-order iterative technique in

minimization problem

Second-order Taylor series expansion around

second-order partial derivatives Hessian

Take partial derivatives to zero with respect to

tw

wHwwwwww T

t

T

tt

)(

2

1)()()()( 222

w

)( 0)()( 212

tt wHwwwH

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 116: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

Circle

0)( wcrf

222 )()()()( RbcarRbacrfwcrf

N

n

nnnn

nn

wcrfc

wcrfr

wcrfw

122

22

)ˆˆ()ˆˆ(

)ˆˆ()( min

)(2 )(2 bcfc

arfr

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 117: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

11104 Fitting to a Circle

N

n nn

nn

bcar

RbcarRba

122

22222

])()ˆ[(4

])()ˆ[()( min

N

n

nn RbcarRba1

2222 ])()ˆ([)( min

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 118: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

11106 Fitting to a Conic

In conic

1)())((2)()()( 22 bcCbcarBarACBAbafwcrf

)(2)(2

)(2)(2

bcCarBfc

bcBarAfr

N

n nnnn

nnnn

bcCarBbcBarA

bcCbcarBarA

122

2222

)]ˆ()ˆ([)]ˆ()ˆ([

]1)ˆ()ˆ)(ˆ(2)ˆ([

4

1

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 119: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

11103 Second-Order

Approximation to Curve Fitting

==Nalwa A Guided Tour of Computer Vision

Fig 415== 1048576

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 120: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

DC amp CV Lab

CSIE NTU

11109 Uniform Error Estimation

Nalwa A Guided Tour of Computer Vision

Fig 31 1048576

The End

DC amp CV Lab

CSIE NTU

Page 121: Computer and Robot Vision Icv2.csie.ntu.edu.tw/CV/_material/CV1_CH11_2019.pdf · Computer and Robot Vision I Chapter 11 Arc Extraction and Segmentation Presented by: 王柏川 Email:

The End

DC amp CV Lab

CSIE NTU