Doubt on "SmartProjectionFactor" expected usage

50 views
Skip to first unread message

José Luis Blanco-Claraco

unread,
Apr 26, 2025, 12:28:50 PMApr 26
to gtsam users
Hi gtsam friends:

I tried to look for a complete example on how to use
SmartProjectionFactor to estimate camera poses *and* calibration
(multiple views from one single camera, so, just one calibration
unknown) but couldn't find it... pointers will be appreciated :-)

In particular, this is what I understand so far and what doesn't make
sense to me:
- SmartProjectionFactor<> instances should be added to the FG, one per
tracked landmark.
- Its constructor takes just the noise model and some params.
- For each Smart Factor instance, one must call add() once per LM observation.
- Arguments of add() are the Z (camera observation, u,v), and the
**camera key**.
- This camera key is expected to be indexing a "Value" of something
like "gtsam::PinholeCamera<gtsam::Cal3DS2>".

Here's the problem:
- Each such "PinholeCamera" variable accepts in its ctor a pose and a
calibration (by value, *not* keys).

So, how can it be enforced that all "cameras" have one single
calibration, if there's no key for a "Calibration" value? What am I
missing?

Best,
JL

PS: Yes, I shamelessly admit I have already checked with all modern
AIs and none produced examples that actually even build :-)
PS2: I already had a functional version with regular (no "smart")
factors, but I wanted to check if the latter is more robust in some
way.

--

/**
* Jose Luis Blanco-Claraco
* Universidad de Almería - Departamento de Ingeniería
* [Homepage]( https://w3.ual.es/~jlblanco/ )
* [GH profile]( https://github.com/jlblancoc )
*/

Dellaert, Frank

unread,
Apr 27, 2025, 11:56:34 PMApr 27
to José Luis Blanco-Claraco, gtsam users
I think what you want is not possible right now :-)

You could​ use SmartProjectionFactor<Camera> and constrain the calibrations to be the same. Or, make your own factor based on SmartFactorBase :-)

PR appreciated! Although, it might be expensive, need to order calibration last :-)

Frank


Best!
Frank

From: 'José Luis Blanco-Claraco' via gtsam users <gtsam...@googlegroups.com>
Sent: Saturday, April 26, 2025 12:28:35 PM
To: gtsam users <gtsam...@googlegroups.com>
Subject: [GTSAM] Doubt on "SmartProjectionFactor" expected usage
 
--
You received this message because you are subscribed to the Google Groups "gtsam users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gtsam-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/gtsam-users/CADEiKfht%2BiMwKTMNW%3DwJK5m%3D5mMwkao%2B7vE1VB0yJ7Ya_UEiaQ%40mail.gmail.com.

José Luis Blanco-Claraco

unread,
Apr 28, 2025, 3:20:40 AMApr 28
to Dellaert, Frank, gtsam users
Thanks Frank.
At least, I feel better that it's not that I couldn't find it :-)
I'll consider the option of a new factor, if time permits (!).

Cheers,
JL
Reply all
Reply to author
Forward
0 new messages