Ask Slashdot: Automated Tool To OCR CCGs Like Magic: the Gathering?
An anonymous reader writes I buy massive collections of trading card games, Magic:The Gathering, Yu-Gi-Oh!, Pokemon, Weiss Schwarts, Cardfight Vanguard, etc, etc. And I've gotten the process fairly streamlined as far as price checking, grading, sorting, etc. Part of my process involves using higher-quality web cams positioned over the top of the cards which are in a stack. I keep a cam window on the screen to show a larger, brighter version of the card. What I'm wondering: Is there is an OCR solution out there that will look at the same spot on the screen, capture, ocr, dump to clipboard, etc.? I've tried several open source solutions but none of them quite fit my needs. What I'd really like is to be able to hit a hotkey, and have my clipboard populated with the textual data of the graphics in a pre-set x,y window range. All this should be done via a hotkey. I may be asking for a lot, but then again, I'm sure someone out there has had need of this type of set-up before. Anyone have any recommendations?
For $25.000 I will make it for you.
A different method would be to have frames from the webcam be compared to a database of images and tally the matches. Space bar could serve as the "capture and compare image" function. Similar to http://www.tineye.com but local and with a limited data set.
But I just wanted to say that you are perhaps the biggest nerd I have ever been aware of. I mean that as a sign of respect.
I read the title and thought this article was going to be about DNA and the amino acid proline.
Grab an OCR system off of https://help.ubuntu.com/community/OCR. Get ImageMagick. Get streamer (package xawtv). Create a script on the order of:
now=$(date --iso-8601=ns) /dev/video0 -b 32 -o $file
file=$now.png
outfile=$now-cropped.png
streamer -c
convert $file -crop 40x80+150+120 $outfile
gocr $outfile > $now.txt
rm $outfile
Now create a keyboard shortcut with your window manager to run this script, or open a terminal and get used to pressing up and enter a lot.
If you're not on Linux, sorry.
What OS do you use? Windows, OSX, Linux, etc.?
I don't know if a plug-and-play solution exists for your exact use-case, but it would not be hard to bootstrap it together. I made something similar for Windows using AutoItScript, which has a tooon of user-defined functions (UDFs) that should suit your needs nicely. Python is an alternative, although if you're on win then AutoIt's community-provided UDFs should get you rolling much quicker than Python (at least in my experience.)
If you're going to try AutoIt (AU3) then find one of the many OCR UDFs that allow you to use arbitrary font files, find the MTG font online (shouldn't be too difficult,) capture the screen, rotate the captured image as needed, and run it. That'll get you started.
I did that back in the 90's - scanning all the cards in one at a time, into a database. It took weeks for hundreds of cards.
In today's world, check out "OCTGN3". Most all of the card sets for MTG have already been scanned and you can download them, with text, and everything. And then play the game on your pc with a full featured deckbuilder -- so why would you have to scan anything when it's already been done?
I use it every day. The Android app is phenomenal at picking the right card from the database based on the picture. The only real problem is that it doesn't have all the alternate art versions of cards from older MTG sets. The interface is a bit sloppy on the desktop version, but the recognition is pretty good.
I've tried several open source solutions but none of them quite fit my needs.
Then modify the source yourself, or sponsor someone else to do it. That's the reason you tried open source solutions, right?
If that was not your motivation, then I do not see why you couldn't try closed source solutions as well. Provided that they actually solve your problem, of course. Maybe there would be a freeware one, or another one appropriately priced that it would bring you good value.
My wife likes this scanner to OCR tool. I do not know if it works for what you want but it is quite impressive. Also has high learning curve.
http://www.piqximaging.com/xcanex
Have you tried using google image search? That might proof to be the easiest solution.
It can be done by scraping the database of cards, creating a model out of them, then matching the new card to the database.
So how much is this worth to you?
If you have $$ try the Blind low vision software - hardware devices. Look at irti.net for scanning, reading, speaking stuff.
OMG WTF TLA OCR CCGs?
A regular digital camera, on a tripod, 5 second timer
A Canon P&S, CHDK (intervelometer), swap the card before it clicks again.
Seto Kaiba has already done it, but added holograms.
Fight Spammers!
Have you considered using something like tineye?
I have no idea what else is out there (ie; as far as software packages) but maybe your solution is not OCR, but matching scans of the entire card (or rather some kind of checksum/hash of the card's scan if you can get a consistent enough scan every time).
You might need to initially populate a database of scans and card data but it sounds like you have incentive to do so.
In Emacs: Ctrl + M + T + G. Also runs a Monte Carlo on the last 3000 cards scanned and outputs the optimal 60 card deck and registers you in the nearest FNM.
/sarcasm ...
Gee, if only some one would invent a device to do repetitive work.
It would follow a set of what I'll call instructions.
And instead of hard-coding them, it would be programmable, so that it is more flexible.
I even have a name for it! A computer, because it "computes" the math along the way it needs.
Nah, that will never sell.
$ apt-cache search ocr | grep -v ^lib | grep -i ocr | grep -i -v language | grep -v motocross
fonts-ocr-a - ANSI font readable by the computers of the 1960s
fuzzyocr - spamassassin plugin to check image attachments
gimagereader - Graphical GTK+ front-end to tesseract-ocr
gocr - Command line OCR
gocr-tk - tcl/tk wrapper around gocr
python-gamera.toolkits.greekocr - toolkit for building OCR systems for polytonal Greek
hocr-gtk - GTK+ frontend for Hebrew OCR
python-gamera.toolkits.ocr - toolkit for building OCR systems
ocrad - optical character recognition program
ocrfeeder - Document layout analysis and optical character recognition system
ocrodjvu - tool to perform OCR on DjVu documents
r-cran-rocr - GNU R package to prepare and display ROC curves
tesseract-ocr - Command line OCR tool
tesseract-ocr-dev - transitional dummy package
http://opencv.org/
Records interactions, mouse X/Y, xdpyinfo data to replicate them.
Zenity or xmessae will give you simple-as-can-be buttons to control the action.
GIMP's OCR, image device supportand scriptability might do it for you. That its cross platform might be a need.
No hurry though, still waiting to get my holographic Charizard back from Mt Gox...
Most linux users don't know this, but the man pages were named after Chuck Norris. Chuck Norris fsck'ing hates noobs!
http://www.techrepublic.com/article/pro-tip-transcribe-text-from-images-in-google-keep/
No, we aren't going to make a custom piece of software for your business, jackass. It's pretty obvious that you're in the business of buying collections of trading cards sold on ebay, etc. to then resell to other collectors at a profit. You need to pay for the services (in this case, software programming) you receive and ditch the sense of entitlement that you seem to have.
Go call a freelance software developer and pay them, or do it yourself.
-1 disagree is not a modifier for a reason. -1 troll, flaimbait, redundant, overrated are NOT acceptable substitutes.
I just wanted to get in on the least popular topic ever to appear on Slashdot. Way to go, guys.
Odd that you should ask this question a few days after I started trying to create a solution for myself. This is a strictly for profit venture for me. Apparently paying for my kid's college fund is naughty in some circles. Not sure how that works out for the world economy but I digress. I've spent about six days on this and might be able to save you some dead alleys. Mostly I've found a lot of frustration. My plan was to develop an app which could scan images of cards via a flat bed 9 at a time, crop those to single images, then extract the trading card title. It would then run the title against any number of online databases for current value of card. Going in to it I did not expect major issues. I've done OCR on many types of trading cards using Microsoft OneNote and text extraction is nearly 100% accurate. So I figured this was simple. Not so. I decided to use Tesseract which seems to be the open source gold standard for OCR. However I discovered rather quickly that tesseract does almost no preprocessing of the image and spits out perhaps at best 5% accurate text on these cards. So I went to image magick and graphics magick to see if I could use them to format my incoming scans in a way that tesseract could use. The teseract and image magick communities have been very helpful in trying to help me find a solution, however the reality is no simple, or even sort of simple solution exists. I'm shocked and amazed but it seems that no real world out of the box solution exsists for open source OCR. That is the stick. At this point I am at a cross roads. I have neither the program skills or time to devote to creating OCR for this. There is a good project for MTG cards using a webcam on github. However it is specific to magic cards and from what I can tell actually does image matching more than OCR. I am either going to abandon the project, or, and this is corny, write a script to drop the files in to one note and use that clunky interface for OCR. It's an awful awful solution, but due to my limited programming skills, and the lack of integration between image preprocessing and open source OCR, I think that is where I'm at. I may be missing some thing but I think this is where I'm at.
I'd have thought this was a classic example of a task to be automated? Why not use a sheet-feed scanner, so you can do a stack of a thousand in a batch, rather than swapping them manually?
Or is there a concern about scuffing the cards?
Have you considered using voice recognition to transcribe the titles as you read them? You're better at OCR than most computers...
I used to work with this enterprise product
http://www.bottomline.com/formscape.html
It can do what you ask, sure it is not cheap.
Currently I'm using OpenCV and a lot of glue code to scan real-time video and recognize cards for MtG. The database is easily extendable for Pokemon, Yugioh, L5R, and other card games.
I wrote it in Python on the PC, and recently ported it over to native Android. So far it works really well, and you can see a screenshot of it in action right here:
http://imgur.com/gallery/v44gIbB
Like others, I'm trying to put my kids through college, and am not quite willing to open-source my months of work just yet. However, I'm not looking to scalp anyone, and my rates are very reasonable. Feel free to PM me if you would like me to license this library to you -- it would be a fairly turn-key solution for you.
But I have not sit to write it down. I have to scan and OCR my two science books and DIY books then trash them since I cannot be loaded with such weight for many days without exhaustion. So I planned my OCR. Will start writing it in a few days, as soon as I can find a place where no cashier will throw me out after half hour or any ... will demolish the building or close the place in two weeks, like always. If I can make it into the library... In fact, among the notes stolen from me where three designs for playing machines for such cards, though I guess I ll have to think of another arduino design since I cannot remember those ideas and my notes are not being returned yet in all these years. I might combine both, though my interest is in parsing the equations for the symbolic calculator that comes next. Basically, **your** problem is the same and the OCR solution is immediate; one OCR solution for each brand of cards. Once I get rid of the books and recover some of my mobility I will prepare the same program for cards! What a coincidence... Danilo J Bonsignore