This repository has been archived by the owner on Aug 7, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
GetFMatrix.m
127 lines (118 loc) · 4.2 KB
/
GetFMatrix.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
function ImgPair_MV = GetFMatrix(Img1_KLT,Img2_KLT,Acc)
if size(Img1_KLT.R1_p,1) > 10
ImgPair_MV.R1_hasF = 1;
try
[ImgPair_MV.R1_F,ImgPair_MV.R1_in,ImgPair_MV.R1_r] = ransac(@fmatrix,[Img1_KLT.R1_p';Img2_KLT.R1_p'],Acc,'verbose');
catch err
[ImgPair_MV.R1_F,ImgPair_MV.R1_in,ImgPair_MV.R1_r] = ransac(@fmatrix,[Img1_KLT.R1_p';Img2_KLT.R1_p'],Acc*10,'verbose');
end
else
ImgPair_MV.R1_hasF = 0;
ImgPair_MV.R1_F = -1;
ImgPair_MV.R1_in = -1;
ImgPair_MV.R1_r = -1;
end
if size(Img1_KLT.R2_p,1) > 10
ImgPair_MV.R2_hasF = 1;
try
[ImgPair_MV.R2_F,ImgPair_MV.R2_in,ImgPair_MV.R2_r] = ransac(@fmatrix,[Img1_KLT.R2_p';Img2_KLT.R2_p'],Acc,'verbose');
catch err
[ImgPair_MV.R2_F,ImgPair_MV.R2_in,ImgPair_MV.R2_r] = ransac(@fmatrix,[Img1_KLT.R2_p';Img2_KLT.R2_p'],Acc*10,'verbose');
end
else
ImgPair_MV.R2_hasF = 0;
ImgPair_MV.R2_F = -1;
ImgPair_MV.R2_in = -1;
ImgPair_MV.R2_r = -1;
end
if size(Img1_KLT.R3_p,1) > 10
ImgPair_MV.R3_hasF = 1;
try
[ImgPair_MV.R3_F,ImgPair_MV.R3_in,ImgPair_MV.R3_r] = ransac(@fmatrix,[Img1_KLT.R3_p';Img2_KLT.R3_p'],Acc,'verbose');
catch err
[ImgPair_MV.R3_F,ImgPair_MV.R3_in,ImgPair_MV.R3_r] = ransac(@fmatrix,[Img1_KLT.R3_p';Img2_KLT.R3_p'],Acc*10,'verbose');
end
else
ImgPair_MV.R3_hasF = 0;
ImgPair_MV.R3_F = -1;
ImgPair_MV.R3_in = -1;
ImgPair_MV.R3_r = -1;
end
if size(Img1_KLT.R4_p,1) > 10
ImgPair_MV.R4_hasF = 1;
try
[ImgPair_MV.R4_F,ImgPair_MV.R4_in,ImgPair_MV.R4_r] = ransac(@fmatrix,[Img1_KLT.R4_p';Img2_KLT.R4_p'],Acc,'verbose');
catch err
[ImgPair_MV.R4_F,ImgPair_MV.R4_in,ImgPair_MV.R4_r] = ransac(@fmatrix,[Img1_KLT.R4_p';Img2_KLT.R4_p'],Acc*10,'verbose');
end
else
ImgPair_MV.R4_hasF = 0;
ImgPair_MV.R4_F = -1;
ImgPair_MV.R4_in = -1;
ImgPair_MV.R4_r = -1;
end
if size(Img1_KLT.R5_p,1) > 10
ImgPair_MV.R5_hasF = 1;
try
[ImgPair_MV.R5_F,ImgPair_MV.R5_in,ImgPair_MV.R5_r] = ransac(@fmatrix,[Img1_KLT.R5_p';Img2_KLT.R5_p'],Acc,'verbose');
catch err
[ImgPair_MV.R5_F,ImgPair_MV.R5_in,ImgPair_MV.R5_r] = ransac(@fmatrix,[Img1_KLT.R5_p';Img2_KLT.R5_p'],Acc*10,'verbose');
end
else
ImgPair_MV.R5_hasF = 0;
ImgPair_MV.R5_F = -1;
ImgPair_MV.R5_in = -1;
ImgPair_MV.R5_r = -1;
end
if size(Img1_KLT.R6_p,1) > 10
ImgPair_MV.R6_hasF = 1;
try
[ImgPair_MV.R6_F,ImgPair_MV.R6_in,ImgPair_MV.R6_r] = ransac(@fmatrix,[Img1_KLT.R6_p';Img2_KLT.R6_p'],Acc,'verbose');
catch err
[ImgPair_MV.R6_F,ImgPair_MV.R6_in,ImgPair_MV.R6_r] = ransac(@fmatrix,[Img1_KLT.R6_p';Img2_KLT.R6_p'],Acc*10,'verbose');
end
else
ImgPair_MV.R6_hasF = 0;
ImgPair_MV.R6_F = -1;
ImgPair_MV.R6_in = -1;
ImgPair_MV.R6_r = -1;
end
if size(Img1_KLT.R7_p,1) > 10
ImgPair_MV.R7_hasF = 1;
try
[ImgPair_MV.R7_F,ImgPair_MV.R7_in,ImgPair_MV.R7_r] = ransac(@fmatrix,[Img1_KLT.R7_p';Img2_KLT.R7_p'],Acc,'verbose');
catch err
[ImgPair_MV.R7_F,ImgPair_MV.R7_in,ImgPair_MV.R7_r] = ransac(@fmatrix,[Img1_KLT.R7_p';Img2_KLT.R7_p'],Acc*10,'verbose');
end
else
ImgPair_MV.R7_hasF = 0;
ImgPair_MV.R7_F = -1;
ImgPair_MV.R7_in = -1;
ImgPair_MV.R7_r = -1;
end
if size(Img1_KLT.R8_p,1) > 10
ImgPair_MV.R8_hasF = 1;
try
[ImgPair_MV.R8_F,ImgPair_MV.R8_in,ImgPair_MV.R8_r] = ransac(@fmatrix,[Img1_KLT.R8_p';Img2_KLT.R8_p'],Acc,'verbose');
catch err
[ImgPair_MV.R8_F,ImgPair_MV.R8_in,ImgPair_MV.R8_r] = ransac(@fmatrix,[Img1_KLT.R8_p';Img2_KLT.R8_p'],Acc*10,'verbose');
end
else
ImgPair_MV.R8_hasF = 0;
ImgPair_MV.R8_F = -1;
ImgPair_MV.R8_in = -1;
ImgPair_MV.R8_r = -1;
end
if size(Img1_KLT.R9_p,1) > 10
ImgPair_MV.R9_hasF = 1;
try
[ImgPair_MV.R9_F,ImgPair_MV.R9_in,ImgPair_MV.R9_r] = ransac(@fmatrix,[Img1_KLT.R9_p';Img2_KLT.R9_p'],Acc,'verbose');
catch err
[ImgPair_MV.R9_F,ImgPair_MV.R9_in,ImgPair_MV.R9_r] = ransac(@fmatrix,[Img1_KLT.R9_p';Img2_KLT.R9_p'],Acc*10,'verbose');
end
else
ImgPair_MV.R9_hasF = 0;
ImgPair_MV.R9_F = -1;
ImgPair_MV.R9_in = -1;
ImgPair_MV.R9_r = -1
end