Search code examples
c++opencvcomputer-visionroibinary-image

Detect High density pixel areas in a binary image


I am doing background subtraction, and I obtain a binary image with foreground objects and with some noise.

I want to obtain a ROI for each object on the binary image and them analyze it to ensure that is the object that I want.

How do I segment only the areas with high pixel intensity (objects)?

One example of obtained image: Image example


Solution

  • Have a look at openCv simpleBlobDetector, there are several configurable parameters to it and tons of tutorials online.

    The documentation can be found here: http://docs.opencv.org/trunk/d0/d7a/classcv_1_1SimpleBlobDetector.html

    Alternatively you could just convolve a white rectangle across multiple scale spaces and return the median values over each scale space.