Code Monkey home page Code Monkey logo

mtg-scanner's Introduction

mtg-scanner

Simple scanner for mtg. Mostly a project to get better with python and opencv while providing a way to keep track of my MTG collection.

Dependencies

  • python2
  • opencv
  • libphash
  • phash python bindings
  • imagemagick

Operation

  1. Run mtg-scanner --update to grab the images from the gatherer and calculate hashes
  2. Run mtg-scanner --scan to open the camera and start scanning
  3. Run mtg-scanner --export to export a list of cards in your collection

Optional Arguments

  • --debug - Enable debugging when scanning
  • --camera <integer> - Specify a camera ID to use for scanning
  • --database <DB> - Specify a database name to use when scanning and exporting

While Scanning

The stand-by screen has a blue border around it. From the stand-by screen, press Enter to isolate the card. If the framing is good, then press enter again to attempt to match. If the framing is not good, then you can press ESC or Backspace to go back to the stand-by screen.

Once a match has been found it will display the matched card on the screen. Press Enter to add the card to your collection. If the card is a foil you can press F instead of Enter to add the card to your collection and mark it as a foil. If the card displayed is not the desired card, press N to try again. You can also press ESC to go back to the stand-by screen.

If you have multiple copies you want to add, after adding the first card you can press the + key on the numpad to bring up the confirmation prompt again. As before you can press Enter to add the card, F to add a foil, or ESC or Backspace to go back to the stand-by screen. You can press P instead of enter when adding a card to add a playset of that card instead (adds 4 copies at once).

Press Q at any time to quit.

Why Python2 and not Python3?

I originally wrote the scanning system for python 2. After everything was fully functional I tried to upgrade everything to python 3, but the opencv library that is required for the scanning process does not support python 3. As such, until opencv supports python 3, this code will stay on python 2.

Credits

http://mtgjson.com for the card data

mtg-scanner's People

Contributors

jeffreysmallhd avatar ncstate-mafields avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.