Ask Your Question
0

How to get the means OTSU threshold level in openCV?

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

Flart gravatar image

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

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
2

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

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
Login/Signup to Answer

Question Tools

Stats

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

Seen: 2,142 times

Last updated: Dec 19 '13