Forum

Author Topic: Importing local coordinates of Markers .CSV file  (Read 2249 times)

ahananq007

  • Newbie
  • *
  • Posts: 2
    • View Profile
Importing local coordinates of Markers .CSV file
« on: December 26, 2021, 10:51:38 PM »
Hi,

I am running python script. I am having some issue while I am trying to import .CSV (local coordinates of markers). Following script I am running

 chunk = Metashape.app.document.chunk
 path = "D:\\GCP.csv"
 chunk.importReference(path, format = Metashape.ReferenceFormatCSV, delimiter="," columns="nxyz") 

and I am getting this error

File "D:/File.py", line 102
chunk = Metashape.app.document.chunk
                                      ^
IndentationError: unindent does not match any outer indentation level
Error: unindent does not match any outer indentation level (D:/File.py, line 102)

This is my workflow sequence

# STEP 1 - Load Images
# STEP 2 - Align Images
# STEP 3 - Detect Markers
#STEP 4 - Importing CSV File
# STEP 5 - Optimize Cameras and Region Reset


Kindly advice

Regards
 

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15029
    • View Profile
Re: Importing local coordinates of Markers .CSV file
« Reply #1 on: December 27, 2021, 11:26:18 AM »
Hello ahananq007,

The error message indicates that there's a problem with the indentation in the script file, please check that there's correct number of "tabs" and "spaces" in the beginning of the lines.
Best regards,
Alexey Pasumansky,
Agisoft LLC

ahananq007

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Importing local coordinates of Markers .CSV file
« Reply #2 on: December 29, 2021, 08:53:03 PM »
Thank you,

Kindly advise, can I import *.CSV file or only .txt files can be imported via python scripts, using same code ?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15029
    • View Profile
Re: Importing local coordinates of Markers .CSV file
« Reply #3 on: January 08, 2022, 08:53:45 PM »
Hello ahananq007,

The file extension doesn't matter, providing that the file stores the same content. You can use both .txt and. csv (so the path variable would contain different string value), while chunk.importReference line can be kept unchanged.
Best regards,
Alexey Pasumansky,
Agisoft LLC