% condition points, determine conditioning matrix see PCV (6.137), but sigma*sqrt(dim) instead of max Usage: [xc,M] = condition_Points(x) x - Nxd matrix of Cartesian coordinates xc - Nxd matrix of Cartesian coordinates of conditioned points M - d+1 x d+1 matrix of conditioning Wolfgang Förstner 2/2013 wfoerstn@uni-bonn.de See also uncondition_Points, condition_Homography, uncondition_Homography
0001 %% condition points, determine conditioning matrix 0002 % see PCV (6.137), but sigma*sqrt(dim) instead of max 0003 % 0004 % Usage: 0005 % [xc,M] = condition_Points(x) 0006 % 0007 % x - Nxd matrix of Cartesian coordinates 0008 % 0009 % xc - Nxd matrix of Cartesian coordinates of conditioned points 0010 % M - d+1 x d+1 matrix of conditioning 0011 % 0012 % Wolfgang Förstner 2/2013 0013 % wfoerstn@uni-bonn.de 0014 % 0015 % See also uncondition_Points, condition_Homography, uncondition_Homography 0016 0017 function [xc,M] = condition_Points(x) 0018 0019 % number and dimension 0020 [N,d] = size(x); 0021 0022 % mean and scale 0023 xm = mean(x); 0024 C = cov(x); 0025 sigma = sqrt(d)*sqrt(trace(C)/d); 0026 0027 % conditioning matrix 0028 M = [eye(d)/sigma -xm/sigma;... 0029 zeros(1,d) 1]; 0030 0031 % condition points 0032 xch = (M * [x ones(N,1)]')'; 0033 0034 % Cartesian coordinates 0035 xc = xch(:,1:d); 0036 0037