I think it's pretty much in the title, obviously I can iterate through and divide. But I assume there is an inbuilt way. I saw cvConvertScale
but this does not work with type cv::Mat
.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
I know the scaling operation for a multiplication 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;