Forum

Author Topic: How do I convert a camera to ENU?  (Read 2329 times)

nickponline

  • Newbie
  • *
  • Posts: 38
    • View Profile
How do I convert a camera to ENU?
« on: September 18, 2018, 02:56:45 AM »
Hey Alexey,

I have exported camera positions in an XML file and want to convert a camera to ENU using the transform at the end of the XML file. I read that the transform represents a ECEF -> local transform. So how do you use it to convert the camera transform to ENU?
Code: [Select]
<camera id="0" label="08e99038b0f96f7003556eb23877402a.jpg" sensor_id="0" enabled="true">
<transform>...</transform>
<orientation>1</orientation>
<reference x="-79.153242361111097" y="37.400188583333303" z="208.38200000000001" enabled="true"/>
</camera>
...

<transform>
<rotation>2.5818723527903192e-01 9.5254434818531153e-01 1.6124086417279426e-01 -5.3390401398553078e-01 2.7978097103927702e-01 -7.9791547929242301e-01 -8.0516200567904861e-01 1.1992444698450438e-01 5.8080312639168274e-01</rotation>
<translation>9.5474336100430344e+05 -4.9826859996768227e+06 3.8528608851181311e+06</translation>
<scale>9.1296180142317489e+00</scale>
</transform>

The reason I want to do this is I want to find the 4 points on the ground (in geodetic coordinates (lon, lat, alt) that correspond to the corner pixels of the image.
« Last Edit: September 18, 2018, 02:58:29 AM by nickponline »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14851
    • View Profile
Re: How do I convert a camera to ENU?
« Reply #1 on: September 18, 2018, 07:11:15 PM »
Hello nickponline,

In the following article there's information about calculation of the exterior orientation parameters for the cameras:
https://agisoft.freshdesk.com/support/solutions/articles/31000145016-how-to-calculate-estimated-exterior-orientation-parameters-for-the-cameras-using-python

But you need to apply the coordinate system information, as the chunk transformation matrix would convert the coordinates to the geocentric coordinate system.


You can also find the information how the coordinates in the geographic system for the image corner pixels can be calculated - in the following script example:
https://github.com/agisoft-llc/photoscan-scripts/blob/master/src/footprints_to_shapes.py
Best regards,
Alexey Pasumansky,
Agisoft LLC