source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/missing-data/compare.m @ 37

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

Added original make3d

File size: 1.2 KB
Line 
1function y = compare(M,INC,r,ERR,n,starts)
2% run shum's method, and mine on the same matrix, and compare with ground truth.
3% Gaussian error is added to the matrix, with sigma as given.
4global Mexternal INCexternal
5
6num_random_starts = starts;
7num_data = num_random_starts+2+2;
8% random starts + my method + my method & iterative, + ground truth + g.t. & it.
9
10[M, INC, ERR] = rem_inc_els(M, INC, ERR, r);
11Merr = M + ERR;
12Mexternal = Merr;
13INCexternal = INC;
14INCsize = min(size(INC));
15if INCsize < r
16  y = repeat(-2,num_data);
17else
18  shum_err = [];
19  for i=1:num_random_starts
20    shum_err = [shum_err,shum(Merr,INC,r,0,100)];
21  end
22  [rankr_err, rankr_res] = rankr(Merr,INC,r,n);
23  if rankr_err == -2
24    rankr_shum_err = -2;
25  else
26    rankr_shum_err = shum(Merr,INC,r,rankr_res,100);
27  end
28%  if r==2
29%    [rankall_err, rankall_res] = rank2(Merr,INC);
30%  elseif r==3
31%    [rankall_err, rankall_res] = rank3(Merr,INC);
32%  else
33%    rankall_err = -2;
34%  end
35%  if rankall_err == -2
36%    rankall_shum_err = -2;
37%  else
38%    rankall_shum_err = shum(Merr,INC,r,rankall_res,100);
39%  end
40  ground_truth_err = sum(sum((M.*INC - Merr.*INC).^2));
41  gt_shum_err = shum(Merr,INC,r,M,100);
42  y=[shum_err,rankr_err,rankr_shum_err,ground_truth_err,gt_shum_err];
43end
Note: See TracBrowser for help on using the repository browser.