Agisoft Metashape

Agisoft Metashape => Python and Java API => Topic started by: mfran2002 on June 23, 2016, 04:52:12 PM

Title: ValueError in buildOrthomosaic command
Post by: mfran2002 on June 23, 2016, 04:52:12 PM
Hello,
I'm trying to build orthomosaic by the following statements:

Code: [Select]
curr_chunk = doc.chunks[0]

crs = PhotoScan.CoordinateSystem("EPSG::32632")

curr_chunk.buildOrthomosaic(surface=PhotoScan.DenseCloudData, blending=PhotoScan.MosaicBlending, color_correction=False, projection=crs)

but I get this error:

Code: [Select]
2016-06-23 15:39:25 curr_chunk.buildOrthomosaic(surface=PhotoScan.DenseCloudData, blending=PhotoScan.MosaicBlending, color_correction=False, projection=crs)

2016-06-23 15:39:25 ValueError: unsupported data source

Do you know where is my mistake?

thanks!
Title: Re: ValueError in buildOrthomosaic command
Post by: Alexey Pasumansky on June 23, 2016, 05:13:31 PM
Hello mfran2002,

Orthomosaic can be build based on the DEM or mesh model, not on the dense cloud directly.
Title: Re: ValueError in buildOrthomosaic command
Post by: mfran2002 on June 23, 2016, 05:17:13 PM
so, could it be ok the following statement?

Code: [Select]
crs = PhotoScan.CoordinateSystem("EPSG::32632")

curr_chunk.buildOrthomosaic(surface=PhotoScan.ModelData, blending=PhotoScan.MosaicBlending, projection=crs)

and please tell me also if the following are ok:

Code: [Select]
curr_chunk.exportOrthomosaic(path="C:/exportOrthomosaic.TIF", format='tif', raster_transform=PhotoScan.RasterTransformNone, projection=crs, write_kml=False, write_world=True, tiff_compression='lzw', tiff_big=False)

curr_chunk.exportModel(path="C:/exportModel.PDF", binary=True, precision=6, texture_format='pdf', texture=True, normals=True, colors=True, cameras=True, udim=False, strip_extensions=False, projection=crs)

thanks
Title: Re: ValueError in buildOrthomosaic command
Post by: Alexey Pasumansky on June 23, 2016, 05:57:53 PM
Hello mfran2002,

You can use PhotoScan.ModelData or PhotoScan.Elevation data for the surface argument.

As for the export model function, texture format should be selected from the image type (jpg, png, tif, exr) while the format argument should be "pdf".

Note that you can always use autocomplete with Crtl+Space in the Console pane to get some help on the actual function and see the supported formats for the function arguments.