Skip to content

Pose convention

Pakkapon Phongthawee edited this page May 28, 2021 · 1 revision

NeX is using OpenCV convention while NeRF and LLFF are using OpenGL convention.

image

( Graphic taken from What are the coordinates? )

How to convert from NeRF (OpenGL) pose to NeX (Ours)

The orange point show below is the same point. However, the different conventions make the value different.

For OpenCV to OpenGL, we have to Flip the axis.

The orange point in OpenCV [x,y,z] become [x,-y,-z] in OpenGL convention.

image

We can multiply this 3x3 matrix to convert the coordinate of the point between OpenCV and OpenGL convention

image

Let's R be a 3x3 rotation matrix such that

image

We will do these following step:

  1. Convert the point [x,y,z] into OpenGL coordinate
  2. Rotate (Apply) in OpenGL coordinate with the rotation matrix
  3. Convert the point into OpenCV coordinate

image

Let's do step by step multiplication.

image

Here you get the line 324-325

https://github.com/nex-mpi/nex-code/blob/eeff38c712ac9a665f09d7c2a3fdf48ae83f4693/utils/sfm_utils.py#L324-L325

For line 323, you just flip the y-axis and z-axis of the camera center.

https://github.com/nex-mpi/nex-code/blob/eeff38c712ac9a665f09d7c2a3fdf48ae83f4693/utils/sfm_utils.py#L323

Clone this wiki locally