source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/BlueCCal/MultiCamSelfCal/MartinecPajdla/utils/dist.m

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

Added original make3d

File size: 736 bytes
Line 
1%dist Return distance between image points in homog. coor. in specified metric.
2%
3%  d = dist(M1, M2, metric)
4%
5%  Parameters:
6%    metric .. x- and y-coordinates are associated with a single image point
7%              1 .. square root of sum of squares of x- and y-coordinates
8%              2 .. std of x- and y-coordinates
9%                   <=> equivalent to noise type 2 in noise_add
10
11function d = dist(M1, M2, metric)
12
13if nargin < 3, metric = 2; end
14
15switch metric,
16 case 1, I = ~isnan(M1(1:3:end,:)) &~isnan(M2(1:3:end,:));
17  d = eucl_dist(M1, M2, I) / sum(sum(I));
18 case 2, D = normalize_cut(M1) - normalize_cut(M2);
19  i = find(~isnan(D(1:2:end)));
20  d = std([D(2*i-1) D(2*i)]);
21 otherwise, error('dist: unknown metric');
22end
Note: See TracBrowser for help on using the repository browser.