The latest SVN version of touchlib (rev 348) is now available from:
http://www.multigesture.net/downloads/
What’s new:
- This version includes the new barrel distortion correction filter.
Examples:
- see attached pictures.
To calculate the barrel distortion correction parameters, please use this tool:
- http://www.multigesture.net/wp-content/uploads/2007/12/touchlib_barreldistortion_tool.zip
Required:
- the image from pattern.pdf (from the zipfile) printed on a piece of paper (perhaps glued on some cardboard)
Usage:
1. Connect a usb camera or firewire cam (using CMU)
2. Start the touchlib_barreldistortion_tool.bat
3. Select your camera type and press enter
4. start the calibration by pressing g
5. Put the pattern on the table
- After each snapshot (the screen will blink) you should move the pattern to another corner or side.
- You should also vary in rotation.
- Don’t forget to put the patter in the middle aswell
6. After 10 snapshots the tool will calculate the correction values and save them to camera.yml
7. By pressing u it is possible to preview the correction.
If the tool has cropped the result too much, add this argument: -b
Example: -w 6 -h 8 -s 2 -n 10 -b 20
20 seems to be good for a F 2.5 mm lens
In touchlib:
8. the camera.yml should be in the same directory as config.xml
9. add this line to your config.xml
<barreldistortioncorrection label="barreldistortioncorrection1">
<border_size value="20" />
</barreldistortioncorrection>
The border size is a value you need to experiment it. It will add a black border of xx pixels.
Try using it with the value 0 first. If it resulting image is cropped too much, try increasing this value.
