Add spherical_reprojected mode to panorama_sfm example#4552
Add spherical_reprojected mode to panorama_sfm example#4552shuta-ochiai wants to merge 3 commits into
Conversation
8623562 to
eb056c9
Compare
|
A note on feature/matcher support of the reprojection design (the example itself currently wires up the default SIFT + nearest-neighbor matching only):
🤖 Generated with Claude Code |
Extract features on the perspective renderings (as in the perspective modes, so the feature quality does not suffer from the equirectangular distortion, especially towards the poles), reproject the keypoints onto the panoramas, and then match and reconstruct directly on the panoramas with the native EQUIRECTANGULAR camera model (as in the spherical mode, with one image per panorama instead of a rig). This gives feature quality comparable to the perspective modes at a matching and mapping cost comparable to the spherical mode. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
eb056c9 to
60344d5
Compare
|
Thank you for your contribution! I have a few concerns, which to me are for now sufficiently critical to not merge this PR.
Could you please provide evidence of this? The speed of matching and BA scales mostly with the number of features, which is unchanged when projecting features from perspective to spherical. BA already considers all observations in the rig at once.
Could you please quantify this? I highly doubt that LightGlue performs satisfactorily with such inputs. |
Summary
This adds a new mode,
spherical_reprojected, topython/examples/panorama_sfm.py, as a middle ground between the existingperspective_*andsphericalmodes. It implements the hybrid flow proposed in #4406, where @chpatrick agreed this is the right approach:convert_to_equirectangular) and inject them, together with their descriptors and GPS pose priors, into a panorama database with a single nativeEQUIRECTANGULARcamera.Compared to the flow sketched in #4406, the one difference is that matching runs on the panoramas after reprojecting the keypoints and descriptors, instead of matching on the faces and reprojecting the matches. This is simpler (no match/two-view-geometry rewriting) and lighter: each panorama pair costs a single matcher invocation and a single geometric verification, whereas matching on the faces needs up to N×N face-pair matches and verifications per panorama pair to catch correspondences that cross face boundaries (12×12 for the overlapping layout), with correspondingly more scheduling overhead and database rows. Cross-face correspondences are matched naturally, since all reprojected features of a panorama live in one image.
Implementation notes
convert_to_equirectangularvia a newPanoProcessor.pano_xy_from_cam_xyhelper; rendering + feature extraction is shared with the perspective modes via a newrender_and_extract_featureshelper.Databasebindings andapply_rig_config([], db), avoiding a throwaway feature extraction pass on the panoramas.--matcher spatialalso works in this mode.This mirrors a pipeline we run in production on long 360° video walkthroughs, where the perspective rig mode is accurate but matching/mapping-heavy and the spherical mode loses feature quality; extracting on the renderings and mapping on the panoramas gave us perspective-level feature quality at spherical-level cost.
Closes #4406.
🤖 Generated with Claude Code