1
General / Re: Metashape 2.0 Laser Scan Referencing
« on: April 11, 2023, 07:16:59 AM »I figured out how to fix this. I had to compute the chunk transform that would ensure that the laser scans are in the correct position. To do this prior to alignment I duplicated the chunk, and then aligned the original chunk. From there I had to use the python console.Code: [Select]# gets chunks to use
non_aligned_chunk = Metashape.app.document.chunks[1]
aligned_chunk = Metashape.app.document.chunks[0]
# function to get camera based on label
def get_camera(chunk,label):
for camera in chunk.cameras:
if camera.label == label:
return camera
return None
# gets a spherical from a laser scan for both chunks
non_aligned_camera = get_camera(non_aligned_chunk, "Scan_001")
aligned_camera = get_camera(aligned_chunk, "Scan_001")
# non aligned camera is in the correct position so we work out chunk transform to equal non aligned camera position
aligned_chunk.transform.matrix = non_aligned_camera.transform * aligned_camera.transform.inv()
Can you please give me some more details on how you managed to do this? I duplicated the chunk, I aligned them using markers and then I tried to run your script but I get this error: 'NoneType' object has no attribut 'transform'