模式识别——万智牌
我希望在我的 Android 上(和/或更可能在服务器上)创建一个程序,以使用手机上的摄像头捕获卡的图像并将其分解为相应的部分,并使用它们来识别卡在我自己创建的数据库中使用。模式识别是我需要帮助的地方。好的,一张卡片有一个黑色边框,顶部有一个“盒子”,上面写着卡片的名称,一张图像,一个带有卡片类型的盒子和一个代表它来自的集合的符号,最后一个盒子是一些更具描述性的文字。首先,我假设所有卡片都遵循该格式。好的,至少要识别该卡,我需要识别顶部框并 OCR 键入的文本。如果我可以匹配中间框中的符号,那就太好了,但是..
任何人都可以向我指出有关我需要自己编码的理论的 API 或文章/书籍吗?
I am hoping to create a program on my android (and/or more likely back at the server) to use the camera on the phone to capture an image of the card and break it into the corresponding parts and use them to identify the card to use in a database of my own creation. The pattern recognition is where I could use help. Ok, a card has a black border, a "box" at the top with the name of the card, an image, a box with the type of the card and a symbol that represents the set it was from, and a final box with some more descriptive text. To start with, I will assume all cards follow that format. Ok, at the least to identify that card, I need to identify the top box and OCR the typed text. If I could match the symbol in the middle box that would be great, but ..
Can anyone point me to either an API or article/book on the theory I would need to code it myself?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我取决于你是否真的想知道
border-color
&设置
。因为如果你不这样做,你就真的不需要一个工具来识别整个卡片的图像。
您只需 OCR 卡名即可。
您可以使用如下 API 来完成此操作:
I depends if you really want to know the
border-color
&set
.Because if you don't you don't really need a tool to recognise an image of the entire card.
You just need to OCR the card name.
You could do this using a API like this one:
不久前我问了一个类似的问题。
我还没有这样做,但 opencv 看起来是值得尝试的正确工具。
I asked a similar question a while ago.
I didn't do it yet, but opencv looks like the correct tool to try out.
我目前正在尝试采用相同的想法,采用更具实验性的方法来适应图像过滤和对象识别。到目前为止,我发现的两种最好的(因为简单)方法是:
第一种也是最简单的方法是等待
Google Goggles API
发布并将其用于所有 OCR 等。它有效对于我测试的所有卡都很好,请查看 应用。它的缺点是它将您的图像发送到 Google 服务器并在那里进行计算,这会导致大量的互联网流量(并且在使用 EDGE 时会带来一些痛苦)。第二个是一些基于特征点的算法,例如(著名的)
SIFT David G. Lowe 的特征检测器
。这是一个针对特征点的比例和旋转不变检测器,您可以将其与所有卡片的数据库进行匹配。虽然可以实时执行 SIFT 检测,但我认为不可能在手机上实时执行(尤其是使用 Java 时)。请记住,SIFT 算法本身受美国版权保护,不得免费用于商业用途。但是,在搜索
特征点检测器
和特征点描述符
时,您可以找到大量其他算法。这两种方法都可以让你摆脱兽人魔法的需要,如果你不知道字母的位置、大小或旋转,这真的会变成一件丑陋的事情。
I am currently playing around with the same Idea on a more experimental approach to get used to image filtering and object recognition. The two best (because simples) approaches I found so far are:
The first and most simple approach would be to wait for the
Google Goggles API
to be released and use this for all your OCR etc. It worked fine for all cards I tested, check out the App in the store. The downside of it is that it sends you Image to the Google Server and computes it there which leads to large internet traffic (and some pain while using EDGE).The second would be some feature point based Algorithm like the (famous)
SIFT Feature Detector
from David G. Lowe. Which is a scale and rotation invariant detector for feature points, which you could match against a database of all cards.Although it is possible to perform SIFT detection in realtime, I don't think it is possible to do it in realtime on a phone (especially when using Java). Keep in mind that the SIFT algorithm itself is under US-Copyright protection and may not be used free for commercial proposes. But you can find tons of other Algorithms when searching for
feature point detector
andfeature point descriptor
.Both approaches get you out of the need of doing ORC magic which really becomes an ugly business if you neither know location nor size nor rotation of your letters exactly.