I want to seed randn function but I'm not able to do it.
srand(time(NULL));
Mat mymat = Mat::zeroes(1024,1024,CV_32F);
randn(mymat,0,1);
Should it not give me random mat, named mymat
, whose mean = 0
, and variance = 1
? However, it gives the same mymat
in every run.
Here is the link for randn which claims srand to work.
I tried to give different numbers instead of time(NULL), but all have the same output randoms. I have checked the same thing from another machine, it gives the same output with the first machine. So seeding is not working.
Thanks,