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

I have a question about random offset units #40

Closed ryukyungjoon closed 2 months ago

ryukyungjoon commented 2 months ago

Hello Vivek,

@beartype def get_random_offset(batch_size: int, device) -> RigidTransform: r1 = torch.distributions.Normal(0, 0.2).sample((batch_size,)) r2 = torch.distributions.Normal(0, 0.1).sample((batch_size,)) r3 = torch.distributions.Normal(0, 0.25).sample((batch_size,)) t1 = torch.distributions.Normal(10, 70).sample((batch_size,)) t2 = torch.distributions.Normal(250, 90).sample((batch_size,)) t3 = torch.distributions.Normal(5, 50).sample((batch_size,)) log_R_vee = torch.stack([r1, r2, r3], dim=1).to(device) log_t_vee = torch.stack([t1, t2, t3], dim=1).to(device) return convert( [log_R_vee, log_t_vee], "se3_log_map", "se3_exp_map", )

In random offset, r1, r2, r3, t1, t2, and t3 were understood as rotation(x, y, z) / translation(x, y, z). So how do the numbers given in the normal distribution map to angles?

Thank you.

eigenvivek commented 2 months ago

Hi @ryukyungjoon , [r1, r2, r3, t1, t2, t3] are elements of se(3) which are mapped to rigid transformations in SE(3) with the exponential map. I'm not aware of a way to directly interpret [r1, r2, r3] as rotation angles (although such an interpretation very well could exist). Appendix A of the paper discusses this exponential mapping in more detail, which might illuminate something.