Re: [Numpy-discussion] 3d plane to point cloud fitting using SVD

2011-01-26 Thread Huan Liu
Hi, I just confirmed Stefan's answer on one of the examples in http://www.mathworks.co.jp/matlabcentral/newsreader/view_thread/262996 matlab: A = randn(100,2)*[2 0;3 0;-1 2]'; A = A + randn(size(A))/3; [U,S,V] = svd(A); X = V(:,end) python: from numpy import * A = random.randn(100

Re: [Numpy-discussion] 3d plane to point cloud fitting using SVD

2010-05-05 Thread Stéfan van der Walt
Hi Peter On 5 May 2010 10:02, Peter Schmidtke wrote: > u,s,vh=numpy.linalg.linalg.svd(M) > > Then in the matlab analog they use the last column of vh to get the a,b,c > coefficients for the equation > a,b,c=vh[:, -1] in numpy Note that vh is the conjugate transpose of v. You are probably intere

[Numpy-discussion] 3d plane to point cloud fitting using SVD

2010-05-05 Thread Peter Schmidtke
Dear Numpy Users, I want to fit a 3d plane into a 3d point cloud and I saw that one could use svd for this purpose. So as I am very fond of numpy I saw that svd was implementented in the linalg module. Currently I have a numpy array called xyz with n lines (number of points) and 3 columns (x,y,z