Hello williamgomes,
Please try this script, it works, however, in semi-manual way - you need to select the markers that you wish to merge at first, then execute the script (from the Custom Menu):
import PhotoScan
def merge_selected_markers():
doc = PhotoScan.app.document
chunk = doc.chunk
print("Script started...")
merge_list = list()
for marker in chunk.markers:
if marker.selected:
merge_list.append(marker)
if len(merge_list) < 2:
print("Nothing to merge, script aborted.")
return False
print(str(len(merge_list)) + " markers found.\nMerging projections")
ref_marker = merge_list[0]
projections = dict()
for marker in merge_list:
for camera in list(marker.projections.keys()):
if camera not in projections.keys():
projections[camera] = PhotoScan.Vector([0,0, 0])
x = marker.projections[camera].coord
x.size = 3
x.z = 1
projections[camera] += x
marker.projections[camera] = None
for camera in projections.keys():
if projections[camera].z:
ref_marker.projections[camera] = PhotoScan.Marker.Projection(PhotoScan.Vector([projections[camera].x, projections[camera].y]) * (1 / projections[camera].z), True)
print("Script finished")
return True
PhotoScan.app.addMenuItem("Custom menu/Merge Selected Markers", merge_selected_markers)