How to robustly segment images to correctly count blurred blobs?
I am trying to robustly segment the following image (as well as other similar images) for image analysis and blob counting:
There should be 900 unique blobs.
I've tried adjusting the contrast, sharpening, thresholding, dynamic local thresholding, erosion, a combination of these and other morphological operators.
I've been able to get close but I still always seem to have blobs connected together:
Eroding the binary image more helps but I end up losing some of the smaller blobs.
Is there a way to do erosion on just blobs that are larger than a certain size so I don't lose the smaller blobs? Should I be using a different erosion element? Or am I just approaching this problem the wrong way?
What you should do is perform a local thresholding, where you select the threshold value for each point according to the intensities in the vicinity. Then, selecting a high threshold value will disconnect the blobs.
The analysis should include something like Max-Lloyd for the neighborhood, and the threshold selected should probably be around the highest peak minus its std-dev, to make sure you get good results.
The window size should probably be such that it includes several blobs.
One option, if you are working with regionprops
to calculate the centroids, would be to at the same time have it calculate MajorAxisLength
and MinorAxisLength
as well as returning the pixel lists. For a nearly round blob, these values should be close to the same. For two round blobs of a similar size connected, on the other hand, major axis length will be ~2x minor. Another value regionprops
can return that may be useful is 'Solidity'
.
Use this to extract a list of the regions which are likely to be joined blobs, use erode on those to separate them, and recalculate the centroids for those bits only.
链接地址: http://www.djcxy.com/p/23696.html上一篇: 改进OpenCV中的岩石提取分析
下一篇: 如何稳健地分割图像以正确计数模糊斑点?