Card identifier

Simplified steps of how the script works:

  1. Feed it image of a deck
  2. Reads it with OpenCV
  3. Takes all cards in all_cards, resizes them appropriately (must be manually set) to match the size of a card on the image (i.e. 1920×1080 deck image for Master Duel ~= 63×94)
  4. Takes each card and passes it over the deck image, line by line
  5. Anytime a card passes the match threshold (ex: 0.75 minimum acceptable to be counted as a match), the card’s filename is added to a list
  6. The list of card ID’s (cards that were found/matched) is translated to a list of card Names, using database with ID/CardName/CardType format
  7. List of names are printed out (additional information/formatting is possible; unecessary for the current point of this script)

*Note: Time for execution is variable based on image size, etc. Total process is approximately 18 minutes in my case. Further optimization is required to accelerate the process, if possible.

GitHub

View Github