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

OpenGL coordinate System #32

Open
DelinQu opened this issue Sep 8, 2023 · 1 comment
Open

OpenGL coordinate System #32

DelinQu opened this issue Sep 8, 2023 · 1 comment

Comments

@DelinQu
Copy link

DelinQu commented Sep 8, 2023

Hi HengyiWang,

Thanks so much for releasing your code. I'm currently confused about the coordinate system of coslam in dataloader and ray direction. Assuming a ground truth trajectory and the corresponding mesh. The trajectory poses are flipped (only y and z) by the data loader, but the ground truth mesh stays in the original coordinate system. Will It cause any problems in the following evaluation phase? Besides, If I export a ground truth trajectory and mesh from other modeling software like Blende .., is it necessary to convert to openGL in both dataloader and ray direction?

# convert poses to openGL 
c2w[:3, 1] *= -1 # * y-axis flip
c2w[:3, 2] *= -1 # * z-axis flip
c2w[:3, 3] *= self.sc_factor

# convert rays to OpenGL
if type is  'OpenGL':
    dirs = torch.stack([(i - cx)/fx, -(j - cy)/fy, -torch.ones_like(i)], -1)
elif type is 'OpenCV':
    dirs = torch.stack([(i - cx)/fx, (j - cy)/fy, torch.ones_like(i)], -1)
@HengyiWang
Copy link
Owner

Hi @DelinQu, the coordinate system will not affect the reconstruction or pose evaluation. We use the OpenGL coordinate system in the code. Since ScanNet uses the OpenCV coordinate system, we need to manually convert the poses to OpenGL (y-axis flip + z-axis flip). If you want to evaluate the ground-truth mesh in this case, you can simply apply a transformation of GT mesh/reconstruction. Or you can convert the coordinate system to OpenCV in the code.

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