Comparing Images Using the Hausdorff Distance Mark Bouts 6th April 2006.

25
Comparing Images Using the Hausdorff Distance Mark Bouts 6th April 2006
  • date post

    19-Dec-2015
  • Category

    Documents

  • view

    226
  • download

    5

Transcript of Comparing Images Using the Hausdorff Distance Mark Bouts 6th April 2006.

Page 1: Comparing Images Using the Hausdorff Distance Mark Bouts 6th April 2006.

Comparing Images Using the Hausdorff Distance

Mark Bouts6th April 2006

Page 2: Comparing Images Using the Hausdorff Distance Mark Bouts 6th April 2006.

Introduction

Efficiently compute the Hausdorff Distance between all relative positions of a model and an image

Main topic:Computing the Hausdorff Distance under translation Extension to rigid motion

Introduction Hausdorff distance Comparing portions HD grid points HD rigid motionHD translation examples

Page 3: Comparing Images Using the Hausdorff Distance Mark Bouts 6th April 2006.

Introduction

Point sets in the plane The minimal Hausdorff Distance under translation and

how to compute it Distance measure portion of a model and an image

Raster dataPresent approximation algorithms, which operate on binary rasters making them suited for IP and MV applications Distance measure for Grid points (and portions)

Examples

Introduction Hausdorff distance Comparing portions HD grid points HD rigid motionHD translation examples

Page 4: Comparing Images Using the Hausdorff Distance Mark Bouts 6th April 2006.

Hausdorff distance

Focus on 2D case Measure the Hausdorff Distance for

point sets and not for segments HD is a metric over the set of all

closed and bounded sets Restriction to finite point sets

(all that is necessary for raster sensing devices)

Introduction Hausdorff distance Comparing portions HD grid points HD rigid motionHD translation examples

Page 5: Comparing Images Using the Hausdorff Distance Mark Bouts 6th April 2006.

Hausdorff distance

set A = {a1,….,ap} and B = {b1,….,bq} Hausdorff distance

Directed Hausdorff distance

h(A,B) ranks each point of A based on its nearest point of B and uses the most mismatched point

)),(),,(max(),( ABhBAhBAH

||||minmax),( baBAhBbAa

Introduction Hausdorff distance Comparing portions HD grid points HD rigid motionHD translation examples

Page 6: Comparing Images Using the Hausdorff Distance Mark Bouts 6th April 2006.

Minimal Hausdorff distance

[Alt, et al. 1991] Can be computed in time O((p+q)log(p+q))

Considers the mismatch between all possible relative positions of two sets

Minimal Hausdorff Distance MG

),(min),( 21 BgAgHBAMGg

G

Introduction Hausdorff distance Comparing portions HD grid points HD rigid motionHD translation examples

Page 7: Comparing Images Using the Hausdorff Distance Mark Bouts 6th April 2006.

How to compute the MT

Again the HD definition

We define

Interested in the graph of d(x)which gives the distance from any point x to the nearest point in a set of source points in B

||||min)( bxxd Bb ||||min)(' xaxd Aa

||)||minmax||,||minmaxmax(),( babaBAHAaBbBbAa

}|))(,{( 2xxdx

Introduction Hausdorff distance Comparing portions HD grid points HD rigid motionHD translation examples

Page 8: Comparing Images Using the Hausdorff Distance Mark Bouts 6th April 2006.

Voronoi surface

It is a distance transform It defines the distance from any point x to

the nearest of source points of the set A or B

Introduction Hausdorff distance Comparing portions HD grid points HD rigid motionHD translation examples

Images: Alt H. Discrete Geometric Shapes

Huttenlocher D. Comparing images using the Hausdorff distance

Page 9: Comparing Images Using the Hausdorff Distance Mark Bouts 6th April 2006.

Computing the HDT

Can be rewritten as:

is the maximum of translated copies of d(x) and d’(x)

Define:

the upper envelope (pointwise maximum) of p copies of the function d(-t), which have been translated to each other by each

||))(||minmax||,)(||minmaxmax(),( tbatbatBAHAaBbBbAa

))(max),(maxmax(),( ' tbdtadtBAHBbAa

)(max)( tadtfAa

A

Aa))(),(max()( tftftf BA

Introduction Hausdorff distance Comparing portions HD grid points HD rigid motionHD translation examples

),( tBAH

Page 10: Comparing Images Using the Hausdorff Distance Mark Bouts 6th April 2006.

Runtime

[Huttenlocher et al., 1991]O(pq(p+q)logpq)

L1,L2 or L∞ norm

[Chew et al.] L1, L∞

O(pqlogpq)

Complicated to implement, less efficient in practice than the rasterized approximations presented later

Introduction Hausdorff distance Comparing portions HD grid points HD rigid motionHD translation examples

Page 11: Comparing Images Using the Hausdorff Distance Mark Bouts 6th April 2006.

Comparing Portions of Shapes

Extent the case toFinding the best partial distance between a model set B and an image set A

Ranking based distance measure

||||min),( baKABhAa

th

BbK

qK 1

K= qf1

)),(),,(max(),( ABhBAhBAH KLLK

Introduction Hausdorff distance Comparing portions HD grid points HD rigid motionHD translation examples

Page 12: Comparing Images Using the Hausdorff Distance Mark Bouts 6th April 2006.

Comparing Portions of Shapes

Target is to find the K points of the model set which are closest to the points of the image set.

‘Automatically’ select the K ‘best matching’ points of B It identifies subsets of the model of size K that

minimizes the Hausdorff distance Don’t need to pre-specify which part of the

model is being compared

Introduction Hausdorff distance Comparing portions HD grid points HD rigid motionHD translation examples

Page 13: Comparing Images Using the Hausdorff Distance Mark Bouts 6th April 2006.

Comparing Portions of Shapes

Does not obey metric properties! Identity and symmetry hold Triangle inequality does not always hold

only under strict conditions

Have to make sure B1 and B2 match the same part of the image. Then we expect both models to be similar

),(),(),( 2121 BAHABHBBH KKK

Introduction Hausdorff distance Comparing portions HD grid points HD rigid motionHD translation examples

Page 14: Comparing Images Using the Hausdorff Distance Mark Bouts 6th April 2006.

Min HD for Grid Points

Now we consider the sets A and B to be binary arrays A[k,l] and B[k,l]

F[x,y] is small at some translation when every point of the translated model array is near some point of the image array

]),['max],,[maxmax(],[ ybxbDyaxaDyxF yxBb

yxAa

Introduction Hausdorff distance Comparing portions HD grid points HD rigid motionHD translation examples

Page 15: Comparing Images Using the Hausdorff Distance Mark Bouts 6th April 2006.

Min HD for Grid Points

Rasterization introduces a small error compared to the true distance Claim: F[x,y] differs from f(t) by at most 1 unit of

quantization

The translation minimizing F[x,y] is not necessarily close to translation of f(t) So there may be more translation having the

same minimum

Introduction Hausdorff distance Comparing portions HD grid points HD rigid motionHD translation examples

Page 16: Comparing Images Using the Hausdorff Distance Mark Bouts 6th April 2006.

Compute VS array D[x,y]

Many distance transform algorithms Two-pass serial algorithm proposed by

Paglieroni [Paglieroni,1992] Using rendering or z-buffers

Use these to compute the lower envelope of the cone-shapes

Run time O(p) time (p number points in E)(rendering and z-buffering is constant time)

Introduction Hausdorff distance Comparing portions HD grid points HD rigid motionHD translation examples

Page 17: Comparing Images Using the Hausdorff Distance Mark Bouts 6th April 2006.

Computing HD array F[x,y]

can be viewed as the maximization of D’[x,y] shifted by each location where B[k,l] takes a nonzero value

Expensive computation! Constantly computing the new upper

envolope

],['max],['max],[1],[;,

ylxkDybxbDyxFlkBlk

yxBb

B

Introduction Hausdorff distance Comparing portions HD grid points HD rigid motionHD translation examples

],[ yxFB

Page 18: Comparing Images Using the Hausdorff Distance Mark Bouts 6th April 2006.

Computing HD array F[x,y]

Probing the Voronoi surface of the image

Looks similar to binary correlation

Due to no proximity notion is binary correlation more sensitive to pixel purturbation

],['],[max],[,

ylxkDlkByxFlk

B

Introduction Hausdorff distance Comparing portions HD grid points HD rigid motionHD translation examples

k l

ylxkAlkByxC ],[],[],[

Page 19: Comparing Images Using the Hausdorff Distance Mark Bouts 6th April 2006.

Matching portions of shapes

Matching portions of the image and a model Partial distance formulation is not ideal!

Consider portion of the image to the model

More wise to only consider those points of the image that ‘underneath’ the model

],[],[max],[

;

),(ylxkDlkAyxF

ynlyxmkx

lkA

Introduction Hausdorff distance Comparing portions HD grid points HD rigid motionHD translation examples

Page 20: Comparing Images Using the Hausdorff Distance Mark Bouts 6th April 2006.

HD under Rigid motion

Extent the transformation set with rotation Minimum value of the HD under rigid (Euclidean)

motion

Ensure that each consecutive rotation moves each point by at most 1 pixel So

))(,(min),(,

tBRAHBAMt

E

)1

arctan(kr

Introduction Hausdorff distance Comparing portions HD grid points HD rigid motionHD translation examples

Page 21: Comparing Images Using the Hausdorff Distance Mark Bouts 6th April 2006.

HD under Rigid motion

Computation Limitations

Only from the model B to the image A Complete shapes

Method For each translation

Create an array Q in which each element = For each point in B

For each rotation we probe the distance transform and maximize it with values already in the array

),)((][ AtBRhiQ i

Introduction Hausdorff distance Comparing portions HD grid points HD rigid motionHD translation examples

Page 22: Comparing Images Using the Hausdorff Distance Mark Bouts 6th April 2006.

Example translation

Image: 360 x 240 pixels Model: 115 x 199 pixels f1 = 0.8 and f2 = 0.5 Sun-4 (SPARCstation 2)

Runtime ± 20 seconds 2 matches

Image model overlaid

Introduction Hausdorff distance Comparing portions HD grid points HD rigid motionHD translation examples

Images Huttenlocher D. Comparing images using the Hausdorff distance

Page 23: Comparing Images Using the Hausdorff Distance Mark Bouts 6th April 2006.

Example Rigid motion

Image: 360 x 240 pixels Model: 31 x 31 pixels f1 = 0.8 and f2 = 0.5 Sun-4 (SPARCstation 2)

Runtime ± 216 seconds 15 matches

Image model overlaid

Introduction Hausdorff distance Comparing portions HD grid points HD rigid motionHD translation examples

Images Huttenlocher D. Comparing images using the Hausdorff distance

Page 24: Comparing Images Using the Hausdorff Distance Mark Bouts 6th April 2006.

Summary

Hausdorff Distance Minimal Hausdorff as a function of translation

Computation using Voronoi surfaces Compared portions of shapes and models The minimal HD for grid points

Computed the distance transform The minimal HD as a function of translation Comparing portions of shapes and models

The Hausdorff distance under rigid (euclidean) motion Examples

Introduction Hausdorff distance Comparing portions HD grid points HD rigid motionHD translation examples

Page 25: Comparing Images Using the Hausdorff Distance Mark Bouts 6th April 2006.

References

References [Huttenlocher et al., 1991]

Huttenlocher Daniel P, Kedem K and M. SharirThe Upper Envelope of Voronoi Surfaces and Its Applications, ACM symposium on Computational Geometry,194-292, 1991

[Alt et al., 1991]Alt H., Behrends B., Blomer J. Measuring the resemblance of polygonal shapes. In Proc. Seventh ACM Symposium on Computational Geometry

[Paglieroni, 1992]Paglieroni D.W, Distance transforms: Properties and machine vision applications. Computer Vision, Graphics and Image Proc: Graphical Models and Image Processing, 54(1):56-74,1992

Introduction Hausdorff distance Comparing portions HD grid points HD rigid motionHD translation examples