need a function to create eigenface image

R

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(imagename)

since i am using images of 200X200 size,
i use an array with 40000 elements like
[ -92.35294118 -81.88235294 -67.58823529 ..., -3.47058824
-13.23529412 -9.76470588]
the problem is ,i get an image that is too dark.it looks like a face
but is too dark that even different arrays will create images rhat all
look alike!..
is there a way to 'tone it down' so that i can generate an eigenface
that can be displayed better?

thanks
RG
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,269
Latest member
vinaykumar_nevatia23

Latest Threads

Top