Hello varadg,
Assuming that you have the following input file:
point 1,IMG_0001.JPG,100,200
point 1,IMG_0015.JPG,345,400
point 2,IMG_0023.JPG,786,211
You can load the projections using the following code:
import PhotoScan
def getMarker(chunk, label):
for marker in chunk.markers:
if marker.label == label:
return marker
return None
def getCamera(chunk, label):
for camera in chunk.cameras:
if camera.label == label:
return camera
return None
chunk = PhotoScan.app.document.chunk
path = "D:/input.txt"
with open(path, "rt") as input:
content = input.readlines()
for line in content:
m_label, c_label, x_proj, y_proj = line.split(",")
marker = chunk.getMarker(chunk, m_label)
if not marker:
marker = chunk.addMarker()
marker.label = m_label
camera = chunk.getCamera(chunk, c_label)
if not camera:
print(c_label + " camera not found in project")
continue
marker.projections[camera] = (float(x_proj), float(y_proj))