When using skimage.transform.rescale()
I get an output image array of which has 3 dimensions when my input image is just 2 dimensions.
from skimage import io, color, transform
image = io.imread(r'C:\Users\ParthD\PycharmProjects\pythonProject\test_images\6.png')
image_bw = color.rgb2gray(color.rgba2rgb(image))
image_rescaled = transform.rescale(image, scale=0.5, anti_aliasing=True)
print(image_bw.shape)
print(image_rescaled.shape)
To this I get the output as:
(397, 602)
(198, 301, 2)
Where is that additional dimension with value 2 is getting added up, I'm not sure. I checked with the rescale function documentation but there is no parameter which contributes to this extra dimension.