Agisoft Metashape

Agisoft Metashape => Python and Java API => Topic started by: spatialdigger on August 24, 2021, 12:57:13 PM

Title: Export GCPS with error values
Post by: spatialdigger on August 24, 2021, 12:57:13 PM
Hi, I'm trying to export the Ground Control Points and the associated error - I'm wanting to assess the error in a script.

I've seen this, but it does not deport the error columns or the overall error
Code: [Select]
saveReference(path, format = PhotoScan.ReferenceFormatCSV, items = PhotoScan.ReferenceItemsCameras, delimiter = ",")
How is this achieved?
Title: Re: Export GCPS with error values
Post by: Alexey Pasumansky on August 24, 2021, 02:41:14 PM
Hello spatialdigger,

Please try the following command:
Code: [Select]
chunk.exportReference(path, format = Metashape.ReferenceFormatCSV, items = Metashape.ReferenceItemsMarkers, delimiter = ",", columns = "nxyzUVW")
Title: Re: Export GCPS with error values
Post by: spatialdigger on August 25, 2021, 12:31:46 AM
Is there any way to access the nxyzUVW values in python without exporting them?

Would it be something like:

Code: [Select]
n = Metashape.ReferenceItemsMarkers.n
or

Code: [Select]
n, x, y, z, U, V, W, = Metashape.ReferenceItemsMarkers
Title: Re: Export GCPS with error values
Post by: Alexey Pasumansky on August 25, 2021, 10:56:48 AM
Hello spatialdigger,

You can check, how the estimated values are calculated in the following script, and then subtract source values to get errors:
https://github.com/agisoft-llc/metashape-scripts/blob/master/src/save_estimated_reference.py