blackjack assistant - stanford universityxj933th8548/... · blackjack assistant arbi tamrazian,...

1
Blackjack Assistant Arbi Tamrazian, Kevin Phuong Department of Electrical Engineering, Stanford University Motivation Algorithm Process Flow Future Work Experimental Results What is the optimal strategy for each hand? Beginner support or augmented-reality application Can form basis for an automated online BJ player Pre-Processing Edge Detection Hough Transform Organization and Recognition Overlay •Convert to Grayscale •Binarize •Fill holes •Morphological edge detection •Dilate with small disk and subtract •Separate image: dealer and players •Dealer edge lines give scaling info •Use approximately vertical edges to determine top corners •Extract rank images using top left rank location of confirmed corners •Use Hough line angles to rotate rank images back into alignment •Eliminate redundant rank location detection •Group ranks into hands using k- means clustering based on filled binary mask region count •Template match hand rank images •Compare hand values to “Basic Strategy” table •Return an image with values of detected cards •Provide user with optimal decision for each hand in play Perspective Invariance Estimate corners occluded from Hough line analysis to determine the four vertices of a rectangle apply appropriate transformation More robust template matching in presence of noise/blur Augmented reality applications using Android smartphone cameras may result in low resolution and blurry images that cannot be template matched Card Counting for Augmented Reality Application Store processed card ranks and compare to input table shoe size to optimize chances of winning beyond basic strategy Robust Against Scaling Rotation (under 90 degrees: vertical edges must be differentiable from horizontal) Card overlaps that do not obstruct top left rank images Limitations Rotation transformation matrix inadequate for images taken with moderate perspective distortion One top corner of each card must be unobstructed, as it form the basis for rank extraction References No top corner found Template match unsuccessful [1] C. Zheng, R. Green, ‘Playing card recognition using rotational invariant template matching’, Proceedings of Image and Vision Computing New Zealand 2007, pp. 276–281, Hamilton, New Zealand, December 2007. [2] P. Martins, L. Reis, L. Teófilo: Poker vision: playing cards and chips identification based on image processing. IbPRIA'11 Proceedings of the 5th Iberian conference on Pattern recognition and image analysis, pp. 436–443, Springer-Verlag Berlin, Heidelberg, 2011. [3] G. Hollinger and N. Ward, “Introducing computers to blackjack: Implementation of a card recognition system using computer vision”, unpublished.

Upload: others

Post on 14-Jul-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Blackjack Assistant - Stanford Universityxj933th8548/... · Blackjack Assistant Arbi Tamrazian, Kevin Phuong Department of Electrical Engineering, Stanford University Motivation Algorithm

Blackjack Assistant Arbi Tamrazian, Kevin Phuong

Department of Electrical Engineering, Stanford University

Motivation Algorithm Process Flow

Future Work Experimental Results

What is the optimal strategy for each hand? • Beginner support or augmented-reality application • Can form basis for an automated online BJ player

Pre-Processing Edge Detection Hough Transform

Organization and Recognition Overlay

•Convert to Grayscale •Binarize •Fill holes

•Morphological edge detection •Dilate with small disk and subtract •Separate image: dealer and players

•Dealer edge lines give scaling info •Use approximately vertical edges to determine top corners •Extract rank images using top left rank location of confirmed corners •Use Hough line angles to rotate rank images back into alignment

•Eliminate redundant rank location detection •Group ranks into hands using k-means clustering based on filled binary mask region count •Template match hand rank images

•Compare hand values to “Basic Strategy” table •Return an image with values of detected cards •Provide user with optimal decision for each hand in play

Perspective Invariance Estimate corners occluded from Hough line analysis to determine the four vertices of a rectangle apply appropriate transformation More robust template matching in presence of noise/blur Augmented reality applications using Android smartphone cameras may result in low resolution and blurry images that cannot be template matched Card Counting for Augmented Reality Application Store processed card ranks and compare to input table shoe size to optimize chances of winning beyond basic strategy

Robust Against • Scaling • Rotation (under 90 degrees: vertical edges must be

differentiable from horizontal) • Card overlaps that do not obstruct top left rank

images

Limitations • Rotation transformation matrix inadequate for

images taken with moderate perspective distortion • One top corner of each card must be unobstructed,

as it form the basis for rank extraction

References

No top corner found Template match unsuccessful

[1] C. Zheng, R. Green, ‘Playing card recognition using rotational invariant template matching’, Proceedings of Image and Vision Computing New Zealand 2007, pp. 276–281, Hamilton, New Zealand, December 2007. [2] P. Martins, L. Reis, L. Teófilo: Poker vision: playing cards and chips identification based on image processing. IbPRIA'11 Proceedings of the 5th Iberian conference on Pattern recognition and image analysis, pp. 436–443, Springer-Verlag Berlin, Heidelberg, 2011. [3] G. Hollinger and N. Ward, “Introducing computers to blackjack: Implementation of a card recognition system using computer vision”, unpublished.