One keyframe's persisted state for loop closure. The authoritative optimized pose lives in the GlobalPoseGraph (keyed by keyframe_id); pose_at_insert is a cached seed for geometric verification. Keep local features (keypoints_left, descriptors_left, stereo); a loop candidate is re-matched with LightGlue and back-projected.
| 15 | // (keypoints_left, descriptors_left, stereo); a loop candidate is re-matched |
| 16 | // with LightGlue and back-projected. |
| 17 | struct KeyframeRecord { |
| 18 | size_t keyframe_id = 0; |
| 19 | double timestamp = 0.0; |
| 20 | gtsam::Pose3 pose_at_insert; // cached seed; not the source of truth |
| 21 | std::vector<cv::KeyPoint> keypoints_left; // left keypoints |
| 22 | cv::Mat descriptors_left; // [N x D] for LightGlue verification |
| 23 | std::vector<gtsam::StereoPoint2> stereo; // (uL, uR, v) per keypoint |
| 24 | std::vector<char> has_depth; // 1 if stereo-valid |
| 25 | cv::Mat global_descriptor; // [1 x Dg] for place recognition |
| 26 | std::vector<size_t> covisible; // keyframe_ids sharing landmarks (candidate pruning) |
| 27 | }; |
| 28 | |
| 29 | // Insertion-ordered store of keyframe records with O(1) id lookup. |
| 30 | class KeyframeDatabase { |
nothing calls this directly
no outgoing calls
no test coverage detected