简体   繁体   English

OpenCV C#-在静态图像中检测简单对象

[英]OpenCV C# - Detecting simple object in static image

I have no experience with images. 我没有图像的经验。 I have to detect simple object in static image. 我必须在静态图像中检测简单的对象。 For example I have image like: 例如我有像这样的图像:

资源

I want to detect edges and remove background. 我想检测边缘并删除背景。 Just to compare them. 只是比较一下。 Something like this. 这样的事情。

检测对象

Do u have any solutions of this problem? 您对此问题有解决方案吗? Images have often white backgrounds. 图像通常具有白色背景。

I've just thought about detect edges, and take everything what they contains. 我刚刚考虑过检测边缘,并获取它们包含的所有内容。

To segment out the shoe- 细分鞋子-

  • Anadptive Threshold to remove the smooth changing background. 自适应阈值可删除平滑变化的背景。
  • Sobelx, which removes the apparent background line, which i assume is common for images of this setup. Sobelx消除了明显的背景线,我认为这种背景线对于这种设置很常见。
  • dilate, closing operation to separate out the shoe. 扩张,闭合操作以分离出鞋子。
  • Find contours, bounding box etc as per your choice. 根据您的选择查找轮廓,边界框等。

在此处输入图片说明

Do an additional threshold if you want to remove the shadow at the bottom. 如果要去除底部的阴影,请增加一个阈值。

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

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