Python Forum

Full Version: Equivalent of 'bwareafilt' for Python
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
What is an equivalent to the MATLAB function bwareafilt in Python? I need an output binary image that only contains the largest connected area of pixels.
I'm not familiar with MatLab but it sounds like a blob analysis. I didn't find anything in PIL (or PILLOW) that does that although you could probably use its functions to make something similar.

Looks like there are similar tools in OpenCV you could use though:
https://stackoverflow.com/questions/2348...-in-opencv
https://makehardware.com/2016/05/19/blob...nd-opencv/