Agisoft Metashape
Agisoft Metashape => Python and Java API => Topic started by: ppant on June 10, 2021, 06:41:23 PM
-
Trying to export the vegetation index band
from python script and ran into this issue RuntimeError: Unsupported format: .tif
vegetation_image = 'D:/orthomosaic_rdvi.tif'
chunk.raster_transform.formula = ["(B10-B6)/sqrt(B10+B6)"]
chunk.raster_transform.calibrateRange()
chunk.raster_transform.enabled = True
chunk.exportRaster(vegetation_image, image_format= Metashape.ImageFormatTIFF, raster_transform=Metashape.RasterTransformValue,
save_alpha=False)
Thanks
-
Hello ppant,
I've just copied your code to the Console pane for the random multispectral project (had to perform chunk variable initialization, though), and it worked as expected without the reported error.
I have used 1.7.3 release version. Please check, if you observe the error on your side in the latest release version. I can also suggest to check, if the problem persists after Metashape re-start.
-
Alexey,
Oho, I am using the metashape version 1.6.6 build 11715. Is that a bug there on 1.6.6 ? Not sure. As I am running several scripts with 1.6.6. it is not easy for me to update our system directly to 1.7.3. without knowing all things are working. Alexy is it possible to get the demo license.
Thanks
-
Hello ppant,
The same code worked fine in 1.6.6 version as well.
Do you observe the same behavior on any project or if the issue is specific to the certain project only? Do you observe the same problem after re-starting Metashape instance and using only the lines that you have provided for any multispectral project?
-
Alexy
I observed the problem in all data. Basically, I only posted the section of code to export the band image. Before exporting the vegetation band image I am exporting the orthomosaic, laz file that is working fine.
But when I add this section of code to export the vegetation band it just gave me an error unsupported tif format. Not sure what is causing that
-
Hello ppant,
The specified message "Unsupported format: .tif" could be related to export points or export tiled model operations only, so I suggest to check, that in those operations correct file extension is used. As it seems, that the error appears in another block of code.