4.4 Incorporating uncertainty into RANSAC
4.4.3 Algorithm
With the above discussion in mind, we now describe a modified RANSAC algorithm that in- corporates knowledge of the uncertainties into the estimation process. Algorithm 4 outlines the operation of the cov-RANSAC algorithm. Steps 1 and 2 proceed as in standard RANSAC – min- imal subsets are randomly sampled from the data in order to compute model hypotheses, whose support is then verified on all data points. Note that the optimizations discussed in Section 3.2 can
Algorithm 4RANSAC with uncertainty estimation: cov-RANSAC
Input: Set ofNdata pointsU, maximum number of iterationskmax, noise variance 2 Setk=0, repeat steps 1–4 whilek<kmax
1. Hypothesis generation:
Sample a minimal subset of sizemat random fromU Setk=k+1
Estimate model parameters from this minimal subset 2. Verification:
Evaluate the model and compute the support setIk
Check if support is non-random: p(model=good||Ik|)> (see Equations 4.13 and 4.14) ifmodel with non-random support foundthen
3. Covariance test and refinement
3a. Compute support accounting for model uncertainty Compute least squares fit using inlier setIk
Compute the covariance⇤Tof the transform (Section 4.3) Find set of inliersIcovusing covariance tests (Section 4.4.1) 3b. Local refinement
RunKiterations of inner (non-minimal) RANSAC Store the support setI⇤
covcorresponding to the best model found 4. Confidence in the solution:
Compute the reduced setU=U\ I⇤cov
Compute number of sampleskmaxfrom Equation 2.4, using"= (N|I|I⇤cov⇤cov| |)
Go to hypothesis generation step end if
be applied here as well; for instance, prior information can be easily integrated into the sampling stage to achieve non-uniform sampling (Section 3.2.2), and hypothesis verification can be performed using a randomized verification strategy (Section 3.2.4). Following verification, we then check if the current model hypothesis has sufficiently large support, as outlined in Section 4.4.1. The goal of this step is to identify promising fits to the data, which can then be further refined.
There are two possible outcomes at stage: either the model is rejected as being random fit, or is accepted. In the first case, we move on to the next hypothesis. In the second case, we have a set of inliersIk, obtained using the standard RANSAC threshold. As we have seen (refer Figure 4.2), the use of this threshold results in a subset of the inliers being found, since we have not compensated for model uncertainty. To do so, we first compute a least squares fit to the set of inliers, and then compute the covariance of the resulting transformation (Step 3a). There are two main reasons for this: first, as noted in (Hartley and Zisserman, 2000: Sec. 5.2.6), if the covariance of the transform is estimated from a the minimal sample and used to transfer additional points (that were not used
in its computation), this may lead to errors. The reason for this is that extrapolation far beyond the set of points used to compute the transform may be unreliable. Secondly, as observed in (Criminisi et al., 1999; Hartley and Zisserman, 2000), the uncertainty of the model reduces with the number of points used in its computation. To handle both these issues, we use all available inliers at this stage, in order to compute an accurate estimate with reduced uncertainty. Following this, we can then carry out the covariance-based inlier tests as discussed in Section 4.4.1 to compute the support, denoted byIcov. This set contains all points that support the current (refined) model,explicitlytaking the estimation uncertainty into account. Further refinement is possible as well – for instance, a local optimization may be carried out, similar to LO-RANSAC (Chum et al., 2003). A simple strategy (Step 3b) is to generate K non-minimal model hypotheses within an inner-RANSAC loop. The consensus setI⇤
covcorresponding to the best model in this local optimization loop is then stored. In the standard LO-RANSAC algorithm, following the local optimization step, sampling then resumes as before, on the entire dataset. The reason is this done is twofold: (a) repeated sampling might provide a better starting point for the local optimization, thus improving the support slightly and (b) there might exist a di↵erent model in the data, with potentially larger support. It is due to these two reasons that sampling then continues on the entire dataset U. However, an additional optimization is possible. More specifically, since we are explicitly compensating for estimation uncertainty, the set of inliersIcovcontains, on average, a fraction↵of the true inliers (recall that ↵is typically set to 0.95 or 0.99, and is used to compute the chi-square statistic in Equation 4.9). In other words, at this point, we have identified (almost) the entire set of inliers corresponding to some model in the data. Thus, if we are confident that there is only a single model in the data, note that we could potentially stop sampling at this stage, and simply return the best set of inliers found so far. However, we can make a small modification to the standard stopping criterion, in order to ensure that we have not missed a di↵erent model with potentially larger support. This is shown in Step 4 of Algorithm 4. Given the support setI⇤
cov, this provides a lower bound on number of inliers in the data. We can remove these points from the original dataset, yielding a reduced set U=U\ I⇤cov. We then need to carry out a sufficient number of iterations to ensure, with confidence ⌘0, that no model with support greater thanI⇤covexists within the remaining (N |I⇤cov|) data points. The number of iterations can then be computed from the standard stopping criterion ( Equation
2.4), with"= (N|I|I⇤cov⇤|
cov|). This small modification in the stopping criterion allows cov-RANSAC to
terminate in fewer iterations compared to LO-RANSAC.
4.5 Results
In this section, we evaluate the performance of cov-RANSAC on homography and fundamental matrix estimation. The performance of the approach was evaluated against the standard RANSAC algorithm and LO-RANSAC (Section 3.2.5.1). Note that for these experiments, we do not assume the existence of prior information regarding correctness of the correspondences, so we do not com- pare against techniques that specifically exploit this information. The assumed standard deviation for the measurement error was set to = 0.60, and the number of inner RANSAC repetitions was set to K = 5. For the standard LO-RANSAC, which uses iterative least squares with threshold
tightening, we set the threshold multiplier to 2.0, and use 4 iterations.