Vision goes Vegas

Introduction
The goal of the project was to code a pice of software, that would grab a picture of a pokercard from a digital videocamera and recognize the card to be able to play blackjack with the result. The project was part of the PPS program of our institute of technology and supervised by Sezeneky of the departement of Computer Vision. The 14 participating students were split up into four groups, each of them working and implementing the sourcecode for themselves. The groups would play "against" each other at the end of semester.

Basic ideas
How does the machine recognize our card? Are we gonna compare the captured image to a bunch of stored images and compare them? Are we gonna teach a neuronal network (yeah baby...):)? Compare different points on the image?

Samples of the raw images captured by the camera:

Raw Image 1
Raw Image 2
Raw Image 3

With assistance of Alexander ... (through the whole project - Thank you Alexander!) we decided on an algorythm which compares various points on the card to decide what kinda card we've got. Also for the game - or rather our variation - of blackjack, the colour of the card doesn't really matter so all the software had to recognize was the actual card value.

So first of all we had to locate the card on the image, or more exactly the card border. This piece of code was already provided by the departement though rather slopy - it would only find the card i centered. Also a perl script for grabbing the image was provided.


Border dots

The border of the card is recognized.

We wrote a frunction that would find the first point (just a random borderpoint of the card. Then the function getBoundaryPoints would draw all the border points.

Coding
The tricky or essential part of the whole recognition is how to locate the corner points (at least two). This is important so you're able to create a local coordinate system on the card (so you're able to ask about specific points). Everything else is quite simple and doesn't use a lot of time (the whole recognition needed about 0.5 milliseconds if I remember right). Our code wasn't the fastest of the groups, but it was close and it was totally stable.

Details about the Contest
Given by the departement
Andreas Griesser
September 7, 2004

  • The groups are essentially operators of the card processing
    system, which is based on the digital camera, an SGI computer
    (ametrine) for grabbing the images and four (equally powerful)
    remote stations for the groups to run their processing and
    decisioning codes on.
  • Groups start with the stack of covered cards. Each group places a
    token on the table and picks up a separate card not showing it to
    the other groups. Note, that all the uncovered cards will remain
    secret to the others until the round ends. The card has do be
    dropped (by a judge or just a member of the same group), so that
    the orientation on the scanning plate is arbitrary.
  • The groups have to scan the card, recognize it and relying on the
    accumulated score decide if they want to take additional card or
    not. A judge (or one of members of the group) records the time of
    a card processing and the number or correctly recognized cards for
    a given group. Wrong recognition of the card means losing the
    round. The time for processing one card must not exceed the
    assumed processing time limit. Groups exceeding this limit are out
    of the current round but not of the whole game. If all the groups
    exceed the processing time limit they all add a token to the token
    pile and continue with a next round.
  • The round ends when all the groups cannot (because of the score
    above 21) or don't want (because of their decisioning algorithms)
    to pick up their next card. The winner is the one whose score is
    closest (thus also equal) to 21. He takes up all the tokens lying
    on the table and all the groups continue with a next round - until
    the total game time is reached.
  • When all the groups exceed the score limit of 21 they all add a
    token to the token pile and continue with a next round.
  • If there is more then one group with the closest-to-21 score they
    all add a token to the pile and play additional rounds until only
    one winner remains. The groups that were out don't participate in
    these additional rounds.
  • Scores are reset before each round.
  • Tokens will be exchanged into Orell Fuessli coupons.
  • Bonus prize will be given to one group per semester which managed
    to minimize the average processing time. The time of the wrong
    recognition will be counted as 6x the average time of the correct
    recognitions.
  • Running out of tokens means a group is out of the whole game and
    no bonus prize can be awarded.

Download
[ Download the source ] | [ Top ]

Follow me on: