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

is there some thing with your code ”compute_epipolar_error“? #84

Closed
lvzhengyi0204 opened this issue Apr 27, 2021 · 2 comments
Closed

Comments

@lvzhengyi0204
Copy link

Hello:
I am looking at the source code, but found some problems。

https://github.com/magicleap/SuperGluePretrainedNetwork/blob/master/models/utils.py#L355
In L367 :E = t_skew @ T_0to1[:3, :3] but the essential matrix is wrong. the correct code is
E = T_0to1[:3, :3] @ t_skew

and In L369 L370, the code is also wrong
Ep0 = kpts0 @ E.T # N x 3
p1Ep0 = np.sum(kpts1 * Ep0, -1) # N

the correct code is
Ep0 = E@kpts0.T
p1Ep0 = np.sum(kpts1.T@Ep0,-1)

I don't know why you wrote that. Can you explain it?

@sarlinpe
Copy link
Contributor

Thank you for your interest in our work. These are not issues :)

  • Let's assume that the epipolar constraint is p1 @ E @ p0 = 0
  • In our code, R and t are such that they transform from 0 to 1: X1 = R @ X0 + t (so t is in the coordinate frame of 1)
  • From Section 9.6 in Hartley & Zisserman: E = skew(t) @ R

I know that Wikipedia and Longuet-Higgins write E = R @ skew(t), but they define t such that X1 = R @ (X0 - t).

The code computing p1Ep0 is correct, please check before asking.

@lvzhengyi0204
Copy link
Author

thank you very much!

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

2 participants