Thursday, March 15, 2007

Draw a Move

Project Description

View PDF version of this project

This project is inspired from Louise W Klinker “Sketch-a-Move” from the Royal College of Art. Basically, I revised the interface from drawing lines on top of the car to the gesture input.
In short, it is a computer vision of Sketch-a-Move. In fact, we have a tablet version of “Sketch-a-Move” in one of my group projects for ITGM 440 class.

Draw a random path in the air in front of a webcam, the remote control (RC) car will shoot off and follow the track that created by the finger’s gesture.

I am interested in building an interactive project that uses gesture input to control a remote control car in real time. I am using motion detection feature in Flash 8, to record the motion track of the brightest spot within the camera view area. And then control two phidgets servo motors to drive the RC car while playing back the path. This project offers exciting play opportunities to play around with the idea of creating tracks by gesture rather than using traditional input devices. “Draw a Move” offers a “Wii” way to play a toy car.

Videos


Draw a Move



Screen Capture


Software Process


1. start -> capture live video as bitmapdata
2. flip the image
3. change the image to gray scale mode
4. draw out the difference pixels between the current frame and the last frame
5. the result image would be the moving objects
6. filter out the dark area (dark grey color) to pure black color
7. filter out the bright area (light grey color ) to pure white
8. the drawing tool (the brightest spot) becomes a white dot in the result image whenever it has motion.
9. if the white dot move over a button, the function of the button is triggered
10. there are 3 buttons as below:
a. Record: record the x, y value of the drawing tool for 5 seconds
b. Stop: stop the recording
c. Play: playback the x, y value and control the position of servo A and servo B
11. the control method as below:
    dx = x2-x1
    dy = y2-y1
    angle1 = atan(dy/dx)*180/PI

    if ((dx >0 && dy< 0) || (dx<0 && dy<0)) => the car turn left
    if ((dx>0 && dy>0) || (dx<0 && dy>0)) => the car turn right
    other conditions, the car goes straight

Currently the sample rate is calculate the dx and dy value once for every 3 records.

Schematics



Materials List


Hardware:
• DVX100 digital camcorder functions as a webcam
• A torch, a laser pen or a LED as a drawing tool. In the video demo, I am using a small torch
• Phidgets servo board + 2 servo
• A remote control car + a remote controller
Software:
Phidgets20 library
• Flash 8
• Splitcam video capture driver (so that we can real time capture the video source from the digital camcorder)

Photos


Physical Setup


Hardware Setup


LED Drawing Tool


Interface


Currently, “Draw a Move” is still in the experimental stage. From the software point of view, it is better to have the speed control as well as the wheel rotation angle control. Unfortunately, the RC car is too cheap to have all those options. In addition, the car has a mechanical problem on the wheel turning. Therefore, currently the driving path of the car is not fully match with the drawing path. The prototype can be improved once the cheap car is replaced with a more robust one. The final goal is to build a working prototype based on the play possibilities of “Sketch-a-Move”.