npb logo npb
meet the boys

news

music

tour

view their research

    
FINAL REPORT (Page 3 of 4)

Introduction
Initial Experimentation
Card Detection Process Overview
Rotation
Results
MATLAB Code
Demos
Division of Labor
Acknowledgements
Consulted Sources



Results

     After synthesizing all of the individual parts of the Playing Card Image Recognition System (PCIRS), we ran a four types of tests:

  1. Single Card
  2. Single Card - Rotated
  3. Multiple Cards - No Overlap
  4. Multiple Cards - Overlap

Here are the results:


Results of testing


     In general, our algorithms proved very successful. We were actually able to "make it work." We starting with an idea and implemented it which is an amazing feeling. With single cards, the system worked 100% of the time. With the multiple card images, the resulting outputs decreased. This was caused by limitation in the Roberts' Cross filtering. Ultimately, however, our group was quite pleased with the project.

     Of course, there are some improvements that the nPhaze Boys would like to see implemented. No system is quite perfect.

  • Instead of using Roberts' edge detection in locating the corners, create an erode/dilate function to increase corner detection accuracy. This would help in the multiple cards - Overlap category.
  • Decrease runtime in the scanning algorithm. Make it more "realtime."
  • Add capability for multiple cards, overlapped, with variation in rotation to cover the most general case.



MATLAB Code

     Here are our MATLAB code files:


Edge/Corner Detection

  • calcspot.m - sorts the potential detections of the card corners, takes the median of the row and column values of each hotspot, stores them as the valid corners (upper left point of the corner).
  • cutout.m - cuts out the corners of the image. Used to check visually that the corners were correctly found.
  • findspot.m - wrapper function which performs the whole edge/corner detection.
  • scanit.m - rasterizes through the image with the scanning window, summing white pixels, saving potential detection.
  • showdetect.m - displays a graph of all the potential detections. Used for debugging.
  • showpic.m - displays any matrix with grayscale colormap and square axes.

Correlation and Point of Control

  • identifyMultipleCards.m - manager function of the scanning and correlation process. The nachos grande so to speak.
  • identifySingleCard.m - takes in the coordinates of a corner and returns the card value (in integer form).
  • library.mat - contains the library reference images used in the correlation.

Rotation

  • cropit.m - cuts off the excess black space created by rotation, used to keep images a manageable size.
  • findang.m - performs the gruntwork of finding the angle from the Radon transform for rot8.m
  • findleft.m - utilized by scan.m, slides down the edge of the card to find the leftmost edge, give the top corner as the starting point.
  • rot8.m - takes in the image and finds the angle by which it has been rotated using a Radon transform.
  • rotback.m - takes in the image and magic angle, returns the upright image.
  • rotcard.m - wrapper function that calls the other functions with the correct nesting.
  • scan.m - finds the upper and left bounds of a rotated card so that it may be cropped from the rest of the image.



Demos

     Here are three demo M-files that can be run to see the Playing Card Image Recognition System (PCIRS) in action. Please type UNLIMIT at the prompt before entering MATLAB to release memory requirements. Also, please be patient. Run time reaches up near a minute for the large image files.

  1. demo1.m - Single Rotated card
  2. demo2.m - Multiple cards - diagonal overlap
  3. demo3.m - Multiple cards - straight overlap




Next: Page 4
Previous: Page 2