Skip to content

Add cv::THRESH_DRYRUN flag to get adaptive threshold values without thresholding#26836

Merged
asmorkalov merged 3 commits intoopencv:4.xfrom
chacha21:thresholding_compute_threshold_only
Jan 24, 2025
Merged

Add cv::THRESH_DRYRUN flag to get adaptive threshold values without thresholding#26836
asmorkalov merged 3 commits intoopencv:4.xfrom
chacha21:thresholding_compute_threshold_only

Conversation

@chacha21
Copy link
Copy Markdown
Contributor

@chacha21 chacha21 commented Jan 24, 2025

A first proposal for #26777

Adds a cv::THRESH_DRYRUN flag to let cv::threshold() compute the threshold (useful for OTSU/TRIANGLE), but without actually running the thresholding. This flags is a proposal instead of a new function cv::computeThreshold()

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

Adds a cv::THRESH_DISABLE flag to let cv::threshold() compute the threshold (useful for OTSU/TRIANGLE), but without actually running the thresholding.
This flags is a proposal instead of a new function cv::computeThreshold()
Copy link
Copy Markdown
Contributor

@asmorkalov asmorkalov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good in general, besides naming.

@asmorkalov asmorkalov self-assigned this Jan 24, 2025
@asmorkalov asmorkalov changed the title Add cv::THRESH_DISABLE flag Add cv::THRESH_DRYRUN flag to get adaptive threshold values without thresholding Jan 24, 2025
@asmorkalov asmorkalov added this to the 4.12.0 milestone Jan 24, 2025
@asmorkalov asmorkalov added the port to 5.x is needed Label for maintainers. Authors of PR can ignore this label Jan 24, 2025
@asmorkalov asmorkalov merged commit 3cbb4ac into opencv:4.x Jan 24, 2025
@chacha21 chacha21 deleted the thresholding_compute_threshold_only branch January 24, 2025 11:43
@asmorkalov asmorkalov mentioned this pull request Feb 19, 2025
NanQin555 pushed a commit to NanQin555/opencv that referenced this pull request Feb 24, 2025
…reshold_only

Add cv::THRESH_DRYRUN flag to get adaptive threshold values without thresholding opencv#26836

A first proposal for opencv#26777

Adds a `cv::THRESH_DRYRUN` flag to let cv::threshold() compute the threshold (useful for OTSU/TRIANGLE), but without actually running the thresholding. This flags is a proposal instead of a new function cv::computeThreshold()

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [X] The PR is proposed to the proper branch
- [X] There is a reference to the original bug report and related work
- [X] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: core feature port to 5.x is needed Label for maintainers. Authors of PR can ignore this

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants