-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Small bug in skimage.feature.peak_local_max() #3019
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
Comments
Hi, Thanks for the report. |
Thank you for the issue. We need to fix it. Can you please provide a small snippet of code so that we can reproduce the problem (and put it in a test for the future function)? |
This seems to be orthogonal to the changes proposed in #3022. Solution: sort peaks by amplitude, and suppress nearby neighbors. |
I thought that #3022 would have been merged in 0.14. Now it makes sense to merge a fix in the LTS version. |
Description
When provided both
min_distance
andthreshold_abs
parameters to theskimage.feature.peak_local_max()
function, the first parameter takes unnecessary precedence over the second one. I did not look at the code, but from my experiments it appears that a list of peaks is calculated internally, then the first constrained is applied, and then the second one. However, if there is a peak above the given threshold that lies to the right of another one under the threshold, but close to it (undermin_distance
), it will be rejected because of its proximity. As such, a tiny peak that will be excluded from the final list anyway manages to eclipse a big peak. I think the threshold criterion should be applied before the minimal distance criterion. Even better, the problem would not appear if the list of thresholds would be processed in decreasing height order, rather than top-down, left-right order (as I guess it is done now).The text was updated successfully, but these errors were encountered: