Forum

Author Topic: Gradual selection of sparse point cloud using python script freezes program  (Read 2389 times)

jslyder

  • Newbie
  • *
  • Posts: 24
    • View Profile
Hi all,

Has anyone had Photoscan freeze up while performing gradual selection in a python script run within Photoscan? I work with an organization that uses an error reduction workflow where, among other things, they use gradual selection to select up to 10% of the sparse point cloud based on reprojection error, remove those points, optimize cameras, then repeat until a target value is reached. 

I was trying to implement this process as a python script run within Photoscan, and it usually works well.  With certain values, however, Photoscan passes through the iterative loop a few times then freezes.  This usually occurs when the value used for gradual selection is small.  The process freezes at a weird spot as well.  I set up the filter with the code below.

f = PhotoScan.PointCloud.Filter()
f.init(chunk, criterion = PhotoScan.PointCloud.Filter.ReprojectionError)

In most cases, this prints to the console the following message
Analyzing point cloud...
Finished processing in 0.141 sec (exit code 1)

However, in some cases it prints "Analyzing point cloud..." and then freezes so that I have to exit Photoscan using the task manager.  I've used nearly this exact same loop with reconstruction uncertainty with no issue, and when most values for reprojection error are chosen.

If anyone can help me identify why this is getting hung up on analyzing the sparse point cloud for gradual selection, that would be greatly appreciated.

Thanks!

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14854
    • View Profile
Hello jslyder,

How fast the gradual selection dialog shows up, if opened from GUI function?

And how many points are there in the sparse cloud for the cases when the Python-based function freezes?
Best regards,
Alexey Pasumansky,
Agisoft LLC

jslyder

  • Newbie
  • *
  • Posts: 24
    • View Profile
Hi Alexey,

On the same project, the gradual selection appears nearly instantly through the GUI, maybe a second or so.  Also, the gradual selection through the python script completes very quickly in earlier iterations. 

As far as the size of the cloud, I've tried it across a few datasets from ~60,000 points to 2 million points, and it seems to occur on both.  I would say that the best predictor is when the reprojection error is set too low.  With our materials, it is typical to get the project to a point where all points >0.3 reprojection error are removed.  The problem seems to occur if you try get to a level below what is reasonable for the dataset.  If I share the script, perhaps I'll just set the lower limit as a fixed variable instead of one that takes user input. 

Thanks!
« Last Edit: January 24, 2018, 07:19:48 PM by jslyder »