Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
Classic Games (Games) Input Devices Games Technology

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?
This discussion has been archived. No new comments can be posted.

Ask Slashdot: Automated Tool To OCR CCGs Like Magic: the Gathering?

Comments Filter:
  • Image Database (Score:2, Interesting)

    by Anonymous Coward

    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.

  • by halivar ( 535827 ) <bfelger.gmail@com> on Saturday February 07, 2015 @01:57PM (#49006297)

    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.

  • ImageMagick (Score:5, Informative)

    by Anonymous Coward on Saturday February 07, 2015 @01:58PM (#49006311)

    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.

    • 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.
      • Re: (Score:3, Funny)

        by Anonymous Coward

        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)

          by Anonymous Coward

          Which means it was already part of emacs.

          • by Anonymous Coward

            All it needs now is a decent text editor.

    • Re:ImageMagick (Score:5, Informative)

      by CronoCloud ( 590650 ) <<moc.liamg> <ta> <noruaduolconorc>> on Saturday February 07, 2015 @03:57PM (#49007015)

      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

  • Decked Builder (Score:5, Informative)

    by DarrenBaker ( 322210 ) <darren@nOspAm.flim.net> on Saturday February 07, 2015 @02:13PM (#49006381) Homepage

    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.

  • 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?
  • IDK (Score:5, Funny)

    by ssam ( 2723487 ) on Saturday February 07, 2015 @02:24PM (#49006445)

    OMG WTF TLA OCR CCGs?

    • I feel embarrassed. The only acronym I didn't know was TLA.
      • by Anonymous Coward

        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

      • I feel embarrassed. The only acronym I didn't know was TLA.

        LOL!!

    • 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

  • 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.

  • by Anonymous Coward on Saturday February 07, 2015 @03:02PM (#49006707)

    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.

    • 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.

  • I just did a quick check for OCR software:

    $ 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

  • No hurry though, still waiting to get my holographic Charizard back from Mt Gox...

  • 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.
  • 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 thos
  • 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. Howev
    • What is the average time to discovering the card start to finish? I saw one project but the time per card was some thing like 10-60 seconds and I can type a lot faster than that.
      • Maybe 0.1 seconds, on average? Not quite fast enough for 30 fps, but close enough that the lag isn't really noticeable to the user.
        • you get the text back in a second? That my friend is very impressive.
          • Thanks!

            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.
            • I should also note that I'm not doing an OCR based method -- I'm using a "fingerprinting" perceptual hashing method that instead looks at the entire picture of the card (similar to how Google's "Find Similar Images" function works)

The trouble with the rat-race is that even if you win, you're still a rat. -- Lily Tomlin

Working...