Photogrammetric approach

433 views
Skip to first unread message

Björn Piltz

unread,
Mar 26, 2014, 8:39:41 AM3/26/14
to ceres-...@googlegroups.com
Hi,
First of all, thank you for a beautiful piece of software. I'm using ceres for classical BA with calibrated cameras supported by GPS/INS and GCPs and have a couple of questions:

I have modeled the following cost functions, returning their residuals as mahalanobis distances.
* A reprojection error relating a camera position, camera orientation and 3D point to an image observation.
* A GPS error relating a camera position to a GPS observation (pos and stddev)
* A GCP error relating a 3D point to a ground control point.

Now, when I throw this into ceres I get sensible results with good performance, but I have the following questions:
1. I additionally want to add a cost function relating the camera orientation to the INS reading (angles and stddev), but I can't think of a way to formulate a differentiable function.
2. How can I measure the quality of the result(beyond reprojection error)? Since I have the standard deviation of all measurements  going in, I would ideally like to have the standard deviation(xyz or covariances) of all results - i.e. camera positions, orientations and reconstructed points. Is there a standard way to propagate covariances?

I am thankful for any answer pointing me in the right direction

Regards,
Björn

Sameer Agarwal

unread,
Mar 26, 2014, 8:45:42 AM3/26/14
to ceres-...@googlegroups.com
Hi Bjorn,
 
Now, when I throw this into ceres I get sensible results with good performance, but I have the following questions:
1. I additionally want to add a cost function relating the camera orientation to the INS reading (angles and stddev), but I can't think of a way to formulate a differentiable function.

I am not sure I understand the barrier here. If you can do it for the position using GPS, why can't you do it for the orientation?
 
2. How can I measure the quality of the result(beyond reprojection error)? Since I have the standard deviation of all measurements  going in, I would ideally like to have the standard deviation(xyz or covariances) of all results - i.e. camera positions, orientations and reconstructed points. Is there a standard way to propagate covariances?


I am thankful for any answer pointing me in the right direction

Regards,
Björn

--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/CAF8Ue3kCPAy61UsC%3Dz%2BHaT6%3DLKwtAnX%3DfrbY40Lau1jwKgQTfQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Björn Piltz

unread,
Mar 26, 2014, 8:58:07 AM3/26/14
to ceres-...@googlegroups.com
2014-03-26 13:45 GMT+01:00 Sameer Agarwal <sameer...@google.com>:
I am not sure I understand the barrier here. If you can do it for the position using GPS, why can't you do it for the orientation? 
 Because right now, I'm using euler angles, and I need to perform a modulo on the difference. I'm also not quite sure how it would work for quaternions.

Thanks


Sameer Agarwal

unread,
Mar 26, 2014, 9:00:48 AM3/26/14
to ceres-...@googlegroups.com
Don't use euler angles:). They are a pain in the butt. Use a quaternion/angle-axis representation for your rotations.

Sameer




--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.

Björn Piltz

unread,
Apr 1, 2014, 11:06:05 AM4/1/14
to ceres-...@googlegroups.com
Hi Sameer,
I'm having moderate success using the Covariance interface. It works well enough for small problems, but when I try a real size problem then calculating of the covariance takes much much longer than the actual bundle adjustment.(6 seconds vs more than half an hour).

This is the scope of the problem:
2.000 images
15.000 3D points
200.000 image points

When I try to retrieve the covariances for the 3D points I call Compute() with:
15.000 covariance blocks (out of 19.000)
Jacobian(400.000x60.000)
nnz 150.000

The time consuming part is that cholmod_solve2() gets called 60.000 times.(QR doesn't seem much faster)

Is this as it should be, or do I seem to be doing something wrong?

Björn

Sameer Agarwal

unread,
Apr 1, 2014, 11:27:00 AM4/1/14
to ceres-...@googlegroups.com
Hi Bjorn,

Are you using OpenMP/threading?
half an hour seems excessive.

Sameer

Björn Piltz

unread,
Apr 1, 2014, 11:43:06 AM4/1/14
to ceres-...@googlegroups.com
I didn't time it exactly, but yes, even with 8 openMP threads and my laptop melting it's somewhere in that range. It's not a show stopper for me, but I was a bit surprised that that would be the bottleneck.
I was hoping to tweak it somehow. 

Björn


--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.

Sameer Agarwal

unread,
Apr 1, 2014, 11:45:37 AM4/1/14
to ceres-...@googlegroups.com
So cholmod_solve2 calls are made to get one row of the covariance matrix at a time.
I am guessing you are solving for homogenous 3d points? which is why you are making 60k calls to cholmod_solve2.

I'd like the performance of the covariance estimator to be better. Please file a bug against me on the bug tracker, I will look into this. 

Sameer


Björn Piltz

unread,
Apr 1, 2014, 12:11:23 PM4/1/14
to ceres-...@googlegroups.com

So cholmod_solve2 calls are made to get one row of the covariance matrix at a time.
Yes. 

I am guessing you are solving for homogenous 3d points? which is why you are making 60k calls to cholmod_solve2.
No, I'm using Cartesian coordinates. 

I'd like the performance of the covariance estimator to be better. Please file a bug against me on the bug tracker, I will look into this. 
I will. Thanks!

Björn


On Tue, Apr 1, 2014 at 8:43 AM, Björn Piltz <bjorn...@blikken.de> wrote:
I didn't time it exactly, but yes, even with 8 openMP threads and my laptop melting it's somewhere in that range. It's not a show stopper for me, but I was a bit surprised that that would be the bottleneck.
I was hoping to tweak it somehow. 

Björn


2014-04-01 17:27 GMT+02:00 Sameer Agarwal <sameer...@google.com>:
Hi Bjorn,

Are you using OpenMP/threading?
half an hour seems excessive.

Sameer

--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/CABqdRUDjemVjsLZGgampz0%3DZxpjU8zDosCFdY7cgMLMmQCEynQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/CAF8Ue3nDQesK1TN1s9odMiGC3Kmj880c1vmwc%3D-hV7nEdpX-sg%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.

Sameer Agarwal

unread,
Apr 1, 2014, 12:16:11 PM4/1/14
to ceres-...@googlegroups.com
hmm, can you show me your calling code then.
Sameer



Reply all
Reply to author
Forward
0 new messages