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 , 14 years ago | |
---|---|
File size: 364 bytes |
Rev | Line | |
---|---|---|
[37] | 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 | ||
11 | function n = planefit(X); | |
12 | ||
13 | X = X-repmat(mean(X),size(X,1),1); | |
14 | ||
15 | [u,s,v] =svd(X); | |
16 | ||
17 | n = v(:,3); | |
18 | n = n./norm(n); | |
19 | ||
20 | return |
Note: See TracBrowser
for help on using the repository browser.