简体   繁体   English

使用OpenCV识别模式

[英]Recognizing a pattern using OpenCV

This my problem. 这是我的问题。

I have a symbol written in black in a white background. 我有一个用黑色写在白色背景下的符号。 As an example assume my symbol is "Z". 例如,假设我的符号是“Z”。 But it does not has to be a letter always. 但它并不总是一封信。

Now i have image of this pattern stored. 现在我已经存储了这种模式的图像。

Then i draw another pattern. 然后我绘制另一种模式。 image size will be same as the above. 图像大小与上面相同。 Then i input this new pattern to my program and i want to check whether it matches to the stored pattern. 然后我将这个新模式输入到我的程序中,我想检查它是否与存储的模式匹配。

Even if the new patten has a similar shape but different size, it should be matched to the stored image. 即使新的图案具有相似的形状但尺寸不同,它也应该与存储的图像匹配。 Therefor pattern shape is the differentiating factor. 因此,图案形状是差异化因素。 Obviously rotated patter means a different pattern. 显然,旋转的图案意味着不同的图案。

Is there a way to do this in opencv?? 有没有办法在opencv中执行此操作?

I tried using feature matching. 我尝试使用功能匹配。 But it did not work. 但它没有用。 I think i can use a classifier but i do not have a good knowledge on that. 我想我可以使用分类器,但我对此并不了解。

Can some one help me?? 有人能帮我吗??

user2389323 - The short answer is yes, you can do what you described using OpenCV. user2389323 - 简短的回答是肯定的,你可以使用OpenCV做你所描述的。 Pattern matching using image processing techniques is a major piece of OpenCV. 使用图像处理技术的模式匹配是OpenCV的主要部分。 Here are some example conversations I have found dealing with this topic: 以下是我发现的一些处理此主题的示例对话:

Edge Based Template Matching (includes source downloads) 基于边缘的模板匹配 (包括源代码下载)
Template Matching and Slice Alignment 模板匹配和切片对齐
Template Matching - Example code and tech description 模板匹配 - 示例代码和技术说明

I hope these links have something to help you. 我希望这些链接能为您提供帮助。 They were not hard to find using Pattern Matching using OpenCV in Google :) 在Google中使用OpenCV使用模式匹配并不难找到它们:)

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

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