The d-touch marker recognition library, libdtouch, is available under GPL licence. To use it in your own projects you have 2 options: you can use the d-touch server (DTServer), or you can include the C++ code directly in your project, see below for more information.

If you have questions or comments about libdtouch, including suggestions to improve the information on this page, please post on our forum (you will need to create an account, if you do not have one already).

DTServer

The DTServer is an application that acquires images from a camera connected to your computer (e.g. a webcam), looks for d-touch markers in them and makes the results available via a socket server. Other programs, written in any programming language (examples for some languages are provided below), can connect to the DTServer and use the information about the d-touch markers.

The DTServer is available under GPL license. If possible, we suggest to compile the latest version of the source code from sourceforge SVN (see compilation instructions below). Otherwise, you can download a compiled version here:

Example code to connect to DTServer and get the information about detected markers is also available on the sourceforge SVN, or can be downloaded here:

When you run DTServer normally the OS will ask you if it’s ok to accept incoming connections. Please say yes.

DTServer recognizes the d-touch markers corresponding to the IDs listed in the file seq.txt (in the conf folder), please refer to the d-touch design rules for more information about IDs. The order of the IDs in seq.txt defines the marker type returned by the DTServer: the ID on the first line will be identified as type 0, the ID on the second line as type 1, and so on.
By default DTServer uses the first marker in seq.txt for calibration: four of these markers are expected to be at the four corners of the interactive surface (like in the audio d-touch applications). The position of all other markers will be calculated relative to these four. If you are not using calibration markers you should launch the DTServer from the command line with the option ‘-k’ to disable calibration.

If you see a rectangle in the centre of the DTServer video window, it means that DTServer thinks that the current image is noisy. Please try to change the lighting conditions, camera focus or background of your physical setup.

Some more instructions for using your own d-touch markers were kindly posted by Patrick Dinnen on his Hogtown Consulting blog.

Compiling DTServer on Windows

To compile dtouch from the svn source you will need:

  • an svn client (we use tortoiseSvn, it's open source);
  • Microsoft Visual Studio 2008 (it may be possible to compile using other versions of visual studio but some tweaking is required -- you will need the commercial version of Visual Studio, because DTServer currently needs some Microsoft libraries that we were able to find only in that one).

Steps:

  1. Checkout the code using SVN, following the instructions on Sourceforge.
  2. Compile the core library. In the folder core\win32 you will find project files for Visual Studio 2008 (core_VS2008). Double click on it to open it.
  3. Change the active configuration to "Release" (by default it is "Debug") from: "Build->Configuration Manager->Active solution configuration"
  4. Build the solution: "Build->Build solution"
  5. Compile DTServer. Repeat the same steps as for the d-touch core library. In the folder DTServer\win32 you will find project files for Visual Studio 2008 (DTServer_VS2008). Double click on it to open it.
  6. Change the active configuration to "Release" (by default it is "Debug") from: "Build->Configuration Manager->Active solution configuration"
  7. Build the solution: "Build->Build solution"
Done! In DTServer\win32\bin you should find dtserver.exe

Compiling DTServer on Mac OS X

To compile DTServer from the svn source you will need:

  • an svn client (we use the command line tool);
  • Apple X Code;
  • the SDL (Simple DirectMedia Layer) runtime for OS X, get it from SDL download page and install it (see the readme.txt that comes with it).

Steps

  1. Checkout the code using SVN, following the instructions on Sourceforge.
  2. Open the DTServer.xcodeproj in the DTServer\macosx folder. Select the deployment configuration (NOT the development one): "Project -> Set Active Build Configuration -> Deployment"
  3. build the project: "Build->Build"
Done! In the build\deployment folder you should find DTServer.app

Compiling DTServer on Linux

The branch "portlinuxupdate" on the project svn works on current Ubuntu (and hopefully other) distributions. Please checout the code from http://libdtouch.svn.sourceforge.net/viewvc/libdtouch/branches/portvideoupdate/. There are a number of dependencies.. more information will be posted here, in the mean time you have to rely on the error messages to understand what packages to install. Sorry.

Using libdtouch directly

In alternative to use DTServer, you can include the d-touch library C++ code directly in your projects. In this case you only need the content of the "core" folder on the sourceforge SVN. Most of the library functionality is wrapped in fiducialrecognition.h please refer to this simple C++ example, or contact us for more information.