What is it?
Gesture Pong is video game playable on your TV or Monitor. Your joystick or game controller is you yourself — the game tracks your body movement and converts that to left and right directions for the pong bar, as shown in video demo
What you need?
Image | Name | Description | Part No. | Qty. | Where to Buy/Get | Where to Borrow |
---|---|---|---|---|---|---|
Raspberry Pi | Micro-computer used for prototyping | RASPBRRY-MODB-512M | 1 | Canada Element 14 | UOIT SEEK | |
Pi Cam | Camera module forimage i/o applications | RPI NOIR CAMERA BOARD | 1 | Canada Element 14 | UOIT SEEK | |
HDMI Cable | Allows video to be shown on monitors/TV | N/A | 1 | Amazon Canada | N/A | |
About 1.2 Amp, 6 Volt Power Adapter | Powers the Raspberry Pi | N/A | 1 | Mom or dad's smartphone | N/A | |
4 Gb or larger SD card | Acts as "Hard Disk" for Raspberry Pi | N/A | 1 | Electronics store | N/A |
How to image sd card with Raspbian
Download latest Raspbian operating system. Then install Win32DiskImager (for Windows) or ApplePi-Baker (for Mac). Unzip Raspbian download. A file .iso will be extracted. Use Win32DiskImager or ApplePi-Baker to flash or "burn" it to the SD card you have inserted in the card reader of your laptop/pc. After it completes flashing the .iso image to the SD card, pop the SD card out and insert into the Raspberry Pi.
How to connect RPi Cam Module
As Figure 1 shows, you connect the unpowered Raspberry Pi Camera Module to the Raspberry Pi board in orientation with the cam facing down.
What Raspberry Pi terminals exist
Figure 2 shows all input and output terminals or "ports" of the Raspberry Pi.
Start Using Raaspberry Pi
Use layout in Figure 2 to connect your board to ethernet using Ethernet or LAN cable to your Router's Ethernet jack. Using HDMI cable connet Raspberry Pi board to a HDMI monitor. Monitor without HDMI, should have DVI Port. Buy or get a HDMI to DVI cable to connect the board to your display monitor. Now power up the Raspberry Pi board You should see on your monitor Raspbian booting and its kernel init messages. Soon you will be asked to login. Use the information in Figure 3. You can change default settings, like the password, by running command shown in Figure 4. Tape the Raspberry Pi Camera itself "flipped" to your monitor.Install Open CV for Raspberry Pi
Open CV is an API to process images or videos. Open CV acts as a library with tools that can be imported in almost all programming languages ‐ C/C++, Python, Java, etc. We will Python because Python is the language of choice to prototype. Type in your terminal
sudo apt-get install python-opencv
to instal OpenCV and its bindings for Python Programming Langauge.
Raspberry Pi Cam Driver Must Install
uv4l driver must be installed. Instructions to install uv4l driver on Raspberry Pi are shown in Figure 6. Without this driver, you will get OpenCV error shown in Figure 5 everytime you run your Python (or other, like C/C++/Java, etc.) program that imports Open CV library and uses Open CV methods.
RPi cam window preview issue
Disable Raspberry Pi Cam preview window with commands of Figure 7. By default the prview windows would have had openned interfering with your game window.
Play GesturePong game
Download GesturePong source code and use Figure 8 to unzip, and start the game on your Raspberry Pi board.