简体   繁体   English

我们如何检测具有相同背景的图像边缘?

[英]How do we dectect edges of image with same background?

图像形式相机

I am trying to find the Contours using cvFindContours( gray, storage, &contour, sizeof(CvContour), CV_RETR_LIST, CV_CHAIN_APPROX_SIMPLE, cvPoint(0, 0)); 我正在尝试使用cvFindContours(灰色,存储,轮廓,sizeof(CvContour),CV_RETR_LIST,CV_CHAIN_APPROX_SIMPLE,cvPoint(0、0))查找轮廓 and Canny but i am not able to dectect it. 和Canny,但我无法将其检测出来。 Is there any way i can detect it.( all the processing is done in c) 我有什么办法可以检测到它。(所有处理都在c中完成)

First equalize image for better contrast. 首先均衡图像以获得更好的对比度。 It will increase noise and other textures also but object will be quite visible. 它也会增加噪点和其他纹理,但是对象将非常明显。

Now, find gradient, it will evade most of gradual color and noise and some texture. 现在,找到渐变,它将避免大多数渐变颜色和噪声以及某些纹理。

Now you can experiment with some thresholding, it will give good edge and region around shadow and object both. 现在您可以尝试一些阈值处理,它将为阴影和对象周围提供良好的边缘和区域。

To remove noise and texture, whole image can be median blurred with large kernel and then thresholded to get interesting region mask. 为了消除噪点和纹理,可以使用大核对整个图像进行中值模糊处理,然后将其阈值化以获得有趣的区域蒙版。

You can try multiple iteration of above method also. 您也可以尝试上述方法的多次迭代。 It lots of accuracy is not required, try blurring out texture. 不需要很高的精度,请尝试使纹理模糊。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM