/ 03 — Computer Vision

Card Detection

A real-time computer-vision system that detects and identifies playing cards from a webcam feed using contour analysis and ORB feature matching.

Role
Solo Developer
Timeframe
2025
Status
Shipped
[ card detection · webcam feed ]
PythonOpenCVNumPy
01 / Problem

Recognizing playing cards from a live camera is a deceptively hard CV problem: cards rotate, overlap, catch glare, and have to be matched against a 52-card template set fast enough to feel real-time.

02 / Approach

I split it into detection and recognition. Contour analysis isolates card-shaped quadrilaterals in each frame and warps them flat; ORB feature matching then identifies each card against a set of template images. The pipeline is modular so each stage can be tested on its own.

03 / What I built

Contour-based detection

Finds and perspective-corrects card-shaped contours in the webcam feed, handling multiple cards per frame.

ORB recognition

Matches each detected card against template images using Oriented FAST and Rotated BRIEF features — rotation-tolerant and license-free.

Live visual feedback

Draws bounding boxes and card identities straight onto the video, with a clean module split (card, detector, matcher, utils).

04 / Outcome
Real-time
webcam card recognition
ORB
rotation-tolerant matching
52
card template set
05 / Learnings

Classic computer vision still goes a long way before you reach for a neural net. Getting the contour and warp stages right made recognition almost easy — most of the accuracy was won in preprocessing.