Card identifier
Simplified steps of how the script works:
- Feed it image of a deck
- Reads it with OpenCV
- 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)
- Takes each card and passes it over the deck image, line by line
- 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
- 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
- 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.