Re: using PIL for PCA analysis

2009-01-13 Thread Jan Erik Solem
ariance matrix for the set of images? > I wrote a short script for doing PCA on images using python, with some explanations and example code http://jesolem.blogspot.com/2009/01/pca-for-images-using-python.html here . Could be of help to you guys. -- View this message in context: http://ww

Re: using PIL for PCA analysis

2008-02-26 Thread harryos
>Paul McGuire wrote > # following approx fromhttp://www.dfanning.com/ip_tips/color2gray.html > grayscale = lambda (R,G,B) : int(0.3*R + 0.59*G + 0.11*B) > print [ [ grayscale(rgb) for rgb in row ] for row in sampledata ] Paul in PIL handbook ,they mention a Luma transform on page15, under the im

Re: using PIL for PCA analysis

2008-02-21 Thread Paul McGuire
On Feb 21, 1:41 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > hi guys > i am trying out  PCA analysis using python.I have a set of > jpeg(rgbcolor) images whose pixel data i need to extract and make a > matrix .( rows =num of images and cols=num of pixels) > For this i need to represent an i

Re: using PIL for PCA analysis

2008-02-21 Thread [EMAIL PROTECTED]
On Feb 21, 7:35 pm, "Bronner, Gregory" <[EMAIL PROTECTED]> wrote: you can do this using numpy and scipy > fairly easily, and you can transform PIL arrays into Numpy arrays pretty > quickly as well. > i can use numpy ndarray or matrix once i have a PIL array with elements in the correct format(ie a

RE: using PIL for PCA analysis

2008-02-21 Thread Bronner, Gregory
, February 21, 2008 2:41 AM To: python-list@python.org Subject: using PIL for PCA analysis hi guys i am trying out PCA analysis using python.I have a set of jpeg(rgbcolor) images whose pixel data i need to extract and make a matrix .( rows =num of images and cols=num of pixels) For this i need to

Re: using PIL for PCA analysis

2008-02-21 Thread Matthieu Brucher
Hi, You should convert your data to numpy and make it 1D (for the moment, it is 3D) by calling the ravel() method. Then you can create your covariance matrix ;) Matthieu 2008/2/21, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > hi guys > i am trying out PCA analysis using python.I have a set of > j

using PIL for PCA analysis

2008-02-20 Thread [EMAIL PROTECTED]
hi guys i am trying out PCA analysis using python.I have a set of jpeg(rgbcolor) images whose pixel data i need to extract and make a matrix .( rows =num of images and cols=num of pixels) For this i need to represent an image as an array. i was able to do this using java's BufferedImage as below