-
Notifications
You must be signed in to change notification settings - Fork 418
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
Adaptive Binarization #132
Comments
Hello. I am glad that my algorithms are useful for you. |
Hello – that would be great if you were able to create a variant that does
the adaptiveThresholding.
From the OpenCV documentation the implementation is defined as follows:
For the Adaptive_Thresh_Mean option for non-inverted thresholding, this
would correspond to the following algorithm.
sum = 0; area = 0;
for(dy = -neighborhood; dy <= neighborhood; ++dy)
{
for(dx = -neighborhood; dx <= neighborhood; ++dx)
{
if(x + dx >= 0 && x + dx < width && y + dy >= 0 && y + dy < height)
{
area++;
sum += src[x + dx, y + dy]
}
}
}
sum /= area;
dst[x, y] = src[x, y] > (sum - C) ? positive : negative;
Where C is a threshold offset value above
*From:* Ihar Yermalayeu <[email protected]>
*Sent:* Sunday, November 8, 2020 5:45 AM
*To:* ermig1979/Simd <[email protected]>
*Cc:* MK-Vision <[email protected]>; Author <[email protected]>
*Subject:* Re: [ermig1979/Simd] Adaptive Binarization (#132)
Hello. I am glad that my algorithms are useful for you.
Unfortunately I can't change existing algorithms due to compatibility.
But I can add new one.
It would better if you give me scalar implementation of algorithm that you
want as example. It will allow to me minimize possible missunderstanding.
The rest (optimizations and tests) I will make by myself.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#132 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARVQPTD2WSZ2GMIGBTUZ2PTSO2OFXANCNFSM4TOAR3BA>
.
|
Can I change expression from |
Yes – that looks fine to me.
Thank you!
Michael
*From:* Ihar Yermalayeu <[email protected]>
*Sent:* Monday, November 9, 2020 1:36 AM
*To:* ermig1979/Simd <[email protected]>
*Cc:* MK-Vision <[email protected]>; Author <[email protected]>
*Subject:* Re: [ermig1979/Simd] Adaptive Binarization (#132)
Can I change expression from src[x, y] > (sum/area - threshold) to (src[x,
y] + threshold)*area > sum in order to avoid division operation?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#132 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARVQPTD7ICT3Y6IHYMELQE3SO6ZYFANCNFSM4TOAR3BA>
.
|
I have been using your SIMD Neon tools to speed up some common OpenCV implementations. They have been very helpful - thanks! Your AveragingBinarization method is functionally similar to the OpenCV adaptiveThreshold tool, but it is not the same. Have you considered implementing something similar to adaptiveThreshold? It may be just a simple alteration to your existing algorithm.
The text was updated successfully, but these errors were encountered: