Purposive Sample Consensus: A Paradigm for Model Fitting with Application to Visual ... · 2020. 3....

14
Purposive Sample Consensus: A Paradigm for Model Fitting with Application to Visual Odometry Jianguo Wang and Xiang Luo Abstract RANSAC (random sample consensus) is a robust algorithm for model fitting and outliers’ removal, however, it is neither efficient nor reliable enough to meet the re- quirement of many applications where time and precision is critical. Various algorithms have been developed to improve its performance for model fitting. A new algorithm named PURSAC (purposive sample consensus) is introduced in this paper, which has three major steps to address the limitations of RANSAC and its variants. Firstly, instead of assuming all the samples have a same probability to be inliers, PURSAC seeks their differences and purposively selects sample sets. Secondly, as sampling noise always exists; the selection is also according to the sensitivity analysis of a model against the noise. The final step is to apply a local optimization for further improving its model fit- ting performance. Tests show that PURSAC can achieve very high model fitting certainty with a small number of iterations. Two cases are investigated for PURSAC implementation. It is applied to line fitting to explain its principles, and then to feature based visual odometry, which requires efficient, robust and precise model fitting. Experimental results demonstrate that PURSAC improves the accuracy and efficiency of fundamental matrix estimation dramatically, resulting in a precise and fast visual odometry. Keywords- robust model fitting; visual odometry; samples’ reliability; samples’ geometry; sampling noise 1. Introduction Introduced in 1981, RANSAC is a popular algorithm for a variety of robust model fitting problems - particularly in computer vision for recovering epipolar geometry and 3D motion estimation [2]. It estimates a model that fits the provided data, while simultaneously classifies the data into inliers (samples consistent with the relation) and outliers (samples not consistent with the relation). It is a simple yet powerful technique that can estimate a model using data contaminated by a large fraction of outliers. RANSAC can be briefly summarized as a hypothesize-and-verify frame- work: a minimal subset of samples for model fitting is randomly selected from the entire dataset. The subset is then used to fit model hypotheses which are evaluated on the entire dataset by computing the distance of all other samples to this model and constructing an inliersset with a threshold. This hypothesize-and-verify loop is repeated until the probability of finding a model with better consensus than the current best model falls below a predefined threshold. Then all the inliers are used for model parameter estimation [1],[4].

Transcript of Purposive Sample Consensus: A Paradigm for Model Fitting with Application to Visual ... · 2020. 3....

Page 1: Purposive Sample Consensus: A Paradigm for Model Fitting with Application to Visual ... · 2020. 3. 14. · Purposive Sample Consensus: A Paradigm for Model Fitting with Application

Purposive Sample Consensus: A Paradigm for

Model Fitting with Application to Visual Odometry

Jianguo Wang and Xiang Luo

Abstract RANSAC (random sample consensus) is a robust algorithm for model fitting

and outliers’ removal, however, it is neither efficient nor reliable enough to meet the re-

quirement of many applications where time and precision is critical. Various algorithms

have been developed to improve its performance for model fitting.

A new algorithm named PURSAC (purposive sample consensus) is introduced in this

paper, which has three major steps to address the limitations of RANSAC and its variants.

Firstly, instead of assuming all the samples have a same probability to be inliers, PURSAC

seeks their differences and purposively selects sample sets. Secondly, as sampling noise

always exists; the selection is also according to the sensitivity analysis of a model against

the noise. The final step is to apply a local optimization for further improving its model fit-

ting performance. Tests show that PURSAC can achieve very high model fitting certainty

with a small number of iterations.

Two cases are investigated for PURSAC implementation. It is applied to line fitting to

explain its principles, and then to feature based visual odometry, which requires efficient,

robust and precise model fitting. Experimental results demonstrate that PURSAC improves

the accuracy and efficiency of fundamental matrix estimation dramatically, resulting in a

precise and fast visual odometry.

Keywords- robust model fitting; visual odometry; samples’ reliability; samples’

geometry; sampling noise

1. Introduction

Introduced in 1981, RANSAC is a popular algorithm for a variety of robust model fitting problems - particularly in computer vision for recovering epipolar geometry and 3D motion estimation [2]. It estimates a model that fits the provided data, while simultaneously classifies the data into inliers (samples consistent with the relation) and outliers (samples not consistent with the relation). It is a simple yet powerful technique that can estimate a model using data contaminated by a large fraction of outliers. RANSAC can be briefly summarized as a hypothesize-and-verify frame-work: a minimal subset of samples for model fitting is randomly selected from the entire dataset. The subset is then used to fit model hypotheses which are evaluated on the entire dataset by computing the distance of all other samples to this model and constructing an inliers’ set with a threshold. This hypothesize-and-verify loop is repeated until the probability of finding a model with better consensus than the current best model falls below a predefined threshold. Then all the inliers are used for model parameter estimation [1],[4].

Page 2: Purposive Sample Consensus: A Paradigm for Model Fitting with Application to Visual ... · 2020. 3. 14. · Purposive Sample Consensus: A Paradigm for Model Fitting with Application

2

For generality and simplicity, RANSAC is based on a set of assumptions which are not true in many real situations. This leaves large room for improvement. In this paper we analyse potentials for improvement, and propose a purposive sampling algorithm named PURSAC (purposive sample consensus) to substitute random sampling. Comparing to RANSAC and MLESAC (maximum likelihood estimation sample consensus), PURSAC can detect more inliers with much fewer number of iterations and in turn can improve both the efficiency and reliability of model fit-ting. This is very important for applications where speed and precision is critical, such as visual odometry (VO). With analysis about a model’s sensitivity against sampling noise (MSASN) and the pattern of samples’ validity, PURSAC is de-signed to efficiently handle both sampling noise and outliers for model fitting.

The rest of the paper is organized as follows: Section II gives a detailed review of RANSAC and various approaches for its improvement at different aspects, and then introduces the principles of the proposed PURSAC. Section III describes a scheme for line fitting to justify the methodology of PURSAC. Section IV explains the details of applying PURSAC to VO, especially a method for purposive sample subsets selection considering both features’ matching score and their geometry. The experimental results of VO on several scenarios are presented in Section V, which demonstrate the effectiveness and robustness of the proposed algorithm. Finally, the conclusion and discussions appear in the last section.

2. RANSAC and Its Variants

RANSAC can often find a correct solution even for seriously contaminated data; however, in order to achieve a high confidence level the required number of sample subsets increases exponentially, and associated computational cost is substantial. Many algorithms have been developed for increasing the efficiency of the basic RANSAC algorithm, some aiming to optimize the process of model verification while some others seeking to preferentially generate more useful hypotheses [3-7]. A comparative analysis of the state-of-the-art RANSAC algorithms and their cate-gorization can be found in [1] and [4]. Here we review them from the aspects they targeted for improvement.

2.1. RANSAC

Assuming all the samples have same outlier possibility ε, and ignoring the impact of sampling noise, RANSAC follows a random sampling paradigm. Fundamentally it is a stochastic algorithm without deterministic guarantees of finding the global maximum of the likelihood. A success rate p is the level of confidence of finding a consensus subset, which is a function of ε, the number of iterations to be conducted N and the number of samples in a subset s [2].

(1)

For the sake of robustness, in many practical implementations N is usually mul-tiplied by a factor of ten, which increases much computational costs [1]. Without prior knowledge of ε, commonly the implementations of RANSAC estimate ε adaptively, iteration after iteration.

Page 3: Purposive Sample Consensus: A Paradigm for Model Fitting with Application to Visual ... · 2020. 3. 14. · Purposive Sample Consensus: A Paradigm for Model Fitting with Application

3

In practice, sampling always has noise and ε may be different for each sample. By analysing the difference of ε, it has large potential for optimizing sample sub-sets selection and improving model fitting performance. As an example, assuming a required success rate p is 99% and a dataset with outlier rate ε = 50%, according to (1), the number of iterations N is 16 for s = 2 (line fitting), 145 and 587 for s = 5 and 7 (visual odometry). If ε still is 50% for the entire dataset, but ε = 20% for a special part of the dataset. If sample subsets are selected only from this part of the dataset, N is just 5, 12 and 20 for s = 2, 5 and 7 respectively. This leads to one of the strategies in PURSAC, which will be detailed in the line fitting example.

The following two subsections review the model fitting approaches applied in computer vision utilizing the difference of samples’ ε and MSASN (model’s sensi-tivity against sampling noise) respectively.

2.2. Samples Reliability Analysis

There are many cases that sampling process can provide some information about the samples’ reliability and accuracy. In feature based image matching, the feature detection and matching stages produce a set of matches where each feature is only matched once, but some of the matches may be in error [21]. In addition to pair the features in two images, feature matching also gives similarity measures (matching scores). It has been found that matches with higher scores have higher reliability of being inliers [9],[21]. The scores or the ranking of the scores provide useful infor-mation for selecting reliable sample subsets and then improving the efficiency of model parameter estimation, which RANSAC does not utilize.

Several sampling consensus algorithms have been proposed considering this important information from features’ matching. Pre-emptive RANSAC by Nistér is powered by random sample consensus with pre-emptive scoring of the motion hy-potheses and enable real-time ego-motion estimation [3]. PROSAC (Progressive Sample Consensus) developed by Chum and Matas tentatively and progressively selects samples from a set of higher ranked features to reduce the computational costs [9]. Uncertainty RANSAC [13] incorporates feature uncertainty and shows that this determines a decrease in the number of potential outliers, thus enforcing a reduction in the number of iterations. A deterministic RANSAC approach [14] also estimates the probability of a match to be correct. Tordoff and Murray [21] pro-posed guided sampling and consensus for motion estimation based on MLESAC. While MLESAC assumes a uniform prior for the validity of a match, the guided-sampling approach uses the quality function of a feature matching algorithm to de-rive the probability of matches’ validity. Similar to PROSAC, guided sampling and consensus is also based on the evidence that a valid match is likely to have a higher matching score.

Above approaches often achieve significant computational savings in practice, since good hypotheses tend to be generated early on during the sampling process. However, it is observed in many cases, features with high matching scores often lie on a same spatial structure and are potentially in a degenerate geometric configura-tion [4]. Thus, utilizing above approaches alone has the danger of selecting feature close to each other; therefor other strategies are needed to avoid the degenerate configurations.

Page 4: Purposive Sample Consensus: A Paradigm for Model Fitting with Application to Visual ... · 2020. 3. 14. · Purposive Sample Consensus: A Paradigm for Model Fitting with Application

4

2.3. Sampling Noise Analysis

For most model fitting tasks, two types of sampling errors must be considered: small errors (noise) and blunders (outlier) [15]. Even if a consensus subset is found after N iterations, due to the sampling noise and degenerate configurations, the model and inliers decided by this subset may be largely wrong. The reason will be explained with a line fitting example in Fig.1.

There are several algorithms have been proposed to address sampling noise with different strategies. GroupSAC [6] proposed by Kai aims to handle sample subset degenerate configuration. It performs well in the cases of high outlier ratios by image segmentation for group sampling; however, it is inefficient as increasing the computational cost. Assuming inlier samples with Gaussian noise, MLESAC adopts the same sampling strategy as RANSAC to generate putative solutions, but chooses the solution to maximize the likelihood rather than the number of inliers [8]. MLESAC is a generalization of RANSAC. Capel [10] proposed a statistical bail-out test for RANSAC that permits the scoring process be terminated early and achieve computational savings. Tordoff and Murray [21] also mentioned spatial grouping of samples as a cue for further speed the search.

Chum et al. define a locally optimized RANSAC variant to deal with sampling noise and to purposively select sample subset [22]. Observing that a good model tends to find a significant fraction of the inliers, an inner RANSAC strategy is de-vised using only the set of inliers to the current best model. The inner RANSAC technique has the effect of improving sample consensus more rapidly than standard RANSAC, which causes the termination criterion (1) to be met earlier.

Above methods can make improvement from RANSAC in some aspect, but the improvement is usually limited and unstable. Further improvement can be achieved by strategically fusing a group of selected strategies together.

2.4. PURSAC

By analysing the principle and effectiveness of various approaches, we design a new algorithm PURSAC, aiming to induce better model fitting results with a smaller number of iterations. It takes three major steps to address the limitations of RANSAC and it variants.

a) Instead of assuming all the samples have same probability to be inliers, PURSAC seeks their difference and purposively selects sample sets.

b) As sampling noise always exists, PURSAC purposely selects the subsets according to the analysis of a model’s sensitivity against the sampling noise, causing a selective geometric consideration in VO and line fitting.

c) The final step is to apply local optimization algorithm iteratively with all the inliers so as to further improve model fitting performance.

PURSAC can achieve results close to optimal theoretical estimation. Being a qualitative guidance in theory, PURSAC’s implementation needs a quantitative analysis to design executable rules for purposive sample consensus. Two examples will be investigated. Line fitting is used as an example to describe the scheme of

Page 5: Purposive Sample Consensus: A Paradigm for Model Fitting with Application to Visual ... · 2020. 3. 14. · Purposive Sample Consensus: A Paradigm for Model Fitting with Application

5

PURSAC and to justify its methodology. Then it is applied to feature based VO, to conform to its prominent requirement of efficient, robust and precise model fitting.

3. PURSAC for Line Fitting

Let us investigate the line fitting example in the original RANSAC paper [2]. One of the assumptions inherent in the standard termination criterion (1) is that a model computed from an uncontaminated sample subset is consistent with all inliers. In practice, this is often not the case, particularly when the data points are noisy. As showing in Fig.1, two types of sampling errors (noise and outlier) exist within the sample points. Due to sampling noise, model hypotheses selected by RANSAC with limited number of iterations usually do not fit a model well, as Line 1 in the figure. By randomly selecting a set of samples (two points for line fitting) from all the samples without considering MSASN, RANSAC likely misses some inliers and consequentially reduces the accuracy of model fitting. Original RANSAC is only effective in removing outliers but is inadequate of handling sampling noise.

Figure 1. Line fitting results by RANSAC (Line 1) , PURSAC (Line 2) and least square (Line 3).

Observation1: Samples Geometry

Two-point form of a linear equation is expressed as (2), where (x1, y1) and (x2, y2) are the coordinates of the two points that decide the line model.

(2)

If the noise terms of the two points position are denoted as (δx1, δy1) and (δx2,

δy2), and let y2 − y1 written as dy, x2 − x1 as dx, δy2 − δy1 as δy and δx2 − δx1 as δx, Then the slope of the line can be expressed as

2 1 2 1 2 1 2 1 2 1 2 1    /             /        

  /

/

( ) ( ) ( ) ( )

(d ) (d )

d 1 d

d 1 d/

y y x x y y y y x x x x

y y x x

y y y

x x x

(3)

The items δx and δy are solely decided by sampling noise, while dx and dy are directly related to the distance of the two points. It can be concluded from (3) that the smaller the distance of two points (dx, dy) is, the more the estimated line slope to be affected by sampling noise (δ x, δ y). This can be evidenced by the results of a Monte Carlo line fitting test.

Page 6: Purposive Sample Consensus: A Paradigm for Model Fitting with Application to Visual ... · 2020. 3. 14. · Purposive Sample Consensus: A Paradigm for Model Fitting with Application

6

Figure 2. Monte Carlo test of the distsnce distribution for line fitting with RANSAC.

Fig.2 shows the results of 1,000 runs’ line fitting tests for the distance between the final two points selected by RANSAC. The left figure shows that the distance between any two points tends to be close; the middle one shows that the distance of the final two points selected by RANSAC has a Gaussian distribution. The right figure suggests that possibility to be a final point increases as the distance increase. This indicates that the distance between the two points for the best consensus set tends to be large, so as to dilute the effects of sampling noise for model fitting. Therefore it should be a wise way to purposely select two sample points apart.

Observation2: Samples Validity

The sample points themselves do not have any information available about their va-lidity for line fitting. It is impossible to rank or score the points without any prior knowledge about them. However, we do know for a line model some of the points are inliers and other are outliers, and their validity will be assessed during the pro-cess of classifying them. This validity information can be used to purposively select points afterward that have higher possibility to be inliers so as to speed up the mod-el fitting process.

Similar to locally optimized RANSAC [22], by observing that a good model tends to find a significant fraction of the inliers, an inner iteration is executed. After a very small number of iterations k, the set of inliers to the current best model is generated with RANSAC or MLESAC. Then next sample subset is selected only form the current inliers and verified against the entire dataset. As the sampling is running on current inliers dataset, there is no need for the size of sample subset to be minimal. On the contrary, to mitigate sampling noise, the size should be selected to minimize the error of the model parameter estimation.

This local optimization technique has the effect of improving the consensus score more rapidly and causes the iteration termination criterion (N in(1)) to be met earlier by selecting samples from current inliers set, which has a lower outlier rate than the entire dataset has. In addition it can also provide more robust and precise model fitting by minimizing the error of model estimation with proper sample size.

Line Fitting with PURSAC

Considering the two observations about samples geometry and validity for the line fitting tests, PURSAC is designed to purposely select two points far apart, instead of random selection. The first point is randomly selected; then the distances from it

0 10 20 30 40 500

500

1000

1500

2000

2500

3000

3500

4000Random two points distance

Diatance

Num

ber

of e

lem

ents

0 10 20 30 40 500

10

20

30

40

50Final two points distance

DiatanceN

umbe

r of

ele

men

ts

0 10 20 30 40 500

1

2

3

4

5Possibility to be final points

Diatance

Pos

sibi

lity

(%)

Page 7: Purposive Sample Consensus: A Paradigm for Model Fitting with Application to Visual ... · 2020. 3. 14. · Purposive Sample Consensus: A Paradigm for Model Fitting with Application

7

to all the other points are calculated. The second point is selected according to the statistical distribution shown in Fig.2. Inner iteration is then applied by selecting samples only from the current inliers until reaching iteration termination criterion (1). Finally local optimization is implemented and all the inliers are used iteratively to compute the final model parameters.

Table I shows the results of 1,000 runs line fitting tests with RANSAC and

PURSAC. Within 100 points, 55 are inliers. The number of iteration N is set to 20,

which means the success rate p in (1) is 99.97%. Fitting_error is a model fitting error

against the ground truth measured by the area between the two lines. Inliers_miss is

the number of points that should be counted as inliers but miscounted as outliers;

similarly is Outliers_miss. STD and mean is the standard deviation and mean of the

1,000 runs’ results.

TABLE I. LINE FITTING MONTE CARLO TEST RESULTS

Line fitting

Method

Number of inliers

mean/STD

Fitting_error

mean/STD

Inliers_miss

mean/STD

Outliers_miss

mean/STD

PURSAC 46.07 / 0.92 117.58 / 7.22 11.69 / 1.80 1.76 / 1.46

RANSAC 43.67 / 3.41 122.99 / 22.23 14.53 / 4.19 2.20 / 1.69

Figure 3. 1000 runs Monte Carlo test results with PURSAC and RANSAC.

The result shows that under exactly the same condition, PURSAC can achieve better performance than RANSAC, with less miscounted inliers and outliers, and is closer to true model. The final line fitting performance is affected by the miscount-ed inliers and outliers. As shown in Table I and Fig.3, all the STDs of PURSAC are smaller than that of RANSAC, indicating that PURSAC has better reliability.

The key idea behind PURSAC is to purposely select sample sets according to the sensitivity analysis of a model to be fitted against sampling noise; and also to the measures of samples’ possibility to be inliers. It is worth to mention that the way to implement PURSAC is based on the analysis of each model fitting case and it is open to find an optimal way for different cases.

4. PURSAC for Visual Odometry

RANSAC and MLESAC has been widely used in computer vision, particularly in the areas of recovering epipolar geometry and 3D motion estimation, such as image registration, structure from motion and feature based VO. The motion of an agent

0 200 400 600 800 10000

5

10

15

20

25

30

35

40

45

50

res in miss

res out miss

act inliers

0 200 400 600 800 10000

5

10

15

20

25

30

35

40

45

50

res in miss

res out miss

act inliers

Page 8: Purposive Sample Consensus: A Paradigm for Model Fitting with Application to Visual ... · 2020. 3. 14. · Purposive Sample Consensus: A Paradigm for Model Fitting with Application

8

(vehicle, human or robot etc.) can be estimated by incrementally estimating the pose of the agent through examination of the movement induced on the images of its on board camera(s) [1]. Feature based VO uses salient and repeatable features extracted and matched across the captured images. No matter which algorithm is used, the matched features are usually contaminated by outliers (wrong data associ-ations). How to efficiently remove the outliers is the most delicate task in VO and still has large room for improvement.

This section introduces how to apply PURSAC to VO. The relations of features matching scores to their possibility to be outliers and to their location accuracy in images are investigated first. Then the sensitivity analysis of the egomotion model against samples noise is conducted. Based on these analyses PURSAC is elaborated aiming to design a purposive sample set selection procedure for the fundamental matrix estimation, and to improve the results of outlier removal and model fitting and in turn the VO performance.

Feature Matching Analysis

First let us analyse the correspondence of features matching score and the features’ possibility to be inliers. Similar analysis has been done previously for SIFT [16] and some other descriptors [21]. In all experiments, regardless of which similarity function used, the fraction of inliers decreased almost monotonically as a function of the number of tentative matches [9]. This is verified by our test results for 169 pairs of images using SURF features[17]. All the results show that the features with lower matching scores have higher possibility of being outliers.

Figure 4. Features’ location accuracy and matching score correspondence.

Another test was conducted to evaluate the robustness and accuracy of SIFT and SURF features’ location and their relation to feature matching scores. Fig.4 is a test result for SIFT features. The horizontal axis is SIFT features’ location accuracy in pixels, and vertical axis is the features’ matching scores, which is the 'confidence level' of a matching is correct. It shows that as the confidence increases, so does the location accuracy (to an extent). This location error can be treated as sampling noise that is related to feature matching score. This observation will be counted in designing PURSAC rules for purposive sample subset selection.

Page 9: Purposive Sample Consensus: A Paradigm for Model Fitting with Application to Visual ... · 2020. 3. 14. · Purposive Sample Consensus: A Paradigm for Model Fitting with Application

9

Model Noise Sensitivity Analysis

Model noise sensitivity analysis is to find a strategic way to dilute the effect of sampling noise for model fitting. It has been found that the geometry of selected features in images affects VO result remarkably [10, 11]. The more evenly features are distributed in images, the less sensitive a model is to noise, and the more stable is VO results. The fact that the geometry of the features in images affects the VO results reflects the relation between sampling noise and the model to be fitted.

The fundamental matrix estimation with RANSAC etc. method takes geometric constraints introduced by a motion model. After feature detection and matching, matched features are nominated for subsequent procedure. In RANSAC, sample data sets are randomly chosen from entire matched features. However, the selected feature points have the possibility of being close to each other (causing degenerate configuration), which will cause significant uncertainty of model fitting and affect the accuracy of fundamental matrix estimation.

PURSAC Rules for Visual Odometry

Feature based VO requires efficient and robust model fitting. According to the sta-tistical analysis of outlier possibility and features’ location accuracy against the matching scores, rules for PURSAC implementation are innovated by considering both scores ranking and feature geometry.

a) All the matched features are ranked by their matching scores. The one with the highest rank is selected and the features close to it within a threshold ρ are excluded in following samples selection. This process iterates until all the matched features are either selected or excluded.

b) Only the selected features are used for searching the sample set for the con-sensus of model hypothesis but it is verified against the entire dataset. Sample subsets are purposely selected according to their ranking until reaching an initial iteration number k.

c) Same as line fitting case, local optimization is then implemented to further increase the speed and certainty of model fitting. By improving accuracy and efficiency of fundamental matrix estimation, a precise and fast visual odometry can be achieved.

This set of rules is combined with both standard RANSAC and MLESAC for fundamental matrix estimation and visual odometry computation. The threshold ρ is set as 10 times of the inlier threshold in RANSAC (10x1 pixels), and the initial iteration number k is set to 20.

5. Experiment Results

Málaga 2009 Robotic Dataset Collection PARKING-6L is used in this paper for featured based VO testing [20]. A section of the dataset is selected from the images captured by a camera mounted on a test vehicle which runs a closed loop in a car park. The test runs 100 times to evaluate the precision and consistency of the VO results from different methods. Test results from PURSAC are compared with RANSAC and MLESAC, which were implemented in our previous approaches for VO [19] and monocular SLAM [18] respectively.

Page 10: Purposive Sample Consensus: A Paradigm for Model Fitting with Application to Visual ... · 2020. 3. 14. · Purposive Sample Consensus: A Paradigm for Model Fitting with Application

10

Table II is the test results of matched features’ inlier rate detected by different methods in 100 runs. Five pairs of images have the inlier rate from less than 50% to over 85%. The tests set two different success rate p1 = 99% and p2 = 99.99%. The number of iterations is calculated by (1) dynamically.

The results show that combining with either RANSAC or MLESAC, PURSAC achieves much better results than the original algorithms. The inlier rate is higher and the standard deviation of the number of detected inliers is much lower, which means PURSAC has much better and more consistent sample consensus. It is noted that for the images with high inlier rate (Image 58&59), the STD of both RP and MP reaches zero, entailing a complete certainty. Results show that the two different success rates p do not impact much on the inlier rate µ of PURSAC, but do for MLESAC and RANSAC. Even if a higher success rate p2 is selected for MLESAC and RANSAC, PURSAC still performs better with a low success rate, as the bold data indicated. Therefore, the number of iterations needed for PURSAC (RP and MP) is much lower than the original algorithms, leading to a faster process.

TABLE II. IMAGE MATCHING MONTE CARLO TEST RESULTS

Image pair

(Number of

matches)

Inlier rate µ

& number of

iteration N

RO (RANSAC

Original)

RP (RANSAC

PURSAC)

MO (MLESAC

Original)

MP (MLESAC

PURSAC)

p1 p2 p1 p2 p1 p2 p1 p2

Image

2&3 (357)

Mean µ 68.74% 70.03% 75.92% 75.83% 68.10% 69.37% 75.90% 75.93%

Inliers STD 10.39 9.06 0.98 1.16 12.78 10.30 0.96 1.0714

Mean N 68.29 116.83 47.66 81.31 79.58 125.68 49.61 85.98

Image 27

&28

(390)

Mean µ 52.78% 54.32% 58.39% 58.46% 52.72% 54.1% 58.45% 58.36%

Inliers STD 8.12 6.82 3.12 2.90 10.23 9.27 3.09 3.1527

Mean N 447.92 689.88 315.82 585.35 475.55 713.77 349.3 610.29

Image 58

&59

(1019)

Mean µ 77.03% 78.71% 85.57% 85.57% 77.3% 78.9% 85.57% 85.57%

Inliers STD 38.96 31.92 0 0 36.85 32.05 0 0

Mean N 31.72 50.60 21.02 39.05 30.89 51.68 23 39.56

Image 2&4

(186)

Mean µ 55.22% 56.81% 59.47% 59.70% 55.35% 56.23% 59.78% 59.77%

Inliers STD 4.97 3.66 2.40 1.72 4.56 5.44 1.53 0.6257

Mean N 335.70 507.45 230.12 390.37 346.98 582.5 228.08 422.55

Image 2&6

(129)

Mean µ 44.32% 44.99% 47.16% 47.22% 43.81% 43.95% 47.28% 47.38%

Inliers STD 1.96 1.87 1.73 1.52 2.25 2.46 1.47 1.6161

Mean N 1471.0 2567.2 1127.7 2090.6 1640.6 3193.4 1338.5 2615.3

The test results on 103 pair of images for 100 runs are plotted in Fig.5. The top figure shows the number of matches Nm, the number of liners Nin and inlier rate µ in each pair of images. The middle one is the mean difference of Nin detected by MO and MP. It indicates that MP can always detect more inliers than MO, espe-cially in the case that Nin is low (image number 76). The bottom figure shows the standard deviation of Nin for 100 runs. MO has higher STD than MP in all the 103 pair of images. This proves that MP has better consistency than original MLESAC, which is also critical for model fitting.

Page 11: Purposive Sample Consensus: A Paradigm for Model Fitting with Application to Visual ... · 2020. 3. 14. · Purposive Sample Consensus: A Paradigm for Model Fitting with Application

11

Figure 5. Number of inliers in visual odometry tests

The trajectories of visual odometry that use MLESAC (MO) and proposed PURSAC (MP) are plotted for analysis and comparison. Fig. 6 is the trajectories generated by VO that uses MLESAC and PURSAC respectively for 100 runs. The left plot shows the trajectories of MLESAC, and the right one for PURSAC. It shows clearly that PURSAC has significantly improved the performance of VO.

Figure 6. The 100 trajectories of VO using MO and MP

10 20 30 40 50 60 70 80 90 100

500

1000

Num

ber

of

matc

hes

Numner of matches and Inlier rate

10 20 30 40 50 60 70 80 90 100

60

80

100

Inlie

r ra

te(%

)

Total

Inliers

Inliers rate

10 20 30 40 50 60 70 80 90 100

10

20

30

Inlie

r diffe

rence

Numner of inliers difference between MO and MP

10 20 30 40 50 60 70 80 90 1000

5

10

number of images

Inlie

r S

TD

Numner of Inliers STD

MP

MO

-20

24

68

-5

0

5

-25

-20

-15

-10

-5

0

5

10

15

20

MO

-20

24

68

-202

-20

-15

-10

-5

0

5

10

15

20

MP

Page 12: Purposive Sample Consensus: A Paradigm for Model Fitting with Application to Visual ... · 2020. 3. 14. · Purposive Sample Consensus: A Paradigm for Model Fitting with Application

12

TABLE III. VO FINAL POSITION STD AND NUMBER OF ITERATIONS

Methods X STD Y STD Z STD Mean iterations

RO (p = 99.99%) 0.2146 2.2201 0.2172 147.51

RP (p = 99%) 0.0840 0.2524 0.0588 65.87

MO (p = 99.99%) 0.1837 0.5326 0.1513 151.75

MP (p = 99%) 0.0625 0.2364 0.0415 67.59

The standard deviation of final camera positions with different algorithms is listed in Table III. Similar to the results for the number of inliers listed in Table II, PURSAC achieves better results than RANSAC and MLESAC with much smaller mean number of iterations and STD.

6. Conclusion

This paper introduces PURSAC, a purposive sample set selection paradigm for model fitting. It has three major steps to implement. Firstly, instead of assuming all the samples have a same probability to be inliers, PURSAC seeks their differences and purposively selects sample sets. Secondly, as sampling noise always exists; the selection is also according to the sensitivity analysis of a model against the noise. The final step is to apply a local optimization for further improving its model fitting performance. PURSAC can combine with any model fitting algorithm using ran-dom sample sets selection, and achieve better model fitting results with a smaller number of iterations.

Being a qualitative guidance in principle, PURSAC’s implementation needs quantitative analysis to design executable rules for purposive sample consensus. Two examples are investigated in this paper. PURSAC is applied to line fitting to explain its principles, and then to visual odometry, which requires efficient, robust and precise model fitting.

Experimental results in the two examples show that PURSAC can achieve very high model fitting certainty using only a small number of iterations. It demonstrates much better performance than RANSAC and MLESAC. Applied in VO, concern-ing both features’ geometry and matching score ranking, PURSAC improves the accuracy and efficiency of fundamental matrix estimation dramatically, resulting in a precise and fast visual odometry.

References

[1] F. Fraundorfer and D. Scaramuzza, "Visual Odometry Part II: Matching, Robustness,

Optimization, and Applications," Robotics & Automation Magazine, IEEE, vol. 19, pp.

78-90, 2012.

[2] M. A. Fischler and R. C. Bolles, "Random sample consensus: a paradigm for model

fitting with applications to image analysis and automated cartography," Communica-

tions of the ACM, vol. 24, pp. 381-395, 1981.

[3] D. Nister, "Preemptive RANSAC for live structure and motion estimation," in Com-

puter Vision, 2003. Proceedings. Ninth IEEE International Conference on, 2003, pp.

199-206 vol.1.

Page 13: Purposive Sample Consensus: A Paradigm for Model Fitting with Application to Visual ... · 2020. 3. 14. · Purposive Sample Consensus: A Paradigm for Model Fitting with Application

13

[4] Rahul Raguram, Jan-Michael Frahm, Marc Pollefeys, " A Comparative Analysis of

RANSAC Techniques Leading to Adaptive Real-Time Random Sample Consensus",

in Proceedings of the 10th European Conference on Computer Vision: Part II, pp.

500-513, 2008.

[5] J. M. Frahm and M. Pollefeys, "RANSAC for (quasi-) degenerate data (QDEGSAC),"

in Computer Vision and Pattern Recognition, 2006 IEEE Computer Society Confer-

ence on, 2006, pp. 453-460.

[6] N. Kai, et al., "GroupSAC: Efficient consensus in the presence of groupings," in Com-

puter Vision, 2009 IEEE 12th International Conference on, 2009, pp. 2193-2200.

[7] E. Rosten, et al., "Improved RANSAC performance using simple, iterative minimal-

set solvers," arXiv preprint arXiv:1007.1432, 2010.

[8] P. H. S. Torr and A. Zisserman, "MLESAC: A New Robust Estimator with Applica-

tion to Estimating Image Geometry," Computer Vision and Image Understanding, vol.

78, pp. 138-156, 2000.

[9] O. Chum and J. Matas, "Matching with PROSAC - progressive sample consensus," in

Computer Vision and Pattern Recognition, CVPR 2005. IEEE Computer Society Con-

ference on, 2005, pp. 220-226 vol. 1.

[10] D. Capel, "An effective bail-out test for RANSAC consensus scoring," in Proc.

BMVC, 2005, pp. 629-638.

[11] D. Scaramuzza, F. Fraundorfer, and R. Siegwart, “Real-time monocular visual odome-

try for on-road vehicles with 1-point RANSAC,” in Proc. IEEE Int. Conf. Robotics

and Automation (ICRA), 2009, pp. 4293–4299.

[12] D. Nister, O. Naroditsky, and J. Bergen, “Visual odometry,” in Proc. Int. Conf. Com-

puter Vision and Pattern Recognition, 2004, pp. 652–659.

[13] R. Raguram, J. Frahm, and M. Pollefeys, “Exploiting uncertainty in random sample

consensus,” in Proc. ICCV, 2009, pp. 2074–2081.

[14] P. McIlroy, E. Rosten, S. Taylor, and T. Drummond, “Deterministic sample consensus

with multiple match hypotheses,” in Proc. British Machine Vision Conf. 2010, pp. 1–

11.

[15] Volker Rodehorst and Olaf Hellwich, "Genetic Algorithm SAmple Consensus

(GASAC) - A Parallel Strategy for Robust Parameter Estimation", in Proceedings of

the 2006 Conference on Computer Vision and Pattern Recognition Workshop

(CVPRW’06), 17-22 June 2006, pp. 103-111.

[16] D. Lowe, “Distinctive image features from scale-invariant keypoints,” I International

Journal of Computer Vision, vol. 20, no. 2, pp. 91–110, 2003.

[17] H. Bay, T. Tuytelaars, and L. V. Gool, “Surf: Speeded up robust features,” in Proc.

ECCV, 2006, pp. 404–417.

[18] Liang Zhao, Shoudong Huang, Lei Yan, Jack Jianguo Wang, Gibson Hu, Gamini Dis-

sanayake, Large-Scale Monocular SLAM by Local Bundle Adjustment and Map Join-

ing, in Proc. of the 11th. Int. Conf. Control, Automation, Robotics and Vision

(ICARCV 2010), ed IEEE Technical Committee, IEEE, Singapore, December 2010,

pp. 431-436.

Page 14: Purposive Sample Consensus: A Paradigm for Model Fitting with Application to Visual ... · 2020. 3. 14. · Purposive Sample Consensus: A Paradigm for Model Fitting with Application

14

[19] J.J. Wang, S. Kodagoda, G. Dissanayake, Vision Aided GPS/INS System for Robust

Land Vehicle Navigation, Proceedings of the 22nd International Technical Meeting of

The Satellite Division of the Institute of Navigation (ION GNSS 2009), Savannah,

Georgia, USA, 22-25 September 2009, pp.600 - 609.

[20] Jose-Luis Blanco, Francisco-Angel Moreno, Javier Gonzalez, A Collection of Outdoor

Robotic Datasets with centimeter-accuracy Ground Truth, Autonomous Robots, 2009.

Volume 27, Issue 4, pp. 327-351.

[21] Ben Tordoff and David W Murray, Guided Sampling and Consensus for Motion Esti-

mation, Computer Vision—ECCV 2002, - Springer

[22] O. Chum, J. Matas, and J. Kittler, “Locally optimized RANSAC,” in Proc. DAGM-

Symposium, pp. 236–243, 2003.