Permalink
Browse files

RANSAC: Remove the random seed initialization. This way a program wil…

…l always return reproducible results
  • Loading branch information...
1 parent 93e023c commit c3392807c32b20f5b261d40f54cae973257c1818 @oleg-alexandrov oleg-alexandrov committed Oct 9, 2012
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/vw/Math/RANSAC.h
View
@@ -201,9 +201,13 @@ namespace math {
// 4. keep fit with best consensus so far
/////////////////////////////////////////
- // Seed random number generator
- srandom((uint32) clock());
-
+ // Note: We do not modify the initial random seed. As such, if
+ // a program uses RANSAC, repeatedly running this program will
+ // always return the same results. However, if that program
+ // calls RANSAC twice while within the same instance of the
+ // program, the second time the result of RANSAC will be
+ // different, since we keep on pulling new random numbers.
+
// This is a rough value, but it seems to produce reasonably good results.
if (ransac_iterations == 0)
ransac_iterations = p1.size() * 2;

0 comments on commit c339280

Please sign in to comment.