Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get Fundamental Matrix GT? #6

Open
junyongjeon opened this issue Jun 3, 2022 · 0 comments
Open

How to get Fundamental Matrix GT? #6

junyongjeon opened this issue Jun 3, 2022 · 0 comments

Comments

@junyongjeon
Copy link

junyongjeon commented Jun 3, 2022

It seems like the way how to get Fundamental Matrix from this paper is very similar with the method from " 9.2.2 Algebraic derivation from the book, Multiple View Geometry(2nd edition)" or the method from "https://sourishghosh.com/2016/fundamental-matrix-from-camera-matrices/".
According to the source code from the blog, I tried to compute Fundamental Matrix, but the result is different from the value of 'pairs_with_gt.txt'.
I use relative rotation, translation on R and t. And in the case of 'KITTI dataset', because all the camera intrinsic is same, so K1 and K2 are same.

Below is the octave code from the blog:

function ret = computeF(K1, K2, R, t) A = K1 * R' * t C = [0 -A(3) A(2); A(3) 0 -A(1); -A(2) A(1) 0] ret = (inverse(K2))' * R * K1' * C endfunction

For example, In the first line of pairs_with_gt.txt in KITTI dataset, Image matching pair is '0' and '5'.
So, my rotation and translation values for left camera are from the 0th line of poses.txt,
and the values for right camera are from the 5th line of poses.txt.
And I compute relative pose like below:
Relative Rotation : (R_left)inv * R_right
Relative Translation : (R_left) * (T_right - T_left)
or
Relative Pose : (Pose_left)inv * Pose_right then get Relative Rotation and Relative Translation from that Relative Pose matrix.

After that, I just put proper value on (inverse(K2))' * R * K1' * C. But the result is different from Ground Truth.
Ground truth (In KITTI, between image 0 and image 5) :
[-1.04297e+04, 2.98104e+06, -4.91357e+08, -2.98109e+06, -1.06854e+04, 1.77879e+09, 5.02479e+08, -1.76782e+09, -4.45117e+09]
Computed Value(In KITTI, between image 0 and image 5) :
[2.08603942e-02, -5.96233429e+00, 9.82758593e+02, 5.96244302e+00, 2.13717526e-02, -3.55774622e+03, -1.00499811e+03, 3.53580415e+03, 8.90074768e+03]
Is there any problem on my code implementation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant