-
-
Notifications
You must be signed in to change notification settings - Fork 55.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A new constant in adaptivethreshold is created to calculate #4149
A new constant in adaptivethreshold is created to calculate #4149
Conversation
gaussianBlur with CV_32F. hence rouding error are avoided
@LaurentBerger, I think, this is not a good way to solve the problem. Either the accuracy of GaussianBlur, applied to 8u images, should be improved or the existing ADAPTIVE_THRESH_GAUSSIAN_C should be modified to use CV_32F internally. |
First sorry for my bad english. |
…ed using float number
@LaurentBerger, thanks! Basically, I'm ready to merge it. However, it would be very useful if you provide some test case that passes with this fix and fails without it. Otherwise some further changes in the library may break it again |
@LaurentBerger, thank you! this is quite remarkable! May I ask you to add such a test (with some automatic analysis) to our regression tests, so that the problem can be verified and possibly eliminated later. |
Yes rounding errors are well known but such effect is very surprising. |
implementation of adaptivethreshold
@LaurentBerger, yes, something like that. There is no need to make fullscale test derived from CvArrTest, just a lightweight google-test that, for example, takes a certain image, computes GaussianBlur directly and via floating-point and then checks that the difference is within a certain threshold. |
Before starting google-test I have a simple program to understand. you can download at perso.univ-lemans.fr/~berger/Afsd56/OCV_PR4149_v2.zip With this threshold value only results with circle are selected when adaptiveThreshold is used |
👍 |
Thanks @LaurentBerger for the patch. There is a corner case that I fixed in #5155. |
A new constant ADAPTIVE_THRESH_GAUSSIAN_C_FLOAT in function adaptivethreshold is created to calculate gaussianBlur with CV_32F. Hence rouding error are avoided
problem using ADAPTIVE_THRESH_GAUSSIAN_C is described in this post http://answers.opencv.org/question/63304/results-stability-given-by-adaptivethreshold-with-adaptive_thresh_gaussian_c/