Skip to content

Fixed threshold(THRESH_TOZERO) at imgproc(IPP) - #21258

Merged
alalek merged 4 commits into
opencv:3.4from
eplankin:fix_threshold_to_zero_ipp_bug
Dec 17, 2021
Merged

alalek merged 4 commits into
opencv:3.4from
eplankin:fix_threshold_to_zero_ipp_bug

Conversation

@eplankin

@eplankin eplankin commented Dec 14, 2021 •

Copy link
Copy Markdown
Contributor

Fix of the issue #16085.
The problem appeared in the case when source element is equal to the threshold (float data type). Due to the difference between OpenCV and IPP function implementations we have to compare source element with the floating point value next to the threshold (thresh + eps), not the threshold itself; eps value was updated.

force_builders=Custom
buildworker:Custom=linux-1
build_image:Custom=centos:7

Comment thread modules/imgproc/src/thresh.cpp Resolved
Comment thread modules/imgproc/test/test_thresh.cpp Resolved

@alalek alalek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you 👍

@alalek
alalek merged commit 175bcb1 into opencv:3.4 Dec 17, 2021
@alalek alalek mentioned this pull request Dec 18, 2021
@alalek alalek mentioned this pull request Dec 30, 2021
@alalek alalek mentioned this pull request Feb 22, 2022
SavyaSanchi-Sharma pushed a commit to SavyaSanchi-Sharma/opencv that referenced this pull request Jul 30, 2026
…pp_bug

Fixed threshold(THRESH_TOZERO) at imgproc(IPP)

* Fixed opencv#16085: imgproc(IPP): wrong result from threshold(THRESH_TOZERO)

* 1. Added test cases with float where all bits of mantissa equal 1, min and max float as inputs
2. Used nextafterf instead of cast to hex

* Used float value in test instead of hex and casts

* Changed input value in test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants