The mathematical formulation of thea contrariocriterion based on the Helmholtz principle consists in assuming as null hypothesis that the spatial distribution of background points on the second image follows a uniform random distribution. Then, events of low expectancy are considered to be meaningful. The ORSA method [MS04] looks for the most meaningful event, i.e. the event with minimal expectation under the null hypothesis of uniform background.
Fundamental Matrix Computation using ORSA 39
The ORSA method (see Algorithm1for a quick reference) is based on: first, the use of the RANSAC paradigm, performing several random trials to generate potential true 7 point matches; second, the use of ana contrariocriterion to select the best set of 7 point matches, i.e. the best fundamental matrix, and the best associated set of inliers; third, a sampling strategy that adaptively selects the set of potential matches [MS04].
Consider a set T of 7 point matches and one of the (up to 3) fundamental matrices F estimated from it using the normalised seven-point algorithm (Sec- tion 2.3.1). For each of thenpoint matches, we can estimate the geometric error (2.20) w.r.t. the selected fundamental matrixF. Applying a thresholdτ to this er- ror will result in a selection of estimated inliers (error smaller thanτ) and outliers (error larger than τ). Depending on the value of τ, we will thus select a certain numberkof potential inliers, with7< k≤n. Thea contrariocriterion associates to each of these nk−−77
possible setsS ofkinliers (containing the initial setT) a number of false alarms1
NFA(S) =N(k, n)·P(k, τ), (5.1)
that is the product of two terms: a number of testsN(k, n), which counts all pos- sible couples (F, S) that can be considered, and an upper boundP(k, τ) of the probability that the maximal geometric error (2.20) of thekestimated inliers re- mains belowτ.
Assuming a uniform distribution of the image points, the upper bound probab- ilityP(k, τ)in (5.1) can be chosen as
P(k, τ) = (α0τ)k−7, (5.2) whereα0is an upper bound for the probability of a random point to have geometric error 1 (obtained by considering the relative image area of a band of width 2 around the image diagonal), andτis the normalised error threshold that selects thekinliers (in practice, thek-th smallest error).
Once 7 point matches have been used to compute a fundamental matrix, there remain n−7point matches to test, which give 2n−7 possible inlier/outlier clas- sification subsets. Hopefully, we do not need to test these 2n−7 possible subsets, but onlyn−7subsets. The reason is simple: for a given cardinalk, the criterion used (NFA) is an increasing function of the maximum errorτ, so the best subset with cardinalkis simply the one made of thekpoint matches that have the smal- lest error. Therefore, by sorting the matches by increasing errors, we can find the minimum NFA over the 2n−7 possible subsets by looking only atn−7subsets, one for each possible value ofk(lines 5–6 in Algorithm1).
Consequently, the number of testsN(k, n)in (5.1) is
N(k, n) = 3(n−7) n k k 7 , (5.3) 1
We denote theN F Aas a function of the set of inliersS, since from this set we know the number of inlersk(number of elements inS), and the inlier thresholdτ(maximum error for the inliers).
40 ORSA: An Outstanding Random Sampling Method
accounting, for each of the possible number k of inliers to test, for the ways of sampling that numberkof inliers among theninput matches, and having selected
7 among those inliers to compute up to3 fundamental matrices using the seven- point algorithm.
The form of (5.1) is typical ofa contrariomodels [DMM08,GM09]: it guaran- tees that for anyε >0, the expected number of setsSthat pass the testN F A(S)< εis, for random data, less thanε. This property is in fact where the NFA function gets its name from. For sake of completeness, in the next chapter we will give a proof this claim in a similar context (Proposition 6.3.1). In practice, one often chooses the valueε= 1, so that only one false alarm is expected, on average, for random data.
If we havekinliers among nmatches, the number of samples to be drawn to have a probabilityqof selecting an inlier minimal sample of matches is [MS04]
N = log(1−q)/log 1− 6 Y i=0 k−i n−i ! . (5.4)
In practice, ORSA considers that a valid fundamental matrix has been found if a NFA value below 1 is obtained (line 9 in Algorithm 1). In general, this event will occur much before the predicted number of iterations (5.4), either because the sampled subset contains only inliers or because it contains a majority of inliers and the outliers are close to consistent with the underlying geometry.
Algorithm 1The ORSA Algorithm [MS04] to Minimise the NFA (5.1) Require: W the set ofnpotential matches,N the maximum number of trials
1: U :=W;N F A∗ :=∞;S∗ :=∅;opt:= 0;iter:= 1;M axIter:=N
2: whileiter≤M axIterdo
3: Randomly sample a setT of 7 point matches fromU
4: for allFundamental matrixF associated toT do
5: Sort the matches by increasing geometric errors
6: S(F) :=set with minimumN F Ain{S(k)(F)}7<k≤n,
whereS(k)(F)= firstkmatches,7< k≤n
7: ifN F A(S(F))< N F A∗then
8: N F A∗ :=N F A(S(F));S∗:=S(F) 9: ifopt= 0and(N F A∗<1oriter >0.9N)then
10: opt:= 1;M axIter:= (iter+ 0.1N);U :=S∗
11: iter:=iter+ 1
12: return Best inlier setS∗ and associated fundamental matrixF