feat(3d): expose the left rectifying rotation on StereoRectifier#940
Conversation
from_calib already computes the rotation mapping raw left-camera coordinates into the rectified frame (rect_l) to build the remap table; store it and add a getter so callers can re-express raw-frame extrinsics for the rectified virtual camera. Concretely, a camera-IMU T_BS calibrated against the raw left camera becomes T_B,rect = T_BS * R_rect^T, which visual-inertial pipelines need to run on rectified stereo.
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
There was a problem hiding this comment.
Pull request overview
This PR extends kornia-3d’s stereo rectification API by persisting the already-computed Bouguet left rectification rotation on StereoRectifier and exposing it via a getter, enabling downstream consumers to re-express raw-frame extrinsics into the rectified virtual camera frame.
Changes:
- Add a private
rect_left: Mat3F64field toStereoRectifier, populated inStereoRectifier::from_calib. - Add
StereoRectifier::left_rectifying_rotation() -> Mat3F64to expose the left rectifying rotation.
|
@edgarriba can you merge this? It currently blocks kornia/kornia-slam#45 from merging |
What
Stores the left rectifying rotation (
rect_l, already computed inStereoRectifier::from_calibto build the remap tables) on the struct and adds aleft_rectifying_rotation()getter.Why
The rectified virtual camera is the raw left camera rotated by the Bouguet rectifying rotation (
p_rect = R_rect · p_left_raw). Any extrinsic calibrated against the raw camera frame therefore has to be re-expressed before it can be used with rectified images — most importantly a camera-IMUT_BS:Without access to
R_rect, visual-inertial pipelines running on rectified stereo (e.g. kornia-slam's stereo-inertial mode on EuRoC) cannot relate IMU preintegration deltas (body frame) to the rectified camera poses, which silently corrupts the estimated gravity direction.Verified downstream in kornia-slam: stereo-inertial init on EuRoC MH_01 recovers the same physical gravity vector as the mono (unrectified) path, re-expressed in the rectified frame, and a gyro bias matching the known sensor bias.
Changes
StereoRectifier: new privaterect_left: Mat3F64field, populated infrom_calibleft_rectifying_rotation() -> Mat3F64No behavior changes; existing stereo tests pass.