Commit 53e68546 authored by Alexander Alekhin's avatar Alexander Alekhin

stitching: force "stable" RNG

parent f46fa6e0
...@@ -70,9 +70,12 @@ struct MatchPairsBody : ParallelLoopBody ...@@ -70,9 +70,12 @@ struct MatchPairsBody : ParallelLoopBody
void operator ()(const Range &r) const void operator ()(const Range &r) const
{ {
cv::RNG rng = cv::theRNG(); // save entry rng state
const int num_images = static_cast<int>(features.size()); const int num_images = static_cast<int>(features.size());
for (int i = r.start; i < r.end; ++i) for (int i = r.start; i < r.end; ++i)
{ {
cv::theRNG() = cv::RNG(rng.state + i); // force "stable" RNG seed for each processed pair
int from = near_pairs[i].first; int from = near_pairs[i].first;
int to = near_pairs[i].second; int to = near_pairs[i].second;
int pair_idx = from*num_images + to; int pair_idx = from*num_images + to;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment