Forum

Author Topic: Dealing with Reference Height Inaccuracies while creating a DEM with a Phantom 4  (Read 9065 times)

marg

  • Newbie
  • *
  • Posts: 18
    • View Profile
Hi,
I am trying to align about 1500 Phantom 4 images of a wheat field, shot from about 37 meters above ground. The aligned camera heights show a rather large variance. The image example shows the reference information in green (from image exif), the aligned cameras in red and the optimized cameras in blue. Optimization seems to counteract the large spread in altitude, but it’s still quite bad. I tried to add some constraints to the estimated height with chunk.camera_location_accuracy. I set the camera accuracies to 1m but this does not seem to reduce the spread and the bias at all. Any ideas?

n@sk

  • Jr. Member
  • **
  • Posts: 89
    • View Profile

"setting the camera accuracies to 1m " means that you are pretty optimistic
not much you can do without ground control points i'm afraid.

marg

  • Newbie
  • *
  • Posts: 18
    • View Profile
I have ground control points, measured with subcm accuracies. I know that the uav gps is far less accurate than 1 m, I’m just looking for ways to counter the large variability in estimated heights…

Jeremiah_ROWE

  • Guest
That will get resolved when you add the GCPs in and optimize. No reason to be messing with the UAV EXIF data when its not what you will ultimately be using to create your fit for the scene in the end.

marg

  • Newbie
  • *
  • Posts: 18
    • View Profile
In my image, the blue dots are optimized. As you can see, the variance in altitude is a little bit lower, but it is still quite high and there is this hanging effect. What do you mean by messing with the EXIF data? I tried using unaltered EXIF reference altitudes before. They are around 40-50 meters, which is either above ground or above home, I'm not sure. Still the exact same problem of very high altitude variance and systematic bias after alignment and optimization.

LFSantosgeo

  • Jr. Member
  • **
  • Posts: 70
    • View Profile
In my image, the blue dots are optimized. As you can see, the variance in altitude is a little bit lower, but it is still quite high and there is this hanging effect. What do you mean by messing with the EXIF data? I tried using unaltered EXIF reference altitudes before. They are around 40-50 meters, which is either above ground or above home, I'm not sure. Still the exact same problem of very high altitude variance and systematic bias after alignment and optimization.

What was your workflow with your photos?
Luiz Fernando

marg

  • Newbie
  • *
  • Posts: 18
    • View Profile
My workflow at the moment is a little bit convoluted, but I'll attach the (commented) script. Feel free to comment on my code.

SAV

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
Hi marg,

You mentioned that you have highly accurate ground control points (sub-cm accuracy). I suggest that you simply uncheck all pictures in the REFERENCE PANE.

This means that Photoscan will ignore the EXIF reference information from your images and only use the highly accurate GCPs. If you have a decent image overlap, Photoscan will be able to estimate the camera locations and orientations very accurately solely based on the GCPs.

Regards,
SAV

marg

  • Newbie
  • *
  • Posts: 18
    • View Profile
I tried something similar before by removing all exif location information with a python script, but had similar results (large altitude variance, hanging bias...) but I could try this. Do you know how the exif camera reference could be deactivated in python? Also, this means I can't use Reference Preselection, right? Which one am I supposed to use instead?
Thanks!

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15086
    • View Profile
Hello marg,

To uncheck all cameras in the Reference pane via Python it is necessary to perform the following:
Code: [Select]
import PhotoScan
chunk = PhotoScan.app.document.chunk
for camera in chunk.cameras:
    camera.reference.enabled = False
Best regards,
Alexey Pasumansky,
Agisoft LLC

Patrick S.

  • Newbie
  • *
  • Posts: 1
    • View Profile
Hi,

I actually have a question of a different sort. I see that you are using a DJI Phantom 4; however, you do not mention what type of Flight Planning software that you are using. This can make a slight difference for the imagery that you collect because if you are not flying a perfectly flat plain, you may have differences in elevation due to the Flight Planning software package that you use.

This is because some Flight Planning Software packages have Terrain Following built into the programming, while others do not.

However, I would also recommend just inputting your Ground Control Points into your Agisoft Photoscan project. From there, just set up your markers and you should be good to go for your elevation.

Thank you,
Patrick S.

SAV

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
Hi Marg,

If you want to still use the EXIF location information, then you'll have to fix it first. DJI's drones record the relative altitude above point of take-off, which means if you add the altitude of the point where you took off to the relative altitude values that are recorded in the EXIF information, then you can get the 'real flight altitude' which will probably be within within Potoscan's default camera accuracy value of 10m. This has do be done either using 3rd party software or by running a Python script.

Alternatively, you could choose a very large camera accuracy value (instead of the 10m default value) and keep all images checked in the reference pane. Remember that Photoscan is simply trying to minimize the total error based on all the reference information and the associated accuracy values. For example, if GCPs have 3cm accuracy and your photos have an accuracy of 30m, then the GCPs will be weighted 1000 times higher than your camera locations. Therefore, your camera locations will not play an important role for referencing the model/point cloud and associated data.

Correct. If you uncheck all images in the reference pane, you cannot use REFERENCE PRESELECTION anymore. Choose GENERIC instead.
Corrected. See post below by Alexey.

All the best.

Regards,
SAV

I tried something similar before by removing all exif location information with a python script, but had similar results (large altitude variance, hanging bias...) but I could try this. Do you know how the exif camera reference could be deactivated in python? Also, this means I can't use Reference Preselection, right? Which one am I supposed to use instead?
Thanks!
« Last Edit: December 06, 2017, 07:14:13 AM by SAV »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15086
    • View Profile
Hello SAV,

Actually, I cannot agree with your last sentence:
Quote
If you uncheck all images in the reference pane, you cannot use REFERENCE PRESELECTION anymore.
Reference Preselection can be used if there are any coordinates for the cameras in the Reference pane and it doesn't matter, if the cameras are checked on or unchecked. Their status (checked/unchecked), however, defines, if the coordinate information will be used for the optimization of the alignment during Estimating Scene Structure phase.
So in general case, when coordinates of the camera positions are quite inaccurate, it is still possible to use Reference preselection, but exclude the coordinate information from internal optimization.
Best regards,
Alexey Pasumansky,
Agisoft LLC

marg

  • Newbie
  • *
  • Posts: 18
    • View Profile
I actually have a question of a different sort. I see that you are using a DJI Phantom 4; however, you do not mention what type of Flight Planning software that you are using. This can make a slight difference for the imagery that you collect because if you are not flying a perfectly flat plain, you may have differences in elevation due to the Flight Planning software package that you use.

I am actually using a custom script for this, which sets a constant flight altitude depending on my desired gsd.

Hello marg,

To uncheck all cameras in the Reference pane via Python it is necessary to perform the following:
Code: [Select]
import PhotoScan
chunk = PhotoScan.app.document.chunk
for camera in chunk.cameras:
    camera.reference.enabled = False

Gonna try this now, thanks! Could you maybe comment on how the camera accuracy setting works? Because it does not actually seem to constrain the camera location estimation to much?

If you want to still use the EXIF location information, then you'll have to fix it first. DJI's drones record the relative altitude above point of take-off, which means if you add the altitude of the point where you took off to the relative altitude values that are recorded in the EXIF information, then you can get the 'real flight altitude' which will probably be within within Potoscan's default camera accuracy value of 10m. This has do be done either using 3rd party software or by running a Python script.

Hm, getting the takeoff altitude might be tricky though...Since my mission consisted of 3 flights, I'd have to lookup these 3 locations and assign each image to one of them...Can't think of a reliable way to do this off the top of my head.

SAV

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
Thanks for clarifying, Alexey.

I assumed that unchecking photos in the reference pane is equal to photos not having any coordinates, because for images without any EXIF location information PAIR PRESELECTION: REFERENCE is not available/working. But apparently that's not the case, as you explained. Thanks.

Regards,
SAV


Hello SAV,

Actually, I cannot agree with your last sentence:
Quote
If you uncheck all images in the reference pane, you cannot use REFERENCE PRESELECTION anymore.
Reference Preselection can be used if there are any coordinates for the cameras in the Reference pane and it doesn't matter, if the cameras are checked on or unchecked. Their status (checked/unchecked), however, defines, if the coordinate information will be used for the optimization of the alignment during Estimating Scene Structure phase.
So in general case, when coordinates of the camera positions are quite inaccurate, it is still possible to use Reference preselection, but exclude the coordinate information from internal optimization.