Forum

Author Topic: Aligning P4RTK images when some images have float position  (Read 3297 times)

SMcMurray1

  • Newbie
  • *
  • Posts: 6
    • View Profile
Aligning P4RTK images when some images have float position
« on: March 09, 2021, 01:41:00 AM »
Hi I am looking for a way to align a P4RTK flight where some of the images have got poor positional data. Over the flight was fixed RTK but some parts of lines the position dropped back to fix hold mode where the position degrades and the z error has crept up. The RTK fix photos all align no problem but I want to be able to align the others as well without holding their position fixed and fixing them to the RTK images.

Anyone know how to do this ?

Regards
Steve

Paulo

  • Hero Member
  • *****
  • Posts: 1352
    • View Profile
Re: Aligning P4RTK images when some images have float position
« Reply #1 on: March 09, 2021, 04:36:30 AM »
Hi Steve,

normally the RTK positioning accuracy will be loaded from XMP metadata as long as this option is ticked in Advanced preferences pane of MS. as in:

Code: [Select]
....
Rtk Flag                        : 16
Rtk Std Lon                     : 1.36853
Rtk Std Lat                     : 1.49256
Rtk Std Hgt                     : 3.18013
.....

In this example, the camera has single point positioning accuracy (meter level)
The RTK flag will determine the accuracy status of RKK as :
RTK status (0 - no positioning; 16 - single-point positioning mode; 34 - RTK float solution; 50 - RTK fixed solution)
So if this metadata is correctly read, then all cameras will have accuracy correctly set (m level for single point, decimeter level for Float, centimeter level for Fixed). And this info will be taken into account during alignment phase (weighing each position according to accuracy).

If this data is not correctly read from XMP then for each camera, you can always modify camera accuracy according to your RTK report...
« Last Edit: March 09, 2021, 06:43:31 AM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor

SMcMurray1

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Aligning P4RTK images when some images have float position
« Reply #2 on: March 10, 2021, 02:19:32 AM »
Thanks Paulo.
The issue I think is that the single point position flagged images all have accuracies listed as approx 70mmXY and 100mm Z - I think this is too tight for the alignment to fit accurately - currently getting an overall error of approx. 1.8m ? . I think I might change the accuracies of the single points to 2m instead and give them more room to move in the alignment. Thoughts ?
Also is there any way to show the RTK flags in the control interface and select the cameras by the flag ?

Cheers
Steve

Paulo

  • Hero Member
  • *****
  • Posts: 1352
    • View Profile
Re: Aligning P4RTK images when some images have float position
« Reply #3 on: March 10, 2021, 02:51:49 AM »
Hi Steve,

the reported accuracies of 70mm/100mm for single point positioning are surprising as they seem to correspond to something more akin to Float solution.

Presently, MS does not read the RTK Flag entry from XMP metadata only the RTK Standard Deviations entries.

You can use ExifTool and a batch file to extract required entries to a tab seperated Text as:
Code: [Select]
exiftool -filename -rtkflag -rtkstdlon -rtkstdlat -rtkstdhgt -T C:\Users\paul.pelletier\Downloads\Phantom4RTK\100_0004 > C:\Users\paul.pelletier\Downloads\Phantom4RTK\GNSS\rtkflagstd.txt
to get following result (filename rtkflag rtkstdlon rtkstdlat rtkstdhgt):
Code: [Select]
100_0004_0001.JPG 16 1.36853 1.49256 3.18013
100_0004_0002.JPG 16 1.35640 1.52763 3.15625
100_0004_0003.JPG 16 1.37848 1.53026 3.10956
100_0004_0004.JPG 16 1.37613 1.68821 3.29696
100_0004_0005.JPG 16 1.37409 1.66451 3.45665
100_0004_0006.JPG 16 1.37828 1.51083 3.28636
100_0004_0007.JPG 16 1.39987 1.50757 3.25633
100_0004_0008.JPG 16 1.37172 1.49396 3.11723
100_0004_0009.JPG 16 1.37592 1.47287 3.09879
100_0004_0010.JPG 16 1.40017 1.45244 3.17528

Update: I stand corrected, the RTK Flag is in fact read by MS and is stored in camera.photo.meta['DJI/RtkFlag']. So you could execute a script that reads this metadata and assigns positioning accuracy according to its value (or select cameras with a certain flag) as:
Code: [Select]
chunk = Metashape.app.document.chunk
for camera in chunk.cameras:
    if not camera.photo.meta['DJI/RtkFlag']:
        continue
    flag = int(camera.photo.meta['DJI/RtkFlag'])
    if flag == 16:    # single point positioning accuracy
        camera.reference.location_accuracy = Metashape.Vector((1,1,3))    # setting camera accuracy at 1m X, 1m Y and 3m Z
        camera.selected = True     # selecting cameras with RTK flag equal to 16
    if flag == 34:    # RTK Float positioning accuracy
        camera.reference.location_accuracy = Metashape.Vector((0.1,0.1,0.3))
    if flag == 50:    # RTK Fix positioning accuracy
        camera.reference.location_accuracy = Metashape.Vector((0.01,0.01,0.03))

Another way to do this, would be to set accuracies at 95% confidence from Standard deviations (68% confidence) read from RtkStdLon, RtkStdLat and RtkStdHgt as follows:
Code: [Select]
for camera in chunk.cameras:
    if not camera.photo.meta['DJI/RtkFlag'] or int(camera.photo.meta['DJI/RtkFlag']) == 0:
        continue
    flag = int(camera.photo.meta['DJI/RtkFlag'])
    sx = float(camera.photo.meta['DJI/RtkStdLon'])
    sy = float(camera.photo.meta['DJI/RtkStdLat'])
    sz = float(camera.photo.meta['DJI/RtkStdHgt'])
    camera.reference.location_accuracy = Metashape.Vector((1.2238*(sx+sy),1.2238*(sx+sy),1.96*sz))  # setting accuracies at 95% confidence level CEP₉₅ = 1.2238 * (sx+sy) and Z₉₅ = 1.96 * sz
« Last Edit: March 12, 2021, 07:56:05 AM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor