You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason is that after conversion by rgb2gray the image is of type float64 and the pixel range [0.0, 1.0].
However, in the following line dtype_limits is called with clip_negative=False:
Yeah, yikes, this is a bug, but also a subtle one because technically float dtypes do support negative numbers. @jni until skimage 2.0, would it make sense to change that range to (0, 1) everywhere instead of (-1, 1)?
Hey, there hasn't been any activity on this issue for more than 180 days. For now, we have marked it as "dormant" until there is some new activity. You are welcome to reach out to people by mentioning them here or on our forum if you need more feedback! If you think that this issue is no longer relevant, you may close it by yourself; otherwise, we may do it at some point (either way, it will be done manually). In any case, thank you for your contributions so far!
When using the
skimage.exposure.is_low_contrast
function I observe different results ifa. passing a grayscale image of type uint8 with pixel range [0, 255] that I converted beforehand
versus:
b. passing an RGB image and let it be converted within
is_low_contrast
by line:scikit-image/skimage/exposure/exposure.py
Line 833 in 5e74a4a
The reason is that after conversion by
rgb2gray
the image is of type float64 and the pixel range [0.0, 1.0].However, in the following line
dtype_limits
is called withclip_negative=False
:scikit-image/skimage/exposure/exposure.py
Line 835 in 5e74a4a
Which results in
dlimits=(-1,1)
and an unexpected value of the calculated ratio.I expect
dtype_limits
should be called withclip_negative=True
to receive the expected ratio.The text was updated successfully, but these errors were encountered: