Using GTSAM for problems with lots of measurements

110 views
Skip to first unread message

raf...@dotproduct3d.com

unread,
Apr 21, 2021, 8:42:31 AM4/21/21
to gtsam users
Hello,
we're currently looking at using GTSAM as part of our 3D reconstruction pipeline. I am wondering if there's a way to provide lots (millions) of pixelwise measurements to GTSAM in an efficient manner.

To give this a bit more color: Let's say we optimize a set of 6dof camera poses. We have lots (many millions) of pixelwise terms / measurements that each provide a constraint on a pose-pose pair. Today, we assemble the JTJ matrix and the JTr vector all internally using fast optimized code and then solve using an off the shelf solver.

So far, so good, but there are many variations of that problem that we're looking at (having additional non-pixelwise constraints, hard constraints, extensions to the state vector, etc.) where GTSAM would come in very handy.
However I'm not sure there's a way to provide millions of pixelwise constraints to GTSAM in an efficient manner as it seems to target use cases with relatively few (1000s or 10000s) measurements, such as from feature-based SLAM.

Could we, for example, still precompute the relevant parts of JTJ and JTr internally and then provide this to GTSAM as a "precomputed block of information"?
Any other suggestions are welcome too!

Regards,
Rafael



Dellaert, Frank

unread,
Apr 21, 2021, 9:57:51 AM4/21/21
to raf...@dotproduct3d.com, gtsam users
Hi Rafael

Your instinct is exactly what I would be thinking about as well: think about how the many pixel measurements constrain your variables, and make that a single factor with derivatives only on the variables. This is for example what happens in PoseSLAM when we register LIDAR point clouds: we get a single pose constraint. If you can pre-compute parts of the Jacobian calculation in the constructor of the factor (which will have access to the measurements), even better! Then only-recompute what depends on the non-linear variables in evaluateError.

If you favor expressions and a function object, transpose the above to that style. I'd probably do that rather than a custom factor.

Frank


From: gtsam...@googlegroups.com <gtsam...@googlegroups.com> on behalf of raf...@dotproduct3d.com <raf...@dotproduct3d.com>
Sent: Wednesday, April 21, 2021 08:42
To: gtsam users <gtsam...@googlegroups.com>
Subject: [GTSAM] Using GTSAM for problems with lots of measurements
 
--
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 on the web visit https://groups.google.com/d/msgid/gtsam-users/fbbff694-81c6-4cdf-b5e4-dcadfaee0ecbn%40googlegroups.com.

Rafael Spring

unread,
Apr 21, 2021, 3:34:51 PM4/21/21
to Dellaert, Frank, gtsam users
OK, thanks! That's good info. I'm out of good questions now so I'm going to familiarize myself a bit more with GTSAM, which I'm sure will replenish my supply of good questions :)

Rafael Spring
CTO, Co-Founder
DotProduct LLC / DotProduct GmbH

Reply all
Reply to author
Forward
0 new messages