on the complexity of affine image matching stacs 2007, aachen university of lbeck institute for...

55
On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lübeck Institute for Theoretical Computer Science Lübeck, Germany Thursday, February 22th 2007 Christian Hundt and Maciej Liśkiewicz

Upload: hester-boyd

Post on 18-Jan-2018

219 views

Category:

Documents


0 download

DESCRIPTION

Overview On the Complexity of Affine Image Matching 1.Notation and the Problem 2.Structure of the Searchspace 3.Polynomial Time Algorithm

TRANSCRIPT

Page 1: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

On the Complexity ofAffine Image Matching

STACS 2007, Aachen

University of LübeckInstitute for Theoretical Computer ScienceLübeck, Germany

Thursday, February 22th 2007

Christian Hundt and Maciej Liśkiewicz

Page 2: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Foto: Andreas Herrmann

What is Image Matching?On the Complexity of Affine Image Matching

? ? ?

Page 3: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

OverviewOn the Complexity of Affine Image Matching

1. Notation and the Problem

2. Structure of the Searchspace

3. Polynomial Time Algorithm

Page 4: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Section 1On the Complexity of Affine Image Matching

Notation and the Problem

Page 5: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Notation and the ProblemR2-Functions and Images

On the Complexity of Affine Image Matching

A: R R R

Page 6: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Notation and the ProblemR2-Functions and Images

On the Complexity of Affine Image Matching

A: Z Z R

Discretization of A ( step I ):

Page 7: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Notation and the ProblemR2-Functions and Images

On the Complexity of Affine Image Matching

A: Z Z R

Page 8: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Notation and the ProblemR2-Functions and Images

On the Complexity of Affine Image Matching

A: Z Z R

Page 9: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Notation and the ProblemR2-Functions and Images

On the Complexity of Affine Image Matching

A: Z Z Z

14 19 12 14

18 21 13 17

16 18 13 15

14 19 12 14

Discretization of A ( step II ):

Page 10: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Notation and the ProblemImage Metric

On the Complexity of Affine Image Matching

BA

: R R R ( e.g. (a,b) = |a-b| )

(A, B) = ( A(x,y), B(x,y) ) dx dy- -

Page 11: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Notation and the ProblemImage Metric

On the Complexity of Affine Image Matching

BA

(A, B) = ( A(x,y), B(x,y) ) N

N

Discretization of for Images:

14N2

y=-N x=-N

Page 12: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Notation and the ProblemTransformations

On the Complexity of Affine Image Matching

f(A)(x,y) = A( f -1(x,y) )

A f(A)

f

f -118

18

Page 13: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Notation and the ProblemTransformations

On the Complexity of Affine Image Matching

f(A)(x,y) = A( f -1(x,y) )

A f(A)

f -1

????????????

and with Images?

Page 14: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Notation and the ProblemTransformations

On the Complexity of Affine Image Matching

A f(A)

Page 15: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Notation and the ProblemTransformations

On the Complexity of Affine Image Matching

A f(A)

Nearest Neighbour Interpolation!!!

Page 16: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Notation and the ProblemTransformations

On the Complexity of Affine Image Matching

f (i, j) =[ f -1(i, j) ], if in (-N ... N)2

sonst

Discretization of f:

(0,0)

(0,1)

(0,2)

(0,3)

(1,0) (2,0) (3,0) (4,0)

(1,1) (2,1) (3,1) (4,1)

(1,2) (2,2) (3,2) (4,2)

(1,3) (2,3) (3,3) (4,3)

Page 17: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Notation and the ProblemTransformations

On the Complexity of Affine Image Matching

f (i, j) =[ f -1(i, j) ], if in (-N ... N)2

sonst

Discretization of f:

(3,1)(0,0)

(0,1)

(0,2)

(0,3)

(1,0) (2,0) (3,0) (4,0)

(1,1) (2,1) (3,1) (4,1)

(1,2) (2,2) (3,2) (4,2)

(1,3) (2,3) (3,3) (4,3)

Page 18: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Notation and the ProblemTransformations

On the Complexity of Affine Image Matching

f (i, j) =[ f -1(i, j) ], if in (-N ... N)2

sonst

Discretization of f:

(3,1)(2,1)(0,0)

(0,1)

(0,2)

(0,3)

(1,0) (2,0) (3,0) (4,0)

(1,1) (2,1) (3,1) (4,1)

(1,2) (2,2) (3,2) (4,2)

(1,3) (2,3) (3,3) (4,3)

Page 19: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Notation and the ProblemTransformations

On the Complexity of Affine Image Matching

f (i, j) =[ f -1(i, j) ], if in (-N ... N)2

sonst

Discretization of f:

(3,1)(2,1)(1,1)(0,0)

(0,1)

(0,2)

(0,3)

(1,0) (2,0) (3,0) (4,0)

(1,1) (2,1) (3,1) (4,1)

(1,2) (2,2) (3,2) (4,2)

(1,3) (2,3) (3,3) (4,3)

Page 20: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Notation and the ProblemTransformations

On the Complexity of Affine Image Matching

f (i, j) =[ f -1(i, j) ], if in (-N ... N)2

sonst

Discretization of f:

(3,1)(2,1)(1,1)(0,1)(0,0)

(0,1)

(0,2)

(0,3)

(1,0) (2,0) (3,0) (4,0)

(1,1) (2,1) (3,1) (4,1)

(1,2) (2,2) (3,2) (4,2)

(1,3) (2,3) (3,3) (4,3)

Page 21: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Notation and the ProblemTransformations

On the Complexity of Affine Image Matching

f (i, j) =[ f -1(i, j) ], if in (-N ... N)2

sonst

Discretization of f:

(3,1)(2,1)(1,1)(0,1)(0,0)

(0,1)

(0,2)

(0,3)

(1,0) (2,0) (3,0) (4,0)

(1,1) (2,1) (3,1) (4,1)

(1,2) (2,2) (3,2) (4,2)

(1,3) (2,3) (3,3) (4,3)

Page 22: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Notation and the ProblemTransformations

On the Complexity of Affine Image Matching

f (i, j) =[ f -1(i, j) ], if in (-N ... N)2

sonst

Discretization of f:

(3,1)(2,1)(1,1)(0,1)

(0,2)

(0,3)

(1,2)

(1,3)

(2,2)

(2,3)

(3,2)

(3,3)

(0,0)

(0,1)

(0,2)

(0,3)

(1,0) (2,0) (3,0) (4,0)

(1,1) (2,1) (3,1) (4,1)

(1,2) (2,2) (3,2) (4,2)

(1,3) (2,3) (3,3) (4,3)

Page 23: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Notation and the ProblemTransformations

On the Complexity of Affine Image Matching

Discretization of F:

N(F) = { f | f F and f injecive }

Page 24: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Notation and the ProblemImage Matching

On the Complexity of Affine Image Matching

BA

f ?

Input: Image A, distorted image B, set of admissible transformations F

Solution:Transformation f in F

Goal: min (f(A), B) = min ( A( (x,y) ), B(x,y) )14N2 y=-N x=-N

N N

f F N(F)

Page 25: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Notation and the ProblemHow to ...

On the Complexity of Affine Image Matching

1. enumerate N(F) ?

2. estimate |N(F)| ?

Page 26: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Notation and the ProblemElastic Image Matching

On the Complexity of Affine Image Matching

f

f(A)A

Set of transformation F: ||(x,y)-(x‘,y‘)|| 1 ||f(x,y)-f(x‘,y‘)||

[Keysers; Unger; 2002] Elastic Image Matching is NP-complete.

Page 27: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Notation and the ProblemProjective Image Matching

On the Complexity of Affine Image Matching

f(A)A

Set of transformation F: f(x,y) = (a/c, b/c) and (a,b,c) = M(x,y,1)

Open Problem.

f

Page 28: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Notation and the ProblemAffine Image Matching

On the Complexity of Affine Image Matching

f(A)A

Set of transformation F: f(x,y) = M(x, y) + t

Our result: Affine Image Matching can be solved in polynomial time.

f

Page 29: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Notation and the ProblemMore Image Matching Classes

On the Complexity of Affine Image Matching

f

f

f

f

f

Translation:

Scaling:

Rotation:

Rotation &Scaling:

LinearTransformation:

f(x,y) = +1 0

0 1

s 0

0 s

cos sin

-sin cos

s cos s sin

-s sin s cos

x

y

t1

t2

f(x,y) =x

y

f(x,y) =x

y

f(x,y) =x

y

f(x,y) =a1 a2

a3 a4

x

y

Page 30: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Section 2On the Complexity of Affine Image Matching

Structure of the Search Space

Page 31: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Structure of the Search SpaceAffine Transformation vs. R6

On the Complexity of Affine Image Matching

f(x,y) = +a1 a2

a3 a4

xy

t1

t2

Transformation:

Vector in R6: v = ( )T

Page 32: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Structure of the Search SpaceAffine Transformation vs. R6

On the Complexity of Affine Image Matching

f(x,y) = +a2

a3 a4

xy

t1

t2

Transformation:

Vector in R6: a1, v = ( )T

Page 33: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Structure of the Search SpaceAffine Transformation vs. R6

On the Complexity of Affine Image Matching

f(x,y) = +a2

a3 a4

xy

t1

t2

Transformation:

Vector in R6: a1, v = ( )T

Page 34: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Structure of the Search SpaceAffine Transformation vs. R6

On the Complexity of Affine Image Matching

f(x,y) = +

a3 a4

xy

t1

t2

Transformation:

Vector in R6: a1, a2, v = ( )T

Page 35: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Structure of the Search SpaceAffine Transformation vs. R6

On the Complexity of Affine Image Matching

f(x,y) = +

a3 a4

xy

t1

t2

Transformation:

Vector in R6: a1, a2, v = ( )T

Page 36: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

v = ( )T

Structure of the Search SpaceAffine Transformation vs. R6

On the Complexity of Affine Image Matching

f(x,y) = +xyTransformation:

Vector in R6: a1, a2, t1,

a3 a4

t2

Page 37: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

v = ( )T

Structure of the Search SpaceAffine Transformation vs. R6

On the Complexity of Affine Image Matching

f(x,y) = +

a3 a4

xyTransformation:

Vector in R6:

t2

a1, a2, t1,

Page 38: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

v = ( )T

Structure of the Search SpaceAffine Transformation vs. R6

On the Complexity of Affine Image Matching

f(x,y) = +xyTransformation:

Vector in R6:

t2

a1, a2, t1, a3,

a4

Page 39: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

v = ( )T

Structure of the Search SpaceAffine Transformation vs. R6

On the Complexity of Affine Image Matching

f(x,y) = +

a4

xyTransformation:

Vector in R6:

t2

a1, a2, t1, a3,

Page 40: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

v = ( )T

Structure of the Search SpaceAffine Transformation vs. R6

On the Complexity of Affine Image Matching

f(x,y) = +xyTransformation:

Vector in R6:

t2

a1, a2, t1, a3, a4,

Page 41: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

v = ( )T

Structure of the Search SpaceAffine Transformation vs. R6

On the Complexity of Affine Image Matching

f(x,y) = +xy

t2

Transformation:

Vector in R6: a1, a2, t1, a3, a4,

Page 42: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

v = ( )T

Structure of the Search SpaceAffine Transformation vs. R6

On the Complexity of Affine Image Matching

f(x,y) = +xyTransformation:

Vector in R6: a1, a2, t1, a3, a4, t2

Page 43: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

v = ( )T

Structure of the Search SpaceAffine Transformation vs. R6

On the Complexity of Affine Image Matching

f(x,y) = +xyTransformation:

Vector in R6: a1, a2, t1, a3, a4, t2

Page 44: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

v = ( )T

Structure of the Search SpaceAffine Transformation vs. R6

On the Complexity of Affine Image Matching

f(x,y) = +xyTransformation:

Vector in R6:

a1 a2

a3 a4

t1

t2

a1, a2, t1, a3, a4, t2

v = f -1

Page 45: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Structure of the Search SpaceHyperplanes

On the Complexity of Affine Image Matching

Xiji‘: i x1 + j x2 + x3 - i‘ + 0.5 0

Yijj‘: i x4 + j x5 + x6 - j‘ + 0.5 0

Let HN be a set of hyperplanes in R6 which contains for all i, j, i‘, j‘ [-N,N] the hyperplanes:

A(HN) is the set of cells in R6 defined by HN.

Page 46: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Structure of the Search SpaceCentral Property

On the Complexity of Affine Image Matching

Lemma 1. For two vectors u, v R6 it holds that u = v iff if for all i, j, i‘ [-N,N] u and v belong to the same half-subspace according to the partition of R6 with the hyperplane Xiji‘.

The same holds for Yijj‘.

Page 47: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Structure of the Search SpaceMain Result

Theorem 1. Let F be the set of affine transformations, then N(F) A(HN).

On the Complexity of Affine Image Matching

Corollary 1. |A(HN)| = O(N18).

Page 48: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Section 3On the Complexity of Affine Image Matching

Polynomial Time Algorithm

Page 49: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Polynomial Time AlgorithmEfficient Representation

Lemma 2. Each convex cell of A(HN) contains a vector coordinates of which can be encoded by rational numbers of lenght O(log N).Moreover the representatives can be computed efficiently.

On the Complexity of Affine Image Matching

Page 50: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Polynomial Time AlgorithmThe Algorithm

On the Complexity of Affine Image Matching

Theorem 2. [Edelsbrunner, 1987] Any arrangement of n hyperplanes in R6 can be constructed in O(n6) time.

Page 51: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Polynomial Time AlgorithmThe Algorithm

On the Complexity of Affine Image Matching

Algorithm ImageMatching( )Input: Images A, B of size (2N+1) (2N+1)Output: Transformation f = arg min (f‘(A), B)

1. Construct A(HN).2. Set f = Id and = .3. For all C A(HN) do4. compute the representative g for C,5. compute ‘ = (g-1(A), B),6. if (‘ < ) then set = ‘ and f = g-1.7. Return f.

f‘ F

Page 52: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Polynomial Time AlgorithmRunning Time

On the Complexity of Affine Image Matching

Lemma 3. The algorithm runs in time O(N20).

Theorem 3. The Affine Image Matching Problem can be solved in polynomial time.

Page 53: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Polynomial Time AlgorithmExtensions

On the Complexity of Affine Image Matching

1. Many subclasses of Affine Transformation

2. Images with more than two Dimensions.

3. Linear Interpolation

Page 54: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Summary

1. The Search Space of discretized inverse affine Transformation has a regular structure.

2. The Affine Image Matching Problem can be solved in polynomial time.

On the Complexity of Affine Image Matching

Page 55: On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lbeck Institute for Theoretical Computer Science Lbeck, Germany Thursday,

Thank you for your attention!

Any Questions?

On the Complexity of Affine Image Matching