Re: [Numpy-discussion] eigenface image too dark

2008-03-19 Thread Nadav Horesh
ודעה מקורית- מאת: [EMAIL PROTECTED] בשם royG נשלח: ד 19-מרץ-08 15:57 אל: numpy-discussion@scipy.org נושא: Re: [Numpy-discussion] eigenface image too dark > Longer solution: >Scale your array: > a_min = inputarray.min() > a_max = inputarray.max() > disp_arra

Re: [Numpy-discussion] eigenface image too dark

2008-03-19 Thread royG
> Longer solution: >Scale your array: > a_min = inputarray.min() > a_max = inputarray.max() > disp_array = ((inputarray-a_min)* 255/(a_max - a_min)).astype('uint8')\ > . thanx Nadav..the scaling works..and makes clear images but why .astype("uint8") ? can't i use the a

Re: [Numpy-discussion] eigenface image too dark

2008-03-19 Thread Nadav Horesh
#x27;uint8')\ . . . newimg.putdata(disp_array) Nadav. -הודעה מקורית- מאת: [EMAIL PROTECTED] בשם royG נשלח: ד 19-מרץ-08 08:23 אל: numpy-discussion@scipy.org נושא: [Numpy-discussion] eigenface image too dark hi while trying to make an eigenface image from a

[Numpy-discussion] eigenface image too dark

2008-03-18 Thread royG
hi while trying to make an eigenface image from a numpy array of floats i tried this from numpy import array import Image imagesize=(200,200) def makeimage(inputarray,imagename): inputarray.shape=(-1,) newimg=Image.new('L', imagesize) newimg.putdata(inputarray) newimg.save