*/
CV_EXPORTS RNG& theRNG();
+/** @brief Sets state of default random number generator.
+
+The function sets state of default random number generator to custom value.
+@param new state for default random number generator
+@sa RNG, randu, randn
+*/
+CV_EXPORTS_W void setRNGSeed(int seed);
+
/** @brief Generates a single uniformly-distributed random number or an array of random numbers.
Non-template variant of the function fills the matrix dst with uniformly-distributed
return getCoreTlsData().get()->rng;
}
+void cv::setRNGSeed(int seed)
+{
+ getCoreTlsData().get()->rng.state = static_cast<uint64>(seed);
+}
+
+
void cv::randu(InputOutputArray dst, InputArray low, InputArray high)
{
theRNG().fill(dst, RNG::UNIFORM, low, high);