Ask Your Question

5-points algorithm in opencv ?

asked 2012-09-25 09:59:00 -0600

Guido gravatar image

Hi there,

I was wondering if it was planned to add the 5-point algorithm for essential matrix computation to opencv ? If not, is there people around here interested in cooperating to add this feature to opencv ?



edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted

answered 2012-09-25 11:02:36 -0600

Jacek gravatar image

updated 2012-09-25 11:07:39 -0600

Some time ago I've implemented 5-pt algorithm (according to Nister solution: see An Efficient Solution to the Five-Point Relative Pose Problem). The code uses additional packages: Eigen (for singular value decomposition) and rpoly.cpp (Jenkins-Traub real roots finder) and has about 500 lines of code (part of the code was generated in Matlab).

Experiments with synthetic data showed that it's more accurace and less sensitive to noise than 7-pt or 8-pt algorithms. And, as theory says, doesn't suffer from planar degeneracy.

If you are interested I can share a source code so it can be modified and added to OpenCV.

edit flag offensive delete link more


That's great news, it is difficult to find an implementation of the 5-point algorithm. As far as I know, there is only a matlab version, a library embeded in Bundler and the libmv version. I would be very interested in seeing your software. What language did you used ?

Guido gravatar imageGuido ( 2012-09-25 11:20:14 -0600 )edit

Is there a way we can contact each other in order to make this happen ?

Guido gravatar imageGuido ( 2012-10-08 05:30:41 -0600 )edit

I'd also be very interested in taking a look at your code if you don't mind!

robocyte gravatar imagerobocyte ( 2012-10-21 12:54:53 -0600 )edit

I would suggest you post the code on github, or simply a tarball on dropbox - then we can work on getting it into an opencv submission. Then everyone benefits!

mgb gravatar imagemgb ( 2012-11-04 12:49:01 -0600 )edit

answered 2012-11-04 12:57:40 -0600

mgb gravatar image

I haven't tested it but Nghia Oh's page lists an implementation

edit flag offensive delete link more


Nice, another one for the list. However she says the code looks like tangled spaghettis...

Guido gravatar imageGuido ( 2012-11-12 04:48:09 -0600 )edit

The spaghetti part is the machine generated code, which is about 200 lines long. It's long because it is symbolic matrix operations fully expanded out.

My code also does the visibility test. So it'll return the correct essential matrix amongst all the possible solutions, which is useful.

I've had one user saying it produces accurate result. I welcome more testers :)

Nghia gravatar imageNghia ( 2012-11-19 08:38:43 -0600 )edit

What about submitting your nice work to opencv ? Is some work more needed ?

Guido gravatar imageGuido ( 2012-11-19 17:47:47 -0600 )edit

I've hardly tested the code. Right now there's very few error checking. Also, I'm not familiar enough with OpenCV's coding standard (and all the software engineering involved) for contributing a new function.

Nghia gravatar imageNghia ( 2012-11-20 07:27:55 -0600 )edit

Question Tools

1 follower


Asked: 2012-09-25 09:59:00 -0600

Seen: 5,684 times

Last updated: Nov 04 '12