Slashdot Mirror


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?

20 of 96 comments (clear)

  1. Re:Why not get someone to make it for you? by binarylarry · · Score: 2

    I bet wizards of the coast will be totally cool with that.

    --
    Mod me down, my New Earth Global Warmingist friends!
  2. Re:Why not get someone to make it for you? by Anonymous Coward · · Score: 2

    $25 seems like a good deal, or did you mean $25,000 rather than $25.000?

  3. Image Database by Anonymous Coward · · 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.

    1. Re:Image Database by Anonymous Coward · · 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

    2. Re:Image Database by hjf · · Score: 3, Interesting

      This is what I did: https://www.youtube.com/watch?...

  4. I don't have a solution by halivar · · 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.

    1. Re:I don't have a solution by hjf · · Score: 2
  5. ImageMagick by Anonymous Coward · · 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)
    file=$now.png
    outfile=$now-cropped.png
    streamer -c /dev/video0 -b 32 -o $file
    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.

    1. Re:ImageMagick by jones_supa · · Score: 2

      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.

    2. Re:ImageMagick by Anonymous Coward · · 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.

    3. Re:ImageMagick by Anonymous Coward · · Score: 3, Funny

      Which means it was already part of emacs.

    4. Re:ImageMagick by CronoCloud · · Score: 4, 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
      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 /dev/video0 -b 32 -o $file
      convert $file -crop 40x80+150+120 $outfile
      gocr $outfile > $now.txt
      rm $outfile
      done

  6. Decked Builder by DarrenBaker · · 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.

  7. Re:Why not get someone to make it for you? by halivar · · Score: 4, 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.

  8. IDK by ssam · · Score: 4, Funny

    OMG WTF TLA OCR CCGs?

  9. There is already shortcut for this. by Anonymous Coward · · 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.

    1. Re:There is already shortcut for this. by Immerman · · Score: 2

      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.

      --
      --- Most topics have many sides worth arguing, allow me to take one opposite you.
  10. Re:Why not get someone to make it for you? by meerling · · Score: 2

    The smallest coin in the USA is the 1 cent coin, yet all gas stations have their prices end with 9 tenths of a cent. (Obviously they automatically round it up and keep it. Essentially it's a real world version of the stealing a fraction of a cent scam that has been used in movies for a very long time.)

  11. Re: There are really good options today. by EdwardFurlong · · Score: 2

    I do not know all that much about MTG, but my SO's kid plays it. There seems to be a new release of cards every few months. Certain cards get re-released, some old ones you can not use in tournament play, if a card is damaged it can't be used. There are all sorts of rare cards on whatever scale they use. I really this it is what is keeping comic book shops going. People will spend hundreds if not thousands buying cards. I am sure you can imagine to person who has to win spending that much on just one card.

  12. Re:Tineye or similar? by retchdog · · Score: 3, 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.

    --
    "They were pure niggers." – Noam Chomsky