Agisoft Metashape
Agisoft Metashape => Python and Java API => Topic started by: naren951 on August 17, 2021, 05:29:10 PM
-
Is there a way to know what are all the operations that have been performed on the Chunk using the Python API?
For Example: Let's say we perform chunk.matchPhotos() and Chunk.alignPhotos(), is there a way to know these 2 operations were performed.
-
Hello naren951,
You can check, if the corresponding assets exist in the chunk:
chunk.point_cloud, chunk.depth_maps, chunk.dense_cloud, chunk.model, chunk.elevation, chunk.orthomosaic, chunk.tiled_model.
then access it's meta information:
chunk.meta, chunk.point_cloud.meta, chunk.dense_cloud.meta and etc. it contains the information about the processing parameters used and time spent on the corresponding processing stage.
-
Thank you so much Alexey Pasumansky, is there a way to know if alignCameras and matchPhoto has been executed before?
-
Hello naren951,
If there's no tie point cloud in the chunk (chunk.point_cloud == None), then it means that image matching hasn't been performed. If it exists, you can check for the meta-information that I have previously mentioned.
In case camera alignment hasn't been performed, camera.transform for all cameras in the chunk should be None as well (i.e. all cameras are not aligned).
-
Is there a way to know if build texture has been run?
-
Hello naren951,
The following code returns the types of the generated textured for the model, if at least one texture exists:
if chunk.model.textures:
for texture in chunk.model.textures:
print(texture.type)
else:
print("no textures for model")