How to get the means OTSU threshold level in openCV?
cv::threshold(img1, img2, 0, 255, CV_THRESH_OTSU);
Zero (threshold level) is ommited. How to get value, that algorithm uses ?
cv::threshold(img1, img2, 0, 255, CV_THRESH_OTSU);
Zero (threshold level) is ommited. How to get value, that algorithm uses ?
The documentation (http://docs.opencv.org/modules/imgproc/doc/miscellaneous_transformations.html?highlight=threshold#threshold) states that the function cv::threshold()
returns the computed threshold value.
So you can simply retrieve the value with something like:
threshold_value = cv::threshold(img1, img2, 0, 255, CV_THRESH_OTSU);
Asked: 2013-12-19 11:31:23 -0600
Seen: 4,840 times
Last updated: Dec 19 '13