use cv::theRNG() instead of ::rand() in gpu::solvePnPRansac
authorVladislav Vinogradov <vlad.vinogradov@itseez.com>
Tue, 19 May 2015 14:27:23 +0000 (17:27 +0300)
committerVladislav Vinogradov <vlad.vinogradov@itseez.com>
Tue, 19 May 2015 14:27:23 +0000 (17:27 +0300)
modules/gpu/src/calib3d.cpp

index ee0004b..6cab63f 100644 (file)
@@ -138,14 +138,16 @@ namespace
             bool was;
             do
             {
-                subset[i] = rand() % num_points;
+                subset[i] = cv::theRNG().uniform(0, num_points);
                 was = false;
                 for (int j = 0; j < i; ++j)
+                {
                     if (subset[j] == subset[i])
                     {
                         was = true;
                         break;
                     }
+                }
             } while (was);
         }
     }