How to reset random number generator in OpenCV?

OpenCV stores random number generators in a local stream store and reuses them between function calls. This can lead to inconsistent results between different call sequences.

In OpenCV 2.1, the tlsRNGKey variable tlsRNGKey defined in cxrand.cpp and is not displayed through the headers.

Am I missing something? I can't be the first person who needs reproducible clustering results, can I?

+4
source share
1 answer

You can do:

 cv::theRNG().state = your_seed; 
+5
source

Source: https://habr.com/ru/post/1401964/


All Articles