I'm trying to fill a cv::Mat with random numbers.
cv::Mat mat(100, 100, CV_8UC4);
cv::randu(mat, cv::Scalar(0), cv::Scalar(256));
The above code works fine, as long as I keep the scalars exactly as they are. Changing 0 and 256 to any other values will cause an Integer division by zero exception on the call to randu. Can anyone explain to me why? I'm using opencv3.
Aucun commentaire:
Enregistrer un commentaire