Compiling TouchLib

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 InstallFull 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 dsvideolibVideoWrapperGLUT 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.

Leave a comment

  • Archives

  • Blog Stats

    • 128,374 hits
  • Current Viewers

  • Admin