Digital Lab Hockey
By Brad Hayes, Class of 2008




Abstract

A digital enhancement to an analog concept, Digital Lab Hockey involves the inclusion of a computer-controlled goaltender to a variation of the sport of hockey. This addition is implemented via a touch sensitive, rear-projected display device and a USB Camera.



Components



Implementation

A touch sensitive screen makes an ideal goal for this hockey-variation (rules viewable in the powerpoint). By detecting the location of the impact of the ball, opportunities for additional enhancement present themselves. Utilizing the rear-projected characteristic of the screen, one can display a sufficiently large target, or goal. It is then an obvious improvement to include functionality to check whether or not the ball impacts within the confines of the goal or not. Further, a goaltender can be added "in front" of the goal to help block shots and increase the difficulty of the game.

It is this goaltending feature that makes the project particularly compelling. By implementing an object detection algorithm to recognize the position of the tennis ball, the goalie can be afforded some level of intelligence regarding its placement. The primary challenge inherent to a project like this is maintaining the utility of the object detection algorithm through sufficient optimization. If the algorithm is too slow to analyze camera frames to maintain the illusion of 'real-time' tracking, the application would not have much value.



Algorithms

Tennis Ball Tracking

  1. Load Texture Patch and detect average color value
  2. Remove pixels (set to 0) that are more than THRESHOLD distance away from detected color average of target or below some NOISE_THRESHOLD
  3. Compute Integral Image on the result
  4. Perform constricting window algorithm to detect densest square area of energy in the integral image.
  5. Return coordinates (x,y,l) of square: Top left corner coords (x,y) and square side length l.


Code Sample



Touch/Impact Tracking

Sample Video

  1. Iterate through frame
  2. If the current pixel intensity is below the specified threshold: Set all channels at the current pixel that are below NOISE_THRESHOLD to 0 and move on to the next pixel
  3. Call recursive "expand" function on current pixel location that searches radially outwards from the current point for connected pixels of sufficient intensity. These pixel locations and values are added to linked lists and then are set to 0 in the image to prevent infinite loops.
  4. Calculate the centroid (x,y) of a given collection of connected points as well as the distance from the center to the furthest pixel in the blob (define as 'r')
  5. Result: Circular blob at coordinates x,y with radius r.