Skip to content

Add SphericalCamera Python bindings#2446

Merged
dellaert merged 3 commits intoborglab:developfrom
inuex35:feature/spherical-camera-bindings
Mar 5, 2026
Merged

Add SphericalCamera Python bindings#2446
dellaert merged 3 commits intoborglab:developfrom
inuex35:feature/spherical-camera-bindings

Conversation

@inuex35
Copy link
Copy Markdown
Contributor

@inuex35 inuex35 commented Mar 2, 2026

Hi, I'm not familiar with the project's contribution guidelines or conventions, so please let me know if there's anything I should change regarding code style, naming, testing, or the overall approach. Any feedback is welcome.

I have been working on enabling Structure-from-Motion (SfM) for 360-degree (omnidirectional) cameras using GTSAM and https://github.com/inuex35/gtsfm. With the SphericalCamera Python bindings added in this PR, combined with improvements we have made on the GTSFM side, it is now possible to run a full SfM pipeline for 360-degree cameras — from bearing-vector
measurements through to bundle adjustment — entirely in Python.

  • Add full Python bindings for SphericalCamera, enabling bearing-vector-based (Unit3) projection, back-projection, and triangulation from Python
  • Generalize GeneralSFMFactor to support non-Point2 measurement types (e.g., Unit3 for SphericalCamera) by introducing MeasurementTraits.h and templating on CAMERA::Measurement
  • Add SphericalCamera support to SmartFactorBase, SmartProjectionFactor, SmartProjectionRigFactor, PriorFactor, NonlinearEquality, and Values

Copy link
Copy Markdown
Member

@dellaert dellaert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice !!!
I'm not sure we need the traits mechanism though. Unit3 is a 2D manifold and it has a Local method in its traits already. And the local method for Point2 is just subtraction. And because the dimension of Unit3 is also 2, there is also no need for dim Z.

claude and others added 2 commits March 4, 2026 09:31
…ementErrorHelper

Remove the MeasurementErrorHelper traits mechanism and MeasurementTraits.h.
Unit3 is a 2D manifold just like Point2, so traits<Measurement>::Local works
directly for both types without needing a specialized errorVector path.

https://claude.ai/code/session_01NGPWjL8oTZqkvqup7RxDMf
Simplify Unit3 measurement error: use traits::Local instead of Measur…
@inuex35
Copy link
Copy Markdown
Contributor Author

inuex35 commented Mar 5, 2026

Hi, you are right.

The updated version works fine, could you review again?

This is the result with my gtsfm.

image

Copy link
Copy Markdown
Member

@dellaert dellaert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks more like it! Love it :-)

I’ll run CI to see if it compiles across platforms, then approve.

Thanks !!

Copy link
Copy Markdown
Member

@dellaert dellaert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All required CI passed, so I’ll merge. Thank you again.

@dellaert dellaert merged commit 06b3457 into borglab:develop Mar 5, 2026
30 of 32 checks passed
@inuex35 inuex35 deleted the feature/spherical-camera-bindings branch March 5, 2026 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants