Re: Re : Re: multispectral imaging: rgb image
red=c3_r.reshape(c3,shape) TypeError: only length-1 arrays can be converted to Python scalars
I assume you want red = c3_r.reshape(c3.shape) ? The method signature for the reshape method of numpy.ndarray is: ndarray.reshape(shape, order='C')
Hi c3_r is a 1D vector of size: (333465,) I have shape=(517, 645) Now if I do: print "New Red 1D vecteur:",c3_r.shape print "original widthXheight=",shape[1]*shape[0] #Reconstitute original image size #should be a red image of size =shape red=c3_r.reshape(shape) print red.shape, red.dtype I have the right original size. Thank you Jean-Patrick On 20 mai, 23:16, Zachary Pincus <zachary.pin...@yale.edu> wrote:
red=c3_r.reshape(c3,shape) TypeError: only length-1 arrays can be converted to Python scalars
I assume you want red = c3_r.reshape(c3.shape) ?
The method signature for the reshape method of numpy.ndarray is: ndarray.reshape(shape, order='C')
participants (2)
-
jip
-
Zachary Pincus