Forum

Author Topic: Agisoft & DJI Phantom 4 Pro: camera calibration or EXIF problem?  (Read 14438 times)

ciara123

  • Newbie
  • *
  • Posts: 6
    • View Profile
Hi there,

I am new to photogrammetry and Agisoft. I have been capturing planform images using the DJI P4P drone and using Agisoft to create a DEM of the surveyed area. This all works ok using a typical workflow when images are captured on the same day. Due to time or battery constraints, sometimes I had to finish a survey on an alternative day. Combining the two sets of images in Agisoft is proving problematic, with one set of images appearing on an elevated plane in comparison to the other set of images after the alignment step. I have GCPs in some of the area for referencing but this is not solving this initial problem.

Issue 1: DJI P4P altitude is different for the two sets of images, generally ~30m difference in the same area.
Troubleshoot: strip the altitude data (EXIF) using a photo editor like Geosetter. Either set to 0m or use elevations taken from Google maps.

This has worked in some cases, but not in others and I'm beginning to wonder is it a calibration issue? Rather than simply a problem with the drone altitude data?

In another case, the 'camera calibration' in Agisoft shows 2 different calibrations for each date the two sets of images were taken. I think I have the DJI camera set to default settings. The two calibrations show different resolutions (5472 x 3648, 5472 x 3078), but the same camera model and focal lengths. The initial value for 'f' is 3648 and 3482.57 and the adjusted values are different for both sets of images.

Could anyone please advise what sort of avenue I should be looking at to troubleshoot this problem?

Kind regards,
Ciara





 

SAV

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
Re: Agisoft & DJI Phantom 4 Pro: camera calibration or EXIF problem?
« Reply #1 on: March 21, 2018, 09:09:35 AM »
Hi ciara123,

First of all, welcome to the PhotoScan / digital photogrammetry community  :D

Have a look at this 'best practice UAV photogrammetry workflow' that has done the job for me (and many other users).
http://www.agisoft.com/forum/index.php?topic=7851.msg37494#msg37494

Additionally, here are 3 ways that might help you to fix the GPS altitude issues:
http://www.agisoft.com/forum/index.php?topic=4986.msg38769#msg38769

Regarding the camera calibration. If you process all images from the same UAV (even if flown on two different days) in one chunk, then PhotoScan should only give you a single camera calibration because the focal length or camera type hasn't changed, as far as I know.
If you have individually processed the two flights, then camera calibration can differ because of several reasons, such as changed GSD (flying at different altitudes), use of better/more reference constraints (i.e., ground control points) or even changes in light conditions. The automatic camera calibration will always differ a little, because the real world conditions are changing and the algorithms are simply trying to minimize the error based on given constraints. For example, image quality itself also impacts camera calibration results.

I hope you'll find this useful.

All the best.

Regards,
SAV
« Last Edit: March 21, 2018, 09:12:57 AM by SAV »

ciara123

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Agisoft & DJI Phantom 4 Pro: camera calibration or EXIF problem?
« Reply #2 on: March 22, 2018, 04:23:54 PM »
Hi SAV,

Many thanks for reading and replying  ;)

I have been following your workflow more or less, but you have a few extra steps so I will incorporate them into my workflow for a more thorough result, so thank you very much for that.

Regarding the GPS/altitude issue - from your posts I am now thinking I had it wrong before. Should the altitude in Agisoft  be the absolute altitude (i.e. ground altitude + flying altitude)?

I have been flying the drone using a combination of automated apps (Pix4D capture) and then the DJI Go app when Pix4D wouldn't connect on my tablet (that's a whole other problem!). so my flight altitude when using the latter app may not be consistent although I tried to keep it so.

Regarding the camera calibration -
 I am only using the camera attached to the P4P, so the focal length and camera type should not change and doesn't seem to in the calibration window. I have been adding them into one chunk, but still two calibrations emerge. One set of images was captured with Pix4D and the other DJI Go so perhaps the resolution of images captured with each app is different (slightly different jpeg height), and maybe this is why two calibrations occur.


Since I wrote my original post I have been processing another survey captured with Pix4D and DJI Go, which also has two camera calibrations. The altitude was also off in that case so I read web (ground) elevations for all images (using Geosetter). After placing GCPs the entire survey moved to the 'right' elevation plane and it seems to be ok.

This practice I have used of stripping the 'z' value in EXIF data, and replacing with web elevations or else 0 has worked in most cases (after placing GCP markers), except the one survey I originally posted about. So I just cannot get my head around it! If said practice is totally incorrect (if altitude in Agisoft is meant to be absolute flying altitude) I would appreciate if you could let me know  :-\

Best,
Ciara

 

SAV

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
Re: Agisoft & DJI Phantom 4 Pro: camera calibration or EXIF problem?
« Reply #3 on: March 23, 2018, 09:55:11 AM »
Hi Ciara,

The camera location in Photoscan uses absolute altitude (ground alt + flight height). However, EXIF Z value stored in the imagery from DJI drones is relative altitude (altitude above point of take off) plus some drift (Z altitude drifts during flight when sensors/drone is warming up). You might find this Python script useful: https://github.com/agisoft-llc/photoscan-scripts/blob/master/src/add_altitude_to_reference.py

Also make sure to use the same coordinate reference system for both your GCPs and camera locations.

If you have accurately surveyed ground control points, then use them and don't bother much about the large error in your EXIF altitude. Simply enter a large number for your camera accuracy (as outlined here http://www.agisoft.com/forum/index.php?topic=4986.msg38769#msg38769).

Regarding the two different camera calibrations. If the resolution/size of your images varies (because you used two different apps), then PhotoScan will automatically split them up.

Have you tried MapPilot? It is only available for iOS, but works quite well for 'basic' surveys. Details here: https://www.dronesmadeeasy.com/Articles.asp?ID=254

Regards,
SAV
« Last Edit: March 23, 2018, 10:04:21 AM by SAV »

ciara123

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Agisoft & DJI Phantom 4 Pro: camera calibration or EXIF problem?
« Reply #4 on: March 23, 2018, 02:13:50 PM »
Hi SAV,

Thanks I meant to say I had a look at that script when you sent the original link, but I'm currently using Photoscan on a colleague's computer and it's an older version, not compatible with the script unfortunately.

Yes I'm in the same co-ordinate system for both, and have GCPs collected with dGPS so they are very accurate. I will try the larger number for camera accuracy and see how that works out.

No I haven't tried MapPilot - I'm on Android for both phone and tablet. I've heard Litchi is a useful alternative to DJI Go so I might try that next.

Thanks again for all your help, it's very much appreciated!

Cheers,
Ciara

SAV

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
Re: Agisoft & DJI Phantom 4 Pro: camera calibration or EXIF problem?
« Reply #5 on: March 24, 2018, 07:43:39 AM »
Hi Ciara,

I recommend to update to the most recent version of PhotoScan (1.4.1). Since version 1.3, there have been some nice speed improvements (i.e., CPU and GPU usage for photo alignment, before it was CPU only) and it will also allow you to use most recent Python scripts.

FlyLitchi is great too, with more functionality compared to the DJI GO 4 app. However, both don't allow you to just pick and outline an area, image overlap and flight height to automatically compute flight lines. MapPilot (and also DJI GS Pro) allows you to do that. This helps to mitigate any image overlap issues. Note that MapPilot also has a 'terrain following' feature to ensure a constant GSD. But you'll need to get an iOS device to run it.

All the best.

Regards,
SAV
« Last Edit: March 26, 2018, 04:54:22 AM by SAV »