source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/zisserman/vgg_multiview/vgg_conditioner_from_pts.m @ 37

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

Added original make3d

  • Property svn:executable set to *
File size: 805 bytes
Line 
1function T = vgg_conditioner_from_pts(Pts,isotropic)
2
3% VGG_CONDITIONER_FROM_PTS - Returns a conditioning matrix for points
4%
5%       T = vgg_conditioner_from_pts(Pts [,isotropic])
6%
7% Returns a DxD matrix that normalizes Pts to have mean 0 and stddev sqrt(2)
8%
9%
10%IN:
11%       Pts - DxK list of K projective points. Last row is ignored.
12%       isotropic - optional; if present then T(1,1)==T(2,2)==...==T(D-1,D-1).
13%
14%
15%OUT:
16%       T - DxD conditioning matrix
17
18% Yoni, Thu Feb 14 12:24:48 2002
19
20Dim=size(Pts,1);
21
22Pts=vgg_get_nonhomg(Pts);
23Pts=Pts(1:Dim-1,:);
24
25m=mean(Pts,2);
26s=std(Pts');
27s=s+(s==0);
28
29if nargin==1
30  T=[ diag(sqrt(2)./s) -diag(sqrt(2)./s)*m];
31else % isotropic; added by TW
32  T=[ diag(sqrt(2)./(ones(1,Dim-1)*mean(s))) -diag(sqrt(2)./s)*m];
33end
34T(Dim,:)=0;
35T(Dim,Dim)=1;
Note: See TracBrowser for help on using the repository browser.