I'm trying to load an image as grayscale as follows:
from skimage import data
from skimage.viewer import ImageViewer
img = data.imread('my_image.png', as_gray=True)
However, if I check for its shape using img.shape
it turns out to be a three-dimensional, and not two-dimensional, array. What am I doing wrong?
data.imread()
to be preferred overrgb2gray()
from thergb2gray
package? – Kunstlied