Forum

Author Topic: Iterate Gradual Selection until reaching target value  (Read 1474 times)

cgg_UH

  • Newbie
  • *
  • Posts: 5
    • View Profile
Iterate Gradual Selection until reaching target value
« on: November 04, 2020, 03:21:32 AM »
Hi all,

I've been trying to automate the Gradual Selection process (Reconstruction Uncertainty, Projection Accuracy, and Reprojection Error) for point cloud error reduction. The goal is to select 10% of the points in the point cloud given a Gradual Selection category, delete the points, and optimize the cameras, and keep looping through until a target value is reached without any points in the point cloud being selected.

For example, under Reconstruction Uncertainty, I want to select 10% of the points in the point cloud, delete them, and optimize the cameras. Then do this as many times as it takes until reaching a Reconstruction Uncertainty level of 10 without any points being selected.

In a reply to another post, Alexey suggested the following:
Code: [Select]
import Metashape as ps
chunk = ps.app.document.chunk
THRESHOLD = 10 #percentage values for selection


fltr = ps.PointCloud.Filter()
fltr.init(chunk, ps.PointCloud.Filter.ReconstructionUncertainty)
values = fltr.values.copy()
values.sort()
thresh = values[int(len(values)* (1-THRESHOLD/100))]
fltr.selectPoints(thresh)

This looks like it'd work, but how do I go about checking the reconstruction uncertainty's level after deleting the points and optimizing the cameras?

I'm very much a python noob. Just been trying to glean what I can from the forum and other resources, so if you have any suggestions, that'd be awesome.
« Last Edit: November 04, 2020, 03:49:12 AM by cgg_UH »

joacampb

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Iterate Gradual Selection until reaching target value
« Reply #1 on: November 15, 2020, 09:28:03 PM »
Hello,

I have found this post very useful while working on a similar process:

https://www.agisoft.com/forum/index.php?topic=10564.msg47949#msg47949

The script defined in the post will give you the RMS reprojection error and the MAX reprojection error. which you can also find in the GUI by right clicking the active chunk -> show info


Best,
joacampb