[Numpy-discussion] eigenface image too dark

Nadav Horesh nadavh@visionsense....
Thu Mar 20 00:48:52 CDT 2008

I never used the putdata interface but the fromstring. It is likely that "putdata" is more flexible. However I urge you to use matplotlib: plotting with "imshow" followed by colorbar(), enables use to inspect the true pixels value, add grids, zoom etc.


-----הודעה מקורית-----
מאת: numpy-discussion-bounces@scipy.org בשם 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_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 array of floats as it is ?
even without  changing the type as uint8 the code makes clear images
when i use
disp_array = ((inputarray-a_min)* 255/(a_max - a_min))

thanks again
Numpy-discussion mailing list

More information about the Numpy-discussion mailing list