20
Computer Vision January 2004 L1.1 © 2004 by Davi Geiger Image Measurements and Detection

© 2004 by Davi GeigerComputer Vision January 2004 L1.1 Image Measurements and Detection

  • View
    220

  • Download
    0

Embed Size (px)

Citation preview

Computer Vision January 2004 L1.1© 2004 by Davi Geiger

Image Measurements and Detection

Computer Vision January 2004 L1.2© 2004 by Davi Geiger

Images are Intensity Surfaces and Edges are Surface Discontinuities

I1(x,y)

I(x,y)

Computer Vision January 2004 L1.3© 2004 by Davi Geiger

For each pixel (x,y) we evaluate the accumulation of the intensity along sixteen (16) directions, and four (4) different scales, s= 3, 5, 7, 9

s

dIs

syxI0

)sin,cos(1

),,,(~

1

0

)sin,cos(1

),,,(~ s

i

yiyxixIs

syxI

Measurements:Intensity Accumulation, ),,,(~

syxI

                                                                                                                                                                                                                                                                                                  

//4 /3

/6

/3 /

/

s=3 pixels

s=7 pixels

Discrete approximation

y

x

Computer Vision January 2004 L1.4© 2004 by Davi Geiger

1

0

)sin,cos(1

),,,(~ s

i

yiyxixIs

syxI

1 x

1 y

2 x 2 y

3

2 x 1 y

1 x

3

2 y

Measurements:Intensity Accumulation, ),,,(~

syxI                                                                                                                                                                                                                                                                                                   

//4 /3

/6

/3 /

/

where,

and for

and for

and for

and for

),(

1),,,(

~

1),,,(

~yxI

ssyxI

s

ssyxI c

Removing the center pixel: ),,(~

syxI c

1

1

)sin,cos(1

1 s

i

yiyxixIs

Computer Vision January 2004 L1.5© 2004 by Davi Geiger

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

/4

s=3

s=5

/3

/6

s=5

s=3s=5

s=3

s=5

s=7s=7

s=7

s=7

s=3

Measurements: Intensity Accumulation II, ),,,(ˆ syxI

)),,,1(~

),,1,(~

),,1,(~

),,,(~

(4

1syxIsyxIsyxIsyxI

)),,1,(~

),,,1(~

),,,1(~

),,,(~

(4

1syxIsyxIsyxIsyxI

)),,1,1(~

),,1,(~

),,,1(~

),,,(~

(4

1syxIsyxIsyxIsyxI

),,,(ˆ syxI for

for

for

In order to obtain more robust measures, for an angle we can average the value of along to obtain

),,,(~

syxI ),,,(ˆ syxI

Computer Vision January 2004 L1.6© 2004 by Davi Geiger

Measurements: Derivatives ),,,(ˆ syxID

.),,,(ˆ),,,(ˆ

sin),,,(ˆ

cos),,,(ˆ

)sin,(cos),,,(ˆ),,,(ˆ),,,(ˆ

syxIsyxI

y

syxI

x

syxI

syxIsyxIsyxID

cc

Taking the derivative along the angle i.e., in a direction )sin,(cosˆ

Analogously we obtain . We have now a bank of sixteen (16) distinct oriented filters at different scales, namely { ; and s.

),,,(~

syxID                                

                               

                             

                           

                               

                               

                           

                           

                               

                               

                             

                           

                               

                               

                               

                               

will have maximum response (highest value) among the possible orientations, while , will have the minimum response.

|),6/,,(ˆ| syxID

|),3

2,,(ˆ| syxID

/ 3),,,(ˆ syxID

x

y

Computer Vision January 2004 L1.7© 2004 by Davi Geiger

Experiments:

),,,(ˆ syxID

)3,0,,(ˆ yxID )3,6

,,(ˆ

yxID

)3,4

,,(ˆ

yxID )3,3

,,(ˆ

yxID

128

64

16

0

-16

-64

-128

Computer Vision January 2004 L1.8© 2004 by Davi Geiger

Exeriments (cont.): ),,,(ˆ syxID

)3,2

,,(ˆ

yxID )3,3

2,,(ˆ

yxID

)3,4

3,,(ˆ

yxID )3,6

5,,(ˆ

yxID

255

128

32

0

-32

-128

-255

Computer Vision January 2004 L1.9© 2004 by Davi Geiger

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

/3

/6

Measurements: Derivatives ),,,(ˆ syxID

),2

,,(ˆ

cos),,,(ˆ

sin),,,(ˆ

)cos,sin(),,,(ˆ),,,(ˆ),,,(ˆ

syxID

y

syxI

x

syxI

syxIsyxIsyxID

Corners and Junctions will respond to high values of at distant locationsfrom the center

),,,(ˆ syxID

),23

,,(ˆ),3

,,(ˆ syxIDsyxID

),26

,,(ˆ),6

,,(ˆ syxIDsyxID

The maximum responses here, among different are for

and

x

y

Computer Vision January 2004 L1.10© 2004 by Davi Geiger

Measurements: 2nd Derivatives

yI

xyI

yxI

xI

yxH

2

22

2

2

2

ˆˆ

ˆˆ

),(Hessian allows for computing the second derivative

Tvu uyxHvsyxID ˆ),(ˆ),,,,(ˆ

in order to compute the (second) derivative along a direction of a (first) derivative along a direction we compute the projections

uv

For example for we obtain

and for we obtain

xvxu ˆ)0,1(ˆ;ˆ)0,1(ˆ 2

2 ˆ),,,,(ˆx

IsyxIDvu

yvxu ˆ)1,0(ˆ;ˆ)0,1(ˆ xyIsyxIDvu

ˆ),,,,(ˆ2

Computer Vision January 2004 L1.11© 2004 by Davi Geiger

Measurements: 2nd Derivatives (cont.)

ssyyxxIDsyxID

yxHsyxID T

),,sin,cos(ˆ),,,(ˆ

)sin,(cos),()sin,(cos),,,,(ˆ

in order to compute the (second) derivative along a direction of a (first) derivative along a direction we obtain a continuous and a lattice approximation as

x

y

sin

cos)sin,(cosˆ,)sin,(cosˆ TTuv

x

y

Computer Vision January 2004 L1.12© 2004 by Davi Geiger

Image Features –Decisions!

Features such as edges, corners, junction, eyes, … are obtained by making some decision from the image measurements.

Decisions are the result of some comparison followed by a choice. Examples (i) if a measurement is above a threshold we accept, not otherwise; (ii) if a measurement is the largest compared to others, we select it.

Computer Vision January 2004 L1.13© 2004 by Davi Geiger

Decisions: Edgels (Edge-pixels and Orientation)

)|),,,(ˆ||),2

,,(ˆ|(maxarg),(max syxIDsyxIDyxs

TsyxIDsyxIDyx )|),,,(ˆ||),2

,,(ˆ|( such that ),,(

Edge threshold: Decision!

Edge orientation: Decision!

A step edge at The value is (equally) large for both, and as shown (in red) for scale s=3 pixels. It is also large for values not shownHowever, the quantity is significantly larger for

|),2/,,(~

| syxID

|),,,(~

||),2/,,(~

| syxIDsyxID

                               

                               

                               

                               

                           

                               

                               

                             

                               

),,,(ˆ syxID ),

2,,(ˆ syxID

3,

4,

6,0

Computer Vision January 2004 L1.14© 2004 by Davi Geiger

),(3max yx

The gray level indicates the angle: the darkest one is 0 degrees. The larger is the angle the lighter is displayed, up to

|),,,(ˆ||),2

,,(ˆ|),,,( syxIDsyxIDsyx Strength of the Edgel

Decisions: Edgels (cont.)

Edgel(xc , yc ) if

else Nil

Tsyx ),,,(

),,,(maxarg),(max syxyxs

Computer Vision January 2004 L1.15© 2004 by Davi Geiger

Decisions: Connecting Edgels, Pseudocode

Algorithm to link edgels. Start with a seed location (xc,yc)

Contour-Follower(xc , yc)

if (Edgel(xc , yc ) NIL )

Link-neighbors+(xc , yc ,max)

Link-neighbors-(xc , yc ,max)

end

Link-neighbors±(xc , yc ,max)

xn± = xc ± xmax cosmax ;

yn± = yc ± ymax sinmax ;

if (Edgel(xn±, yn±) NIL )

Link((xc , yc), (xn±, yn±))

Link-neighbors±( xn± , yn± ,max(xn± , yn±) )

end

max

(xc , yc)

Computer Vision January 2004 L1.16© 2004 by Davi Geiger

Decisions: Connecting Edgels, Pseudocode

Link-neighbors±(xc , yc ,max-c)

xn± = xc ± xmax cosmax ;

yn± = yc ± ymax sinmax ;

if ((Edgel(xn±, yn±) NIL )&(Coherence(xc , yc xn±, yn±)))

Link((xc , yc), (xn±, yn±))

Link-neighbors±( xn± , yn± ,max-n(xn± , yn±) )

endCoherence is used so that contrast does not change and contours can not return on the same path.Coherence(xc , yc xn, yn )

if ( and ) return True else Nilend

1maxmax |),2

,,(~

),2

,,(~

| TsyxIsyxI cccnnn

1maxmax |),2

3,,(

~),

2

3,,(

~| TsyxIsyxI cccnnn

Computer Vision January 2004 L1.17© 2004 by Davi Geiger

Threshold Parameters: Estimation

We have considered at least four parameters: 1,,, TTTT H

How to estimate them? One technique is Histogram partition:

Plot the Histogram and find the parameter that “best partition it”:

|),2/,,(ˆ| syxID

ountingHistogram c:

T

Computer Vision January 2004 L1.18© 2004 by Davi Geiger

Decisions: Local Angle Change

),()sin,cos(),( maxmaxmax yxyyxxyx sss Angle change

y

x

),(max yxs

2)sin,cos(max yyxxs

2),(max

yxs

A contour segment

),( yxs

212222 )sin,cos( yx

is the contour curvature multiplied by the arc length , where

),(max yxs .),(max yxs where

Computer Vision January 2004 L1.19© 2004 by Davi Geiger

Curvature of Isocontour

2

2

222

2

2

32

2

2

222

2

2

2

2

22

2

2

2

ˆˆˆˆˆ2ˆˆ

ˆ

1

ˆ

Thus, .ˆby given is which arc, theoflength by the divided change angle thebe willcurvature the

ˆˆˆˆˆ2ˆˆ

ˆ

1

ˆ

ˆ

ˆˆ

ˆˆˆˆ

ˆ

ˆ),(

ˆ

ˆ

i.e.,

Isocontour thealong movingwhen ˆ vector d)(normalize with theoccurs

change (angle)much howask simply can onecontour -iso theof curvature theestimate To

y)(x, from direction in the movingby contour -Iso thefollowcan one Thus,

IsoContour theo tangent tisˆ

I of change maximal ofdirection theisit as ,Isocontour the tonormal isˆ),(ˆ

xI

yI

xyI

xI

yI

yI

xI

II

I

xI

yI

xyI

xI

yI

yI

xI

I

xI

yI

yI

xyI

yxI

xI

xI

yI

I

IyxH

I

I

I

I

I

ICyxI

Computer Vision January 2004 L1.20© 2004 by Davi Geiger

IIyxH

yxHyxH

IIyxHII

IyxHII

yxHII

I

ICyxI

ˆandˆ thengrepresenti),( of rseigenvecto two

for thesearch theas maximal isother theandlowest is onesuch that sderivative

orthogonal twoof smeasurmentby drepresente ,detector" edge"our interpret nowcan We

negative.-non are seigenvalue thei.e., matrix,

symmetric a is),( that Notezero. be to),( of eigenvaluesmallest expect the we

)0( curvature zero i.e., segments),(straight linesstraight are that contours-isofor Thus,

ˆˆ),()ˆ(ˆ

1

thereforeis eigenvalueminimun theand

,ˆ),()ˆ(ˆ

1

thereforeis eigenvalue maximum Thes.eigenvalueminimun and maximum

thetoingcorrespond),( of rseigenvecto theare ˆ andˆ vectors, two theseThus,

IsoContour theo tangent tisˆ

I of change maximal ofdirection theisit as ,Isocontour the tonormal isˆ),(ˆ

2min

2max