Forum

Author Topic: gradual selection > model confidence  (Read 2239 times)

geo_enth3

  • Newbie
  • *
  • Posts: 26
    • View Profile
gradual selection > model confidence
« on: April 21, 2022, 06:02:51 PM »
Hi,

I was delighted to see that in version 1.8 it is now possible to perform gradual model selection with "confidence" as parameter.

I wanted to ask if this is also accessible via the python API (like for the dense cloud filtering). I cpuldn't find it in the python API manual

Thanks!

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15067
    • View Profile
Re: gradual selection > model confidence
« Reply #1 on: April 21, 2022, 06:47:24 PM »
Hello geo_enth3,

Currently there are no .filter options that can be applied to polygonal model, however, you can try to implement your own function that will loop over each face in chunk.model.faces and will check vertex.confidence value for each vertex corresponding to the face. If any vertex has confidence above the threshold, select the face and proceed to the next one. In the end remove all the selected faces.
Best regards,
Alexey Pasumansky,
Agisoft LLC

geo_enth3

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: gradual selection > model confidence
« Reply #2 on: April 22, 2022, 12:25:59 PM »
Thanks for the hint!

I managed to implement such a function. For anybody interested I paste it here:

Code: [Select]
def filterModelBasedOnConfidence(model, confidenceThreshold=4):
    for face in model.faces:
        for i in face.vertices:
            if model.vertices[i].confidence <= confidenceThreshold:
                face.selected = True
                continue
    model.removeSelection()