Forum

Author Topic: Altitude or height.  (Read 34466 times)

pmgzamorano

  • Newbie
  • *
  • Posts: 1
    • View Profile
Altitude or height.
« on: February 20, 2016, 12:12:27 PM »
Good Morning.
I uploaded some photos taken with a phantom and altitude drone presented is the height of the camera above the ground. Control points are taken with GPS and their altitudes are relative to mean sea level How do I resolve these differences ?.

Thanks for everything and best regards.

HMArnold

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
Re: Altitude or height.
« Reply #1 on: February 20, 2016, 10:34:25 PM »
The answer is not good

If you look closely at the altitude values in the EXIF you will find that the values are off by sometimes hundreds of feet because they are derived from the GPS Altitude, which is much less accurate than lat and lon.

I live very near the coast and my EXIF altitudes usually come out below sea level

Another problem is that for both my P3P units, the EXIF altitude values come out in feet, but WGS84 takes them in as meters.

To my knowledge there is no way to correct these values on the platform,  or to switch the EXIF to record height above ground, which has enough accuracy to almost be able to land softly with.

There had been some posts about height above ground being in the EXIF info as a non-standard tag, but I looked at the individual tags and could not find an accurate value

The best solution I know of is to download the flight log and create an Agisoft import file based upon those values, which not only gives you height above ground but also the gimbal angle (pitch) and camera direction  (yaw)

Inclusion of these values also significantly helps Photoscan in the alignment process

Anxious to hear other solutions

dsheehan

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Altitude or height.
« Reply #2 on: December 07, 2017, 12:01:15 AM »
Looking at the Omega Phi Kappa, which is pitch and which is yaw? 

First three lines of the OPK file output from Photoscan:

# Cameras (32)
# PhotoID, X, Y, Z, Omega, Phi, Kappa, r11, r12, r13, r21, r22, r23, r31, r32, r33
DJI_0464.JPG   334431.9611538954800000   7216944.2492030482000000   217.4452483703651100   85.6828479713175570   -82.617933788249616   -3.8434413251724098


Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: Altitude or height.
« Reply #3 on: December 07, 2017, 12:06:10 AM »
Hello dsheehan,

There are no yaw, pitch or roll angles in Omega, Phi, Kappa format export.
Best regards,
Alexey Pasumansky,
Agisoft LLC

SAV

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
Re: Altitude or height.
« Reply #4 on: December 07, 2017, 06:18:56 AM »
Hi pmgzamorano,

Several solutions:

1. Fix the Z value in EXIF by using one or both of these Python scripts:
Extract 'relative' altitude from DJI imagery: https://github.com/agisoft-llc/photoscan-scripts/blob/master/src/read_altitude_from_DJI_meta.py
Add the altitude of the point of take-off (relative to mean sea level) to calculate absolute flight altitude values: https://github.com/agisoft-llc/photoscan-scripts/blob/master/src/add_altitude_to_reference.py

2. Adjust the accuracy settings for ground control points and camera locations.
If you enter a very large number for camera accuracy (Photoscan default value is 10m) and a low number for marker accuracy (default is 0.005m), then the optimisation and height of the model will mainly depend on the Z value of your your ground control points/markers.

3. Uncheck all images/cameras in the reference pane so Photoscan will ignore their locations during Photo alignment and only use GCPs.

Regards,
SAV



Good Morning.
I uploaded some photos taken with a phantom and altitude drone presented is the height of the camera above the ground. Control points are taken with GPS and their altitudes are relative to mean sea level How do I resolve these differences ?.

Thanks for everything and best regards.
« Last Edit: March 15, 2018, 03:40:00 AM by SAV »

dsheehan

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Altitude or height.
« Reply #5 on: December 07, 2017, 05:51:20 PM »
Hello dsheehan,

There are no yaw, pitch or roll angles in Omega, Phi, Kappa format export.

Can you tell me how to convert Omega, Phi, Kappa, to direction the camera is facing and angle from the horizontal?

LFSantosgeo

  • Jr. Member
  • **
  • Posts: 70
    • View Profile
Re: Altitude or height.
« Reply #6 on: February 02, 2018, 10:22:53 PM »
Several solutions:

1. Fix the Z value in EXIF by adding the altitude relative to mean sea level of the point of take-off to your flight height above point of take-off (which is recorded by your DJI drone). Can be done using a custom Python script or externally.

2. Adjust the accuracy settings for ground control points and camera locations. If you enter a very large number for camera accuracy (Photoscan default value is 10m) and a low number for marker accuracy (default is 0.005m), then the optimisation and height of the model will mainly depend on the Z value of your your ground control points/markers.

Hello SAV!

Do you have this python script to change the altitude in EXIF? Does it need to install a module in PS (when thinking of using it in PS)?

Would not be good to apply the first 2 fixes (exif edit and adjusting the accuracy of photos/markers and uncheck) at the same time?

3. Uncheck all images in the reference pane so Photoscan will ignore their locations during Photo alignment (and only use GCPs).

On your workflow you recommend to uncheck the photos after placing or importing markers which is a step after photo alignment. Would you care to comment?

Best regards,

« Last Edit: February 02, 2018, 10:36:40 PM by LFSantosgeo »
Luiz Fernando

GPC

  • Jr. Member
  • **
  • Posts: 83
    • View Profile
    • Geopro
Re: Altitude or height.
« Reply #7 on: February 03, 2018, 07:57:27 AM »
If agisoft would update their documentation this answer would be obvious. The software allows for input of site elevation, clearly to convert AGL to AMSL, but you really can't figure that out on your own. They also mention geoids but Lord knows how you'd figure that out without documentation.
« Last Edit: February 03, 2018, 07:59:03 AM by GPC »
When things get weird, the weird turn pro.

stihl

  • Sr. Member
  • ****
  • Posts: 410
    • View Profile
Re: Altitude or height.
« Reply #8 on: February 03, 2018, 08:25:01 PM »
You can't just convert AGL to AMSL because AGL is a height based on an arbitrary reference, i.e. the elevation of the project terrain. If there's no correlation between the references used there's no real way to convert the values without knowing the elevation of the ground in the coordinate system you want to work in.

What's best would be to record the start-off elevation with a high or low accuracy GPS receiver. Then change the flight log elevations in Windows Excel by adding the recorded value to the AGL elevations to get ASML or WGS84 elevations (based on your recorded value).
They also mention geoids but Lord knows how you'd figure that out without documentation.
There are courses and studies you can take to deal with these subjects.
« Last Edit: February 03, 2018, 08:27:30 PM by stihl »

SAV

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
Re: Altitude or height.
« Reply #9 on: February 05, 2018, 08:24:21 AM »
Hi LFSantosgeo,

Sorry for my late reply.

Here is the Python Script that allows you to change the Z EXIF info within PhotoScan:

Code: [Select]
#Solves EXIF altitude problem for imagery acquired by DJI drones
#For questions, get in touch with Agisoft PhotoScan forum user SAV
#Tested on PhotoScan Pro 1.4.0

import PhotoScan

doc = PhotoScan.app.document
chunk = doc.chunk

flight_height = PhotoScan.app.getFloat("Please specify the flight height in meters", 30)
take_off_alt = PhotoScan.app.getFloat("Please specify altitude above mean sea level for the point of take-off:", 0)

for camera in chunk.cameras:
if camera.reference.location:
coord = camera.reference.location
camera.reference.location = PhotoScan.Vector([coord[0], coord[1], flight_height + take_off_alt])

chunk.updateTransform()
PhotoScan.app.update()
print("DONE")

The script will first ask you for the planned flight height (it assumes that the survey occurred along a constant flight height, so no terrain following). Next, you'll have to enter the altitude above mean sea level for the point of take-off. It will then use the sum of both values to populate the altitude column in the Reference pane.

For example, if the point of take-off was 120m above mean sea level (AMSL) and the survey was planned at a constant flight height of 65m, then the altitude value would be 185m.

This script might help many DJI UAV users. Feel free to share this script/post.

All the best.

Regards,
SAV

Several solutions:

1. Fix the Z value in EXIF by adding the altitude relative to mean sea level of the point of take-off to your flight height above point of take-off (which is recorded by your DJI drone). Can be done using a custom Python script or externally.

2. Adjust the accuracy settings for ground control points and camera locations. If you enter a very large number for camera accuracy (Photoscan default value is 10m) and a low number for marker accuracy (default is 0.005m), then the optimisation and height of the model will mainly depend on the Z value of your your ground control points/markers.

Hello SAV!

Do you have this python script to change the altitude in EXIF? Does it need to install a module in PS (when thinking of using it in PS)?

Would not be good to apply the first 2 fixes (exif edit and adjusting the accuracy of photos/markers and uncheck) at the same time?

3. Uncheck all images in the reference pane so Photoscan will ignore their locations during Photo alignment (and only use GCPs).

On your workflow you recommend to uncheck the photos after placing or importing markers which is a step after photo alignment. Would you care to comment?

Best regards,
« Last Edit: February 05, 2018, 11:53:46 AM by SAV »

xanngy

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Altitude or height.
« Reply #10 on: May 11, 2018, 09:37:30 PM »
Hello, someone can tell me what is improve changing this? because even you do not this, the result from GCP are excellent very similar to traditional topography survey...

Good Morning.
I uploaded some photos taken with a phantom and altitude drone presented is the height of the camera above the ground. Control points are taken with GPS and their altitudes are relative to mean sea level How do I resolve these differences ?.

Thanks for everything and best regards.

feliperios

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Altitude or height.
« Reply #11 on: September 14, 2018, 06:33:18 PM »
Hello SAV; I am new to Python, please could explain how to run the Python Script that allows you to change the Z EXIF info within PhotoScan?

Thanks,

Felipe

gto234

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: Altitude or height.
« Reply #12 on: September 15, 2018, 09:55:00 AM »
Go to https://github.com/agisoft-llc/photoscan-scripts and download the scripts.
Then load the script "add_altitude_to_reference.py" within Photoscan.
Then run the script from the Custom menu
Enter the value of the altitude you want to add or subtract and you are done..! Pretty simple!

joecnc2006

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Altitude or height.
« Reply #13 on: December 07, 2020, 07:40:41 PM »
Is there an update to this for 1.7 the original only works for 1.6.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: Altitude or height.
« Reply #14 on: December 07, 2020, 10:02:24 PM »
Hello joecnc2006,

Do you have any problems with this script version used in the 1.7 pre-release?
https://github.com/agisoft-llc/metashape-scripts/blob/master/src/add_altitude_to_reference.py
Best regards,
Alexey Pasumansky,
Agisoft LLC