Forum

Author Topic: detecting the number of camera's that where used to define a point  (Read 6193 times)

mpatalberta

  • Newbie
  • *
  • Posts: 24
    • View Profile
Is their a way to detect the number of cameras that made up a particular point.
Obviously you need at least 2 cameras for a point.
I want to remove all points from my data that had less than 3 cameras that made up the point.
Thanks,

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15635
    • View Profile
Re: detecting the number of camera's that where used to define a point
« Reply #1 on: March 05, 2019, 07:14:31 PM »
Hello mpatalberta,

You can use Model Menu -> Gradual Selection option -> Image Count criterion while the sparse point cloud is displayed in the Model view.

Thus you can select the points that are visible from only 2 cameras and remove them.
Best regards,
Alexey Pasumansky,
Agisoft LLC

mpatalberta

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: detecting the number of camera's that where used to define a point
« Reply #2 on: March 05, 2019, 07:26:03 PM »
Alexy,
How would I do the same from python?
Pat,

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15635
    • View Profile
Re: detecting the number of camera's that where used to define a point
« Reply #3 on: March 05, 2019, 07:44:26 PM »
Hello Pat,

Code: [Select]
chunk = Metashape.app.document.chunk
threshold = 2
f = Metashape.PointCloud.Filter()
f.init(chunk, criterion = Metashape.PointCloud.Filter.ImageCount)
f.selectPoints(threshold)
#f.removePoints(threshold)
Best regards,
Alexey Pasumansky,
Agisoft LLC

mpatalberta

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: detecting the number of camera's that where used to define a point
« Reply #4 on: March 05, 2019, 10:54:52 PM »
1-
I see the code:
chunk = Metashape.app.document.chunk
threshold = 2
f = Metashape.PointCloud.Filter()
f.init(chunk, criterion = Metashape.PointCloud.Filter.ImageCount)
f.selectPoints(threshold)
#f.removePoints(threshold)

What does f.removePoints(threshold) do ? Do I need the line to actually remove the points?

2-
I want to add an additional criterion

threshold = 2
f = Metashape.PointCloud.Filter()
f.init(chunk, criterion = Metashape.PointCloud.Filter.ImageCount)
f.selectPoints(threshold)
f.removePoints(threshold)

f1 = Metashape.PointCloud.Filter()
f1.init(chunk, PhotoScan.PointCloud.Filter.ReconstructionUncertainty)
f1.selectPoints(10.1)
f1.removePoints(10.1)


f2 = Metashape.PointCloud.Filter()
f2.init(chunk, PhotoScan.PointCloud.Filter.ReprojectionError)
f2.selectPoints(0.5)
f2.removePoints(0.5)


f3 = Metashape.PointCloud.Filter()
f3.init(chunk, PhotoScan.PointCloud.Filter.ProjectionAccuracy)
f3.selectPoints(8.0)
f3.removePoints(8.0)

Would the above apply the four filters to the point cloud data?
Can you please correct where things are wrong?

Thanks,
Patrick

« Last Edit: March 06, 2019, 12:00:51 AM by mpatalberta »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15635
    • View Profile
Re: detecting the number of camera's that where used to define a point
« Reply #5 on: March 06, 2019, 10:29:38 AM »
Hello Patrick,

The code seems valid.

Note that you can use only .removePoints(threshold) command to invalidate the tie points that do not fit the criterion. Selection can be used, if you want to check the applied filter in GUI before implementing it in the automated script.

The filters will be applied one after another.
Best regards,
Alexey Pasumansky,
Agisoft LLC