Agisoft Metashape > Python and Java API

Build orthomosaic with only mesh

(1/1)

saduka:
Hi,
In oder to save some computation time, I try to use only mesh to build orthomosaic. However, it keeps jumping Error: Empty frame path.
I am wondering what is the problem here.


--- Code: ---chunk.matchPhotos(accuracy=Accuracy,
                      generic_preselection=True,
                      reference_preselection=True,
                      filter_mask=False,
                      keypoint_limit=Key_Limit,
                      tiepoint_limit=Tie_Limit)
chunk.alignCameras(adaptive_fitting=True)
doc.save(path) #This works fine

chunk.buildModel(surface = PhotoScan.SurfaceType.HeightField,
                 interpolation=PhotoScan.Interpolation.EnabledInterpolation,
                 face_count=PhotoScan.FaceCount.HighFaceCount,
                 quality=PhotoScan.Quality.HighQuality,
                 vertex_colors=False)
doc.save(path)#This works fine

chunk.buildOrthomosaic(surface=PhotoScan.DataSource.ModelData,
                       blending=PhotoScan.BlendingMode.MosaicBlending,
                       fill_holes=True,
                       projection= chunk.crs) #Error jumps out

--- End code ---

Alexey Pasumansky:
Hello saduka,

You are using doc.save(path) function to save PSX project, but it works like Save As operation, so the project is saved and re-opened. It means that the chunk variable is no longer related to the opened document ( in your doc variable).
So either you need to re-assign chunk=doc.chunk after each "save as" operation, or save the project before assigning chunk variable and then just use doc.save() without path argument.

saduka:

--- Quote from: Alexey Pasumansky on September 24, 2018, 08:19:19 PM ---Hello saduka,

You are using doc.save(path) function to save PSX project, but it works like Save As operation, so the project is saved and re-opened. It means that the chunk variable is no longer related to the opened document ( in your doc variable).
So either you need to re-assign chunk=doc.chunk after each "save as" operation, or save the project before assigning chunk variable and then just use doc.save() without path argument.

--- End quote ---

Hi Alexey
Thanks for the reply, everything works fine!

Navigation

[0] Message Index

Go to full version