Ask Your Question

Revision history [back]

Why don't you just pass the 32FC1 image to cv::threshold:

http://docs.opencv.org/modules/imgproc/doc/miscellaneous_transformations.html?highlight=threshold#threshold:

src – input array (single-channel, 8-bit or 32-bit floating point).

Why don't you just pass the 32FC1 image to cv::threshold:

http://docs.opencv.org/modules/imgproc/doc/miscellaneous_transformations.html?highlight=threshold#threshold:

src – input array (single-channel, 8-bit or 32-bit floating point).

And BTW: If you write a loop over pixels in an image, you are doing it wrong (in maybe 90%) of the cases. You are not the first person to compute the abs of a matrix, so there is a function for it:

cv::Mat result = cv::abs(res)* (1/8)

click to hide/show revision 3
No.3 Revision

Why don't you just pass the 32FC1 image to cv::threshold:cv::threshold:

http://docs.opencv.org/modules/imgproc/doc/miscellaneous_transformations.html?highlight=threshold#threshold:

src – input array (single-channel, 8-bit or 32-bit floating point).

And BTW: If you write a loop over pixels in an image, you are doing it wrong (in maybe 90%) of the cases. You are not the first person to compute the abs of a matrix, so there is a function for it:

cv::Mat result = cv::abs(res)* (1/8)