Random Number Generation regarding
I had generated a random number using the following code in OpenCV 2.4.8.
RNG rng;
cout << rng.uniform(0.0,1.0);
It keeps on generating the same number. Why?
I had generated a random number using the following code in OpenCV 2.4.8.
RNG rng;
cout << rng.uniform(0.0,1.0);
It keeps on generating the same number. Why?
"It keeps on generating the same number. Why?"
you will have to seed the RNG, else it starts with ~0 for seed all the time.
RNG rng(getTickCount());
Asked: 2014-08-01 01:02:00 -0600
Seen: 352 times
Last updated: Aug 01 '14
Why are the results of RNG same every time?
Saving an image with unset pixels
How to calculate distance between camera and image?
Question about polar or radial angle calculation in the image coordinate system
Access multiple channels in Mat
How can I work with pixels of an image directly?
fingerprint orientation map through gradient method - opencv c++