How to use cvRandInit() and cvRandState in opencv 2.4
Hi, I found some old code that uses OpenCV's C API. I'm trying to run it but the function cvRandInit()
and the variable type CvRandState
are not being recognized. Right now I'm only including opencv2/opencv.hpp
. Is there another header file that I can use to access these older keywords? If not, are there newer functions that can be used to replace them?
Thank You!
cvRandInit is in opencv 2.413 version but imho not in opencv 3.
cvRandState is RNG class and I think that cvRandInit is depreceated. You can use method fill or gaussian or uniform
Like @LBerger suggest, just remove old C code completely and replace it by their C++ variants. Else you will stumble into memory addressing issues when combining both interfaces. The RNG class is about everything that you will need I guess.
@StevenPuttemans I want to run it once first to see if it's worth updating to C++, @LBerger, what method is fill gaussian or uniform? I cant find it in the documentation. Thanks
Running old code without updating ... just a bad habbit I guess :D