1
Bug Reports / Re: Assertion "3478972301441" failed at line 720
« on: March 23, 2023, 03:07:25 AM »
Metashape 2.0.2 fixed this error for us
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
# 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()
chunk = Metashape.app.document.chunk
camera = chunk.cameras[2]
transform = chunk.transform.matrix * camera.transform
# this works as expected, values are matching those in reference pane
pos = transform.translation()
rot = transform.rotation()
# this is not working, expected values are 93.583, -0.937, -44.785, outputted values are 273.58297001960716, 1.784351814162492, -135.21509554607456
ypr = Metashape.Utils.mat2ypr(rot)