Ask Slashdot: Automated Tool To OCR CCGs Like Magic: the Gathering? 96
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?
Re: (Score:3)
I bet wizards of the coast will be totally cool with that.
Re: (Score:2)
Re: (Score:2)
Some European countries swap the , and ..
Re: (Score:2)
Some European countries swap the , and ..
True, but do any of those countries have English as an official language? I thought the choice of thousands or decimal separator depended on the language of the surrounding words: French uses one convention, German another, etc.
Re:Why not get someone to make it for you? (Score:5, Insightful)
I can tell you that when I lived in Germany, even if I was writing in German, I got the decimal notation wrong every single time. I was just too used to my way of doing it.
Re: (Score:1)
I just use spaces for the digit grouping and a period or comma for the decimal. That way seems the least ambiguous to me.
Re: (Score:2)
Maybe if it's a price, but it wouldn't be valid as an amount. Or can you tell me whose head is on the one mil coin?
Re: (Score:3)
Re: (Score:2)
It gets even more interesting when the last digit is a 5. Accounting rules kick in and you round towards the nearest even number so $22.995 = $23, but $22.985 = $22.98.
This one threw me for a loop when I first hit it as there are some programming languages that the default Math.Round function follows to RNE (round nearest even) definition.
-Rick
Re: (Score:2)
I think he meant if you are dumb enough to take this AC post seriously, I will happily take your $25.
Image Database (Score:2, Interesting)
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.
Re:Image Database (Score:4, Interesting)
And, as a bonus, that has application has already been done specifically for MTG cards. e.g. https://github.com/tenderlove/magic_scan
Re:Image Database (Score:4, Interesting)
This is what I did: https://www.youtube.com/watch?... [youtube.com]
I don't have a solution (Score:5, Funny)
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.
Re: (Score:3)
How about me? https://www.youtube.com/watch?... [youtube.com]
Re: (Score:2)
I thought I was the biggest the nerd/geek. :P
CCG (Score:2)
I read the title and thought this article was going to be about DNA and the amino acid proline.
ImageMagick (Score:5, Informative)
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.
Re: (Score:3)
Re: (Score:3, Funny)
This. He might be looking for a single monolithic program, but his problem is actually completely solvable with clever usage of UNIX. It's the perfect platform for creating a customized pipeline for this kind of task.
Also in 2 days it will be integrated into systemd.
Re: (Score:3, Funny)
Which means it was already part of emacs.
Re: (Score:1)
All it needs now is a decent text editor.
Re:ImageMagick (Score:5, Informative)
Or just have it run continously, snapping pictures every 8 seconds or so, then all they have to do is swap cards.
while true;do /dev/video0 -b 32 -o $file
echo "Preparing to scan new MTG card in 8 seconds"
for i in `seq 8 -1 1`; do
echo $i
sleep 1
done
now=$(date --iso-8601=ns)
file=$now.png
outfile=$now-cropped.png
streamer -c
convert $file -crop 40x80+150+120 $outfile
gocr $outfile > $now.txt
rm $outfile
done
Re: (Score:1)
Re: (Score:1)
Re: (Score:2)
As far as becoming a rival to a site, so what? If he can do it better then more power to him. If he can get people to help him to it better for free, even more so. In the end, what do you care unless you have some vested interested in one of the services that already does this kind of thing.
Re: (Score:2)
Why is that a problem?
Because it's another example of turning Ask Slashdot into Slashdot, Please Do My Job.
Remind me to never ask you for directions. Sheesh.
Re: (Score:2)
Hey, people can be convinced to buy any old ridiculous thing - just look at baseball cards. Or stamps. Or tulip bulbs. It seems a certain percentage of the population has an obsessive compulsion to hoard things and, all in all, playing cards beat old chicken bones or pizza boxes.
Re: (Score:2)
Search Ebay for sold items with "Box Only" in the title. You'd be amazed how much some OEM boxes sell for.
Re: (Score:2)
Indeed. I'm unconvinced though that a lot of those prices aren't due to careless idiots not paying close enough attention to what they're buying. Especially considering the deceptive images often included.
Re: (Score:2)
Oh, and then I suppose there's money laundering as well. It's not uncommon to see things selling on ebay, Amazon, etc. with prices that are hard to explain any other way.
Re: There are really good options today. (Score:2)
Decked Builder (Score:5, Informative)
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.
The point of open source (Score:1, Troll)
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.
keep it simple (Score:1)
Have you tried using google image search? That might proof to be the easiest solution.
Computer Vision (Score:2)
So how much is this worth to you?
Re: (Score:2)
This is what I did, exactly for what OP wants: https://www.youtube.com/watch?... [youtube.com]
Re: (Score:2)
Better video here: https://www.youtube.com/watch?... [youtube.com]
IDK (Score:5, Funny)
OMG WTF TLA OCR CCGs?
Re: (Score:2)
Re: (Score:1)
Person A: What does TLA stand for?
Person B: Three-letter Acronym
Person A: I know it's a three-letter acronym, but what does it stand for?
Person B: Three-letter Acronym
Person A: I said I already know that! What does it stand for?
Person B: It's three-letter acronym.
Person A: I said I already know that it's a three-letter acronym! I JUST WANT TO KNOW WHAT IT STANDS FOR!
Person A goes to Google...
Person A: Oh, I get it. Wait, can't it also stand for two-letter acronym too?
Person B facepalms
Re: (Score:2)
LOL!!
Re: (Score:2)
That is a problem with Slashdot.
Different geeks have there area of specialties and they have their own set of acronyms, often the same as something different. Then you mix in political acronyms and company acronyms. It gets messed up.
Also there are times where the acronym isn't used much, then the poster just decided to use it.
For example "Network Nutrality" to NN. There can be a big topic on say how Verizon is fighting NN, and you are trying to guess what the story is about. Is NN some sort of wireless
Camera, timer, done. (Score:2)
A Canon P&S, CHDK (intervelometer), swap the card before it clicks again.
Big deal, already done. (Score:2)
Seto Kaiba has already done it, but added holograms.
Re: (Score:2)
Hashes/checksums are unlikely to be of any use - all it takes is one pixel being a slightly different color and the hash will change completely, unless it's a fairly worthless hash to begin with.
There are various techniques by which you could "fingerprint" images in a more variation tolerant manner, but they have nothing to do with hashes/checksums, which are specifically designed to be able to detect even single-bit changes.
Re:Tineye or similar? (Score:4, Interesting)
uh, you're thinking of cryptographic/non-invertible/fast-mixing/whatever hashes specifically. it's not exactly defined what a hash is, but generally it means a possibly many-to-one (i.e. lossy) function of data, usually with outputs of fixed (or parametrizable) size.
for example, an OCR is a hash; it (ideally) hashes images of arbitrary dimension into an output space of characters according to which one it most resembles; similarly for any other image recognizer.
Re: (Score:2)
/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.
There is already shortcut for this. (Score:3, Funny)
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.
Re: (Score:3)
Oh crap, I thought that was Ctrl + F + H + T + A + G + N. What the hell have I been doing!?!?! Come to think of it though, that might explain all the encounters I've been having with transdimensional horrors gibbering for my soul.
If you're looking for OCR software, try Debian (Score:2)
$ 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
Let me know what you come up with (Score:1)
No hurry though, still waiting to get my holographic Charizard back from Mt Gox...
OP is clearly asking for free work (Score:1)
Go call a freelance software developer and pay them, or do it yourself.
I've been working on this project for a week (Score:1)
Re: (Score:1)
Re: (Score:1)
I've had this working for a few months... (Score:2)
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. Howev
Re: (Score:1)
Re: (Score:2)
Re: (Score:1)
Re: (Score:2)
Yeah, it could possibly be sped up a bit, but right now I'm doing a linear search for the nearest Hamming distance in a data set of about 25k cards (all of the MtG cards printed) -- if I were to optimize the Hamming search with a tree of sorts (similar to the algorithms used for spell-checker algorithms) I could possibly speed it up, but no need to prematurely optimize things at this point.
Re: (Score:2)