Skip to content
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

Tiebreaker code from non-maximum suppression filter looks wrong #1871

Closed
mabuchner opened this issue Dec 10, 2014 · 2 comments
Closed

Tiebreaker code from non-maximum suppression filter looks wrong #1871

mabuchner opened this issue Dec 10, 2014 · 2 comments

Comments

@mabuchner
Copy link

The following lines from GPUImageNonMaximumSuppressionFilter.m look wrong:

lowp float multiplier = 1.0 - step(centerColor.r, topColor);
multiplier = multiplier * 1.0 - step(centerColor.r, topLeftColor);
multiplier = multiplier * 1.0 - step(centerColor.r, leftColor);
multiplier = multiplier * 1.0 - step(centerColor.r, bottomLeftColor);

Multiplying by 1 and then subtracting might produce a result which is negative.
I think, correct is this:

lowp float multiplier = 1.0 - step(centerColor.r, topColor);
multiplier *= 1.0 - step(centerColor.r, topLeftColor);
multiplier *= 1.0 - step(centerColor.r, leftColor);
multiplier *= 1.0 - step(centerColor.r, bottomLeftColor);
BradLarson added a commit that referenced this issue Dec 17, 2014
… in Issue #1871. Also expanded the search radius for the non-maximum suppression filter.
@BradLarson
Copy link
Owner

This should be fixed in the latest commit. Thanks for pointing this out, it was indeed wrong.

@nishant-dani
Copy link

Am curious about this code. We are using multiplier to see how the center stacks up against the left and the top colors. But for the right and bottom colors we use a step w.r.t. maxValue. Why not use multiplier for all directions? Or alternatively maxValue for all directions. Are not both approaches equivalent? It appears that I am missing something very obvious.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants