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
For some reason rgb2lab([1,1,1]) returns [0.,0.,0.] instead of array([ 1.00000000e+02, -2.45493786e-03, 4.65342115e-03]).
It works fine on my windows machine but the DO app doesn't work properly.
Way to reproduce:
from skimage.color import rgb2lab
rgb2lab([1,1,1])
This is a matter of image data type, indeed: rgb2lab calls rgb2xyz which calls _prepare_colorarray which calls img_as_float32 or (in this case) img_as_float64 to convert the input array into floating-point representation... and:
importnumpyasnpimportskimageasskiprint(np.__version__)
1.26.4print(ski.__version__)
0.23.2arr= [1, 1, 1]
arr=np.asanyarray(arr)
print(arr.dtype)
int64# Range of int64 goes up to 1/(2**64 - 1) so:assertski.util.dtype.img_as_float64(arr)[0] ==1/(2**64-1) *2
Description:
For some reason rgb2lab([1,1,1]) returns [0.,0.,0.] instead of array([ 1.00000000e+02, -2.45493786e-03, 4.65342115e-03]).
It works fine on my windows machine but the DO app doesn't work properly.
Way to reproduce:
from skimage.color import rgb2lab
rgb2lab([1,1,1])
Version information:
The text was updated successfully, but these errors were encountered: