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

What's the mean of world_to_camera? #52

Open
duanyongli opened this issue Aug 21, 2020 · 3 comments
Open

What's the mean of world_to_camera? #52

duanyongli opened this issue Aug 21, 2020 · 3 comments

Comments

@duanyongli
Copy link

Thanks for your nice work!
I wonder the meaning of world_to_camera.
To put it bluntly, whether world_to_camera transform a point in camera frame to world frame, or vice versa.

If world_to_camera means transform a point in camera frame to world frame, then the motion formula may be:
Eigen::Affine3f motion = last_camera_pose_.inverse() * current_camera_in_volume;

@schornakj
Copy link
Contributor

The names of transforms in this package should follow a consistent pattern that shows the direction of the transformation. Reading through the section of code that you linked, we probably need to rename some of the result transforms to be as clear as possible.

For the transform world_to_camera, it will transform a point in the world frame to the camera frame. We follow a pattern where transforms named X_to_Y transform from frame X to frame Y. The volume_to_world_ transform also works in the same way, so if we chain them together like this:

https://github.com/ros-industrial/yak/blob/c5c1ab71c3dea42b108bcc28d45cb5e5a5f8d2d9/yak/src/yak_server.cpp#L19

It results in a transform from the TSDF volume frame to the camera frame.

@duanyongli
Copy link
Author

The names of transforms in this package should follow a consistent pattern that shows the direction of the transformation. Reading through the section of code that you linked, we probably need to rename some of the result transforms to be as clear as possible.

For the transform world_to_camera, it will transform a point in the world frame to the camera frame. We follow a pattern where transforms named X_to_Y transform from frame X to frame Y. The volume_to_world_ transform also works in the same way, so if we chain them together like this:

https://github.com/ros-industrial/yak/blob/c5c1ab71c3dea42b108bcc28d45cb5e5a5f8d2d9/yak/src/yak_server.cpp#L19

It results in a transform from the TSDF volume frame to the camera frame.

Thanks for your reply, but I'm still confused about the transformation.

  1. the meaning of motion
    Eigen::Affine3f motion = current_camera_in_volume * last_camera_pose_.inverse();
    current_camera_in_volume stands for volume_to_cameraNew.
    last_camera_pose_ stands for volume_to_cameraOld, then last_camera_pose_.inverse() means cameraOld_to_volume.
    then motion = volume_to_cameraNew * cameraOld_to_volume, I think the matrix multiplication is wrong.
    motion may be calucated through cameraNew_to_volume * volume_to_cameraOld

  2. vol2cam
    Affine3f vol2cam = camera_motion_tform.inv() * pose_;
    vol2cam must be used to transfrom voxel coordinate from volume frame to camera frame,
    so camera_motion_tform must stands for camera_to_volume.
    Through function call, I think camera_motion_tform is passed by current_camera_in_volume.
    However, current_camera_in_volume means volume_to_camera.
    That is conflict!

@jpizarrom
Copy link

@duanyongli: Do you mean?

// we want volume to camera
const Eigen::Affine3f current_camera_in_volume = world_to_camera * volume_to_world_;

Eigen::Affine3f motion = current_camera_in_volume.inverse() * last_camera_pose_;

cc @schornakj

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

3 participants