Skip to content

Commit 674158b

Browse files
committed
modified function introduction
1 parent 1572bee commit 674158b

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

test_synth.m

+9-10
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
1-
close all;
2-
clear;
3-
clc;
41
% -------------------------------------------------------------------------
52
% Program Introdution:
63
% This program is a benchmark simulation to verify the 8-point algorithm.
7-
4+
%
85
% Prgram flow
96
% Fix the first camera at the origin and randomly generate a relative pose
107
% for the second camera. Both cameras are assumed as calibrated, where the
118
% intrinsic matrix is an identify matrix. Then randomly generate 8 points
129
% in space and project them onto both cameras to obtain matched points in
1310
% two views. 8-point algorithm is then carried out to compute the essential
1411
% matrix and the result is justified.
15-
12+
%
1613
% Key variables
1714
% thetad - rotation angle in degrees
1815
% theta - rotation angle in radians
@@ -26,12 +23,14 @@
2623
% x2 - coordinates of matched features in the second view
2724
% eMatrix - the ground truth of essential matrix
2825
% eMatrix8 - the essential matrix computed using 8-point algorithm
29-
26+
%
3027
% Author: Frederic Zhang
3128
% Last modified: 15 June 2017
3229
% Version: 2.0
3330
% -------------------------------------------------------------------------
34-
31+
close all;
32+
clear;
33+
clc;
3534

3635
% Intrinsic matrix
3736
K = eye(3);
@@ -77,11 +76,11 @@
7776
x1 = x1 ./ repmat(x1(3, :), [3, 1]);
7877
x2 = x2 ./ repmat(x2(3, :), [3, 1]);
7978

80-
x1 = x1(1:2, :);
81-
x2 = x2(1:2, :);
79+
x1 = transpose(x1(1:2, :));
80+
x2 = transpose(x2(1:2, :));
8281

8382
% Compute essential matrix using 8-point algorithm
84-
eMatrix8 = eightPoint(x1', x2', K, K);
83+
eMatrix8 = eightPoint(x1, x2, K, K);
8584
eMatrix8 = eMatrix8 / eMatrix8(3, 3);
8685

8786
% Varification

0 commit comments

Comments
 (0)