Ask Your Question
1

How to get the means OTSU threshold level in openCV?

asked 2013-12-19 11:31:23 -0600

Flart gravatar image

updated 2013-12-19 11:52:06 -0600

cv::threshold(img1, img2, 0, 255, CV_THRESH_OTSU);

Zero (threshold level) is ommited. How to get value, that algorithm uses ?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
3

answered 2013-12-19 22:08:02 -0600

pyro gravatar image

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);

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-12-19 11:31:23 -0600

Seen: 4,682 times

Last updated: Dec 19 '13