Skip to content

Simple OpenCV based card detector for HDI@PUT classes

Notifications You must be signed in to change notification settings

ptylczynski/card-detector

Repository files navigation

card-detector

Simple system for real-time playing card detection, written in Python

Usage

python3 CardDetector.py

Used modules

  • OpenCV
  • NumPy
  • PiCamera - (basicaly works with any other module but some reimplementations in Camera.py are needed)

Tested on:

  • Raspberry Pi 3B+ with PiCamera
  • Raspbian

Simplified working algorithm

for frame in stram:
    cards = detect_all_cards_present()
    for card in cards:
        rank_part, suite_part = zoom_card(card)
        rank_diff, rank = match_rank(rank_part)
        suite_diff, suite = match_suite(suite_part)
        if rank_diff < RANK_THRESH and suite_diff < SUITE_THRESH:
            make_an_overlay_on_card(card=card, rank=rank, suite=suite)

Docs

Full documentation, with further explaination is available under ./docs/latex/raport.pdf

Some results

with one card

res1

with two cards

res2

with three cards

res3

with even more cards

res4

About

Simple OpenCV based card detector for HDI@PUT classes

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages