检测,如果从一个图像中的物体是与OpenCV的另一图像 [英] Detecting if an object from one image is in another image with OpenCV

查看:109
本文介绍了检测,如果从一个图像中的物体是与OpenCV的另一图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含对象的样本图像,如下面的图像中的耳环:

I have a sample image which contains an object, such as the earrings in the following image:

http://imgur.com/luj2Z

然后我有一个大的候选集的,我需要确定哪一个最有可能的图像包含对象,如:

I then have a large candidate set of images for which I need to determine which one most likely contains the object, e.g.:

http://imgur.com/yBWgc

所以,我需要产生一个得分对于每个图像,其中最高得分对应于最可能包含目标对象的图像。现在,在这种情况下,我有以下条件/约束带/周围的工作:

So I need to produce a score for each image, where the highest score corresponds to the image which most likely contains the target object. Now, in this case, I have the following conditions/constraints to work with/around:

1),我可以以不同角度获得的多个样本图像

1) I can obtain multiple sample images at different angles.

2)将样品图像很可能是在不同的分辨率,角度和比候补图像距离。

2) The sample images are likely to be at different resolutions, angles, and distances than the candidate images.

3)有候选图像的很多(> 10,000),所以它必须是相当快的。

3) There are a LOT of candidate images (> 10,000), so it must be reasonably fast.

4)我愿意牺牲一些精度的速度,因此,如果意味着我们必须通过顶部100,而不是仅仅前10名进行搜索,那很好,可以手动完成。

4) I'm willing to sacrifice some precision for speed, so if it means we have to search through the top 100 instead of just the top 10, that's fine and can be done manually.

5)我可以手动操纵样本图像,如作为概述,我希望检测的对象;候选图像可以,因为有太多不能手动操作。

5) I can manipulate the sample images manually, such as outlining the object that I wish to detect; the candidate images cannot be manipulated manually as there are too many.

6)我在OpenCV的或计算机视觉没有真正的背景可言,所以我从头开始在这里。

6) I have no real background in OpenCV or computer vision at all, so I'm starting from scratch here.

我最初的想法是样品图像中绘制对象周围的粗线条启动。然后,我能够确定候选图像中物体的角落和角落。我可以围绕简介每个角的像素以看他们的样子相似,然后通过职级的每一个角落的最大相似性得分的总和。我也不能确定如何量化相似的像素。我想只是他们的RGB值的欧几里德距离

My initial thought is to start by drawing a rough outline around the object in the sample image. Then, I could identify corners in the object and corners in the candidate image. I could profile the pixels around each corner to see if they look similar and then rank by the sum of the maximum similarity scores of every corner. I'm also not sure how to quantify similar pixels. I guess just the Euclidean distance of their RGB values?

存在这样一种忽略物体的中心的问题。在上面的例子中,如果耳环的拐角都是黄金帧附近,那么它不会考虑的耳环内的红色,绿色和蓝色的石头。我想我可以通过,然后看着都对角落,并沿它们之间的线采样某些点确定相似改善这种

The problem there is that it kind of ignores the center of the object. In the above examples, if the corners of the earrings are all near the gold frame, then it would not consider the red, green, and blue stones inside the earring. I suppose I could improve this by then looking at all pairs of corners and determining similarity by sampling some points along the line between them.

所以,我有几个问题:

A)请问这行的想法是有意义的,一般或者是有什么我失踪?

A) Does this line of thinking make sense in general or is there something I'm missing?

乙)我应该调查哪些具体的算法从OpenCV的使用?我知道,有多个角点检测算法,但我只需要一个,如果差异都在优化的边缘,然后我很好用最快的。

B) Which specific algorithms from OpenCV should I investigate using? I'm aware that there are multiple corner detection algorithms, but I only need one and if the differences are all optimizing on the margins then I'm fine with the fastest.

C)使用的算法,将有助于在我的理解,以帮助所有示例代码?

C) Any example code using the algorithms that would be helpful to aid in my understanding?

我对语言的选项是Python或C#。

My options for languages are either Python or C#.

推荐答案

检查出的 SURF 功能,这是OPENCV的一部分。这里的想法是,你必须在两个图像寻找兴趣点的算法。您还可以计算每个周围的兴趣点的图像补丁的描述符的算法。典型地,这描述捕捉边缘方位的在贴片的分布。然后,你试图找到对应点,我。即在图像A中的每个景点试图找到图像B.一个相应的利息,这点通过比较描述符,寻找最接近的匹配来实现的。然后,如果你有一组是由一些几何变换的相关对应关系,你有一个检测。

Check out the SURF features, which are a part of openCV. The idea here is that you have an algorithm for finding "interest points" in two images. You also have an algorithm for computing a descriptor of an image patch around each interest point. Typically this descriptor captures the distribution of edge orientations in the patch. Then you try to find point correspondences, i. e. for each interest point in image A try to find a corresponding interest point in image B. This is accomplished by comparing the descriptors, and looking for the closest matches. Then, if you have a set of correspondences that are related by some geometric transformation, you have a detection.

当然,这是一个非常高的水平的解释。魔鬼在细节,而对于那些你应该阅读一些文件。开始由大卫·罗伊的尺度不变关键点形象鲜明的特点,然后阅读SURF的文件。

Of course, this is a very high level explanation. The devil is in the details, and for those you should read some papers. Start with Distinctive image features from scale-invariant keypoints by David Lowe, and then read the papers on SURF.

此外,考虑将这个问题信号与图像处理堆栈交易所

Also, consider moving this question to Signal and Image Processing Stack Exchange

这篇关于检测,如果从一个图像中的物体是与OpenCV的另一图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆