Affine invariant Fourier descriptors Sought: a generalization of the previously introduced similarityinvariant Fourier descriptors H. Burkhardt, Institut für Informatik, Universität Freiburg ME-II, Kap. 4e 1
Geometrical transformations central projections affine mappings similarities congruencies translations (preserves parallelisms) (preserves angles) H. Burkhardt, Institut für Informatik, Universität Freiburg ME-II, Kap. 4e 2
Real, vectorial, parametric description of a closed contour v x() t ut () = vt () x(t) t=s possible parameterization: t=s (arc length) u H. Burkhardt, Institut für Informatik, Universität Freiburg ME-II, Kap. 4e 3
Affine mapping of a contour x() t = Ax (( t t )) + b A A b A= b= A 11 12 1 with: det( ) A21 A 22 b 2 Additonally starting point translation: (, ) tt In case arc length is used for tt = tt + τ parameterization: (, ) ( ) Thus 7 degrees of freedom result for affine mapping! τ τ H. Burkhardt, Institut für Informatik, Universität Freiburg ME-II, Kap. 4e 4
Equivalent structures In the equivalence class of similar maps with equivalence relation ~ applies: circle1 ~ circle2 circle ellipse parallelogramm rectangle square In the equivalence class of affine maps though applies: circle ~ ellipse parallelogramm ~ rectangle ~ square but: circle square H. Burkhardt, Institut für Informatik, Universität Freiburg ME-II, Kap. 4e 5
Developing the contour as a periodic function into a Fourier series x() t ut () = = vt () k =+ k = X k e j2 π kt/ T with the complex valued Fourier coefficient vector: X k U = = ( ) V T k 1 j2 π kt/ T T x te k t= dt H. Burkhardt, Institut für Informatik, Universität Freiburg ME-II, Kap. 4e 6
Choosing a parameterization, which guarantees a linear (homogeneous) mapping t t with the effect of the affine map A tt (, A) = μ( A) t The arc length does not meet this requirement! H. Burkhardt, Institut für Informatik, Universität Freiburg ME-II, Kap. 4e 7
Non-linear map over arc length with shear of objects t t horizontal dilation t t vertical compression T /4 T /2 T t H. Burkhardt, Institut für Informatik, Universität Freiburg ME-II, Kap. 4e 8
Choosing an appropriate parameterization 1st possibility: Using differential invariants of second order in form of affine length. Needed are: [ xx, ] 2nd possibility: Using differential invariants of first order and additionally area centre of gravity x s (semi-differential approach). Needed are: [ xx, ] H. Burkhardt, Institut für Informatik, Universität Freiburg ME-II, Kap. 4e 9
outer product: x1 y1 [ xy, ] = det( xy, ) = = ( xy 1 2 xy 2 1) = x ysin( ϕ) x y 2 2 [ xy, ] = 2 FΔ The outer (tensor) product and its geometric meaning The outer product of two vectors [x,y] is a (signed) real number, which corresponds to the area of the included parallelogram (or: 2 times the area of the triangle) x ϕ F y F x ϕ y h h = x sin( ϕ) F = y Δ h/2 = y x sin( ϕ) 1 2 H. Burkhardt, Institut für Informatik, Universität Freiburg ME-II, Kap. 4e 1
Results from differential geometry We differentiate the parameterization t adequately from the arc length s. For an analytical curve (which is differentiable arbitrary number of times) applies by means of [x,y]: ( n) ( n+ 1) = = (2n 1) ( n) ( n 1) (2n 1) dt() s + + x, x ds + Ax, Ax ds ( n) ( n+ 1) ds (2n+ 1) (2n+ 1) = A x, x n 1 μ ( A) dt n (1) ( n) d x x = x s with: x = e.g. is n (2) ds x s n s n ( s) normal x () s = n(s)=1 ( ) tangential vector = κ()() curvature vector x() s x () s tangent dt = μ( A) dt H. Burkhardt, Institut für Informatik, Universität Freiburg ME-II, Kap. 4e 11
1st possibility: Using differential invariants of second order in form of affine length 3 3 t =, ds= κ( s) ds affine length C [ xx] dx() s with: x = ( s arc length) ds [ ] it applies: 3 3 xx, ds = 3 A, ds x x C μ ( A) C 3 and thus: t = At = μ( A) t C t t problem for polygons: the second derivative disappears along the line and the first derivative is non-continuous in the corners and therefore the 2 nd derivative is not defined! H. Burkhardt, Institut für Informatik, Universität Freiburg ME-II, Kap. 4e 12
2nd possibility: using differential invariants of first order and additionally normalization by center of gravity (COG) x s (semi-differential approach) The vector starting from the COG to the contour are used for parameterization (outer product of pointer and tangential vector) df due to: ds x s A ds x s df det( Ax, Ay) = det( A ( x, y)) = det( A)det(, x y) [ Ax, Ay] det( A) [ x, y] = df = α( A) df = det( A) df df [ x x, x ] t = F = ds C df = A x xs, x C = μ( A) F = μ( A) t s ds H. Burkhardt, Institut für Informatik, Universität Freiburg ME-II, Kap. 4e 13
The effect of the transformation is eliminated due to the normalization to the COG It applies: The affine transformation maps area COG to each other and areas to each other in a constant relation! The outer product is signed! In order to avoid ambiguities the amplitude of area increment df is chosen and therefore a monotonic increasing parameterization! H. Burkhardt, Institut für Informatik, Universität Freiburg ME-II, Kap. 4e 14
Affine invariant Fourier descriptors for polygons x 3 area element F i x N-1 =x 4 v x 1 =x N+1 x 2 x N =x u [ ] polygon: x, x,, x x 1 N i u i = v i H. Burkhardt, Institut für Informatik, Universität Freiburg ME-II, Kap. 4e 15
Affine invariant Fourier descriptors of det( xi, xi+ 1 ) [ ] polygons area center of gravity of the whole traverse: x N 1 N 1 x, x ( x + x ) ( uv u v)( x + x ) i i+ 1 i i+ 1 i i+ 1 i+ 1 i i i+ 1 1 i= 1 i= s = 3 = N 1 3 N 1 parameter: t = [ x, x ] [ x, x ] i i+ 1 i i+ 1 i= i= 1 ti+ 1 = ti + 2 uv i i+ 1 u i+ 1v i x u u us = s v = x x = v v s F i H. Burkhardt, Institut für Informatik, Universität Freiburg ME-II, Kap. 4e 16 i =,1,, N 1 T = tn
ki, Fourier coefficients U N 1 1 X = 2T ( i 1 i)( ti 1 ti) V = x + + x + i= U N 1 k ( x i 1 i) T + x Xk = 2 (2 k ) ( ek, i 1 ek, i )(1 δ ( ti 1 t π + + i )) V = k i= ( ti+ 1 ti) with: e N 1 j 2π k i= j2 π kt / T + ( x x ) e δ ( t t ) for k = e i i+ 1 i k, i i+ 1 i 1 if ti+ 1 = ti (planar increase = ) δ ( ti+ 1 ti) = if ti+ 1 ti first part transforms continuities second part transforms discontinuities (switching through δ-operator) H. Burkhardt, Institut für Informatik, Universität Freiburg ME-II, Kap. 4e 17
Fourier coefficients of affine distorted contours x() t = Ax ( t + τ ) + b X X k = F ( x( t)) = F ( x ( t )) k thus follows: X k z = k = z AXk k e j2 πτ / T (eliminates translation) H. Burkhardt, Institut für Informatik, Universität Freiburg ME-II, Kap. 4e 18
A-invariants (τ=) with: Δ = det X, X = det( A) det X, X = det( A) Δ from that result complete and minimal invariants: kp k p k p kp Δ det, kp k p det( ) Q X X A Δ k = = = Δ pp det Xp, X p det( A) Δ p= const k =± 1, ± 2, ± 3, UV VU = = UV VU * kp k p k p pp p p p p Q k for τ results though: Q = Q z = Q z k p k k k kp has to be eliminated H. Burkhardt, Institut für Informatik, Universität Freiburg ME-II, Kap. 4e 19
Additional starting point invariance (τ ) (special solution of second order) I = Q Φ Φ ( k p) λ ( k p) η k k q r with: Q = Q Φ = Q e k k k k jarg( Q ) ( λη, ) are integral solutions of the following linear diophantic equation: λ( q p) + η( r p) + 1= a solution exists for: gcd( q p, r p) = 1 (solution with extended Euclidean algorithm) These invariants are also complete and minimal! The approach realizes also a compensation of phases, which are unknown mod 2π. H. Burkhardt, Institut für Informatik, Universität Freiburg ME-II, Kap. 4e 2 k
for example: r = 7, q = 6, p= 1 q p= 5 gcd(5,6) = 1 r p = 6 λ 5+ η 6+ 1= holds for: λ = 1, η = 1 I = Q Φ Φ k k k 1 1 k 6 7 Also in this case one representative from the equivalence class results from the invariants, i.e. a contour in a certain location and view! Also a linear complexity results for a constant number of Fourier descriptors : O(N) H. Burkhardt, Institut für Informatik, Universität Freiburg ME-II, Kap. 4e 21
Properties of Fourier series Since the parametrical description of contours still contains discontinuities (polygon section in radial direction with planar increase ), the magnitude of the FC is proportional to 1/n and thus tend to, which is slower than for continuous functions. c n 1/n n H. Burkhardt, Institut für Informatik, Universität Freiburg ME-II, Kap. 4e 22
Affine invariant Fourier descriptors a b c Fourierkoeffizienten Invarianten n a b c aa b c c -5.17.4.146 -.1 -.86.284.75.94.75-4 -.6 -.34 -.47 -.58 -.86.311.57.84.57-3 -.36 -.55 -.1 -.74.126.481.29.14.29-2.283 -.477.227 -.49-1.56.392.315.29.315-1 -.263 -.779 -.178 -.733-5.37.661... --- --- --- --- --- --- --- --- --- 1-1,12-1,73-1,9-1,65,743-7,33 1, 1, 1, 2 -.24 -.375 -.64 -.467.927 -.751.229.252.229 3 -.169 -.14 -.191 -.96.72.3.14.111.14 4 -.81.182 -.63.175.476 -.385.119.126.119 5.66 -.2.57.14.46 -.21.61.59.61 F 2 2 5 5 2 2 7 7(5) 3 2 = A F mit: F =,5 = 5 5 7 7 9 9 11 11 A 1 3 H. Burkhardt, Institut für Informatik, Universität Freiburg ME-II, Kap. 4e 23
Power spectra of the difference of the invariants of both objects difference for real affine map considering the quantization error difference for real structure changes H. Burkhardt, Institut für Informatik, Universität Freiburg ME-II, Kap. 4e 24