-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
Description
Describe the feature and motivation
Currently (OpenCV 4.11), cv::threshold() supports auto-threshold binarizations OTSU and TRIANGLE and returns the computed threshold value.
It's a pity that there is no API to only query that auto-threshold without actually performing the thresholding.
To avoid adding an API for that and do not duplicate any code, a very easy fix would be to add some flag cv::THRESH_DISABLEcv::THRESH_DRYRUN specifically for that purpose.
However, cv::threshold() also has a big limitation : it does not support masking. I would like to add such a cv::thresholdWithMask() (or a cv::threshold() overload with additional mask parameter). But if this new API is created, cv::THRESH_DISABLEcv::THRESH_DRYRUN could be irrelevant, replaced by a boolean parameter of the new function.
- would a PR
cv::thresholdWithMask()(orcv::threshold()overload) be accepted or is there a reason why thresholding does not support masking ? - which is better,
cv::thresholdWithMask()orcv::threshold()overload ? - is the flag
cv::THRESH_DISABLEcv::THRESH_DRYRUNa better idea than somecv::getThresholdAutoValue()? - is the flag
cv::THRESH_DISABLEcv::THRESH_DRYRUNa better idea than some specific boolean input parameter ?
[edit]
For future readers and contributors :
From reviewers :
We recommend to use another name like thresholdWithMask to reduce chance of API collision in Python and Java.