简体   繁体   English

使用C ++在图像中标记兴趣点

[英]Marking an interest point in an image using c++

I have a bitmap image like this 我有这样的位图图像

在此处输入图片说明 My requirement is to create a GUI to load the image and for changing the contrast and other things on the image and algorithm to mark the particular area in silver colour as shown in the fig using C++ or C#.I am new to image processing and through my search I have found out that I can use the Histogram of the image for finding the required area.These are the steps. 我的要求是创建一个GUI来加载图像并更改图像上的对比度和其他内容,并使用C ++或C#如图所示将算法标记为银色的特定区域。我的搜索发现我可以使用图像的直方图查找所需区域。这些是步骤。

  • Get the histogram 获取直方图
  • Search for intensity difference 搜索强度差异
  • Search for break in the line 搜索行中的中断

Can someone suggest me how can I proceed from here.Can I use Opencv for this or any other efficient methods are available..? 有人可以建议我如何从这里继续。我可以为此使用Opencv还是可以使用其他任何有效的方法。

NOTE: 注意:

在此处输入图片说明 This image have many bright points and the blob algorithm is not successful. 该图像具有许多亮点,并且斑点算法不成功。 Any other suggestions to retrieve the correct coordinates of the rectangle like object. 任何其他建议来检索矩形(如对象)的正确坐标。

Thanks 谢谢

OpenCV should work. OpenCV应该工作。

  1. Convert your input image to greyscale. 将您的输入图像转换为灰度。
  2. adaptiveThreshold converts it to black and white adaptiveThreshold将其转换为黑白
  3. Feature detection has a whole list of OpenCV feature detectors; 特征检测包含OpenCV特征检测器的完整列表。 choose one depending on the exact feature that you're trying to detect. 根据您要检测的确切功能选择一个。

Eg have a look at the Simple Blob Detector which lists the basic steps needed. 例如,查看Simple Blob Detector ,其中列出了所需的基本步骤。 Your silver rectangle certainly qualifies as "simple blob" (no holes or other hard bits) 您的银色矩形肯定符合“简单斑点”(没有孔或其他硬位)的条件

If all of your pictures look like that, it seems to me not complicate to segment the silver area and find its centre. 如果您的所有图片看起来都是这样,那么在我看来,分割银色区域并找到其中心并不复杂。 Basically you will need to apply these algorithms in the sequence below: 基本上,您将需要按以下顺序应用这些算法:

  1. I would suggest binaryze the image using Otsu adaptive threshold algorithm 我建议使用Otsu自适应阈值算法对图像进行二值化
  2. Apply a labelling (blob) algorithm 应用标签(blob)算法
  3. If you have some problem with noise you can use an opening filter or median before the blob algorithm 如果您对噪声有任何疑问,可以在Blob算法之前使用开放滤波器或中值
  4. If you end up with only one blob (with the biggest area I guess) use moment algorithm to find its centre of mass. 如果最终只有一个斑点(我猜面积最大),请使用矩算法来找到其质心。 Then you have the X,Y coordinate you are looking for 然后,您有要查找的X,Y坐标

These algorithms are classical image processing, I guess it wouldn't be hard to find then. 这些算法是经典的图像处理,我想届时将不难发现。 In any case, I may have they implemented in C# and I can post here latter in case you think they solve your problem. 无论如何,我可能都用C#实现了它们,如果您认为它们可以解决您的问题,我可以在此处发布后者。

可能是Directshow的一项研究,Microsoft的多媒体框架将帮助您完成任务。

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

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