[Numpy-discussion] eigenface image too dark

royG roygeorget@gmail....
Wed Mar 19 08:57:10 CDT 2008

> 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

More information about the Numpy-discussion mailing list