Oh, Oh, Oh, It's Magic!
summary
Built a card-scanning pipeline in Ruby + OpenCV that crops cards via grayscale → Canny → contours → polygon → warp, computes perceptual hashes with libphash Hamming distance, stores data in SQLite, and returns top matches from ~22,000 cards. Added a promise executor pool for parallel scraping and downloads ~1.6 GB in 40 minutes. Pushed a C-extension patch to release the GVL and get ~4× hashing speedup. System learns from confirmations and generally works, with failures on similar artwork and focus time.
AI-written summary · about
chapters (13)
- 0:00Welcome and introduction
- 4:38Business up front complaining
- 19:39Party in the back magic
- 22:30Hardware setup demo
- 25:16Data scraping process
- 27:45Promise executor pool
- 30:11Perceptual hashing explained
- 33:24Parallel processing speedup
- 33:45OpenCV edge detection
- 36:33Contour detection and warping
- 39:43Card matching and results
- 41:07Current challenges and future work
- 42:33Conclusion and Q&A
related talks
29mA Magical Gathering
41mThe Future of Computer Vision: How Two Rubyists Are Changing The World
26mIs This Your Card? Computer Vision for Playing Card Recognition
32mMagic of Computer Vision Unraveled
26mDetecting and classifying object images using ruby
37mUnveiling the secrets of ancient coins
25mMagic is Ruby, Ruby is Magic!
39mCheating with Ruby
