Dear Alexey,
Thank you for the hint! That works fine if a single iteration is set as follows:
for chunk in Metashape.app.document.chunks:
f = Metashape.PointCloud.Filter()
f.init(chunk,Metashape.PointCloud.Filter.ReprojectionError)
f.removePoints(reperr)
chunk.optimizeCameras(fit_f=True,fit_cx=True,fit_cy=True,fit_b1=True,fit_b2=True,fit_k1=True,fit_k2=True,fit_k3=True,fit_k4=True,fit_p1=True,fit_p2=True,fit_p3=True,fit_p4=True,adaptive_fitting=False,tiepoint_covariance=False)
Like this, the script will run on every chunk that is in the project. How do I have to change that it will only run on the active chunk? I tried to change
"for chunk in Metashape.app.document.chunks"
into
"for chunk in Metashape.app.document.chunk"
but that resulted in an error. Please excuse my beginner's questions...
Best regards