Get segments sizes in image and remove small segments

asked 2015-12-06 10:30:20 -0500

Hi, I'm new to openCV, can't find what is the way to do basic segmentation on a binary image and get segments (with black pixels) sizes, then delete small segments from image with given threshold. The example image is below image description

edit retag flag offensive close merge delete


Is that a representative sample image? As in, you're always looking for a straightish line across the whole image?

If so, I suggest the Hough Line Transform, link text

Another way could be to invert your binary, and then do Connected Components, throwing away anything that doesn't meet your size expectations.

Tetragramm gravatar imageTetragramm ( 2015-12-12 22:19:33 -0500 )edit