Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…l always return reproducible results
  • Loading branch information...
commit c3392807c32b20f5b261d40f54cae973257c1818 1 parent 93e023c
@oleg-alexandrov oleg-alexandrov authored
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/vw/Math/RANSAC.h
View
10 src/vw/Math/RANSAC.h
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.