opencv RANSAC random sequence

asked 2016-02-04 03:24:28 -0600

bellone gravatar image

updated 2016-02-04 06:46:29 -0600

i use findhomography and findfundamental algorithm in my code.

but when i use this with ransac

findHomography(src_points, dst_points, Matches_Info.inliers_mask, CV_RANSAC, 3.0);
findFundamentalMat(src_points, dst_points, Matches_Info.inliers_mask, CV_RANSAC, 3.0, 0.99);

like this

it always gets me same result.

but RANSAC algorithm use random sample to build model. so it have to has some different between other running.

i think this problem cause from random sequence of Opencv's RANSAC algorithm

but i can't find any information about this.

am i right? or if you have any information about this please comment me.

thank you.

edit retag flag offensive close merge delete

Comments

1

you're right, the random generators used there are all seeded with (uint64)(-1)

berak gravatar imageberak ( 2016-02-04 06:35:59 -0600 )edit

thank you for your comment berak. is there any way to give another seed to RANSAC?

bellone gravatar imagebellone ( 2016-02-04 19:24:43 -0600 )edit