-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
feature.peak_local_max changes input image #5410
Comments
Thank you @odoublewen for reporting, I will investigate ASAP 😉 |
This seems similar to #5235 as well? I remember because I ran into the same problem recently and discovered that issue when I was trying to figure it out. |
@memoryleine, I can't reproduce the bug with current >>> import skimage
>>> from skimage import feature
>>> import numpy as np
>>>
>>> print("skimage version")
skimage version
>>> print(skimage.__version__)
0.19.0.dev0
>>>
>>> im = np.genfromtxt('im_int.txt')
>>> labels = np.genfromtxt('labels_int.txt', dtype=int)
>>>
>>> print("image before calling feature.peak_local_max")
image before calling feature.peak_local_max
>>> print(im)
[[1145. 1136. 1041. ... 1055. 999. 1153.]
[1115. 1107. 1073. ... 1001. 1060. 1114.]
[1091. 1065. 1069. ... 927. 1124. 1109.]
...
[1110. 1168. 908. ... 1149. 917. 953.]
[1045. 1104. 937. ... 1057. 1094. 916.]
[ 793. 954. 1128. ... 1013. 1018. 983.]]
>>> print(np.min(im))
793.0
>>>
>>> peaks = feature.peak_local_max(im, labels=labels, num_peaks_per_label=1, exclude_border=False)
>>>
>>> print("image after calling feature.peak_local_max")
image after calling feature.peak_local_max
>>> print(im)
[[1145. 1136. 1041. ... 1055. 999. 1153.]
[1115. 1107. 1073. ... 1001. 1060. 1114.]
[1091. 1065. 1069. ... 927. 1124. 1109.]
...
[1110. 1168. 908. ... 1149. 917. 953.]
[1045. 1104. 937. ... 1057. 1094. 916.]
[ 793. 954. 1128. ... 1013. 1018. 983.]]
>>> print(np.min(im))
793.0 I will investigate more concerning v18 😉 . |
OK, as @memoryleine pointed out 👏, this bug is already reported in #5235 and it is fixed by #5236 😉. I will close this issue as it is already fixed. Thank you again @odoublewen for reporting. |
Description
Under certain conditions, the input
image
changes after callingfeature.peak_local_max
. This behavior is evident in scikit-image 0.18.0 and 0.18.1. It is not present in 0.17.2Way to reproduce
Input data files attached:
im_int.txt
labels_int.txt
Script:
Output from both 0.17.2 and 0.18.1:
Version information
FYI @rfezzani - Somewhat similar to #5047
The text was updated successfully, but these errors were encountered: