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

filters.gaussian ignores preserve_range #3999

Closed
stefanv opened this issue Jul 9, 2019 · 3 comments
Closed

filters.gaussian ignores preserve_range #3999

stefanv opened this issue Jul 9, 2019 · 3 comments

Comments

@stefanv
Copy link
Member

stefanv commented Jul 9, 2019

from skimage import filters
import numpy as np

x = filters.gaussian(np.array([[0, 0.5, 200, 1000]]), preserve_range=True)
y = filters.gaussian(np.array([[0, 0.5, 200, 1000]]), preserve_range=False)

np.testing.assert_array_equal(x, y)
@sciunto
Copy link
Member

sciunto commented Jul 10, 2019

I don't think this is a bug. Docstring says:

    Whether to keep the original range of values. Otherwise, the input
    image is converted according to the conventions of `img_as_float`.

https://github.com/scikit-image/scikit-image/blob/master/skimage/filters/_gaussian.py#L60

and img_as_float says:

Notes
-----
The range of a floating point image is [0.0, 1.0] or [-1.0, 1.0] when
converting from unsigned or signed datatypes, respectively.
If the input image has a float type, intensity values are not modified
and can be outside the ranges [0.0, 1.0] or [-1.0, 1.0].

@sciunto
Copy link
Member

sciunto commented Jul 23, 2019

@stefanv Do you agree that we can close this ussue? or you think that the behavior must be changed?

@rfezzani
Copy link
Member

I agree with @sciunto, this doesn't look like a bug but the expected result.

@sciunto sciunto added this to the 0.17 milestone Feb 13, 2020
@scikit-image scikit-image locked and limited conversation to collaborators Oct 18, 2021
@scikit-image scikit-image unlocked this conversation Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants