Getting xyz coordinates

Hi all,

I’ve been very quiet recently as I’ve been so busy with work and other commitments. I have however managed to spend a few minutes working on this and have come up with something that will probably be of interest:

A typical bundle output file contains the following at the top of the file which contains the camera matrices.

2 91
-1.1680543659e+03 -8.2785439640e-03 -2.0917368741e-03
9.9540196832e-01 -3.4818628195e-02 8.9233315532e-02
8.3940971950e-02 7.6583033696e-01 -6.3754043654e-01
-4.6139296683e-02 6.4209933665e-01 7.6523173430e-01
-9.2741313285e-02 2.1412703300e+00 2.4608983486e+00
-8.4474235190e+02 -1.1686877722e-01 8.4610023619e-02
7.2277187255e-01 -6.9056164176e-01 2.6933978188e-02
5.5082608608e-01 5.5210599240e-01 -6.2591500705e-01
4.1736248411e-01 4.6722969949e-01 7.7942604830e-01
-7.1338688568e-01 1.4901089187e+00 1.9101461806e+00

It took me a while to fully understand this data and how it can be manipulated but I now have a function (in python) that reads these matrices from the bundle file and, when given a correspondence between the images can work out the xyz coordinate of that location. This should be useful to us and I think allows us to do the following additional tasks:

  • Add our own points to the bundle without having to re-run the process
  • By picking out some correspondences that represent an “up” vector we can work out how the coordinate system is orientated to allow translation into lat,lon,alt

I’ve been investigating a particularly interesting application of this as well, oblique aerial photography. I don’t believe oblique aerial photos have been much use to anyone up till now as warping the photos for tiling usually results in large errors that make it useless. By using a photo and ground control points I think a much better warper can be created to make it more useful.

Do I understand correctly what you are meaning as I’m describing in the following example?

Suppose an angle of a builidng isn’t in the bundle output. But we want its 3D coordinates.

We supply to your script 2D image coordinates of the angle on the image A and 2D image coordinates of the angle on the image B. Then your scripts yields 3D coordinates of the building angle.