Re: [Numpy-discussion] confusion about eigenvector

2008-02-29 Thread [EMAIL PROTECTED]
> This example assumes that facearray is an ndarray.(like you described > in original post ;-) ) It looks like you are using a matrix. hi Arnar thanks .. a few doubts however 1.when i use say 10 images of 4X3 each u, s, vt = linalg.svd(facearray, 0) i will get vt of shape (10,12) can't i take th

Re: [Numpy-discussion] PCA on set of face images

2008-02-29 Thread Peter Skomoroch
I think that is correct... Here is what the final result should look like: http://www.datawrangling.com/media/images/first_16.png If the dimensions for the sample faces don't work out to ( 361 x 361 ) in the end, then you are likely to be missing a transpose somewhere. Also, be aware that the s

Re: [Numpy-discussion] contiguous true

2008-02-29 Thread Anne Archibald
On 01/03/2008, Charles R Harris <[EMAIL PROTECTED]> wrote: > > On Fri, Feb 29, 2008 at 10:53 AM, John Hunter <[EMAIL PROTECTED]> wrote: > > > I have a boolean array and would like to find the lowest index "ind" > > > where N contiguous elements are all True. Eg, if x is [...] > Oops, ind = aran

Re: [Numpy-discussion] contiguous true

2008-02-29 Thread Charles R Harris
On Fri, Feb 29, 2008 at 11:12 PM, Charles R Harris < [EMAIL PROTECTED]> wrote: > > > On Fri, Feb 29, 2008 at 10:53 AM, John Hunter <[EMAIL PROTECTED]> wrote: > > > [apologies if this is a resend, my mail just flaked out] > > > > I have a boolean array and would like to find the lowest index "ind"

Re: [Numpy-discussion] contiguous true

2008-02-29 Thread Charles R Harris
On Fri, Feb 29, 2008 at 10:53 AM, John Hunter <[EMAIL PROTECTED]> wrote: > [apologies if this is a resend, my mail just flaked out] > > I have a boolean array and would like to find the lowest index "ind" > where N contiguous elements are all True. Eg, if x is > > In [101]: x = np.random.rand(20)

Re: [Numpy-discussion] PCA on set of face images

2008-02-29 Thread [EMAIL PROTECTED]
On Mar 1, 12:57 am, "Peter Skomoroch" wrote: I think > > matlab example should be easy to translate to scipy/matplotlib using the > > montage function: > > > load faces.mat > > %Form covariance matrix > > C=cov(faces'); > > %build eigenvectors and eigenvalues > > [E,D] = eig(C); hi Peter, nice

[Numpy-discussion] image to array doubt

2008-02-29 Thread Ray Schumacher
At 10:00 AM 2/29/2008, you wrote: > Robin wrote > I'm not sure why they would be doing this - to me it looks they might > be using Image as a convenient way to store some other kind of data... thanks Robin, I am wondering if there is a more straightforward way to do these.. especially the vector

Re: [Numpy-discussion] PCA on set of face images

2008-02-29 Thread Peter Skomoroch
Forgot the url: http://www.cis.hut.fi/Opinnot/T-61.2010/harjoitustyo_en07.shtml On Fri, Feb 29, 2008 at 2:56 PM, Peter Skomoroch <[EMAIL PROTECTED]> wrote: > Here is the page I referenced for the octave version ... it includes > examples very similar to what you want. I will be posting a very s

Re: [Numpy-discussion] PCA on set of face images

2008-02-29 Thread Peter Skomoroch
Here is the page I referenced for the octave version ... it includes examples very similar to what you want. I will be posting a very similar example in Python later this month. I don't have any Python code on hand for the Petland paper, but I think matlab example should be easy to translate to s

Re: [Numpy-discussion] PCA on set of face images

2008-02-29 Thread Peter Skomoroch
RoyG, The timing of your question couldn't be better, I just did an blog post on this (I also plugged scipy and the EPD): http://www.datawrangling.com/python-montage-code-for-displaying-arrays.html The code basically replicates the matlab montage() function and approach to handling grayscale ima

[Numpy-discussion] PCA on set of face images

2008-02-29 Thread [EMAIL PROTECTED]
hi guys I have a set of face images with which i want to do face recognition using Petland's PCA method.I gathered these steps from their docs 1.represent matrix of face images data 2.find the adjusted matrix by substracting the mean face 3.calculate covariance matrix (cov=A* A_transpose) where

Re: [Numpy-discussion] image to array doubt

2008-02-29 Thread Andrew Straw
[EMAIL PROTECTED] wrote: >> Robin wrote >> I'm not sure why they would be doing this - to me it looks they might >> be using Image as a convenient way to store some other kind of data... > > thanks Robin, > I am wondering if there is a more straightforward way to do these.. > especially the vector

Re: [Numpy-discussion] contiguous true

2008-02-29 Thread Robert Kern
On Fri, Feb 29, 2008 at 11:53 AM, John Hunter <[EMAIL PROTECTED]> wrote: > [apologies if this is a resend, my mail just flaked out] > > I have a boolean array and would like to find the lowest index "ind" > where N contiguous elements are all True. Eg, if x is > > In [101]: x = np.random.rand(2

Re: [Numpy-discussion] image to array doubt

2008-02-29 Thread [EMAIL PROTECTED]
> Robin wrote > I'm not sure why they would be doing this - to me it looks they might > be using Image as a convenient way to store some other kind of data... thanks Robin, I am wondering if there is a more straightforward way to do these.. especially the vector to image function D __

[Numpy-discussion] contiguous true

2008-02-29 Thread John Hunter
[apologies if this is a resend, my mail just flaked out] I have a boolean array and would like to find the lowest index "ind" where N contiguous elements are all True. Eg, if x is In [101]: x = np.random.rand(20)>.4 In [102]: x Out[102]: array([False, True, True, False, False, True, True, F

Re: [Numpy-discussion] image to array doubt

2008-02-29 Thread Robin
On Fri, Feb 29, 2008 at 2:54 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > hi > i came across a codebase by rice univ people..in that there are some > functions for conversion btw image and vectors I'm not an expert by any means but I thought I'd try and help... > 1. > def image_to_vecto

[Numpy-discussion] image to array doubt

2008-02-29 Thread [EMAIL PROTECTED]
hi i came across a codebase by rice univ people..in that there are some functions for conversion btw image and vectors 1. def image_to_vector(self, filename): try: im = Image.open(filename) except IOError: print 'couldn\'t load ' + filename sys.e

[Numpy-discussion] ANN: sympycore version 0.1 released

2008-02-29 Thread Pearu Peterson
We are proud to present a new Python package: sympycore - an efficient pure Python Computer Algebra System Sympycore is available for download from http://sympycore.googlecode.com/ Sympycore is released under the New BSD License. Sympycore provides efficient data structures for represent

Re: [Numpy-discussion] A little help please?

2008-02-29 Thread Damian Eads
Neal Becker wrote: > Sounds like this needs a bit of re-thinking. > > Given a set of function signatures: > F(a,b,c) > F(d,e,f) > ... > > The user calls: > F(A,B,C) (no relation between a,A ,etc) > > How do we find the 'best' match? > > I think we can start with: > Rules: > 1) Only allowed (at