A Statistical Theory of Shape - CiteSeerX

Report 2 Downloads 44 Views
A Statistical Theory of Shape Rikard Berthilsson Abstract

In this paper, the statistical theory of shape for ordered nite point congurations is studied. A general, invariant based, approach for dening shape and nding its density is developed. Some examples, that have been possible to compute analytically, are given, including both ane and positive similarity shape. Projective shape and the related projective invariants are important topics in computer vision and have been assigned a section of their own.

1 Introduction In many disciplines (technology, science, biology, etc), one often encounters a need to describe geometrical shapes. This is usually done by extracting a conguration of feature points, that are characteristic for the object at hand. Once these points have been extracted, they have to be treated collectively, and not as individual points. Moreover, when talking about shape, the location and orientation in space is in general irrelevant, which means that one should not distinguish between congurations that can be transformed into each other by rotations and translations. Often there are other immaterial properties at hand, like for example scaling. To treat this quantitatively, a parametrisation of point congurations is needed, that only bother about essential properties, 'the shape' in the application at hand. What is meant by 'essential' can often be described in terms of a group of transformations, by identifying objects that can be transformed into each other by the group. When using such parametrisations of shape in practice, one soon encounters the problem of how uncertainties in the measurements of individual feature points aect the shape parameters. This is the subject of the present study, i.e. to device a general, abstract, method for parametrisation of shape, taking only relevant information into account, and to investigate the statistical density of the shape parameters given the statistical density for the individual points of the congurations. As an example of a specic eld of applications, let us mention computer vision. For instance, when deriving the structure of a 3D-scene from a sequence of 2D-images, one often has little or none calibration information about the cameras. Fortunately, cf [Spa95], it is still often possible to derive structure information, but only up to some class of transformations, i.e. a situation similar to the one described above. The algorithms for this only use some kind of shape data, with respect to some group of transformations. This means that the data needed by the algorithms consists of shape parameters, which are 'packages' of measurement parameters. To analyse the stability and robustness 1

of such algorithms, the densities of these shape parameters are needed. This application is in fact the main motivation for this study. Another computer vision application of the result of this paper, is model based recognition. Then a data base is built containing e.g. ane or projective shapes of a number of model objects. The recognition problem consists of matching measured image features to the right model object. To do this, shapes are computed from image data. Knowing the densities of shape, this can be done in a rm way, using quantitative hypothesis testing. In this paper we will outline a general framework for shape. The result will be explicit parametrisations of shape spaces together with formulas for the density of shape, given as integrals. The general theory will be illustrated by a number of examples of ane, projective as well as positive similarity shape. The pioneer in the study of shape along these lines is Kendall, cf [Ken89], who dealt with the case of positive similarity transformations. Bookstein, cf [Boo86], introduced variables for size and shape to treat this problem when all feature points belongs to a plane. The density for the shape variables was later computed in [MD89], where the feature points were assumed to be normally distributed. In computer vision, density of ane shape has been studied in [GHJ92], [Wer93] and [Hey95]. In [GHJ92], the uncertainty of the ane coordinates of a planar four point conguration is treated. In [Hey95] a rst order approximation is used to compute the density of the ane shape to a planar four point conguration, when the points are normally distributed. A similar method is used in [Wer93]. Densities of projective shape have been studied in [Åst96] and [May93], where the exact density for the cross ratio for four points on a line is computed. The approach of the present paper uses an abstract setting, which makes it possible to cover all these situations simultaneously. In still more abstract setting, similar ideas can be found in [Amb90].

2 Shape of nite ordered point congurations In this section, we will dene a general notion of shape of nite point congurations. To begin with, we introduce some terminology. Let Cmn be the set of ordered m-point congurations

X = (p1 ; p2 ; : : : ; pm) in Rn , where pi 2 Rn is the coordinate vector of point number i in X . Thus, there is a natural isomorphism between Cmn and Rmn . As topology on Cmn , we will use the one inherited from Rmn . Let G be a group of transformations Cmn ! Cmn . By the G-orbit of X 2 Cmn is meant the set fY jY = g(X ); g 2 Gg: We write X  Y , when X and Y are in the same orbit. For a group G of transformations Rn ! Rn , let Gm be the group of product transformations, Cmn ! Cmn , dened by

g(X ) = (g(p1 ); : : : ; g(pm )); when X = (p1 ; : : : ; pm) 2 Cmn and g 2 G: 2

For our applications, this is the most usual situation, i.e. the same transformation is applied to all points of the conguration. By abuse of language, we write G instead of Gm . For the geometric applications we are interested in, the following terminology is convenient. Denition 2.1. Let G be a group of transformations Cmn ! Cmn . The shape space is dened as the set of orbits Cmn =G. Let

s : Cmn ! Cmn =G; be the natural projection. For X 2 Cmn , the orbit s(X ) 2 Cmn =G is called the shape of X and each element of s(X ) is called a representative of s(X ). A function ' on Cmn , which is constant on each orbit is called an invariant. The functions ' = ('1 ; : : : ; 'k ) form a complete set of invariants if '(X ) = '(Y ) if and only if X  Y . As topology on Cmn =G, we choose the strongest topology that makes s continuous. Since G forms a group, the orbits of Cmn =G are disjoint. The space Cmn can then be viewed as divided into disjoint strings, where each string is an orbit. n Cm

orbits

Figure 1: Orbits of Cmn . According to Klein, in his Erlanger-program, geometry is the study of properties of geometric objects, which are invariant with respect to some class of transformation. This point of view ts with Denition 2.1, as is also illustrated by the following examples. Example 2.1. Let G be the group of nonsingular Euclidean transformations, acting on Cmn . Euclidean invariants are distances between points in the point congurations. The orbits consist of congurations that are congruent, in the sense of classical Euclidean geometry. Example 2.2. Similarity geometry for triangles. Consider C32, which may be identied with the triangles in the plane. Let G be the group of similarity 3

transformations R2 ! R2 , the group generated by rotations, translations and scalings. Then g 2 G can be written g(x) = Rx + t; where > 0, R is a 2  2 rotation matrix and x and t are two 2  1 matrices. If we only consider the dense open subset U  C32 , consisting of congurations whose points not are collinear, the orbits of U can be parametrised by ordered triples (1 ; 2 ; 3 ) of inner angles of some triangle in each orbit. This comes from the fact that this triple is invariant to rotation, scaling and translation. Hence, (1 ; 2 ; 3 ) is a similarity invariant. The remaining set C32 n U consists of point congurations, where all points lie on a line. From a probabilistic point of view, when dealing with densities in L1 (C32 ), these cases are uninteresting, as they form a set of measure zero. For this situation, when G is the group of similarity transformations, the shape space Cmn =G is often denoted by m n , cf [Ken89]. Example 2.3. Let G be the projective group on the line. The cross ratio is a well known invariant for the group of nonsingular projective transformations. Example 2.4. When G is the group of ane transformations, Cmn =G is isomorphic to a Grassman manifold, consisting of linear subspaces of some ambient linear space, cf [Spa95]. These subspaces have been called ane shape, and can be described explicitly as

) ( X m m X s(X ) =  i xi = 0; i = 0; X = (x1 ; : : : ; xm ) : i=1 i=1

3 Density of shape, general theory

(1)

We now introduce a parametrisation of point congurations Cmn , by taking the transformation group G into account, which will enable us to write down a formula for a density function on the shape space Cmn =G, when a density function on Cmn , or on the individual points of the congurations is known. This parametrisation will be done by pulling Cmn back to two parameter sets A and B , such that B labels the orbits Cmn =G and A provides parameters along each orbit. Recall that a function is called a C n -dieomorphism if it is invertible and f; f ?1 2 C n . Denition 3.1. Let A  Rk and B  Rk be two open subsets for some k and k0 and l Let G be a group of transformations Cmn ! Cmn . Suppose that there exist open sets A  Rk and B  Rk , a bijection g : A 3 a ! ga 2 G; and a function  : B ! Cmn ; such that the function

 : A  B ! Cmn ; dened by  (a; b) = ga   (b); 0

0

4

has a dense open range U  Cmn and  : A  B ! U , is a C 1 -dieomorphism. Then we say that  a parametrisation of shape and g a parametrisation of G. The dimensions k; k0 only depend on Cmn and G, as  is a C 1 -dieomorphism. The specic choices of parametrisations for shape and G merely represent a choice of coordinates on U  Cmn , such that  labels the orbits and g describes the location within each orbit, see Figure 2. n Cm

orbits

 (B )

Figure 2: Parametrisation of Cmn . Each orbit has a unique intersection with  (B ).

Remark. Since the topology on Cmn =G is dened as the strongest topology, which makes s continuous, and as  : A  B ! U  Cmn is a C 1 -dieomorphism, this implies that B and s(U ) are homeomorphic. In fact, let 2 B be open, then

0 =  (A  ) is open since  is a C 1 -dieomorphism and s?1 fs( 0 )g = 0 . This implies that s( 0 ) is open, by the topology on Cmn =G. The map  (a;) s s(U ) ; a 2 A B ?! Cmn ?! is independent of the choice of a 2 A. It is bijective, continuous and also open, that is a homeomorphism. Thus, s(U ) is also metrizable, since B is a metric space. We call s(U ) the non-degenerate shape space. As was noted in Example 2.2, it was enough to consider the dense open subset U  C32 , where all X 2 U form non-degenerate triangles, since the complement C32 nU has measure zero. This example motivates the claim U  Cmn to be an open dense subset in Denition 3.1. Furthermore, we can not expect to parametrise all of Cmn by one function, such as  , but it is rather easy to parametrise dense open subsets.

We now turn to the main question, to dene densities on shape spaces. To end assume that Cmn has a density function 0   2 L1 (Cmn ), where R dthis X = 1. Often it is obtained from density functions for the individual points 5

of the congurations. We want to dene a density function on Cmn =G, i.e. a density function for shapes. Let  be as in Denition 3.1, then

Z

Cmn

(X )dX =

Z Z

A

B

 0    (a; b) det(  ) da db;

where det( 0 ) is the functional determinant of  (a; b). It is thus a determinant of order k + k0 . Here the function

B3b!

Z

A





   (a; b) det( 0 ) da 2 L1

is dened almost everywhere. As B and the non-degenerate shape space s(U ) are homeomorphic, by the remark above, it is natural to use this function when dening a density of shape. Denition 3.2. Let  2 L1(Cmn ) be a density function,  : B ! Cmn a parametrisation of shape, g : A 3 a ! ga 2 G a parametrisation of the group G and set

 (a; b) = ga   (b). The function D(;  ) : B ! R, dened by

Z





D(;  ) : b !    (a; b) det 0 da A shape on Cmn , with respect to G.

is called the density of Observe that the density of shape depends on the parametrisation of shape, which can be chosen in many ways. This seems to bring in an ambiguity. Also the parametrisation of G can be done in many ways. The following theorem claries the rate of ambiguity.

Theorem 3.1.

1. The density of shape is independent of the parametrisation of G. 2. If i : Bi ! Cmn , i = 1; 2, are two parametrisations of shape, then there exist open and dense subsets B~i  Bi and a C 1 -dieomorphism f : B~2 ! B~1 , such that D(; 2 ) = jdet f 0j D(; 1 )  f: Proof. 1 : Let  : B ! Cmn be a parametrisation of shape and

gi : Ai 3 a ! gi (a) 2 G; i = 1; 2; two parametrisations of G. Set

i : Ai  B 3 (a; b) ! gi (a)   (b) 2 Ui ; i = 1; 2; where Ui  Cmn are dense and open, such that i are C 1 -dieomorphisms, i = 1; 2. Since 1 and 2 are compositions with the same parametrisation of shape  , and each orbit has a unique intersection with  (B ), this implies that U1 = U2 . Thus h : A2  B 3 (a; b) ! 1?1  2 (a; b) 2 A1  B 6

is a C 1 -dieomorphism. Letting pB be the natural projection A1  B ! B , then pB  h is the identity on B . The change of variables h in

Z

D1 (;  ) =   1 jdet 10 j da gives D1 (;  ) = D2 (;  ), which proves the rst statement. 2 : Let gi and i , i = 1; 2, be two parametrisations of G and shape, respectively. Since the intersection of open dense sets is again an open dense set, there exist open and dense subsets B~i  Bi and U  Cmn , such that

i : Ai  B~i 3 (a; b) ! gi (a)  i (b) 2 U; i = 1; 2

are C 1 -dieomorphisms. For a0 2 A2 , dene f : B~2 ! B~1 by f = pB~1  ?11  2 (a0 ; ); where pB~1 is the natural projection A1  B~1 ! B~1 . We now show that f is a C 1 -dieomorphism, which is independent of the choice a0 . For two choices a2 and a~2 2 A2 , we have

g1 (a1 )  1 (b1 ) = g2 (a2 )  2 (b2 ) and

g1 (~a1 )  1 (~b1 ) = g2 (~a2 )  2 (b2 ): Composing with g2 (a2 )  g2 (~a2 )?1 in the second identity, we get g1(a1 ) = g2 (a2 )  g2 (~a2 )?1  g1 (~a1 ) and b1 = ~b1 . If the arguments are reversed we see that f ?1 2 C1. Set

Then

 : A1  B~2 3 (a; b) ! 1 (a; f (b)) 2 U:

h : A1  B~2 3 (a; b) ! ?21  (a; b) 2 A2  B~2 is a C 1 -dieomorphism and pB~2  h is easily seen to be the identity on B~2 . By making a change of variables h, in D(; 2 ), we get Z D(; 2 ) =   1(a; f (b)) det d 1((a;a; bf)(b)) da:

The chain rule implies

a; f (b)) = det f 0 (b) det 0 (a; f (b)); det d 1((a; 1 b) which proves the theorem. The second statement in Theorem 3.1 means that the dependence of  is illusory. In fact, the formula says that if we integrate over a set in s(U ) the result will be independent of the specic choice of parametrisation of shape  . Usually A is an open dense subset of some Euclidean space and then the integration can 7

be performed over the whole space instead of A, since the complement is just a closed set of measure zero. Remark. For some groups G of transformations it is possible to factorise Cmn = G  Cmn =G and then use the factorisation of the Haar integral on G to obtain a density for Cmn =G. This is possible e.g. for the ane group G acting on Cmn , where m > n. To describe this, it is convenient rst to identify Rn with the hyperplane ) ( +1 nX xi = 1  Rn+1 : 1  ? n Thus if X 2 Cm is represented by a matrix X = x1 : : : xm , then all the column sums are equal to 1. Going one step further, X is represented by the m  m matrix x y

0 = x

X= 0 I ;

where x is a (n +1)  (n +1) matrix and I is the (m ? n ? 1)  (m ? n ? 1) identity matrix. This representation makes Cmn into a group under matrix multiplication. If G is the set of nonsingular ane transformations Cmn ! Cmn ,then g 2 G can be written  0 g= 0 I ;

where is a nonsingular (n + 1)  (n + 1) matrix and 1T a = 1T , where 1T = (1; : : : ; 1). Then G is a subgroup of Cmn . For every X 2 Cmn , it is possible to make the factorisations,



 

X = x0 yI = x0 I0

I 0 s I 0 yx 0 0 I = 0 I 0 I ;

where s is an invariant that can be interpreted as the ane shape of X . From the theory of the Haar integral, if G is a locally compact group with Haar measure dhG and H  G a normal subgroup with Haar measure dhH , then G=H has a Haar measure dhG=H and

Z

G

'dhG =



Z

Z

H

G=H

'dhH dhG=H :

(2)

If H is not normal but there exists a G-invariant measure dhG=H on G=H , then (2) is still valid. Now G  Cmn is not a normal subgroup, but the factorisation shows that there exists a Cmn -invariant integral on Cmn =G and this yields a density of ane shape, by (2). This formula is analogous to Denition 3.2 and envisages another, canonical, way to the density of shape. Note that the parametrisations are dened by intrinsic properties of Cmn only. Example 3.1. As an illustration of Denition 3.1 and 3.2, let G be the group of nonsingular ane transformations R2 ! R2 . As usual extend G to the space C42 , which consist of all ordered four point congurations in R2 . Using matrix notation, we write x x x x  X = y1 y2 y3 y4 2 C42; 1

2

3

8

4

where each column represents a point in R2 . Let : R2

1







 3 b ! 0 01 00 bb12 2 C42 be a parametrisation of shape and

 

? g : A 3 a ! ga () = aa11 aa12  + aa1 2 G; det(faij g) 6= 0; 2 21 22

be a parametrisation of G, where A  R6 is open and dense. Then  in Denition 3.1 is given by

a

 : A  R2 3 (a; b) ! a11 21

a12 a1 a22 a2

 01 @0

1

0 0 b1 1 0 b2A 2 C42: 1 1 1 1

(3)

 has a dense open range in C42 and  : A  R2 !  (A  R2 ) is a C 1 -

dieomorphism. If  2 L1 (C42 ) is a density function, inserting  in Denition 3.2, gives us a density function of ane shapes for C42 . Examples will be given below. Theorem 3.2. Let  2 L1(Cmn ), be a density function, g : A ! ga 2 G a parametrisation of G and  a parametrisation of shape. If ga0 2 G is a C 1 dieomorphism, then



D (;  ) = D ? det ga0 0   ga0 ;   :

Proof. It follows that

 : A  B 3 (a; b) ! ga   (b) 2 U  Cmn is a C 1 -dieomorphism. Set

h : A  B 3 (a; b) ! ?1  ga?01   (a; b) 2 A  B: Then h is a C 1 -dieomorphism and since ga0 2 G, this implies that pB  h is the identity on B . By using h as a change of variables in D(j det ga0 0 j  ga0 ;  ), the theorem is proved. As a consequence of Theorem 3.2, neither scaling nor translation of the density  2 L1 (Cmn ), aect the density of ane or positive similarity shape.

4 Density of ane and similarity shape We will now focus on the ane and positive similarity groups of transformations.

4.1 Theory

Let us start with a parametrisation of Cmn as in Denition 3.1, when m  n + 2 and G is the group of ane transformations. 9

Proposition 4.1. Let  2 L1(Cmn ) be a density function for Cmn , where m  n + 2, and let G be the group of nonsingular ane transformations Rn ! Rn with the parametrisation

g : A 3 a = (fyij g ; ftk g) ! ga () = fyij g () + ftk g 2 G; det fyij g 6= 0; where fyij g is an n  n matrix, ftk g is an n  1 matrix and A  Rn2  Rn . Furthermore, let

?



 : Rn(m?n?1) 3 fbij g ! I 0 fbij g 2 Cmn be a parametrisation of ane shape, where I is the (n  n) identity matrix and fbij g is a (n  (m ? n ? 1)) matrix. Then the density of ane shape is given by

Z

D(;  )(b) = jdet fyij gjm?n?1    (a; b)da; and

D(;  ) = D(jdet C jm   f;  )

for every nonsingular ane transformation f (b) = Cb + d. It is easily seen that  fullls Denition 3.1. All that has to been done then is to compute the functional determinant of 0 . The details are left to the reader.

4.2 Examples and applications

In this section we will give some examples where the density of shape is possible to compute analytically. We will also show how our framework can be used for a solution of Sylvesters problem. Example 4.1. Consider linear 3-point congurations C31, where the points are uniformly and independently distributed on [0; 1]. Let denote the density function. Then the density function on C31 is

(x1 ; x2 ; x3 ) = (x1 ) (x2 ) (x3 ); where

 0 jx ? 1=2j > 1=2 (x) = 1 jx ? 1=2j  1=2 :

(4)

Let G be the group of nonsingular ane transformations l ! l. This group can be parametrised by

g : A 3 = (a; t) ! g () = a  +t 2 G; a 6= 0: Choose as a parametrisation of ane shape

?



 : R 3 x ! 1 0 x 2 C31: Set

 : A  R 3 ( ; x) ! g   (x) 2 C31 : 10

The density of ane shape is given by

Z

D(;  )(x) =    ( ; x)jajd =

Z

A

This gives

8 < D(;  ) = :

A

(a + t) (t) (ax + t)dadt:

1 3(x?1)2 1 31 3x2

x < 0; x 2 [0; 1]; x > 1: In computing this, we have used the fact that D(;  )(x) = D(;  )(1=x)x?2 ,

which is obtained by a change of variables in the integral. Figure 3 shows the results of a simulation. A sequence of point congurations were drawn, each with the density function . From the map  , a unique x was obtained and the histogram for that variable is shown to the right. D(;  )(x) is shown to the left. 700

0.3

600

0.25

500

0.2

400

0.15

300

0.1

200

0.05

100

0 −4

−3

−2

−1

0

1

2

3

4

5

0 −4

−3

−2

−1

0

1

2

3

4

5

Figure 3: Computed density function and simulated.

Example 4.2. Let

!

4 X (x) = 12 exp ? x2i ;

i=1 1 be a density function on C4 , in the case of four independent, normally distributed

points on a line l, with equal means. Let G be the group of nonsingular ane transformations l ! l. As above we parametrise G by

g : A 3 = (a; t) ! g () = a  +t 2 G; a 6= 0 and as a parametrisation of shape we choose

?



 : R2 3 (x; y) ! 1 0 x y 2 C41 : Set

 : A  R2 3 ( ; x; y) ! g   (x) 2 C41 :

Then the density of ane shape is

Z

D(;  )(x; y) =    ( ; x; y)a2 d ; A

11

which yields

D(;  )(x; y) = 12

Z A





exp (a + t)2 + t2 + (ax + t)2 + (ay + t)2 dadt:

A symbolic computation, e.g. by means of the computer program Maple, gives D(;  )(x; y) = 2 ?3 ?1 + x2 + y2 ? 2 (x + y + xy)?3=2 :



More generally, if the densities of the four points have dierent means mi ,

i = 1; 2; 3; 4, but still equal standard deviations, i.e.

!

4 X (x) = 12 exp ? (xi ? mi )2 ;

i=1



then where

and



D(;  )(x; y) = 2 p?3=2M 1 + 2q ; p = 3(1 + x2 + y2 ) ? 2(x + y + xy); q = f?3m1 + m2 + m3 + m4 + y (m1 + m2 + m3 ? 3m4) + x (m1 + m2 ? 3m3 + m4 )g2 p?1

0 4 !2 4 1 X X 1 1 mi ? m2i + 4 qA : M = exp @ 4 i=1

i=1

Example 4.3. Let (x; y) =

Y4 i=1

(xi ) (yi );

where (x) = ?1=2 e?x2 , be the density for four points in a plane. Let

g : A 3 = (fyij g ; ftk g) ! g () =

y

11 y21



 

y12 ? + t1 ; det fy g 6= 0; ij y22 t2

be a parametrisation of the group G of nonsingular ane transformations R2 ! R2 , where A  R6 is open and dense. Choose 1 0 0 x  2  : R 3 (x1 ; x2 ) ! 0 1 0 x1 ; 2 as a parametrisation of shape. Set

 : A  R2 3 ( ; x) ! g   (x) 2 C42 : Then the density of shape is

Z

D(;  )(x) = jdet fyij gj    d : A

12

After tedious symbolic computations, see section 6.1, we obtain D(;  )(x) = 21p2 ?1 ? x1 ? x2 + x22 + x21 + x1 x2 ?3=2 : As in Example 4.1 a simulation was performed here and in the same manner (x1 ; x2 ) was computed from ?1 . The results are shown in Figure 4, where the simulated data are shown to the right. Assume now that the points are normally 4

4

3

3

2 2

1 1

0 0

−1

−1

−2

−2

−3

−3 −4 −3

−4 −3

−2

−1

0

1

2

3

−2

−1

0

1

2

3

4

Figure 4: Computed density function and simulated. distributed, with dierents means mj , j = 1; 2; 3; 4 but with the same standard deviation, i.e.

Y4

(xj ? mxj ) (yj ? myj ); j =1 where (x) = (22 )?1=2 e?x2 =(22 ) . By Theorem 3.2, with ga0 : R2

(x; y) =

3 v 7! Rv ? m, where R is a rotation 2matrix and m is a vector, it is no restriction to assume that (x) = ?1=2 e?x and that m1 = (0; 0) and m2 = (0; my2 ). It

is then possible to write the density of shape as an integral in one dimension, which generally has to be evaluated numerically. As an example, assume that m2 = (0; 1) m3 = (1; 1) and m4 = (1; 0). The density of shape is then given by (see section 6.1) Z 1 u(x; y; !) 1 D(;  ) = 2 ! d!

where

u(x; y; !) =

and

0

4!(3a + !2 ? b) cos( a+c!!2 ) + 2c(a ? !2 ) sin( a+c!!2 ) ? ba+2+!!22 e ; (a3 + 3a2 ! + 3a!4 + !6 )

a(x; y; !) = (x + y)2 + (x ? 1)2 + (y ? 1)2 ; b(x; y; !) = (x + y)2 + (x ? 1)2 ; c(x; y; !) = 2(1 ? y):

The density function can be found in Figure 4.3. 13

4

3

2

1

0

−1

−2

−3

−4 −3

−2

−1

0

1

2

3

4

Figure 5: Computed density function. These densities D(;  ) of four points in a plane can be used to limit the search area in a hash table. For a set of planar objects, four feature points are extracted of each to give the set fXj gn1 . The ane shape s(Xj ) = (xj ; yj ) 2 R2 is computed and stored in a hash table fs(Xj )gn1 . If we assume that the feature points Xj have a normal independent density function j , it is possible to compute the density of shape D(j ;  ), by above. Set

b (j ) =

) Z (x; y) D(j ;  ) > a; D(j ;  )dxdy = b ; D(j ; )>a

(

where 0  b  1 is set by an operator. For an unknown object, the four feature points are extracted (Y ) and the shape s(Y ) is computed. We identify Y as object j in the hash table if Y 2 b (j ).

Example 4.4. An interesting situation for C42, is when the points are independently and uniformly distributed in [0; 1]  [0; 1]. That is, (x; y) =

Y4

i=1

(xi ) (yi );

where is dened as in (4). With the parametrisation of G of Example 4.3, and   (5)  : R2 3 (x1 ; x2 ) ! 10 01 x01 x0 2 C42 2 as a parametrisation of shape, it is possible to compute the density of shape in closed form, though some eort is needed. 14

That  is in fact a parametrisation of shape can be seen if, given a point conguration X = (p1 ; p2 ; p3 ; p4 ) 2 C42, we let tT = (t1 ; t2 ) be the intersection of the lines obtained by adjoining the points p1 with p3 and p2 with p4 . Thus

y

11 y21

and

x



y12 = ?p ? t p ? t 1 2 y22



 

0 = y11 y12 ?1 ?p ? t p ? t : 1 2 y21 y22 0 x2 This computation is possible for almost all X 2 C42 . The density of ane shape, given as an integral, is 1

Z

D(;  )(x1 ; x2 ) = j1 ? x1 jj1 ? x2 j jdet(A)j    (y; x)dy and when computed, it turns out to be a piecewise rational function in R2 , (see Section 6 for the formula). By Theorem 3.2, the result is independent of the side lengths of the rectangle and/or translation. Example 4.5. As an alternative parametrisation of shape, we use the linear space s(X ) of (1). If X 2 Cmn , then dim sP (X ) = 1, and can thus be represented by a vector s = (s1 ; s2 ; s3 ; s4 ), where si = 0. If the convex hull of the four points of X is a quadrangle, then s(X ) contains an element of the form s = (u; v; 1 ? u; ?1 ? v). Using this parametrisation by (u; v), early simulations in [Wer93] indicated that, under the assumptions of this example and a density function for C42 as in Example 4.4, the density of shape is uniform in the set

= f(u; v) ju 2 [0; 1] v 2 [?1; 0] g : (To check this hypothesis was in fact a starting point for this study.) We are now able to disprove it. In fact, the relation between the two parametrisations is x1 = u ?u 1 ; dx1 = ? (1 ?u u)2 du; x2 = 1 +v v ; dx2 = (1 +1 v)2 dv: Using Theorem 3.1, the density with respect to the (u; v)-parameters can be computed from that for (x1 ; x2 ). The tedious computations are done in Section 6.2, and shows that the hypothesis is false, i.e. that the density is not uniform.

Example 4.6. Sylvester: What is the probability that four points, randomly drawn according to a uniform density function in a rectangle, form a convex set? By convex here we mean that no point belongs to triangular region spanned by the others. Since convexity is a property, that is invariant under ane transformations, we can use the density of ane shape to solve this problem. Let  and D(;  ) be as in Example 4.4. The four points form a convex set if and only if x1 and x2 have the same sign. Hence P (not convex) =

Z



15

D(;  )(x; y)dxdy;

where = f(x; y)jx < 0; y > 0g[f(x; y)jx > 0; y < 0g. Because of the simplicity of D(;  ) for the non convex situation, see Section 6.2, compared to the convex situation, we choose to compute P (not convex). As is seen in Section 6.2, we have 8 j1 ? x jj1 ? x jf (x ; x ); x1 2 [?1; 0]; x2 2 [0; 1] > 2 < j1 ? x11 jj1 ? x22 jf (x11; 1=x 3 ) = j x j ; x1 2 [?1; 0]; x2 > 1 2 2 D(;  )(x; x2 ) = > j1 ? x1 jj1 ? x2 jf (1=x1; 1=x 3 3 ) = j x j = j x j ; : j1 ? x1 jj1 ? x2 jf (1=x1; x2 )=2jx1j32; 1 xx11 2 [01 ; 1]; where f (x1 ; x2 ) = 72(1 11 ? x )3 : 1

If we note that D(;  )(x1 ; x2 ) is symmetric with respect to x1 = x2 , an easy 11 , which in turn gives P (convex) = 25 . computation gives P (not convex) = 36 36 We now turn to some examples of shape for the positive similarity group in R2 . Example 4.7. Let  2 L1(C32) be a density function, G the set of nonsingular positive similarity transformations R2 ! R2 with parametrisation





 

? g : A 3 = (a; b; t1 ; t2 ) ! g () = ab ?ab  + tt1 2 G; a2 + b2 6= 0 2

and

1



 3 (x; y) ! 0 x0 y0 2 C32 ; a parametrisation of shape. Set

 : A  R2 3 ( ; x; y) ! g   (x; y) 2 C32 : The density of shape is : R2

Z

D(;  )(x; y) = (a2 + b2)jx ? yj   ( ; x; y)d : A

Now consider the special case of three points that are uniformly and independently distributed in the set [0; 1]  [0; 1], that is

(x; y) =

Y3

i=1

(xi ) (yi );

where is dened as in (4). By Theorem 3.2, the density of shape is independent of scaling, rotation and translation of . This density is possible to compute analytically. Since D(;  )(x; y) = D(;  )(y; x) and D(;  )(x; y) = D(;  )(?x; ?y), it is enough to compute D(;  ) in the triangle y  jxj. We omit the details. Example 4.8. We proceed as in Example 4.7, but with the points being independently distributed with normal density

!

3 ? X  x2i + yi2 2 L1 (C32 ); (x; y) = 13 exp ?

i=1

16

having equal mean and standard deviation. The density of shape is, 3 jx ? yj D(;  )(x; y) = : 4 (1 + x2 + y2 ? xy)2 If we allow the points to have dierent means (mxi ; myi ), i = 1; 2; 3 but equal deviations, i.e.

!

3 ? X  (x; y) = 13 exp ? (xi ? mxi )2 + (yi ? myi )2 2 L1 (C32 );

i=1

then the density of shape becomes  1 q2 + q2  3 j x ? y j D(;  )(x; y) = 4p2 1 + 3 1 2p 2 C1 C2e2r=3; where p = 1 + x2 + y2 ? xy; q1 = 2my1 ? my2 ? my3 + (mx1 + mx2 ? 2mx3 )y + (mx1 ? 2mx2 + mx3 )x; q2 = 2mx1 ? mx2 ? mx3 + (2my2 ? my1 ? my3 )x + (2my3 ? my2 ? my1 )y Ci = eqi2 =(6p) ; i = 1; 2; and 3 ? 3 ? X   X mxi mxj + myi myj : m2xi + m2yi + r=? i;j =1 i<j

i=1

Remark. For a density of shape for Cm2 , m  3, when G is the group of positive similarity transformations R2 ! R2 , we can use

1



: : : x1m ;  3 x ! 0 01 xx11 21 : : : x2m as a parametrisation of shape and compute the density of shape explicitly for a given m. For another treatment of this example see [MD89]. : R2(m?2)

5 Density of projective shape

In this section, we will derive a parametrisation for Cmn , as in Denition 3.1, when m  n + 3 and G is the group of nonsingular projective transformations Cmn ! Cmn . There are also important projective invariants that however are not complete, i.e. not shape. Below, we will use the parametrisation of ane shape as described in Proposition 4.1, to deduce densities for these. Let Pn be the projective space, coming from Rn by adjoining points at innity, and let G be the group of nonsingular projective transformations Pn ! n is the set of n-point congurations in Pn , the space of orbits Pn. Then, if C~m ~Cmn =G is called the projective shape space. As before, let s : C~mn ! C~mn =G; 17

be the natural projection. We call s(X~) the projective shape of X~ 2 C~mn . We will now try to nd a parametrisation of projective shape and a parametrisation of G, when m  n + 3. Since the probability functions are in L1 (Cmn ), the points at innity are irrelevant and it is enough to consider only Cmn . It will then be necessary to cut down G a little in order not to send points to innity. Pn can be identied with Rn+1 n f0g, by identifying two points x1 ; x1 2 n +1 R n f0g if x1 = x2 , for some  6= 0 . It is customary to embed Rn in Rn+1 by identifying Rn with points (x1 ; : : : ; xn ; 1) 2 Rn+1 . The same is done for C~mn . Set B = Rn(m?n?2) and let  ? (6)  : B 3 fxij g ! I 1~ x~ ; be a parametrisation of shape for C~mn , when m  n + 3. Here I is the (n + 1)  (n + 1) identity matrix, ~1 a (n + 1)  1 matrix with entries ~1i = 1, and x~ a matrix with entries x~ij = xij for i  n and x~(n+1);j = 1. Let G0  G, be the subset of G, consisting of transformations, not sending points to innity. As a parametrisation of G0 , we choose

g : A  Rn 3 (y; u) ! g(y; u) 2 G0 ; where





(7)





A = y det 1fy: :ij:g1 6= 0  Rn(n+1) (8) is dense and open and fyij g is a n  (n + 1) matrix. In order to dene g, let u = (u1 ; : : : ; un ; 1 ? and

k(x; u)?1 =

For x 2 Pn, set

nX +1 1

n X 1

ui )

ui xi

 fy g 

gi (y; u)(x) = 1 : :ij: 1 x; i = 1 : : : (n + 1);



and, for m  n + 3,



gn+2 (y; u)(x) = 1fy: :ij:g1 diag(u)x;

 fy g 

gm (y; u)(x) = 1 : :ij: 1 diag(u)xk(x; u): Now

 : (A  Rn )  B 3 (y; u; x) ! g(y; u)   (x) 2 Cmn ;

(9)

is dened almost everywhere and there exist dense and open U  Cmn and V  (A  Rn )  B , such that  : V ! U is a C 1 -dieomorphism. 18

We illustrate this for n=1 and m = 4. Then





X = x11 x12 x13 x14 :

x x  M = 11 12 ; 1 0 u v 

If then

M ?1 X = 0 1 u1 v1 2 2



and



?1 ?1 diag(u)?1 M ?1 X = u10 u0?1 11 uu1?1 vv1 : 2 2 2 P With xk = u?k 1 vk =( j vj ), we have



P



?1 x) : X = M diag(u) u01 u0?1 11 xx1 kk((u; u; x) 2 2

Since n1 +1 uj = 1 and y = y for  2 R n f0g and y 2 Pn, this shows that this is a parametrisation of U . As a dense open subset we can choose







V = A  (u; x) k(x; u)?1 6= 0; uj 6= 0; j = 1; : : : ; n + 1 ; (10) where A is given by (8). For n > 1, the same argument holds, but the notation

gets more complicated.

 can now be used to obtain a density of shape as in Denition 3.2. A dierence from before, is that we do not integrate over all of G. However, G n G0 applied to the image  (B ) give points that are not in the domain of L1 (Cmn )n. We state this parametrisation of U  Cmn as a theorem. Theorem 5.1. Let  2 L1(Cmn ), m  n +3, be a density function,  a parametrisation of projective shape, dened as in (6) and let G0 be the set of nonsingular projective transformations  (B ) ! Cmn , parametrised as in (7). Then, if  is given by (9), the density of projective shape is given by

D(;  ) =

Z

AR





   det 0 dydu: n

Remark. When n = 1 and m = 4, we get the density for the well known cross

ratio of four points on a line. Closely related to projective shape are projective invariants. These are invariant under nonsingular projective transformations. However if X and Y have dierent projective shape, that is they do not belong to the same orbit, they need not necessarily have dierent projective invariants. Thus, projective invariants carry, in general, less information than projective shape and in these situations they are said to be not complete. The cross ratio is one example of a projective invariant, which also happens to be projective shape, that is a complete invariant. As noted above, we have already obtained a density in this case, by setting m = 4 and n = 1 in Theorem 5.1. More generally, almost all 19

X 2 Cnn+3  C~nn+3 can be transformed by some some nonsingular projective transformation to

I

0 1

0 1 1

x



~n xn+1 2 Cn+3 ;

and quotients qij = xi =xj are projective invariants . If it is enough to consider only one such projective invariant at a time, we can take the way around density of ane shape to obtain densities of these. We will describe this into some detail below. Let  be a parametrisation of ane shape for Cnn+3 , dened as in Proposition 4.1, i.e. ?   : Rn  Rn 3 (x; y) ! I 0 x y 2 Cnn+3 : Embed  (Rn ; Rn ) in C~nn+3 as above and multiply  (x; y) from the left by a nonsingular projective transformation P1 , to obtain





xn y n 2 C~n : P P1  (x; y) = I0 01 1 ? P n+3 x 1 ? i 1 1 yi Assume that the density for the variables (x; y) is known, that is the density of ane shape D(; P ). Then, it is possible toPcompute the density for the variables xi , yi , xn+1 = 1 ? n1 xi and yn+1 = 1 ? n1 yi . Hence for all x in a dense open subset U  Rn there exists a nonsingular projective transformation P2 , such that I 0 1 z  2 C~nn+3 ; P2 P1  (x; y) = 0 1 1 z n+1 P P where zi = yi =xi , i = 1; : : : n and zn+1 = (1 ? n1 yi )=(1 ? n1 xi ). Quotients of these zi are now projective invariants, and it is seen that there are n independent such invariants. It is also seen that there are two types of quotients - those that do not include zn+1 and those that do. We call the rst type A and the latter type B. The densities for these types is the content of the next theorem. Theorem 5.2. Let  2 L1(Cnn+3) be a density function and  a parametrisation of ane shape, dened as in Proposition 4.1, by ?   : Rn  Rn 3 (x; y) ! I 0 x y 2 Cnn+3 : Then the density for projective invariants, of type A and B, are given by:  Type A: i = xy11 = xyii , (i ) =

Z

D(;  )(x; i tx1; y2    ; yi?1 ; txi ; yi+1;    ; yn) jtx1 xi j dxdydt a:e:;

for i = 2;    ; n.

Pn

 Type B: n+1 = xy11 = 11??Pn11 xyii ,

Z (n+1 ) = j 1 ? 1j D(;  )( ; x2    ; xn ; tn+1 ; y2    ; yn ) j j dxdydt a:e:; n+1 where x = (x2 ;    ; xn ), y = (y2 ;    ; yn), Pn 1) ? (Pn y ? 1) 2 i = t ( 2 xi(? n+1 ? 1) t 20

P P ( n2 yi ? 1) ? n+1 t ( n2 xi ? 1) : = (n+1 ? 1) t For the proof, a few lemmas are needed. Lemma 5.3. If  2 L1(Rn ) is a density function, then the density function for xij = xi =xj and xk := xk , k 6= i; j , is given by and

Z

~ =   f jxj jdxj a:e:: Moreover ~ 2 L1 , where f : Rn ! Rn , is dened by fk (x) = xk for k 6= i and fi (x) = xij xj . Proof. We need only consider the two dimensional case, that is to nd

P (xi =xj < xij ): It is easily seen that this probability is

F (xij ) =

Z0

Z1

xj =?1 xi =xj xij

(xi ; xj )dxi dxj +

Z 1 Z xj xij xj =0 xi =?1

(xi ; xj )dxi dxj :

Dierentiation gives

dF = Z (x x ; x )jx jdx ; a:e:; ~ = dx j ij j j j ij

which is the density dened almost everywhere. That ~ 2 L1 follows, for example, from Fubinis theorem. Before the next lemma, recall that the pullback of a distribution u by a C01 dieomorphism f , is dened by (f  u; ') = u; '  f ?1j det(f ?1 )0 j); where ' 2 C01 . Lemma 5.4. If  2 L1(Rn ) is a density P function, then the density distribution for xi , i = 1; : : : ; n and xn+1 = 1 ? i xi is given by ~ = f ((t) 0 );

P

where f  is the pullback dened by f (x) = (x1 ;    ; xn ; n1 +1 xi ? 1) and 0 is the Dirac measure in the variable xn+1 . Proof. Set ) ( n X

= x xi  ti ; 1 ? xi  tn+1 : i

Let i , i = 1; : : : ; n, be the characteristic function of

i = fx j xi  ti g ; 21

and let n+1 , the characteristic function of

) ( X n

i = x 1 ? xi  tn+1 : 1

The probability P (x 2 ) is given by

Z nY +1

P (x 2 ) = F (t) =  Dierentiation gives

@nF = @t1    @tn

0

(t1 ;    ; tn )

1

i dx:

Pn+1 t  1 P1n+1 ti > 1 1

i

a:e:;

which in turn gives n+1 ~ = @t @   @tF 1

n+1

= (t1 ;    ; tn )1?t1 ?tn :

Here the derivative is taken in distribution sense. Proof of Theorem 5.2. We start by proving the type A part: By using Lemma 5.3 twice, we obtain the density for t1 = y1 =x1 and ti = yi =xi as

^(t1 ; ti ) =

Z

  (f; g)jx1 xi jdxdy^;

where fi (x; y) = xi , i = 1; : : : ; n, g1 (x; y) = t1 x1 , gi (x; y) = ti xi , gk (x; y) = yk for k 6= 1; i and dy^ means integration over all yk , such that k 6= 1; i. The density we are looking for is for i = t1 =ti and using Lemma 5.3 again and setting t = ti gives Z ~(i ) =   (f; g)jtx1 xi jdxdy^dt; where (f; g) is as before except for g1(x; y) = i tx1 and gi (x; y) = txi . This proves the rst part. ToR prove the formula for the type B invariant, we observe that if 2 C01 , with dx = 1, and we set  = ?1 (x=), then  ! 0 in D0 , i.e. in distribution sense. By Lemma 5.4, the density for x, y, xn+1 and yn+1 is

g ((x; y) 0 0 ); where x~ = (x; xn+1 ), y~ = (y; yn+1 ), 0 0 operates on (xn+1 ; yn+1 ) and the pullback g is dened as in Lemma 5.4, with obvious modications. Then f = g f(x; y)  (xn+1 )  (yn+1 )g ! g((x; y) 0 0 ) in D0 . For f , we can apply Lemma 5.3 to obtain the density ~ (s; t) of s = y1 =x1 and t = yn+1 =xn+1 . This gives

~ (s; t) =

Z

(x; sx1 ; y2    ; yn )  22

nX +1 1

!

xi ? 1 





sx1 +

n X 2

!

yi + txn+1 jx1 xn+1 j dx~dy2    dyn :

The density for  = s=t is then

~ () =





Z

tx1 +

The change of variables

(x; tx1 ; y2    ; yn )  n X 2

1

!

!

xi ? 1 

yi + txn+1 jx1 xn+1 j dx~dy2    dyn dt: x1 :=

nX +1

1 xi := xi ; yi := yi ;

and

nX +1

xi ;

n X

xn+1 := tx1 +

2

i = 2    n; yi + txn+1

with determinant t(1 ? ), implies Z ~ () = ( ; x2    ; xn ; t ; y2    ; yn )  (x1 ? 1)

j dxdy    dy dt;   (xn+1 ? 1) jj n ? 1j 2

where

= xn+1 ? tx1 + t

and

n X

= tx1 ? xn+1 ? t

2

xi ?

n X 2

n ! X

xi +

yi = (( ? 1) t)

2

n ! X

yi = (( ? 1) t) :

2

By another change of variables x1 := (x1 ? 1)=, xn+1 := (xn+1 ? 1)= and by letting  ! 0 we get

~() =

Z



j ( ; x2    ; xn ; t ; y2    ; yn ) jj ? 1j xx1 =1=1 dx2    dxn dy2    dyn dt; n+1

with convergence in D0 .

We now focus on the cross ratio of four points on a line. Densities for this ratio have been computed before, for the situation when the points are normally and independently distributed with identical means and deviations, [May93]. For the situation of uniform density for the points, see [Åst96]. The appearances of these two densities are very similar and there are in fact many features for the cross ratio that generally apply when the points are distributed with the same densities. For example, the density of the cross ratio is symmetric with respect to x = 1=2, which was pointed out in [May93], and it is also easy to see that the density tends to innity at x = 0 and x = 1. In fact, we have the following more general result about when the density function tends to innity at x = 0 and x = 1: 23

Theorem 5.5. Let  2 L1(C41) be a density function for four points on a line,

dened by

(x) =

Y4 i=1

i (xi );

where i are one dimensional densities. Let M 2 R and let be the density for the cross ratio corresponding to , dened as in Theorem 5.1. Then 1. if Z Z 1 (x)2 (x)dx > 0; 3 (x)4 (x)dx > 0; there exists an open neighbourhood U1 3 1, such that (x) > M for almost all x 2 U1 . 2. If Z Z 1 (x)3 (x)dx > 0; 2 (x)4 (x)dx > 0; then there exists an open neighbourhood U0 3 0, such that (x) > M for almost all x 2 U0 . Proof. The requirements of Theorem 5.1 are satised if we set u = (u; 1 ? u) and k(x; u)?1 = xu + 1 ? u = 1 + u(x ? 1). As in (10), let  V = x 2 R4 j x1 6= x2 ; x3 6= 0; x3 6= 1; 1 + x3 (x4 ? 1) 6= 0 : Then   ? 4

 : V 3 (a1 ; a2 ; u; x) ! a1 a2 10 01 1 ?u u k(1ukx ? u) 2 R belongs to C 1 , and  : V !  (V ) is a dieomorphism. Hence the density for the cross ratio is Z a2 )2 ju(1 ? u)j  da da du: (x) = (1 (+a1u?  1 2 (x ? 1))2 R R Since 1 2 dx > 0, 3 4 dx > 0 and i  0 almost everywhere, there exist R~1 ; ~2 2 C0+ , such that ~1  1 ; 2 and ~2  3 ; 4 almost everywhere and ~i dx > 0, i = 1; 2. Set ~ (x) = ~1 (x1 )~1 (x2 )~2 (x3 )~1 (x4 );

and let, for small  > 0, x 2 1 + [?; ] = U , u 2 [?1= + ; 1= ? ] = T and  S = (a1 ; a2 ) a21 + a22  d; ja1 ? a2 j  1 : For x 2 U , set Z (a1 ? a2 )2 ju(1 ? u)j~  da da du: ~(x) =  1 2 S T (1 + u(x ? 1))2 Then ~ is continuous on U and (x)  ~(x) for almost all x 2 U . Introduce the change of variables b1 = a1 , b2 = a2 , b3 = (a1 ? a2 )u + a2 . Set S 0 = S and let T 0 be the image of S  T 3 (a1 ; a2 ; u) ?! (a1 ? a2 )u + a2 : 24

Then

Z

jb3 ? b2 jjb3 ? b1 j ~ (b )~ (b )~ (b )2 db: 1 1 1 2 2 3 jb1 ? b2 j S T R R Since 22 dx > 0, there is a c > 0, such that T jb3 ? b1 jjb3 ? b2 j2 (b3 )2 db3  c for all (b1 ; b2 ) 2 R2 , if  is small enough. This implies that ~(1) =

0

0

0

~(1) > c

Z

S

1

0

jb1 ? b2 j (b1 )(b2 )db1 db2 :

The right hand side of this inequality can be made arbitrarily large by choosing 1 small and d large. Since (x)  ~(x) almost everywhere on U and ~ is continuous, the theorem is proved for a neighbourhood of x = 1. The situation x = 0 is treated in the same way.

5.1 Examples

Example 5.1. For four points on a line, the cross ratio is a projective invariant.

This is exactly the type B density in Theorem 5.2, with ? t) = ((1 k ? 1)t and ?1 = (kt k ? 1)t :

Let  2 L1 (C41 ) be a density function,  a parametrisation of ane shape as in Proposition 4.1 and D(;  ) the corresponding density of shape. Then by Theorem 5.2, the density of the cross ratio is Z (k) = jk ?1 1j D(;  )( ; tk )j jdt: We can for instance apply this to Example 4.2, where the density of ane shape for four normally and independently distributed points, with dierent means, is given. However, it seems dicult to compute analytically in this case. Example 5.2. For ve normally distributed points with arbitrary means in the plane, it is straight forward to compute the density of ane shape with the parametrisation of shape given as in Proposition 4.1. The obtained density function can be used together with Theorem 5.2. The resulting densities of projective invariants will be given by triple integrals.

6 Appendix We have postponed some computations to this section in order not to obscure the main arguments of the text.

25

6.1 Computations of Example 4.3 By an obvious coordinate change we get

Z

D(;  )(x1 ; x2 ) = jy11y22 ? y12y21jf (y11 + t1)f (y12 + t1)f (t1) f (y11 x1 + y12 x2 + t1 )f (y21 + t2 )f (y22 + t2 )f (t2 )f (y21 x1 + y22 x2 + t2 )dyij dtk ;

where

f (x) = p1 e?x2 :

Set y = (y11 ; y12 ; y21 ; y22)t and integrate over t1 and t2 . Then

Z

D(;  )(x1 ; x2) = C jy11y22 ? y12y21jehy;Q(x1;x2)yidy; where C is a constant, Q(x1 ; x2 ) is the symmetric matrix

0 1 x + 3 ? 3 x2 p(x ; x ) 0 2 1 4 4 1 1 2 13 2 3 2 B p ( x ; x ) x ? ? x 0 1 2 2 2 4 4 2 1 Q(x1 ; x2 ) = B 3 3 2 @ 0 0 x + 1 2 4 ? 4 x1 0

0

p(x1 ; x2 )

0 0

p(x1 ; x2 ) 1 x2 ? 3 ? 3 x2 2 2 4 4 2

and p(x1 ; x2 ) = 41 (1 ? 3x1 x2 + x1 + x2 ). There are two eigenvalues 1 (x1 ; x2 ) and 2 (x1 ; x2 ) of Q(x1 ; x2 ), each with a multiplicity of two. Since Q(x1 ; x2 ) is symmetric, the eigenvectors can be used as a new orthogonal basis, which gives

Z



D(;  )(x1 ; x2 ) = C (1 2)?1=2 y111y222 ? y121 y213 e?jyj2 dyij = = C (1 2 )?3=2

The eigenvalues fulll Since

we get

Z

Z

jy11 y22 ? y12 y21 je?jyj2 dy:



?

1 2 = 12 1 ? x1 ? x2 + x21 + x22 + x1 x2 : 1

dx dx = (1 ? x1 ? x2 + x22 + x21 + x1 x2 )3=2 1 2 Z p 1 dudv = 2 2; 2 2 3 = 2 2(2=3 + 3=4u + 1=4v )

D(;  )(x1 ; x2) = 21p2 (1 ? x1 ? x2 + x22 + x21 + x1 x2)?3=2 : For dierent means mj , j = 1; 2; 3; 4, it does not seem possible to obtain a closed form solution of D(;  ). The density can be given as a one dimensional integral though, which has to be evaluated numerically. 26

1 CC ; A

Let

 ta t > 0 0 t0 ;

0

t0 jtja t < 0 : It can be shown that that the Fourier transformation jbtj is a tempered distributa+ =

tion given by

ta? =



?

jbtj = ?2!?2 = ?2 !+?2 + !??2 ;

where t?k = t?+k +(?1)k t??k for k = 0; 1; : : : and (t) = (?t). The distribution !+?2 acts on a test function 2 S (R), by

?!?2; (!) = ? Z 1 ln(!) 00(!)d! + +

and Thus

0 (0)

0

?!?2; (!) = (!?2; (!)) = ? Z 1 ln(!) 00(?!)d! ? ? ?

(jbtj; (!)) = 2

0

Z1 0

ln(!) ( 00 (!) + 00 (?!)) d! = ?2

0 (0)

Z 1 0(!) ? 0(?!) d!: ! 0

as lim!!0 f 0 (!)? 0 (?!)g!?1 is bounded. Let n be the characteristic function of ft j jtj  ng . Then Z n jtj = 21 ei!t [ n jtj(! )d! and Z n jdet fyij gj    d = A

Z

1 Z [ n jtj(! ) 2

by Fubini. Set un = n jtj and

=



A

Z A

   ei! detfyij g d

d!;

   ei! detfyij g d

where    ei! detfyij g = ep , with p being a polynomial of degree 2. be computed analytically from the formula

Z

e?(z1 t2 +z2 t) dt = ez22 =(4z1 )

can thus

r

z1 ;

which is obtained by changing the path of integration to the complex plane. It follows that   (un  det fyij g ;    ) = 21 [ n jtj; :

Since both sides are continuous functions of un, limn!1 un = jtj and limn!1 u^n = jbtj in D0 it follows that   D(;  ) = 21 jbtj; : 27

The function (x; y; !; m) =

Z A

   ei! detfyij g d

for general means mj , j = 1; : : : ; 4, is straight forward to compute but is not presented here for aesthetic reasons. Let us instead compute D(;  ) when m1 = (0; 0), m2 = (0; 1), m3 = (1; 1) and m4 = (1; 0). Then (x; y; !) = where and

Z

?u

A

   ei! detfyij g d = ev ;

v(x; y; !) = (x + y)2 + (x ? 1)2 + (y ? 1)2 + !2 2 2 + 2! 2 + 2i! (1 ? y ) : u(x; y; !) = (x + y) + (x ?v1) (x; y; !)

D(;  ) is presented in Example 4.3.

6.2 Computation of Example 4.4

We now turn to the computations of Example 4.4. They are rather messy and are done by dividing the integration into dierent cases according to when the integrand becomes zero. A lot of cases appear, but the amount of computing can be reduced by symmetry and certain changes of variables. First note that D(;  )(x1 ; x2 ) = D(;  )(x2 ; x1 ) and that it is sucient to compute D(;  ) in the triangle

T = f(x1 ; x2 )j ? 1  x1  x2  1g: In fact, if for example

D(;  )(x1 ; x2 ) = j1 ? x1 jj1 ? x2j(x1 ; x2 ) 0  x1  x2  1; then

D(;  )(x1 ; x2) = j1 ? x1 jj1 ? x2 j(1=x1; 1=x2)x?1 3 x?2 3 1  x2  x1 ; which is seen by the change of variables y11 := y11 =x1 , y21 := y21 =x1 , y12 := y12 =x2 and y22 := y22 =x2 . If we start by integrating over t1 and t2 , we obtain

Z

D(;  )(x1 ; x2 ) = jy11y22 ? y12y21 jm1(y11; y12; x1 ; x2)m2 (y21; y22; x1; x2 )dy; where 0  mi are piecewise rst order polynomials in yi1 ; yi2 for xed x1 ; x2 . For the sake of completeness we give the details for D(;  )(x1 ; x2 ) when (x1 ; x2 ) 2 T , when 0  x1  x2  1:

D(;  )(x1 ; x2 ) = f135x23x1 2?105x23x1 3+66x22x1 3+51x14x2 3?15x15x2 3+3x15+ 6x1 4 x2 ? 2x1 6 ? 3x1 6 x2 2 + 3x1 6 x2 + 21x1 5 x2 2 ? 9x1 5 x2 ? 54x1 4 x2 2 + 2x1 6 x2 3 + 28

?99x1x2 3 ? 3x1 4 + 33x23 + 6x1 3 x2 ? 36x22 x1 2 g 216x?3(1?+1 x+2 x )5 1 2 when ?1  x1  0 and 0  x2  1: 11(1 ? x2 ) ; D(;  )(x1 ; x2) = 72(1 ? x 1 )2 and when ?1  x1  x2  0: D(;  )(x1 ; x2 ) = ?f?45x25 x12 ? 408x13x2 3 + 36x22x1 4 + 3x16x2 4 + 2x1 6x26 + ?3x1 6 x2 5 + 11x1 3 x2 6 + 2x2 6 + 423x1 3 x2 2 + 6x1 2 x2 6 + 3x1 x2 6 ? 198x13 x2 + 3x1 5 x2 6 + 6x1 4 x2 6 ? 18x1x2 5 + 33x13 ? 6x1 x2 3 + 3x2 4 + 9x1 x2 4 + 36x1 2 x2 2 ? 120x12 x2 3 +153x12 x2 4 ? 3x2 5 +165x13 x2 4 ? 66x13 x2 5 ? 120x14 x2 3 + 153x14 x2 4 ?45x1 4 x2 5 ?6x1 5 x2 3 +9x1 5 x2 4 ?18x15 x2 5 g=(216(?1+x2)5 x1 3 (?1+x1 )2 ):

References [Amb90] R. V. Ambartzumian. Factorization Calculus and Geometric Probability. Cambridge University Press, 1990. [Åst96] K. Åström. Invariancy Methods for Points, Curves and Surfaces in Computer Vision. PhD thesis, Lund University, Lund Institute of Technology, Department of Mathematics, 1996. [Boo86] F. L. Bookstein. Size and shape spaces for landmark data in two dimensions. Statistical Science, 1(2):181242, 1986. [GHJ92] W Grimson, D Huttenlocher, and D Jacobs. A study of ane matching with bounded sensor error. In G. Sandini, editor, ECCV'92, Lecture notes in Computer Science, volume 588, pages 291306. SpringerVerlag, 1992. [Hey95] Anders Heyden. Geometry and Algebra of Multiple Projective Transforms. PhD thesis, Lund University, Lund Institute of Technology, Department of Mathematics, 1995. [Ken89] David G. Kendall. A survey of the statistical theory of shape. Statistical Science, 4(2):87120, 1989. [May93] SJ Maybank. Probabilistic analysis of the application of the cross ratio to model based vision. Long Range Laboratory, GEC Hirst Research Centre, January 1993. [MD89] V. Mardia, K. and I. L. Dryden. Shape distribution for landmark data. Adv. Appl. Prob., pages 742755, 1989. [Spa95] G. Sparr. Structure and motion from kinetic depth. Technical Report ISRN LUTFD2/TFMA95/7016SE, Dept of Mathematics, Lund Institute of Technology, 1995. To appear in Proc of the Sophus Lie International Workshop on Computer Vision and Applied Geometry, Nordfjordeid, Norway, 1995. 29

[Wer93] Carl-Gustav Werner. Selective geometric hashing, by means of determinants of transformations. In SCIA '93, Proceedings of The 8th Scandinavian Conference on Image Analysis, volume 2, pages 715718. NOBIM, 1993.

30