• Nem Talált Eredményt

Object recognition

4.2 Invariants

4.2.2 Projective and permutation invariants

involved in that determinant are coplanar (parallel or intersecting). If only two lines are coplanar, then there is a geometric configuration, that yields one invariant. The remaining two lines intersect the plane formed by the coplanar lines in two points. Taking the intersection of the line determined by these points with the coplanar lines yields four collinear points, that can be used to calculate a cross ratio.

The coplanarity of lines (namely points of lines) could be tested as the determinant composed from the four points vanishes. In practice this means that when the absolute value of the determinant is bellow a limit, those cases are eliminated.

The other, more restricted cases (three or four lines are coplanar) are completly useless.

x

-1 0 0.5 1 2

1

x

-1

2 1 0.5 0

1

x

2 1 0.5 0 -1

Table 4.1: Important values of the cross ratio

-2 -1 0 1 2 3

-2 -1 0 1 2 3

x 1/x 1-x (x-1)/x 1/(1-x) x/(x-1)

Figure 4.1: Plot of the six possible functions of the cross ratio

J2(I) = 2I66I5+9I48I3+9I26I+2 I2(I−1)2

In order to get bounded values J(I)= JJ21(I)(I) is used, hence 2 ≤J(I)≤2.8. The PDF (probability density function) of the algebraic permutation invariants is shown in lower part of Figure 4.3.

Stereographic permutation invariants for cross ratio

The developed method follows a different way. As it can be seen in Figure 4.1, the plot of the six possible permutations of the cross ratio is symmetrical to the value 0.5 and (projectively)∞. By pairs equating the three basic functions (occurs in cross ratio){x,1x,1−x}yields x= 1xx= ±1 and x =1−xx=0.5, the mapping of these values could be calculated. (Note, that the other possible combinations 1x =1−x and 1x = xx1 do not give real solution.) Considering Table 4.1 (note, that in projective manner the values∞and−∞represents the same) it can be concluded, that the key values of the six mappings are{−1,0,0.5,1,2,∞}, because they form a closed set respecting to these mappings.

In order to generate permutation invariants, application of periodic function(s) is required that gives same value to the six possible combinations of the basic functions. This could be achieved in a two step process.

Stereographic projection

In order to define a periodic function, the mapping of the infinite line (possible values of cross ratios) onto a circle

0 0.2 0.4 0.6 0.8 1

0 0.2 0.4 0.6 0.8 1

P O N

A B

Figure 4.2: Stereographic projection of the cross ratio

is required. This could be achieved with the stereographic projection (used in the developed system) or gnomonic projection. The parameters of the circle can be determined from the following constraints:

• The values in the same pair must be mapped on the opposite side of the cirlce.

• The infinity on the line must be mapped into the “north pole” (at point N). Therefore the value 0.5 must be on the “south pole” (at point P).

• The arrangement of the (six) key values must be symmetrical.

• The mapping is continuous.

This yields, that the values{0.5,1,2,∞,−1,0}are mapped onto the angles (see Figure 4.2),

(POB)=

0,π3,3, π,3,3,

, respectively. Note, that 2×⊳(PN B)=⊳(POB), because(POB) is the central angle and⊳(PN B) is the respecting inscribed angle. The radius r of the circle can be determined as

tan (⊳(PNA))= AP

2rr= AP

2 tan (⊳(PNA)) Substituting the values

A=1,P=0.5,⊳(PN B)= pi6,tan (⊳(PN B))= 13

gives r =

3

4 for the radius. Using the determined circle the calculated value of the cross ratio I is mapped from the “infinite” number line onto the circle yielding stereographic cross ratio:

Φ =arctan 2(I−0.5)

√3

!

=⊳(PNA) (4.3)

The PDF (probability density function) of the stereographic permutation invariants is shown in the upper left of Figure 4.3.

Application of a periodic function

Using the output of the mapping, the aim of the stereographic permutation invariant is to give the same value inde-pendently for the six different possible values of the cross ratio. This requires application of a periodic function to the

1.9 2 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 PDF of cross ratio with polynomial function (N=100000)

-2 -1.5 -1 -0.5 0 0.5 1 1.5 2

PDF of cross ratio with stereographic function (N=100000)

Figure 4.3: PDF of the cross ratios of the stereographic and the polynomial functions

output of the stereographic projection of the cross ratio, such that the requirement Jp(Iα)=Jp(Iα+kπ3),k=0, . . . ,5 must be fulfilled. The output of the function is used during indexing. From the practical point of view, the output of the tested functions are mapped into [0,1] interval. In order to apply a simple (Euclidean) distance function during the indexing, a nonlinear transformation must be defined such a way, that the output density must be close to the uniform one. Amongst the severeal possibilities, the following functions (whose period isπ/3, against arcsin(sin(x))=x whose period is 2π) are tested (see Figure 4.4, and note, the left column shows only one period of functions):

Jp1=sin2(3Φ)

Jp2=π2|arcsin(sin(3Φ))|

Jp3=π2arcsin q2

π|arcsin(sin(3Φ))|

Jp4=0.57(Jpb(Φ)−6Jpb(Φ−π6))+0.86, where Jpb=π1arcsin

q1

π|arcsin(sin(3Φ))|

HereΦdenotes the output of stereographic projection (4.3) which maps the infinite line of cross ratios onto the circle in Figure 4.2 resulting in periodic functions of periodπ3.

Examining the PDF of the invariants applying the different functions, it can be seen that the Jp4 gives the PDF closest (most similar) to the uniform distribution.

The output of the periodic function Jp4gives the solution to the Problem 1.

Elimination of the effect of element interchanges

The next step is to eliminate the effect of interchanging the elements between two permutation groups (giving solution to the Problem 2). The number of possible combinations isN+3

4

. Therefore the permutation invariant is not a single

0 0.2 0.4 0.6 0.8 1 Function: Jp1(x)

0 0.2 0.4 0.6 0.8 1

Density: Jp1(x)

0 0.2 0.4 0.6 0.8 1

Function: Jp2(x)

0 0.2 0.4 0.6 0.8 1

Density: Jp2(x)

0 0.2 0.4 0.6 0.8 1

Function: Jp3(x)

0 0.2 0.4 0.6 0.8 1

Density: Jp3(x)

0 0.2 0.4 0.6 0.8 1

Function: Jp4(x)

0 0.2 0.4 0.6 0.8 1

Density: Jp4(x)

Figure 4.4: Some periodic functions applied to the cross ratio and its density

value but a vector J. In order to remove the effect of the initial labelling of N+3 points, the vector must be sorted.

The applicability of the following configurations are checked: 6 points, 1 line + 4 points, 2 lines + 3 points, 3 lines + 2 points, 4 lines, 5 lines.

The elimination of different labelling is required, because the invariants are used in indexing process (database query). But after the database retrieval, the correspondences between the features used in query and the results must be determined. The concept described here is applied for all of the used feature combinations. The object database contains objects and the objects contain also features, from which different subsets containing the basic configurations can be built. The database contains Euclidean information belonging to the subset of features. From this information, using the homogeneous coordinates of the features, the invariants can be computed. By using the nonlinear function Jp4the (normalized) components of the vector J can be computed and sorted and the permutation p after sorting can be determined. This pair of J and p are precomputed and stored in the database before application. In the scene basic feature configurations are choosen and from their 3D projective coordinates another pair of J and p is determined in a similar way during application. The basis for finding corresponding sets of features are the J’s both in object database and scene. The J’s are compared using Euclidean distance and a tolerance. Corresponding sets of features are marked and the collineation mapping features from scene into features from database is determined. This collineation makes it possible to map further features from the scene into database and check for correspondence. Thus the set of corresponding features belonging to the same object can be enlarged. In the success indices a and b identify the sets in database and scene, respectively. The main problem is that the order of the points in the database and scene may be different. The details are as follows.

Configuration: 6 points

In case of six points, interchanging the elements between the permutation groups yields the invariant vector [72]

J = S

J (Φ1),J (Φ2),J Φ1

Φ2

!

,J Φ1−1 Φ2−1

!

,J Φ21−1) Φ12−1)

! ,

J (Φ3),J Φ1

Φ3

!

,J Φ1−1 Φ3−1

!

,J Φ31−1) Φ13−1)

! ,

J Φ2

Φ3

!

,J Φ2−1 Φ3−1

!

,J Φ32−1) Φ23−1)

!

J Φ3−Φ1

Φ3−Φ2

!

,J Φ23−Φ1) Φ13−Φ2)

! ,

J2−1)(Φ3−Φ1) (Φ1−1)(Φ3−Φ2)

!

(4.4) whereΦ1, Φ2 andΦ3 are the stereographic invariants belonging to the permutation groupΠ1(1,2)Π2(3,4,5,6) of points, S () denotes the sorting operator.

The number of points in the configuration is six but the vector J has 15 elements. Therefore no one-to-one mapping exists between the points and the elements of the vector. Instead, the mapping exists between pairs of points and the respecting vector element. The first line (first five elements) in the (4.4) depend on (Q1Qi),i =2, . . . ,6, the second line (the next four) depends on (Q2Qi),i=3, . . . ,6, and so on. Finally the last line (last element) depends on (Q5Q6).

This means, that building a 6×6 table, according to the indexing with J, the ordering of the points between two sets of respecting six point configurations can be determined in the following way.

The 15 components of the vectors Ja(from projective scene description) and Jb(from Euclidean object data) can be computed and sorted (as described earlier), let paand pbcontain the permutation indices of the elements, therefore if Ja(i)= Jb(i),i =1, . . . ,15, then element indexed by pa(i) corresponds pb(i). Defining the vector V according to table 4.2 yields that the pair V (pa(i)) corresponds to V (pb(i)), for example V (pa(1))=V(6)={2,3}corresponds to V (pb(1))=V(13)={4,5}. Let A be a 6×6 (symmetric) table, where A (V (pb(i)))=V (pa(i)). The i’th point in the set ’a’ corresponds to the j’th point in the set ’b’, if every element in the i’th row of A contains the index j.

i 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

V(i)

1,2 1,3 1,4 1,5 1,6 2,3 2,4 2,5 2,6 3,4 3,5 3,6 4,5 4,6 5,6

Table 4.2: Possible pairings in the six points configuration

1 2 3 4 5 6

1

* 5,6 1,6 3,6 2,6 4,6

2

5,6 * 1,5 3,5 2,5 4,5

3

1,6 1,5 * 1,3 1,2 1,4

4

3,6 3,5 1,3 * 2,3 3,4

5

2,6 2,5 1,2 2,3 * 2,4

6

4,6 4,5 1,4 3,4 2,4 *

Table 4.3: Determine correspondences in six points configuration (example)

For example a query from the scene into the database contains the sorted vector and permutation Ja =

0.0075 0.0247 0.0322 0.0344 0.0420 0.0667 0.3196 0.3269 0.4270 0.4341 0.7054 0.7185 0.7257 0.9517 0.9739 pa =

6 12 10 7 9 14 1 8 11 2 5 4 15 3 13

The resulted entry from the database gives Jb =

0.0103 0.0338 0.0441 0.0468 0.0572 0.0909 0.3209 0.3309 0.4270 0.4367 0.7037 0.7219 0.7315 0.9513 0.9816 pb =

13 3 14 15 4 5 11 8 7 10 2 6 1 12 9

The vector V is given in detailed form in Table 4.2.

Using the permutation vectors pa(1)=6 corresponds to pb(1)=13, yields that pair 2,3 corresponds to pair 4,5.

Write 2,3 into the position 4,5 (and 5,4) of the 6×6 table and continuing the process gives the results in Table 4.3.

Searching for the common elements row-wise (e.g. 6 in the first row in Table 4.3) gives the final pairings of the features: 1−6, 2−5, 3−1, 4−3, 5−2, 6−4.

A fault tolerant method is also developed. For example some numerically close elements in the corresponding vectors are swapped by sorting process (with other sorted vector and permutation not detailed here), hence the table does not yield a valid solution, see the cells framed in Table 4.4. The solution to the problem is the following. Fill another 6×6 table from the original one (A) such that the element in (i,j) contains the number of occurences of the

j’th value in the i’th row of the original table. Then repeat the following process:

1. Search for a maximum value in this new table. The row-column index gives the pairing.

2. Fill the row and the column with zeros of the pair already found. If the current maximum value is less than the desired parameter (typically 4, tolerating only one mis-match), the pairing is not possible.

The processing of the faulty case can be seen in Table 4.4. Applying the proposed method gives the pairs: 1−5, 1−6, 4−3, 5−4, 3−1, 6−2.

Configuration: 1 line, 4 points

The calculation of the permutation invariant from the projective one is very simple, applying the function J() to the

1 2 3 4 5 6 1

* 5,6 1,5 3,5 4,5 2,5

2

5,6 * 1,6 3,6 4,6 2,6

3

1,5 1,6 * 2,3 1,4 1,2

4

3,5 3,6 2,3 * 3,4 1,3

5

4,5 4,6 1,4 3,4 * 2,4

6

2,5 2,6 1,2 1,3 2,4 *

1 2 3 4 5 6

1 1 1 1 5 1

1 1 1 1 1 5

4 2 1 1 1 1

1 1 5 1 1 1

1 1 1 5 1 1

2 4 1 1 1 1

Table 4.4: Determine correspondences in six points configuration, fault tolerant version (example)

only one projective invariant. But no method is currently known to determine pairings from permutation and projective invariants, therefore this type of configuration is not used during indexing.

Configuration: 2 lines, 3 points

As mentioned earlier, the geometric configuration for this case could be traced back to the five coplanar (2D) points case. Therefore the results of [72] could be used, namely interchanging the elements between the permutation groups yields the vector

J2D=S

J (Φ1),J (Φ2),J Φ1

Φ2

!

,J Φ1−1 Φ2−1

!

,J Φ21−1) Φ12−1)

!

(4.5) The elements of the vector can be determined by exchanging the first element with the elements at 2, . . . ,5, respec-tively.

But this is unnecessary, because the lines and points can be clearly distinguished, therefore the first element should only be exchanged with the second and the third one. Interchanging the two lines means applying I1I mapping of the invariant (see the algebraic form). This means, that the permutation invariant vector should contain only:

J=S

J (Φ1),J (Φ2),J Φ1

Φ2

!

(4.6) If the pairing of the points and lines between two sets are required, the simplest solution is to calculate the vector defined in (4.5), because there is a one-to-one mapping between the five points and the five elements of J2D. A possible additional check is to pair points generated by line intersection with a similar one.

Configuration: 3 lines, 2 points

This configuration yields six planes, because a plane can be formed from a line and a point, where the point and the line is not coincident. In the projective 3D space the points and planes are dual to each other (principle of duality), therefore applying the principle of duality the results of the six points case can be used.

Configuration: 4 lines

The calculation of the permutation invariant from the projective one is simple, applying the function J() to the projec-tive invariants. But no method is currently known to determine pairings from permutation and projecprojec-tive invariants, therefore this type of configuration is not used during indexing.

Configuration: 5 lines

In order to be able to use line only configuration, from which the pairing can be determined, compound configuration must be used. The simplest one is 5 lines in general position. From 5 lines five different 4-lines configuration can be extracted. A 4-lines configuration gives two independent invariants. Applying a function f Ji,1,Ji,2

Ji,i=1, . . .5, yields five different invariants. From these invariants the pairing could be determined.

Let the i’th configuration be the one from which the i’th line is excluded (for example. 1’st configuration is built from lines 2,3,4,5). Let the unsorted 5-vectors be Jaand Jb. Let the permutation vectors containing the output of the

sorting be pa, pb, respectively. This means, that the Ja(pa(i)) invariant equals to Jb(pb(i)), therefore the (eliminated) lines pa(i), pb(i) correspond to each other.