5
« 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:
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.