source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/BlueCCal/MultiCamSelfCal/LocalAlignments/planefit.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 364 bytes
Line 
1% planefit ... fit a plane to a point cloud
2%              algebraic minimization applied
3%
4% n = planefit(X);
5% X ... Nx3 matrix with 3D points
6%
7% n ... 3x1 normal of the fitted plane
8%
9% $Id: planefit.m,v 1.1 2003/07/03 15:34:43 svoboda Exp $
10
11function n = planefit(X);
12
13X = X-repmat(mean(X),size(X,1),1);
14
15[u,s,v] =svd(X);
16
17n = v(:,3);
18n = n./norm(n);
19
20return
Note: See TracBrowser for help on using the repository browser.