Metadata-Version: 1.0
Name: hearthstonecarddetector
Version: 0.1
Summary: match a specific cropped image to a hearthstone card id
Home-page: https://www.github.com/russon77/hearthstonecarddetector
Author: Tristan Kernan
Author-email: russon77@gmail.com
License: GPLv3+
Description: =========================
        Hearthstone Card Detector
        =========================
        To use (with caution), simply do::
        
            >>> from hearthstonecarddetector import image_to_card_id
            >>> from PIL import Image
            >>> with Image.open("test_image_here.ext") as img:
            >>>     # if image is not cropped, perform the crop now
            >>>     img = img.crop(bbox=(x1, y1, x2, y2))
            >>>     card_id = image_to_card_id(img)
            >>>     print(card_id)
        
        It's that simple!
        
        db.json
        ^^^^^^^
        The most interesting part of this module is the hashing of all the cards.
        The hashes are taken of only a certain crop of the card image, a good portion
        of the artwork. This is explained in "crop_explained.png" and you can see
        the examples in the tests folder for more help.
        
        Each card was hashed in the four ways provided by the imagehash library. These are
        average_hash, dhash, phash, and whash. phash is the default algorithm used in this
        module.
        
        Tests and Examples
        ^^^^^^^^^^^^^^^^^^
        Please take a look at the tests directory. You will find several images
        that are cropped appropriately, in order to match. The TestDetector.py file
        also contains a working code example.
        
        Please examine the file "crop_explained.png" for information about
        specific areas to crop. For even more information, you can find the
        entire collection of cropped images that were used to create these hashes
        online at https://s3.amazonaws.com/draftwithme/hashed_images/ + CARD_ID .png.
        For example, the first card is linked at
        "https://s3.amazonaws.com/draftwithme/hashed_images/AT_001.png".
        
        Future Work
        ^^^^^^^^^^^
        Ideally, this library should support working with full card images. The problem
        was that the bottom half of cards are all too similar, so hashing the full image
        ended up with lots of errors. Focusing on the card artwork has provided a lot of
        success.
        
        One idea for improvement is to organize the cards by mana (and subsequently by attack / health).
        Then, parse each of these individually and compare some region to the region previously hashed and indexed.
Keywords: hearthstone
Platform: UNKNOWN
