[Numpy-discussion] eigenface image too dark
Nadav Horesh
nadavh at visionsense.com
Thu Mar 20 01:48:52 EDT 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.
Nadav.
-----הודעה מקורית-----
מאת: numpy-discussion-bounces at scipy.org בשם royG
נשלח: ד 19-מרץ-08 15:57
אל: numpy-discussion at 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
RG
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion at scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
More information about the NumPy-Discussion
mailing list