findHomography RANSAC should check chosen Points for collinearity?

asked 2015-02-05 08:40:10 -0500

Micka gravatar image

I wonder if it is by concept or a bug, that RANSAC within findHomography does not check the chosen random points for collinearity.

From my understanding it should do it, because afaik homography can't be computed (correctly) if some of the 4 points (either scene- or objectpoints) are collinear.

Should this be placed as a request or to bug tracker or something?

findFundamentalMat does perform a collinear check, btw.

edit retag flag offensive close merge delete


I am curious, is it because you have analyzed the code? Or a deduction from the doc?

Doombot gravatar imageDoombot ( 2015-02-12 14:06:30 -0500 )edit

@Doombot I've had a look at the code and it looked like it's just random sample drawing and checking that no points are drawn multiple times, but no check for colinearity. But didn't analyze the code completely, so maybe I missed something.

Micka gravatar imageMicka ( 2015-02-23 07:18:15 -0500 )edit

Ok! I was curious since I use findHomography and sometime it finds results that are pretty much random. I mean, I manually check the matches beforehand to make sure the algorithm would be able to find something but it rather sometime find impossible shapes and sometime plainly give an empty H matrix as an answer.

Doombot gravatar imageDoombot ( 2015-02-23 08:06:10 -0500 )edit