1 | % By Philip Torr 2002
|
---|
2 | % copyright Microsoft Corp.
|
---|
3 | %this is a script to test the self calibration stuff
|
---|
4 |
|
---|
5 | %main()
|
---|
6 | %profile on
|
---|
7 |
|
---|
8 | m3 = 256;
|
---|
9 | %user chooses the appropriate nmethod
|
---|
10 | method = 3;
|
---|
11 | total_sse = 0;
|
---|
12 | epipole_distance = 0;
|
---|
13 | %
|
---|
14 | % randn('state',0)
|
---|
15 | % rand('state',0)
|
---|
16 | no_tests = 1;
|
---|
17 | for(i = 1:no_tests)
|
---|
18 | % [true_F,x1,y1,x2,y2,nx1,ny1,nx2,ny2] = ...
|
---|
19 | % torr_gen_2view_matches(foc, no_matches, noise_sigma, translation_mult, translation_adder, ...
|
---|
20 | % rotation_multplier, min_Z,Z_RAN,m3);
|
---|
21 | [true_F,x1,y1,x2,y2,nx1,ny1,nx2,ny2,true_C,true_R,true_t, true_E] = torr_gen_2view_matches;
|
---|
22 | true_epipole = torr_get_right_epipole(true_F,m3);
|
---|
23 |
|
---|
24 | no_matches = length(nx1);
|
---|
25 |
|
---|
26 | matches = [nx1,ny1,nx2,ny2];
|
---|
27 | perfect_matches = [x1,y1,x2,y2];
|
---|
28 | set_rank2 = 0;
|
---|
29 |
|
---|
30 | %first estimate F
|
---|
31 | [f, e1, n_inliers,inlier_index,nF] = torr_estimateF( matches, m3, [], method, set_rank2);
|
---|
32 |
|
---|
33 | %check errors vs the true (noise free) points
|
---|
34 | groundtrutherrors = torr_errf2(f, x1,y1,x2,y2, no_matches, m3);
|
---|
35 | total_sse = total_sse + sum(groundtrutherrors);
|
---|
36 |
|
---|
37 |
|
---|
38 | %calc noisy epipole
|
---|
39 | noisy_epipole = torr_get_right_epipole(nF,m3);
|
---|
40 | epipole_distance = epipole_distance + sqrt(norm(true_epipole -noisy_epipole));
|
---|
41 | end
|
---|
42 |
|
---|
43 | disp(' the average sse vs the noise free points is')
|
---|
44 | total_sse/no_tests
|
---|
45 | %profile off
|
---|
46 |
|
---|
47 | disp('RMS distance between true and estimated right epipole is')
|
---|
48 | epipole_distance
|
---|
49 |
|
---|
50 |
|
---|
51 |
|
---|
52 |
|
---|
53 | %torr_display_matches(matches)
|
---|
54 |
|
---|
55 |
|
---|
56 |
|
---|
57 |
|
---|
58 |
|
---|
59 | % e = fm_error_hs(F, n1, n2, nowarn); |
---|