针对特定平面物体的物体检测
我是计算机视觉新手,我想检测图像(或视频帧)中的特定且平坦的对象。
具体和扁平是什么意思?
平面
好吧,平面物体就像物体一样,但是,你知道,平面......对我意味着什么:
- 物体总是从大约相同的“正面”角度观看,也就是说,相机的轴对应(更多或更多)少)与其表面法线。 (但它们可以绕该轴旋转)。
- 照明角度不会发生任何变化的对象(即没有投射阴影的凹凸和折痕)。
特定
- 我知道其确切外观和形状的 物体。它们都是完全相同的,没有任何变化。
- 我有他们的(精确的)照片(或代表)。
此类物体的示例
- 1 美元钞票的正面
- 蒙娜丽莎
- 最后一期的封面(这里是您最喜欢的杂志)
- ...
我相信这个问题很简单,我应该能够找到计算机视觉的功能库的工作原理基本上是这样的:
> findObjects("object.png", "image.png")
[object at x1, y1, rotated z1 degrees, size height1*width1,
object at x2, y2, rotated z2 degrees, size height2*width2,
...]
事实上,我什至并不真正关心对象的大小和位置,我只需要一个计数。
但我找不到这样的东西。 我能找到的只是无数使用哈尔分类器进行人脸识别的例子,这似乎根本不适合我的问题,因为:
- 人脸不是平坦的,因此该分类器必须处理不同照明、阴影等问题...
- 它必须识别面孔,即相似但不完全相同的物体。
- 它必须识别那些未经训练的面孔,仅仅因为它们“看起来像”面孔。
- 证明这是不适合的:它必须用数百或数千个正样本和负样本进行训练。在我的问题中,所需的所有信息都包含在单个样本中。所以这不可能是正确的。
那么,这样的事情存在吗?
我更喜欢使用 OpenCV,因为这似乎是标准的计算机视觉库,但我对任何解决方案持开放态度。
I'm new to computer vision, and I want to detect specific and flat objects in an image (or video frame).
What do I mean with specific and flat?
Flat
Well, flat objects are like objects, but, you know, flat... What it means to me:
- Objects will always be viewed from approximately the same "frontal" angle, that is, the axis of the camera corresponds (more or less) with their surface normal. (But they may be rotated around that axis).
- Objects for which the angle of illumination doesn't change anything (i.e. it doesn't have bumps and creases that cast shadows).
Specific
- Ojects of which I know the exact appearance and shape. They are all exactly the same, there are no variations.
- I have a (precise) photograph (or representation) of them.
Examples of such objects
- The obverse of a $1 bill
- The Mona Lisa
- The front cover of the last issue of (your favorite magazine here)
- ...
I believe the problem is easy enough that I should be able to find a function of a computer vision library that basically works like that:
> findObjects("object.png", "image.png")
[object at x1, y1, rotated z1 degrees, size height1*width1,
object at x2, y2, rotated z2 degrees, size height2*width2,
...]
In fact I don't even really care about the sizes and locations of the objects, I just need a count.
But I can't find anything like this.
All I can find are countless examples of face recognition with something called a Haar-classifier, which doesn't seem appropriate for my problem at all, because:
- Faces are not flat, and thus that classifier must cope with problems like different illuminations, shadows...
- It must recognize faces, that is, objects that are similar, but not exactly identical.
- It must recognize faces that it hasn't been trained with just because they "look like" faces.
- Proof that this is not suited: it must be trained with hundreds or thousands of positive and negative samples. In my problem, all the information needed is contained in a single sample. So that can't be right.
So, does something like this exists?
I'd prefer to use OpenCV since this seems to be the standard computer-vision library, but I am open to any solution.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一种方法是使用关键点匹配器。 Opencv 有一个演示可以实现您想要的功能(查找 https://i.sstatic.net/FUCEm. https://i.sstatic.net/8Bz9F.jpg 中的 .jpg 作为预制演示(在 opencv 2.2 发行版中:
samples/c/find_obj.cpp
)。输出在 https://i.sstatic.net/SjcPl.jpg - 您应该能够从此开始进行调整,以便它找到图像的多个实例并对其进行计数。One way to do that would be to use a keypoint matcher. Opencv has a demo doing kind-of what you want (find https://i.sstatic.net/FUCEm.jpg in https://i.sstatic.net/8Bz9F.jpg as a premade demo (in the opencv 2.2 distribution:
samples/c/find_obj.cpp
). The output is visualized in https://i.sstatic.net/SjcPl.jpg - you should be able to start from that to adapt it so it finds multiple instances of the image and counts them.