Agisoft Metashape
Agisoft Metashape => General => Topic started by: csherwood on January 23, 2017, 11:43:44 PM
-
The EXIF altidudes in the images (DJI Phantom 3 FC300X camera) have positive values; the values imported into Photoscan (Pro Windows 1.2.6 build 2843, 64 bit) are negative. Same numbers, but with a minus sign.
This is annoying, but the workaround is simple: export the camera locations, edit to remove the minus signs, and re-import...or use a script to scan the EXIF info in the images and generate the file to import, which may be preferable, because as others have pointed out, the actual values are off by some offset that could be removed in the same script.
Camera info after loading photos in PhotoScan:
# CoordinateSystem: GEOGCS["WGS 84",DATUM["World Geodetic System 1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9102"]],AUTHORITY["EPSG","4326"]]
#Label,X/East,Y/North,Z/Altitude
DJI_0012.JPG,-70.486803,41.768299,-154.170000
DJI_0013.JPG,-70.486481,41.768133,-154.170000...
EXIF info as read by IrfanView (EXIF plugin):
Filename - DJI_0012.JPG
ImageDescription - DCIM\100MEDIA\DJI_0012.JPG
Make - DJI
Model - FC300X
Orientation - Top left
XResolution - 72
YResolution - 72
ResolutionUnit - Inch
Software - v01.30.5036
DateTime - 2017:01:09 12:48:27
...more info...
GPS information: -
GPSVersionID - 3.2.0.0
GPSLatitudeRef - N
GPSLatitude - 41 46 5.88 (41.768300)
GPSLongitudeRef - W
GPSLongitude - 70 29 12.49 (70.486803)
GPSAltitudeRef - Sea level reference
GPSAltitude - 154.17 m
-
Hello csherwood,
Can you send any sample image file with the negative altitude to support@agisoft.com?
-
Hello csherwood,
Exiftool utility shows that GPSAltitude is defined below sea level for the provided image.
-
So it appears that the altitude is marked as Below Sea Level for the images, also the negative sign is observed for "Absolute Altitude tag in the XMP header extension.
The script that reads "Relative Altitude" from XMP (I assume it's height above take off point) for all the cameras in the active chunk is the following:
import PhotoScan
doc = PhotoScan.app.document
chunk = doc.chunk
for camera in chunk.cameras:
if "DJI/RelativeAltitude" in camera.photo.meta.keys() and camera.reference.location:
z = float(camera.photo.meta["DJI/RelativeAltitude"])
camera.reference.location = (camera.reference.location.x, camera.reference.location.y, z)
chunk.updateTransform()
PhotoScan.app.update()
print("Script finished")
And the script that adds the same value to camera heights in the active chunk is the following:
import PhotoScan
alt = PhotoScan.app.getFloat("Please specify the height in meters to be added:", 100)
doc = PhotoScan.app.document
chunk = doc.chunk
for camera in chunk.cameras:
if camera.reference.location:
coord = camera.reference.location
camera.reference.location = PhotoScan.Vector([coord[0], coord[1], coord[2] + alt])
chunk.updateTransform()
PhotoScan.app.update()
print("Script finished")
-
The elevation of my photo is 7.1452 The elevation of the software is -7.1452 why?Turn negative
-
Hello FLEX,
I suggest to open the image in exiftool application and check if there's "Below sea level" mark. If it is there, then it should be corrected at side of camera and drone.
-
(http://r.photo.store.qq.com/psb?/V11FTXaK27tCr4/4BaQss6RIF80V4sHvex9nwQtnQ*bMY5Zvws*7Rk87Lo!/o/dFYBAAAAAAAA&ek=1&kp=1&pt=0&bo=OwPSATsD0gEDCC0!&tm=1492092000&sce=0-12-12&rf=viewer_311)
-
Hello FLEX,
Can you please attach any image from this set to the post?
-
For me it looks like a DJI firmware issue, similar to the problem discussed on other forums:
http://forum.dev.dji.com/thread-31960-1-1.html
http://forum.dronedeploy.com/t/incorrect-exif-data-in-latest-dji-firmware-anyone-else-seen-this/1484
In another thread I've posted two scripts that can be used to read Relative Altitude from the image header and after that to add absolute altitude of the take-off point above ellipsoid:
http://www.agisoft.com/forum/index.php?topic=6405.0
-
For me it looks like a DJI firmware issue, similar to the problem discussed on other forums:
http://forum.dev.dji.com/thread-31960-1-1.html
http://forum.dronedeploy.com/t/incorrect-exif-data-in-latest-dji-firmware-anyone-else-seen-this/1484
THANKS :) Solved my question
In another thread I've posted two scripts that can be used to read Relative Altitude from the image header and after that to add absolute altitude of the take-off point above ellipsoid:
http://www.agisoft.com/forum/index.php?topic=6405.0
-
Thank you for the add-altitude script, Alexey. Very useful, especially when using photos from DJI P4.
-
I'm sorry Guys, but I'm not the expert in scripts. Could anyone explain in a very simple and transparent way how to run this script and what exactly do I have to do, step by step?:
import PhotoScan
alt = PhotoScan.app.getFloat("Please specify the height in meters to be added:", 100)
doc = PhotoScan.app.document
chunk = doc.chunk
for camera in chunk.cameras:
if camera.reference.location:
coord = camera.reference.location
camera.reference.location = PhotoScan.Vector([coord[0], coord[1], coord[2] + alt])
chunk.updateTransform()
PhotoScan.app.update()
print("Script finished")
-
Hello mcuske,
Save the script as .py file:
https://raw.githubusercontent.com/agisoft-llc/metashape-scripts/master/src/add_altitude_to_reference.py
Then use Run Script option in the Tools Menu and point to the .py file location.
It will add new menu item in Custom Menu, use it to open the dialog that would allow to add the fixed offset value to all altitude values for the cameras in the Reference pane.
P.S. Note that the script that I am referring to is for the version 1.5, but on Github you can also find the script version for PhotoScan Pro 1.4, if you are still using the older version.
-
Thank You so much. It is working! :)