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
I was trying to call the skimage.util.compare_images with integers matrices (the documentation does not prevent this).
The function does return a value, but not the expected one.
I found out that the function skimage.util.img_as_float32 called in skimage.util.compare_images does not convert the int matrix to a float matrix as expected, resulting into a wrong return value for compare_images.
Way to reproduce:
importskimage.utilasskiumat_a=skiu.img_as_float32([[1.0, 1.0], [1.0, 1.0]])
mat_b=skiu.img_as_float32([[1, 1], [1, 1]])
mat_c=skiu.compare_images(mat_a, mat_b, method='diff')
assertmat_a[0][0] ==1.0# OKassertmat_b[0][0] ==1.0# Will failassertmat_c[0][0] ==0#Will fail too
Description:
I was trying to call the
skimage.util.compare_images
with integers matrices (the documentation does not prevent this).The function does return a value, but not the expected one.
I found out that the function
skimage.util.img_as_float32
called inskimage.util.compare_images
does not convert the int matrix to a float matrix as expected, resulting into a wrong return value for compare_images.Way to reproduce:
Version information:
The text was updated successfully, but these errors were encountered: