Hi,
I have the following error when I try to build an orthomosaic in a python script:
libtiff error: Error writing TIFF header
RuntimeError: TIFFClientOpen: unexpected error: memory stream
Do you know why I could get this error? The weird thing is that when I execute the same code within the Metashape software with GUI, it goes fine.
Here is the code that I execute in the python script:
import Metashape
document = Metashape.Document()
document.open(folder + "project_before_ortho.psx", ignore_lock=True)
chunk = document.chunk
task = Metashape.Tasks.BuildOrthomosaic()
task.surface_data = Metashape.ModelData
task.blending_mode = Metashape.MosaicBlending
task.fill_holes = True
task.cull_faces = False
task.refine_seamlines = False
task.resolution_x = 0.001
task.resolution_y = 0.001
proj = Metashape.OrthoProjection()
proj.crs = Metashape.CoordinateSystem("LOCAL")
proj.matrix = Metashape.Matrix([
[1.0, 0.0, 0.0, 0.0],
[0.0, 0.0, 1.0, 0.0],
[0.0, -1.0, 0.0, 0.0],
[0.0, 0.0, 0.0, 1.0]
])
task.projection = proj
chunk.addOrthomosaic()
chunk.orthomosaic = chunk.orthomosaics[-1]
task.apply(chunk)
In the software, I just open Metashape and execute the same code, except for the first lines:
document = Metashape.app.document
document.open(folder + "project_before_ortho.psx", ignore_lock=True)
And as I said, when done in the Metashape software, I don't have the error and the orthomosaic is built...
Any help would be great!
Thanks a lot