Forum

Author Topic: align to reference targets  (Read 3156 times)

assafge

  • Newbie
  • *
  • Posts: 6
    • View Profile
align to reference targets
« on: August 13, 2024, 04:30:18 PM »
I'm trying to scan interiors, I've placed a calibration target on my window, took a lot of images - and the result is not aligned to my arbitrary coordinate system.

Code: [Select]
chunk.addPhotos(filenames=color_images)
accuracy = Metashape.Vector((0.001, 0.001, 0.001))
chunk.detectMarkers(target_type=Metashape.CircularTarget12bit, tolerance=50)
for marker in chunk.markers:
  if marker.label in yaml_data:
    marker.reference.location = Metashape.Vector(yaml_data[marker.label])
    marker.reference.enabled = True
    marker.reference.accuracy = accuracy
chunk.matchPhotos(downscale=0, generic_preselection=True, reference_preselection=True)
chunk.alignCameras(adaptive_fitting=True, reset_alignment=True)

and I'm checking the result using:
Code: [Select]
for m in chunk.markers:
    print(f'{m.label}: reference:({m.reference.location.x:.4f}, {m.reference.location.y:.4f}, {m.reference.location.z:.4f}), location:({m.position.x:.4f}, {m.position.y:.4f}, {m.position.z:.4f})')

which prints:
target 159: ref :(0.0000, 0.0000, 0.0000), loc:(0.3900, 0.4396, -2.7118)
target 160: ref :(0.0000, 0.0863, 0.0000), loc:(-0.0759, 0.4119, -2.7516)
target 161: ref :(0.0852, 0.0000, 0.0000), loc:(0.3779, 0.8753, -2.8706)
« Last Edit: August 13, 2024, 06:45:14 PM by assafge »