eigenvivek / DiffPose

[CVPR 2024] Intraoperative 2D/3D registration via differentiable X-ray rendering
http://vivekg.dev/DiffPose/
MIT License
118 stars 14 forks source link

The definitions of several transformation and frame. #44

Open SangbaekYoo opened 3 weeks ago

SangbaekYoo commented 3 weeks ago

Hello! I'm trying to understand some code, but I'm not clear on how certain transformations and frame are precisely defined, so I wanted to ask a few questions.

  1. Camera frame Generally, camera frame is defined as optical axis-> z-axis, image height axis -> y-axis, image width axis -> x-axis. But in the medical registration problem, it may not. Is there any clear definition of camera frame?

  2. flip_xz When you use ljubljana dataset, you define these transformations.

    self.flip_xz = RigidTransform(
            torch.tensor(
                [
                    [0.0, 0.0, -1.0],
                    [0.0, 1.0, 0.0],
                    [1.0, 0.0, 0.0],
                ]
            ),
            torch.zeros(3),
        )
    self.translate = RigidTransform(
            torch.eye(3),
            torch.tensor([-self.focal_len / 2, 0.0, 0.0]),
        )

    and when you calculate the camera frame, you implemented as follows

    extrinsic = (
            self.flip_xz.inverse().compose(self.translate.inverse()).compose(pose)
        )

    Why these transformations are needed?

Maybe there are general concept, but I could not find these definitions.