We used the VGA clock for most modules. The timing is synchronized with the VGA clock and, thus, the VGA screen can be updated within the time gap between drawing two consecutive frames. The skin color detection is fast, and, thus, enables the camera to track the player's hand motion in real time. The speed of the ball is controlled by the low frequency clock. We purposely chose this so that the ball can move at a reasonable speed.
There is very minimal noise within the lab setting. Since the coordinates of the paddle are determined by the position of the player's hand, when the player moves his hand too fast, the movement of the paddle becomes less stable. Additionally, the relative position between the camera and the player's hand is important. If the player locates his hand too far away or too close to the camera, the detection scheme can become less accurate. When the ball moves too fast, the player can become excited and move his hand out of the camera's view. This, obviously, also affects the accuracy of the detection scheme. We added several low pass filters to keep the paddle from moving too fast. Although this helps reduce some noise, we were still unable to obtain perfect movement for the paddle. We learned that there are also other factors that affect the detection accuracy. We tried to set up the camera and light in various ways and realized the camera was not very good at detecting the player's hand at the left and right edges of the VGA screen. The light settings play an important role in helping the camera detect the hand motion. Hence, when setting up the game, the player needs to pay additional attention to the light settings to ensure the camera can correctly detect the skin color before he starts playing. Overall, we were impressed with how accurate our skin color detection algorithm was since we chose a very narrow range for the skin color intensity check. Since we have been able to verify the camera's ability to detect most skin colors, this exceeds our expectation.
Since no additional equipment is required, anyone can play the game by simply waving their hand in front of the camera to control the paddle. This is an easy, yet very fun, game to play and, especially, has been proved as one of the most effective ways for students to relieve stress during finals week.
See below for some photos of our project
This is how we set up the game
Beginning of the game
When the ball hit the bricks, their colors faded or they disappeared, depending on the number of hits
The player can move the paddle up
... or down
... or left
... or right
When the player lost the game, a message is displayed