开发者

Pattern recogntion - Magic the Gathering Card

开发者 https://www.devze.com 2023-01-13 10:48 出处:网络
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 t

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 creatio开发者_如何转开发n. 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?


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:

OCR-IT OCR Cloud 2.0 API offers a commercial-grade high-quality free light use OCR API without an expiration date. It is popular with university projects and prototyping of applications that eventually may switch to larger paid subscriptions, but it can be used for implementations that require on-going OCR use. This is probably as close as one can come to a free OCR API that can handle poor quality images and complex multilingual text.


I asked a similar question a while ago.

I didn't do it yet, but opencv looks like the correct tool to try out.


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 and feature 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消