Touchlib - Tutorials
In order to calibrate Touchlib for your camera and projector, you'll need to run the config app. Here's how it works. You'll need to set up your computer so that the main monitor is the video projector so that the app comes up on that screen. Run config.exe, Press 'b' at any time to recapture the background. Tweak the sliders until you get the desired results. The last step (rectify) should just have light coming from your finger tips (no background noise, etc).
When you are satisfied press 'enter'. This will launch the app in full screen mode and you'll see a grid of points (green pluses). Now you can press 'c' to start calibrating. The current point should turn red. Press on your FTIR screen where the point is. Hopefully a press is detected (you can check by looking in the debug window). Press 'space' to calibrate the next point. You'll continue through until all points are calibrated.
Note that the screen may not indicate where you are pressing. When you are all done, you can press 'ESC' to quit. All your changes (slider tweaks and calibration points) are saved to the config.xml file. Now when you run any touchlib app it will be calibrated. Note that any changes to where the projector is pointing or your webcam will require a re-calibration.
Alternate config files are available if you want to test the library using an .AVI for input (instead of the webcam). Replace the config.xml with 5point_avi.xml or 2point_avi.xml. You can edit those files to use a different AVI if you like (you can record a new one using your camera - but you may need to tweak some of the other settings in the config too).
Touchlib is written in C++ and has a Visual Studio 2005 Solution ready to compile. The source code includes our main library which you can link into your application to start capturing touch events. It also includes a basic config app which will need to be run in order to calibrate your camera, and has a couple example apps. You can check out some of the demo apps if you want to see how it works. Pong or the config app should be fairly easy to follow. Setting up a bare minimum multitouch app should only take a dozen lines of code or less.
- OSCPack for the OSC application
- GLUT was used for most of the applications.
- Microsoft Platform SDK (DirectShow)
- Microsoft DirectX SDK
You'll need to configure a few environment variables to get everything compiled. They are:
- DSVL_HOME - dsvideolib root directory
- VIDEOWRAPPER_HOME - root directory of the video wrapper library
- OPENCV_HOME - root directory of OpenCV
- OSCPACK_HOME - root directory of oscpack