Forum

Author Topic: Removing low confidence dense cloud points  (Read 10593 times)

bbbares

  • Newbie
  • *
  • Posts: 21
    • View Profile
Removing low confidence dense cloud points
« on: April 23, 2020, 04:41:04 PM »
I have a script that sets the confidence filter of the dense cloud. I would like to select all of the points remaining from the filter (say 10 - 255 confidence) and cut them, removing all the other points (0 - 9 confidence). I didn't see any dense cloud point selection method. Do I need to apply the points to a class and then delete the class?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15160
    • View Profile
Re: Removing low confidence dense cloud points
« Reply #1 on: April 23, 2020, 06:08:53 PM »
Hello bbbares,

You can select points that you would like to remove (0-9 confidence) and use dense_cloud.removeSelectedPoints command, or select points that you would like to keep (10-255 confidence) and use dense_cloud.cropSelectedPoints.

For example:
Code: [Select]
chunk.dense_cloud.setConfidenceFilter(0,9)
chunk.dense_cloud.removePoints(list(range(128))) #removes all "visible" points of the dense cloud
chunk.dense_cloud.resetFilters()
Best regards,
Alexey Pasumansky,
Agisoft LLC

bbbares

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Removing low confidence dense cloud points
« Reply #2 on: April 24, 2020, 12:37:16 AM »
Perfect, thank you.

3DWinter

  • Full Member
  • ***
  • Posts: 103
    • View Profile
Re: Removing low confidence dense cloud points
« Reply #3 on: April 29, 2021, 01:28:02 AM »
Alexey, why did you use list(range(128)) in your example?
I want to use dense_cloud.cropSelectedPoint, should I also use list(range(128))?


Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15160
    • View Profile
Re: Removing low confidence dense cloud points
« Reply #4 on: April 29, 2021, 04:30:48 PM »
Hello 3DWinter,

list(range(128)) - creates the list of ints, that defines the classes of the dense cloud (all classes, actually).
Best regards,
Alexey Pasumansky,
Agisoft LLC

3DWinter

  • Full Member
  • ***
  • Posts: 103
    • View Profile
Re: Removing low confidence dense cloud points
« Reply #5 on: April 29, 2021, 08:47:45 PM »
Makes sense.
But I am getting a Null dense cloud selection error

Code: [Select]
   207     chunk.dense_cloud.setConfidenceFilter(4,255)
--> 208     chunk.dense_cloud.cropSelectedPoints(list(range(128)))
    209     chunk.dense_cloud.resetFilters()
    210

Exception: Null dense cloud selection

My guess is that for some reason
Code: [Select]
chunk.dense_cloud.setConfidenceFilter(4,255) is not capturing points and therefore I cannot crop them.

Thoughts!?

Paulo

  • Hero Member
  • *****
  • Posts: 1359
    • View Profile
Re: Removing low confidence dense cloud points
« Reply #6 on: April 29, 2021, 10:07:54 PM »
3DWinter,

setConfidenceFilter(4,255) will only filter points with confidence from 4 to 255, not select them. So CropSelectedPoints as nothing to crop....

I would try doing inverse filtering from 0 to 3 confidence and delete these filtered points as:
Code: [Select]
chunk.dense_cloud.setConfidenceFilter(0,3)
chunk.dense_cloud.removePoints(list(range(128))) #removes all "visible" points of the dense cloud
chunk.dense_cloud.resetFilters()
Best Regards,
Paul Pelletier,
Surveyor

3DWinter

  • Full Member
  • ***
  • Posts: 103
    • View Profile
Re: Removing low confidence dense cloud points
« Reply #7 on: April 30, 2021, 09:02:07 PM »
Hello Paulo,
Thanks for your comment. I am now confused, but Alexey wrote above:
"dense_cloud.removeSelectedPoints command, or select points that you would like to keep (10-255 confidence) and use dense_cloud.cropSelectedPoints.". How do use the crop.SelectedPoints then?

3DWinter

  • Full Member
  • ***
  • Posts: 103
    • View Profile
Re: Removing low confidence dense cloud points
« Reply #8 on: May 04, 2021, 03:48:59 AM »
@Pauloa,
I am confused.  If I want to use the cropSelectedPoints, like described below, how would I got about it selecting the points to be cropped?
Code: [Select]
chunk.dense_cloud.setConfidenceFilter(4,255)
chunk.dense_cloud.cropSelectedPoints(list(range(128)))
thanks

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15160
    • View Profile
Re: Removing low confidence dense cloud points
« Reply #9 on: May 04, 2021, 03:42:44 PM »
Hello 3DWinter,

I could be wrong in the original post, it doesn't seem to be that easy to "crop" the filtered points using current API.

You can, however, follow these steps, providing that you are not interested in preserving the results of the point cloud classification:
chunk.dense_cloud.setConfidenceFilter(4,255)
chunk.dense_cloud.selectPointsByColor((155,155,155), tolerance = 255) #will select all the filtered points
chunk.dense_cloud.assignClass(127)
chunk.dense_cloud.resetFilters()
chunk.dense_cloud.removeSelectedPoints(list(range(127)))
Best regards,
Alexey Pasumansky,
Agisoft LLC

geodet1994

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Removing low confidence dense cloud points
« Reply #10 on: October 21, 2021, 07:42:23 PM »
Hello,

you have another question. I am using a camera that has the calibration parameters calculated in the calibration field. Therefore, I am interested in how to automatically read the calibration parameters from * xml named 4_KALIBRACIJSKI_PARAMETRI_KOF_002, which is stored in the computer file: /// C: / Apps / Acad_GEO.

In addition, I would like to delete points that have confidence 1. I am showing a test area in the image. Namely, I would like all points that are red (confidence 1) to be deleted from the point cloud. It just has to perform at the end of the script, I don’t need a basic point cloud. I just need a filtered point cloud without confidence point 1.

Thank you very much