Integrate RANSAC to compute essential matrix


159 观看


487 作者的声誉

I have calculated the essential matrix using the 5 point algorithm. I'm not sure how to integrate it with ransac so it gives me a better outcome.

Here is the source code.

Currently, I was thinking about computing the essential matrix for 5 random points then convert the essential matrix to fundamental and see the error threshold using this equation x'Fx = 0. But then I'm not sure, what to do after.

How do I know which points to set as outliners? If the errors too big, do I set them as outliners right away? Could it be possible that one point could produce different essential matrices depending on what the other 4 points are?

作者: Lun Zhang 的来源 发布者: 2017 年 12 月 27 日

回应 (1)


2149 作者的声誉


Well, here is a short explanation, in pseudo-code, of how you can integrate this with ransac. Basically, all Ransac does is compute your model (here the Essential) using a subset of the data, and then sees if the rest of data "is happy" with that result. It keeps the result for which a highest portion of the dataset "is happy".


for iter=1 to max_iter_number:    
    n_pts=get_n_random_pts(P);//get a subset of n points from the set of points P. You can use 5, but you can also use more.


    for pt in P:
        //we want to know if pt is happy with the computed E
        err=cost_function(pt,E);//for example x^TFx as you propose, or X^TEX with the essential.

This should do the trick. Usually, you set some_threshold experimentally to a low value. There are of course more sophisticated Ransacs, you can easily find them by googling.

Your idea of using x^TFx is fine in my opinion.

Once this Ransac completes, you will have best_estimated_essential_matrix. The outliers are those that have a x^TFx value that is greater than your optional threshold.

To answer your final question, yes, a point could produce a different matrix given 4 different points, because their spatial configuration is different (you can have degenerate situations). In an ideal settings this wouldn't be the case, but we always have noise, matching errors and so on, so what happens in the end is that the equations you obtain with 5 points wont produce the exact same results as for 5 other points.

Hope this helps.

作者: Ash 发布者: 27.12.2017 08:43