-
-
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
'subpixel' boundaries at the edges of an image #5432
Comments
Hello @firerain42, Thanks for reporting! I agree with you, the current behaviour is not consistent. Would you like to try and investigate by yourself?
You could run this function line by line, starting with |
Hello @mkcor, I think the problem is the padding in scikit-image/skimage/segmentation/boundaries.py Lines 37 to 39 in 23fd40b
which introduces 0 as an image value. Replacing it with np.pad(label_img_expanded, 1, mode='edge') should do the trick. I would have sent a pull request, but I couldn't get the tests running on my PC (and don't have the time to find the cause).
|
Description
When using the function
find_boundaries
withmode='subpixel'
the behavior at the edges of the image seems strange to me.From the documentation it is not clear to me what the intended behavior should be. Without an option to explicitly specify the behavior at the edges of the image, I would expect a constant input image to have no boundary at all or maybe straight lines at the edges of the image. However, for constant images with a non-zero value the actual image alternates between
True
andFalse
. If the image is completely zero, there is no such effect.Way to reproduce
returns
I would expect the same output as
np.zeros((5,5), dtype=bool)
.Version information
The text was updated successfully, but these errors were encountered: