[Python] OpenCV: understanding the filterByArea parameter used in SimpleBlobDetector

Discussão em 'Python' iniciado por Stack, Março 9, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to detect a large stain using OpenCV's SimpleBlobDetector following this SO answer.

    Here is the input image:

    [​IMG]

    I first tried working with params.filterByArea = False, which allowed to detect the large black stain:[​IMG]

    However, smaller spots also ended up being detected. I therefore toggled params.filterByArea = True hoping to enforce a criterion on object area.

    However, when setting params.filterByArea = True with params.minArea = 10 the largest stain is no longer identified: [​IMG]

    I tried using other minArea parameters to no avail, even trying a minArea of 0, which should be equivalent to no filtering at all.

    What am I missing here?

    Continue reading...

Compartilhe esta Página