Hello,
I've been trying to import a reference for markers in a local CS. I don't get an error message, nonetheless it will not asign the coordinates to the markers and the corresponding boxes remain empty in the referemce pane. So how can I import local coordinates for markers? Here is the code:
import os
import Metashape
doc = Metashape.app.document
chunk = doc.chunk
#chunk.label = "V1"
### Create project file
##project_path = 'D:/Franziska/py_test.psx'
##doc.save(project_path)
###doc.open(project_path)
# Add Photos
path_photos = "D:/Python/C_dreieckPfeiler_V1_Comprimiert/Bilder/"
image_list = os.listdir(path_photos)
photo_list = list()
for photo in image_list:
if photo.rsplit(".",1)[1].lower() in ["jpg", "jpeg", "tif", "tiff"]: photo_list.append("/".join([path_photos, photo]))
chunk.addPhotos(photo_list, strip_extensions = False)
chunk.crs = Metashape.CoordinateSystem('LOCAL_CS["Local CS",LOCAL_DATUM["Local Datum",0],UNIT["metre",1]]') # define crs as local coordinate system
#Align Photos
chunk.matchPhotos(downscale=1, generic_preselection=True, reference_preselection=False)
#Downscale=1 means high accuracy
chunk.alignCameras()
##Detect markers
marker = chunk.detectMarkers(Metashape.TargetType.CircularTarget12bit, 50)
path = 'D:/Python/C_dreieckPfeiler_V1_Comprimiert/KoordinatenMarker2.txt'
##KOS = open(path,"r")
##print(KOS.read())
chunk.marker_crs = Metashape.CoordinateSystem('LOCAL_CS["Local CS",LOCAL_DATUM["Local Datum",0],UNIT["metre",1]]') # define crs as local coordinate system
#chunk.crs = Metashape.CoordinateSystem("EPSG::9001") # define crs as local coordinate system
#crs = Metashape.CoordinateSystem()
#crs.init('LOCAL_CS["Local CS",LOCAL_DATUM["Local Datum",0],UNIT["metre",1]]')
#chunk.importReference(path,format=Metashape.ReferenceFormatCSV, columns = "nxyz", delimiter =" ",skip_rows=1,items = Metashape.ReferenceItemsMarkers,ignore_labels=True,threshold=0.1)
chunk.importReference(path,format=Metashape.ReferenceFormatCSV, columns = "nxyz", delimiter =" ",items = Metashape.ReferenceItemsMarkers,crs = Metashape.CoordinateSystem('LOCAL_CS["Local CS",LOCAL_DATUM["Local Datum",0],UNIT["metre",1]]'))
chunk.updateTransform()
Thank You!!