Agisoft Metashape

Agisoft Metashape => Python and Java API => Topic started by: rpr1g08@soton.ac.uk on July 25, 2022, 02:05:07 PM

Title: marker reference import one column python
Post by: rpr1g08@soton.ac.uk on July 25, 2022, 02:05:07 PM
Hello,

I am running an RTK drone survey script in python and getting large error numbers on the markers when I import them (4m+). Any idea how to include accuracy info of markers into the importReference() function?

Marker example:
n,   x,   y,   z,   accu
target 116,   462824.203,   100642.111,   3.822,   0.02

Cheers



Title: Re: marker reference import one column python
Post by: Paulo on July 26, 2022, 05:33:52 PM
Hello,

maybe you should look at p.43 API reference manula and columns parameter of importReference
Quote
importReference(path='', format=ReferenceFormatCSV, columns='', delimiter='', group_delimiters=False,
skip_rows=0[, items ][, crs ], ignore_labels=False, create_markers=False,
threshold=0.1, shutter_lag=0[, progress ])
Import reference data from the specified file.
Parameters
• path (string) – Path to the file with reference data.
• format (ReferenceFormat) – File format.
• columns (string) – Column order in csv format (n - label, o - enabled flag, x/y/z - coordinates,
X/Y/Z - coordinate accuracy, a/b/c - rotation angles, A/B/C - rotation angle accuracy,
[] - group of multiple values, | - column separator within group).
Title: Re: marker reference import one column python
Post by: Alexey Pasumansky on July 28, 2022, 12:19:52 PM
Hello rpr1g08,

For such input you should use the following:
Code: [Select]
chunk.importReference(path, format = Metashape.ReferenceFormatCSV, columns='nxyz[XYZ]', delimiter=',')In this case the last column in the file will be used as same accuracy for X, Y and Z.

Also make sure that either comma or tab is used as a delimiter, not both simultaneously.