[][src]Function opencv::core::the_rng

pub fn the_rng() -> Result<RNG>

Returns the default random number generator.

The function cv::theRNG returns the default random number generator. For each thread, there is a separate random number generator, so you can use the function safely in multi-thread environments. If you just need to get a single random number using this generator or initialize an array, you can use randu or randn instead. But if you are going to generate many random numbers inside a loop, it is much faster to use this function to retrieve the generator and then use RNG::operator _Tp() .

See also

RNG, randu, randn