source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/BlueCCal/MultiCamValidation/Ransac/normu.m @ 37

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

Added original make3d

File size: 571 bytes
Line 
1function A = normu(u);
2
3% NORMU Normalizes image points to be used for LS estimation.
4%       A = NORMU(u) finds normalization matrix A so that mean(A*u)=0 and mean(||A*u||)=sqrt(2).
5%       (see Hartley: In Defence of 8-point Algorithm, ICCV`95).
6%       Parameters:
7%         u ... Size (2,N) or (3,N). Points to normalize.
8%         A ... Size (3,3). Normalization matrix.
9
10if size(u,1)==3, u = p2e(u); end
11
12m = mean(u')'; % <=> mean (u,2)
13u = u - m*ones(1,size(u,2));
14distu = sqrt(sum(u.*u));
15r = mean(distu)/sqrt(2);
16A  = diag([1/r 1/r 1]);
17A(1:2,3) = -m/r;
18
19return
Note: See TracBrowser for help on using the repository browser.