Pokemon TCG Scanner

An application that uses computer vision to detect, segment, and identify Pokémon TCG cards.

PythonUltralyticsOpenCVNumpyPandas
May 1, 2025
Scanner Process

Overview

Pokemon TCG Scanner is a computer-vision application built in Python that detects, segments, and identifies Pokémon Trading Card Game cards from images, videos, or live webcam input. The system performs perspective correction, card extraction, and perceptual-hash matching to accurately recognize cards from a reference dataset. It includes a lightweight graphical interface that allows users to easily load media, visualize detections, and review identification results.

Key Features

Tech Stack

  • Python

    High-level, interpreted, open-source programming language.

  • Ultralytics

    An AI company that develops and maintains open-source computer vision solutions.

  • OpenCV

    Is probably the most versatile computer vision tool used in a broad field of computer vision tasks.

  • NumPy

    Is a Python library used for working with arrays.

  • Pandas

    A popular open-source Python library used for data manipulation, analysis, and cleaning.

Challenges & Learnings

Handling diverse lighting and capture conditions

Different lighting setups, shadows, camera qualities, and reflections affected segmentation accuracy and card identification. The system required preprocessing steps and threshold tuning to maintain stable performance.

Improving segmentation accuracy for edge cases

Cards partially occluded, rotated, or overlapping made it difficult for the model to produce clean masks. Additional annotation and model fine-tuning were necessary to improve detection consistency.

Perspective correction for non-ideal contours

Cards photographed at extreme angles or with incomplete borders sometimes produced inaccurate homographies. Robust contour filtering and fallback mechanisms were implemented to reduce distortion.

Building and maintaining a reliable reference dataset

A high-quality reference dataset was needed to ensure accurate pHash comparisons. This required careful selection of card images, resolution normalization, and the generation of consistent hash values across the entire catalog.

Outcome

The system successfully detects, segments, and identifies Pokémon TCG cards across images, videos, and webcam input with strong reliability and minimal latency.


Segmentation and perspective correction significantly improved the quality of extracted card crops, enabling accurate pHash matching even under imperfect capture conditions.


The lightweight GUI made the workflow accessible, allowing users to quickly load media and validate results without interacting directly with code.


The project demonstrated that combining classical computer vision (OpenCV) with modern segmentation models (Ultralytics) provides an efficient and interpretable pipeline for TCG card recognition.


Future improvements include expanding the reference dataset, adding support for multiple editions or card variations, and exploring deep-learning–based visual embeddings to further refine identification accuracy.


Ready to Turn Data Into Real Impact?

Let’s work together to turn your data into insights and real results. I build reliable, data-driven solutions that help companies make smarter decisions and unlock new opportunities.