jump to navigation

Touchlib

Touchlib is a library for processing multi-touch interaction with a suitable multi-touch input surface. It handles tracking blobs of infrared light, and sends your programs these multi-touch events, such as ‘finger down’, ‘finger moved’, and ‘finger released’.

It includes a configuration app and a few demos to get you started, and will interface with most types of webcams and video capture devices. It currently works only under Windows but can be compiled to work on linux as well. (i haven’t tested Touchlib’s functionality on linux for my self first hand so i can’t comment it its workings)

More info about Touchlib can be found here.

Download precompiled binarys of Touchlib Beta v2.0.

Alternatively you can download the source and compile it.

Instructions for Compiling Touchlib under Windows.

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 with respect to your screen, and has a couple example applications.

Hardware:
A webcam (USB or a Firewire)

Software Dependencies:

Microsoft Visual Studio 2005 SP1

TortoiseSVN

Miscallenous Libraries (dependencies)
OpenCV (download OpenCV_1.0.exe)
DSVideoLib (download dsvideolib-0.0.8c)
VideoWrapper (download VideoWrapper_0_1_1.zip)
OSCpack (download oscpack_1_0_2.zip)
GLUT (download glut-3.7.6-bin.zip)
CMU 1394 Digital Camera Driver (download 1394camera644.exe)
Microsoft Platform SDK (aka Windows Server 2003 R2 SDK) Web Install, Full download or ISO
DirectX SDK (download August 2007)

Installation instructions:

  1. Install Visual Studio 2005
  2. Install the the Visual Studio 2005 Service Pack 1 update – (Vista Users you must run the setup as an administrator. If you’re using Windows Vista you will need to install the SP1 update for Vista aswell, again in administrator mode.)
  3. Now it is time to install Touchlib dependencies libraries, Installing OpenCV 1.0. Use the recommend path and let it set the environment variables.
  4. Next, create a directory called C:\_libraries and unzip the content of dsvideolib, VideoWrapper, GLUT and OSCpack to this directory.

  5. Install the CMU 1394 Digital Camera Driver (yes, even if you dont have/use a firewire camera)
    During the setup Check “Development Files” and “Program Shortcuts”.
  6. Install the Microsoft Platform SDK, typical settings should be fine. Its best to download the ISO or Full download to install this, if you use the webinstaller be sure you download and install the correct platform.
  7. Install the DirectX SDK.
  8. Install TortoisSVN.

Setting environment variables:
Depending on your setup you might need to change a few directory location values.

  1. Press the right mouse button on “My Computer” and choose: Properties > Advanced > Environmental Variables
  2. To add an entry, click “new” at the System Variables.
  3. Add the OpenCV root directory:
    name: “OPENCV_HOME”
    value: “C:\Program Files\OpenCV”
  4. Add the DSVideoLib:
    name: “DSVL_HOME”
    value: “C:\_libraries\dsvl-0.0.8c”
  5. Add the VideoWrapper
    name: “VIDEOWRAPPER_HOME”
    value: “C:\_libraries\VideoWrapper_0_1_1″
  6. Add the OSCpack
    name: “OSCPACK_HOME”
    value: “C:\_libraries\oscpack_1_0_2\oscpack”
  7. Add the CMU driver location
    name: “CMU_PATH”
    value: “C:\Program Files\CMU\1394Camera”

Checkout touchlib svn:

  1. Create a directory called C:\multitouch in windows explorer
  2. Click the right mouse button and choose SVN Checkout
  3. Enter “http://touchlib.googlecode.com/svn/trunk/” as the URL of the repository
  4. Enter “C:\multitouch\touchlib” as checkout directory
  5. Click OK (confirm creation of the directory)
  6. Downloading the files might take a while because of the demo movies which are included. The latest revision rev.395 is 121.14Mb

Visual studio settings:
We are almost done with setting up the enviroment, there are just a few steps left before we can compile Touchlib.

  1. Open up “solution.sln” in the “C:\multitouch\touchlib\build\VC8″ directory.
  2. Choose Tools > Options
  3. On the left choose Project and Solutions > VC++ Directories
  4. On the right change “Show directories for:” to “Include files”
  5. Add the directory “C:\_libraries\glut-3.7.6-bin”
  6. Add the directory “C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include”
  7. Add the directory “C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses”
  8. Add the directory “C:\Program Files\Microsoft DirectX SDK (August 2007)\Include”
  9. Change “Show directories for:” to “Library files”
  10. Add the directory “C:\_libraries\glut-3.7.6-bin”
  11. Add the directory “C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib”
  12. Add the directory “C:\Program Files\Microsoft DirectX SDK (August 2007)\Lib\x86″
  13. Click OK
  14. In the menu choose Build > Build Touchlib
  15. When it has compiled Touchlib, Build > Build solution
  16. And you’re done.
Thanks to NUIGroup and Laurence Muller for this Tutorial.

Comments»

1. Amy Hines - Saturday, 28 June, 2008

What can I use other than Visual Studio 2005?

2. Taha - Saturday, 28 June, 2008

umm… the only other thing i can think of is linux to compile it under. Otherwise VS2005 is all i can think of….

i know other people have tried to compile under visual C and other software but it hasnt worked out for them… you can always download a trial copy from MS.

3. Giggs - Thursday, 31 July, 2008

Wooot! Thanks Taha great step by step walkthro



  • Multi-Touch Blogs

  • Justin
  • Paul D'Intino (Fairlane)
  • Seth Sandler (cerupcat)
  • Bridger
  • David Wallin (whitenoise)
  • Donovan Solms (donovan_sa)
  • Elliot Franford (efranford)
  • Joroen Braspenning
  • Laurence Muller (falcon4ever)
  • Lynn Marentette
  • Mark van Wijnen
  • Mike (miketavius)
  • Mike Wags
  • Multitouch-Barcelona
  • Pawel Solyga (solydzajs)
  • Tim Roth
  • Tag Cloud

    aesthetic plans app application AS3 bandpass filter begining C# cam Camera concept conceptual design design electrooptical Hardware IR keyboard Leds lens media app mediaapp Multi-touch multitouch Nasa NWW Osyris Patch Photo photo app pictures plans screen Software spectrum touch touchlib touchSpectrum update video video app vision visualisation Webcam welcome World Wind xbox 360
  • Categories

  • Recent Posts

  • Archives

  • Pages

  • Meta

  • Blog Stats

  • Current Viewers

    hit counter Display Pagerank
  • Category Cloud

    Acrylic General Hardware IR Frame Leds My Progress Software Webcam