Touchlib Configuration Information

From NUI Group Community Wiki

Jump to: navigation, search

This is a brief article to describe what Touchlib's config.xml file does.

If you are interested in knowing how the Touchlib Configapp works, go there.

config.xml is the main configuration file used by all the touchlib binaries. Running any of the binaries should cause this file to be created with some default settings. There are also some .xml files provided with touchlib that can be used for testing or as templates for you to work from. To use these config files just copy them over your existing config.xml.

The config file defines two things.

First is the 'screen' section which defines a grid of points. This is used to map your finger presses from Camera space to Screen space. These points are camera space points. To setup these points run the Touchlib Configapp. This should be the first touchlib app you run.

The next section is the filtergraph.

This defines a list of filters used to proces the images from your camera. It also defines the order that they are applied and any parameters on them. Each filter must have a label. The label can be anything, however it must be unique. The background filter should be considered [strong]required[/strong]. Also, do not change the name of the background filter from 'bacground4' since many of the example apps depend on this. You also should make sure that you use the mono filter if you are capturing in an RGB (color) format. Touchlib expects to get a greyscale image.

If you are doing the Diffused Illumination approach then use the highpass filter. If you are lighting from the front as opposed to the rear, you will probably need the invert filter.

The list of filters you can use is:

After processing all the filters, Touchlib's blob detection processes the image. Any non-zero pixels will be interpreted as blobs so you want to be sure that you are ONLY sending it blobs and not any background noise. You can run the Touchlib Configapp to adjust your settings before attempting to detect blobs. The config app will only attempt to detect blobs after you hit 'enter' to go into the fullscreen mode.