Forum

Author Topic: "Error: Empty Frame Path" when building orthomosaic (PhotoScan 1.2.0)  (Read 1086 times)

vicviod

  • Newbie
  • *
  • Posts: 7
    • View Profile
Hello,
I am trying to automate the processing of a chunk (aligning photos,  building dense point cloud, generating mesh, adding texture, building orthomosaic, and exporting the orthomosaic)

However, when I try to build the orthomosaic, I get "error: empty frame path"

Here is my code:

Code: [Select]
import PhotoScan
import os
import sys

doc = PhotoScan.app.document
chunk = doc.chunk
doc.chunk.crs = PhotoScan.CoordinateSystem("EPSG::4326")

imagePath = sys.argv[1]

chunk.matchPhotos(accuracy=PhotoScan.HighAccuracy, preselection=PhotoScan.ReferencePreselection)
chunk.alignCameras()
chunk.buildDenseCloud(quality=PhotoScan.MediumQuality)
chunk.buildModel(surface=PhotoScan.Arbitrary, interpolation=PhotoScan.EnabledInterpolation)
chunk.buildUV(mapping=PhotoScan.GenericMapping)
chunk.buildTexture(blending=PhotoScan.MosaicBlending, size=4096)
doc.save(path=os.path.join(imagePath, "test.psx"))

# Problem area
chunk.buildOrthomosaic(surface=PhotoScan.DataSource.ModelData, blending=PhotoScan.BlendingMode.MosaicBlending)
chunk.exportOrthomosaic(os.path.join(imagePath, "orthomosaic.tif"), format='tif')

It works until the saving of the file as a psx. Then I get the error when I try to build the orthomosaic.

I read somewhere that I should try to save the document before doing the processing steps, but when I tried that the outputs of the processing steps (tie points, dense point cloud, model, etc.) were not being added to the chunk, and when I tried to build the orthomosaic I got "Error: bad allocation"

I am using PhotoScan 1.2.0, and at the moment I am unable to change versions. How can I fix this?
« Last Edit: June 07, 2017, 07:57:00 AM by vicviod »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 9894
    • View Profile
Hello vicviod,

"Empty frame path" means that the chunk that you are using to generate the orthomosaic is not saved.
When you use doc.save(path) method it works similar to "Save as" operation from the interface - the project is saved and re-opened, so you need to re-assign chunk = doc.chunk after using that operation, or alternatively, save the document in the very beginning of the script and then just use doc.save() without any arguments, it will act as simple save operation under the same name.
Best regards,
Alexey Pasumansky,
AgiSoft LLC

vicviod

  • Newbie
  • *
  • Posts: 7
    • View Profile
Thanks! This fixed the problem.