Skip to content

Commit 53e6854

Browse files
committed
stitching: force "stable" RNG
1 parent f46fa6e commit 53e6854

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

modules/stitching/src/matchers.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,12 @@ struct MatchPairsBody : ParallelLoopBody
7070

7171
void operator ()(const Range &r) const
7272
{
73+
cv::RNG rng = cv::theRNG(); // save entry rng state
7374
const int num_images = static_cast<int>(features.size());
7475
for (int i = r.start; i < r.end; ++i)
7576
{
77+
cv::theRNG() = cv::RNG(rng.state + i); // force "stable" RNG seed for each processed pair
78+
7679
int from = near_pairs[i].first;
7780
int to = near_pairs[i].second;
7881
int pair_idx = from*num_images + to;

0 commit comments

Comments
 (0)