问题
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:
回答1:
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.
来源:https://stackoverflow.com/questions/41070676/detect-high-density-pixel-areas-in-a-binary-image