Hello mrefiei,
In case you wish to import marker projections in pixels and place them on the corresponding images you can use the following script (for PhotoScan Pro 1.1):
#markers import script
#input file format:
#marker_label camera_label x-coord y_coord
#(TAB separator)
import PhotoScan
doc = PhotoScan.app.document
chunk = doc.chunk
path = PhotoScan.app.getOpenFileName("Specify input file with marker coordinates:")
print("Import started...") #informational message
photos_total = len(chunk.cameras) #number of photos in chunk
markers_total = len(chunk.markers) #number of markers in chunk
file = open(path, "rt") #input file
eof = False
line = file.readline()
if len(line) == 0:
eof = True
while not eof:
print(line)
sp_line = line.rsplit("\t", 3) #splitting read line by four parts
y = float(sp_line[3]) #x- coordinate of the current projection in pixels
x = float(sp_line[2]) #y- coordinate of the current projection in pixels
camera_label = sp_line[1] #camera label
marker_name = sp_line[0] #marker label
flag = 0
for camera in chunk.cameras:
if camera.label.upper() == camera_label.upper(): #searching for the image (comparing with all the photo paths in chunk)
for marker in chunk.markers: #searching for the marker (comparing with all the marker labels in chunk)
if marker.label == marker_name:
marker.projections[camera] = (x, y) #setting up marker projection of the correct photo)
flag = 1
break
if not flag: #adding new marker if no correspondence found
chunk.addMarker()
chunk.markers[-1].label = marker_name
chunk.markers[-1].projections[camera] = (x, y) #setting up marker projection of the correct photo)
break
line = file.readline() #reading the line in input file
if not len(line):
eof = True
break # End of File
print("Script finished") #information message
file.close()