Separate objects from the background. ( Using contour detection )

I want to separate objects from the background.

The edge image was taken using the sobel edge detection with some filters. Then using the function "find contours" in opencv I get all the contours in the image. Then remove the contours that are not in the specific threshold size. (area of the contours should be greater than the 1/1000 th of the image area and smaller then 1/25 th of image area)

The main problem is the output of the edge detection is not very precise. There are couple of objects that are very closer and blurred in the image. When computing the contours both objects will consider as one contour then the whole contour was rejected because it was not in the correct range.

Is there any method to separate the regions in the edge image. I tried the morphological transformations(Erode and dilate) but it is error prone.

Edge image and contour output for that image

链接地址: http://www.djcxy.com/p/23706.html

上一篇: 如何检测文本文件的编码/代码页

下一篇: 从背景中分离物体。 (使用轮廓检测​​)