I think this is pretty much in the title, obviously I can iterate and share. But I suppose there is a built-in way. I saw cvConvertScale , but this does not work with type cv::Mat .
cvConvertScale
cv::Mat
I know the scaling operation for multiplying by a scalar:
cv::Mat M; float alpha; cv::Mat Result = M * alpha;
Let's try this:
cv::Mat Result = M / alpha;
Or:
float beta = 1.0f / alpha; cv::Mat Result = M * beta;