1

I have an image, loaded from a file thus:

img = misc.imread('mypic.jpg')

it is a 3 dimensional, RGB numpy.ndarray. I wish to turn it into a greyscale ndarray (1-D).

4

1 回答 1

1

I don't know if I understood your question, but I think this should do what you want:

img = misc.imread('mypic.jpg', flatten=True)

See the documentation: http://docs.scipy.org/doc/scipy/reference/generated/scipy.misc.imread.html

于 2013-08-27T14:38:07.753 回答