Docsity

Template Matching - Rigid Motion | CMSC 828, Study notes of Computer Science

Partial preview of the text

Download Template Matching - Rigid Motion | CMSC 828 and more Study notes Computer Science in PDF only on Docsity!

Problem Definition

-^

An Image is a set of 2D geometric features,along with positions.

-^

An Object is a set of 2D/3D geometricfeatures, along with positions.

-^

A pose positions the object relative to theimage.^ – 2D Translation; 2D translation + rotation; 2D

translation, rotation and scale; planar or 3D objectpositioned in 3D with perspective or scaled orth.

-^

The best pose places the object featuresnearest the image features

Two parts to the problem

-^

Definition of cost function.

-^

Search method for finding best pose. 1.^

Can phrase this as search among poses.

Or as search among correspondences

There are connections between two.

Cost Function

  • We look at this first, since it defines the

problem.

  • Again, no perfect measure;
    • Trade-offs between veracity of measure

and computational considerations.

  • One-to-one vs. many-to-one• Bounded error vs. metric

Example: Chamfer Matching

Many-to-one, distance

^ di

For every edge point inthe transformed object,compute the distance tothe nearest image edgepoint. Sum distances.

min(||

2

1

1

m i

i

n i

i^

q p q p q p

Variations

-^

Sum a different distance^ –

f(d) = d

2

  • or

Manhattan distance

.

-^

f(d) = 1

if^

d^ < threshold, 0 otherwise.

  • This is called

bounded error

.

-^

Use maximum distance instead of sum.^ – This is called:

directed Hausdorff distance

.

-^

Use other features^ –

Corners.– Lines. Then position and angles of lines must besimilar.

  • Model line may be subset of image line.

Other comparisons

  • Enforce each image feature can match

only one model feature.

  • Enforce continuity, ordering along

curves.

  • These are more complex to optimize.

Clever Idea 1: Chamfer Matching

with the Distance Transform

Example: Each pixel has (Manhattan)distance to nearest edge pixel.

D.T. Adds Efficiency

  • Compute once.• Fast algorithms to compute it.• Makes Chamfer Matching simple.

Computing Distance Transform

-^

It’s only done once, per problem, not onceper pose.

-^

Basically a shortest path problem.

-^

Simple solution passing through image oncefor each distance.^ – First pass mark edges 0.– Second, mark 1 anything next to 0, unless it’s

already marked. Etc….

-^

Actually, a more clever method requires 2passes.

Chamfer Matching Complexity •^

Brute force approach: for each pose,compare each model point to every imagepoint. O(

pnm). p =

number poses,

n

=

number of image points,

m =

number of

model points.

-^

With distance transform: compute D.T., thenfor every pose, sum value under each modeledge. O

(s + pm). s =

number of pixels,

which is about same as

p.

(Forsyth & Ponce)