YoYo000 / BlendedMVS

BlendedMVS: A Large-scale Dataset for Generalized Multi-view Stereo Networks
559 stars 40 forks source link

What is the coordinate system for the poses? #11

Closed half-potato closed 4 years ago

half-potato commented 4 years ago

I'm trying to create a point cloud from the depth maps.I am using z forward, x right, y up and the results don't make sense.

half-potato commented 4 years ago

The coordinate system is the standard one, but the poses are inverted.

raynehe commented 1 year ago

@half-potato Hi! Sorry to bother.

I encounter a similar problem, I want to convert the 3x3 rotation matrix from BlendedMVS to OpenGL format (x-axis to the right, y-axis upward, and z-axis backward along the camera’s focal axis). But I couldn't find any information about the coordinate system convention of BlendedMVS.

The coordinate system is the standard one, but the poses are inverted.

Could you please tell me how does the poses inverted?

Thank you very much!!

half-potato commented 1 year ago

Inverted, like, the transformation is inverted.

JDihlmann commented 1 year ago

Hey I'm fighting with the same issue, can you give an example what you mean by that, only the rotation matrix or also the translation vector?

Did you find a solution for the OpenGL conversion @raynehe ?

half-potato commented 1 year ago

@raynehe had the z axis backwards. Hope that helps!

JDihlmann commented 1 year ago

Thanks, figured it out myself ... so inverted does mean to get the inverse of the Transform Matrix T^(-1). For everyone trying to format the poses to Nerfstudio, here is the code (not cleaned and could be further simplified):

# Load Transform
transform = ...

# Invert transform
transform = np.linalg.inv(transform)

# Conversion from OpenCV to Blender coordinate system
transform[0:3, 1:3] *= -1
transform = transform[np.array([1, 0, 2, 3]), :]
transform[2, :] *= -1

# Rotate 90 degrees around y axis (Optional)
transform = np.array([[0, 0, 1, 0],
                        [0, 1, 0, 0],
                        [-1, 0, 0, 0],
                        [0, 0, 0, 1]]) @ transform 

Also be carefull es images might need to be rescaled as the height and weight differs from the stored images.