31
Python and Java API / Re: Duplicate element keys not allowed
« on: April 28, 2020, 07:58:04 PM »
Please don't blame me but the error happened with 1.5.0 :S !
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.
proj = marker.projections[camera].coord
reproj = camera.project(marker.position)
error = (proj - reproj).norm()
__project_path = "directory/project.psx"
__archive_path = "directory/archive.psz"
doc = Metashape.app.document
doc.open(path=__archive_path, ignore_lock=True)
doc.save(path=__project_path)
doc.clear()
doc = Metashape.app.document
doc.open(path=__project_path, ignore_lock=True)
chunk = doc.chunk
doc.save()
__project_path = "directory/project.psx"
__archive_path = "directory/archive.psz"
doc = Metashape.app.document
doc.open(path=__archive_path, ignore_lock=True)
chunk = doc.chunk
doc.save(path=__project_path)
chunk.dense_cloud.transform = Metashape.Matrix().Diag([1,1,1,1]) * previous_chunk_transform_matrix * new_chunk_transform_matrix.inv()
The dense cloud take the right new location, but then following treatments don't work correctly anymore (like dense_cloud classification, etc...)chunk=Metashape.app.document.chunk
# importing cameras from only one sensor
my_sensor = chunk.sensors[0]
my_sensor.type = Metashape.Sensor.Type.Fisheye
my_sensor.user_calib = Metashape.Calibration()
my_sensor.calibration.load("my_path/my_calibration.xml", format='xml')
It return False ...