-
Notifications
You must be signed in to change notification settings - Fork 1.4k
How does the coordinate frame of the transformation matrix defined? #1199
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
Comments
It's clear that the original nerf uses the convention that the camera poses unproject image point to the world, however, in Pytorch3D, the camera poses project a point from world to the camera. Thus, we need invert the original transformation matrix at first, then apply a transformation matrix to align the OpenGL coordinate frame to Pytorch3D's coordiante frame. It's easy to obtain that the rotation matrix is: [[ 9.9990219e-01 1.3988681e-02 4.6566129e-10 -5.6255717e-10]
[ 4.1922452e-03 -2.9965907e-01 9.5403719e-01 2.3841858e-07]
[ 1.3345719e-02 -9.5394367e-01 -2.9968831e-01 4.0311279e+00]
[ 0.0000000e+00 0.0000000e+00 0.0000000e+00 1.0000000e+00]] The translation part `` obviously has a translation in both the x and y axes, since the correct translation is |
Any update on this? I'm struggling to get the correct translation too |
After reading the documentation that introduces the camera coordinate system, I still can't obtain the correct translation on the lego dataset. However, on the fern dataset, by simply left multiplying the same transformation matrix [[-1, 0, 0, 0], [0, 1, 0, 0], [0, 0, -1, 0], [0, 0, 0, 1]] to the original poses, I can get the same poses as it downloaded from Pytorch3D's. It's really weird. |
That is really weird. I wonder if it has anything to do with the lego data being 360 degrees vs the fern data which is frontal?... Also I noticed that the rotation matrix of the lego data does not have a determinant of exactly 1, whereas the fern rotation matrix does. |
Still cannot figure out why, but I'll check the poses one by one later. This class assumes that transformations are applied on inputs which
are row vectors. The internal representation of the Nx4x4 transformation
matrix is of the form:
.. code-block:: python
M = [
[Rxx, Ryx, Rzx, 0],
[Rxy, Ryy, Rzy, 0],
[Rxz, Ryz, Rzz, 0],
[Tx, Ty, Tz, 1],
]
To apply the transformation to points which are row vectors, the M matrix
can be pre multiplied by the points:
.. code-block:: python
points = [[0, 1, 2]] # (1 x 3) xyz coordinates of a point
transformed_points = points * M |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
This issue was closed because it has been stalled for 5 days with no activity. |
❓ How does the coordinate frame of the transformation matrix defined?
Hi, I noticed that the nerf project uses a different coordinate frame from the original one, which uses an OpenGL coordinate frame. However, I have trouble figuring out how the transformation matrices are converted from the original, which are provided by the json files. For example, when I output the camera parameters of the Fern dataset, the transformation matrix of the first camera in the original file is:
However, the nerf project gives the transformation matrix as:
The text was updated successfully, but these errors were encountered: