2
« on: April 23, 2024, 09:30:55 AM »
I was using this thread as a reference for my task and I am running into problems. I'm trying to export orthomosaics using raster transform 'B4' values using a script but when I compare it to the orthomosaic exported from the GUI, I get different values and different tif file sizes as well. What could be the problem? I've posted the script below along with the export settings that I used in the GUI. I'm currently using Metashape 2.0.1.
import Metashape
app = Metashape.app
doc = app.document
chunk = doc.chunk
proj = Metashape.OrthoProjection()
proj.crs = Metashape.CoordinateSystem("EPSG::4326")
chunk.raster_transform.formula = ["B4"]
chunk.raster_transform.calibrateRange()
chunk.raster_transform.enabled = True
exportPath = "[i]path[/i]"
compression = Metashape.ImageCompression()
compression.tiff_compression = Metashape.ImageCompression.TiffCompressionLZW
compression.tiff_big = True
chunk.exportRaster(path=exportPath, source_data = Metashape.OrthomosaicData, raster_transform = Metashape.RasterTransformValue, image_format = Metashape.ImageFormat.ImageFormatTIFF, image_compression = compression, save_world = True, save_alpha = False, global_profile = True, white_background = False)