gisma / MetashapeTools

Scripts and Utilities for Agisoft Metashape
2 stars 1 forks source link

Ortho+ tool: Orthoimage-post-GCP (step 4) does not process the orthomosaic after optimizing and georeferencing the sparse cloud #1

Closed Runge123 closed 1 year ago

Runge123 commented 1 year ago

Dear Chris,

I have a set of RGB images that I have processed using GCP using the otho+ tool.

I follow the steps described in the guide (https://github.com/gisma/MetashapeTools) to obtain an optimized and georeferenced sparse cloud with GCPs. However, when I try to process step 4 (Orthoimage-post-GCP) I get the error: Null point coud and, therefore, I cannot generate the orthoimage on the smoothed mesh.

Point cloud refers to the optimized sparse cloud derived from SfM, or a dense point cloud from MVS? I thought I have to use the SfM sparse cloud to intepolate the mesh and calculate the orthoimage by step 4, is this correct?

Thanks :)

gisma commented 1 year ago

Hi Christian, can you sent me the log file? the code says that you need a sparsecloud active in the chunk that you are processing. and the error tells you there is no sparse cloudn

def Toolchain02():
  orthoRes = Metashape.app.getFloat("Target Resolution of Orthoimage in meter?",value =0.03)  
  ac = Metashape.app.getBool("Process all Chunks?")
  if ac:
    for chunk in Metashape.app.document.chunks:

      sparse2ortho(chunk,orthoRes)
      exportOrtho(chunk)
      #exportSeamlines(chunk)
      exportMarker(chunk)
  else:
      chunk = Metashape.app.document.chunk

      sparse2ortho(chunk,orthoRes)
      exportOrtho(chunk)
      #exportSeamlines(chunk)
      exportMarker(chunk)
Runge123 commented 1 year ago

Thanks Chris,

I used Reset Region option in the Model view to reenable the optimized sparse cloud, now I was able to process steap 4.

gisma commented 1 year ago

fine