1 of 2
1
Touchlib compiled libraries, revision 348 (19 dec 2007)
Posted: 25 December 2007 08:33 AM   [ Ignore ]
Avatar
RankRank
Joined  2007-04-03
Total Posts:  230
Moderator

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.

Image Attachments
items_new.pngitems_new_und.png
 Signature 

My multitouch blog: http://www.multigesture.net
Howto: Compile touchlib on windows XP/Vista
Howto: Compile touchlib on Ubuntu Linux
Downloads: Touchlib SVN builds

Profile
 
 
Posted: 26 December 2007 05:16 PM   [ Ignore ]   [ # 1 ]
Avatar
Rank
Joined  2007-11-04
Total Posts:  85
New Member

Wow this is really usefull. I bought an f 2.0 lens for testing and my primary result shown a lot of distorsion. I think this filter will help me!! There’s a little grey zone in your explanation on how to use it. At the 9th step you tell to add this line in config.xml but i dont undestand wich line to add.... Sorry for my newbie question and thanx a lot for your work its great!!!!!!

 Signature 

My setup Description
My Website with video reviews of soft! UPDATED!
Sorry for my bad english, Im french!

Profile
 
 
Posted: 26 December 2007 05:22 PM   [ Ignore ]   [ # 2 ]
Avatar
RankRank
Joined  2007-04-03
Total Posts:  230
Moderator

hmm i had to place the tags in a [code.] field. Btw, there is a readme.txt included aswell which explains it…

 Signature 

My multitouch blog: http://www.multigesture.net
Howto: Compile touchlib on windows XP/Vista
Howto: Compile touchlib on Ubuntu Linux
Downloads: Touchlib SVN builds

Profile
 
 
Posted: 04 January 2008 11:22 PM   [ Ignore ]   [ # 3 ]
Rank
Joined  2007-08-01
Total Posts:  94
New Member

I am trying to get this to work with the Pt. Grey Firefly MV. I enter 2 for the firewire cam but when i hit enter the command line closes. One thing to note is that I am doing this on a MacBook Pro. If I select the USB cam i launches with my built in iSight. Any thoughts?

 Signature 

Brett Forsyth
Blog: http://blog.thestem.ca
My Mult-touch build: http://ddblog.vfs.com/category/multi-touch/
Where I teach: http://vfs.com/fulltime.php?id=13

Profile
 
 
Posted: 25 January 2008 06:57 AM   [ Ignore ]   [ # 4 ]
Rank
Joined  2007-09-20
Total Posts:  5
New Member

well first of all thanks for this application, it works almost perfectly. Only there is one major bug in the software. If you calibrated your screen and you start for instance smoke within touchlib the folowing happens: (check your task manager) the memory that is used by the touchlib program is duplicating itselve until your system runs out of memory and the application will crash. I’m talking here about the latest touchlib software. I would say that it is an easy job for you to fix this bus and hopefully you will fix it soon. thanks for your good job so far....

Profile
 
 
Posted: 25 January 2008 07:18 AM   [ Ignore ]   [ # 5 ]
Avatar
RankRank
Joined  2007-04-03
Total Posts:  230
Moderator
diebassie - 25 January 2008 06:57 AM

well first of all thanks for this application, it works almost perfectly. Only there is one major bug in the software. If you calibrated your screen and you start for instance smoke within touchlib the folowing happens: (check your task manager) the memory that is used by the touchlib program is duplicating itselve until your system runs out of memory and the application will crash. I’m talking here about the latest touchlib software. I would say that it is an easy job for you to fix this bus and hopefully you will fix it soon. thanks for your good job so far....

could you give some more details on which filters you’re using, which camera/camera drivers, system specs and OS (xp/vista)?

 Signature 

My multitouch blog: http://www.multigesture.net
Howto: Compile touchlib on windows XP/Vista
Howto: Compile touchlib on Ubuntu Linux
Downloads: Touchlib SVN builds

Profile
 
 
Posted: 25 January 2008 07:32 AM   [ Ignore ]   [ # 6 ]
Rank
Joined  2007-09-20
Total Posts:  5
New Member

could you give some more details on which filters you’re using, which camera/camera drivers, system specs and OS (xp/vista)?

ofcourse i can:

webcam:
firefly MV black/white

using a fisheye lens with an normal lens filter (cut out of diapositive film)

driver:
pgrcam.sys 1.5.3.15

system:
intel Quad Q6700, 2,66 Ghz
3.25 gb ram (cause xp can’t see 4 gb)
nvidia 8800 GTS videocard
asus p5e3 ws prof motherboard
raptor harddisk

Profile
 
 
Posted: 25 January 2008 07:36 AM   [ Ignore ]   [ # 7 ]
Avatar
RankRank
Joined  2007-04-03
Total Posts:  230
Moderator

diebassie with filter I actually mean the filter chain (config.xml).
Could you post the content encapsulated in the code tags?

thanks.

 Signature 

My multitouch blog: http://www.multigesture.net
Howto: Compile touchlib on windows XP/Vista
Howto: Compile touchlib on Ubuntu Linux
Downloads: Touchlib SVN builds

Profile
 
 
Posted: 25 January 2008 07:37 AM   [ Ignore ]   [ # 8 ]
Rank
Joined  2007-09-20
Total Posts:  5
New Member

<filtergraph>
    <
vwcapture label="capture1">
        <
videostring value="pgr: 0 640 60 grey8 0 rgb" />
    </
vwcapture>
    <
mono label="mono2" />
    <
smooth label="smooth3" />
    <
backgroundremove label="background4">
        <
threshold value="0" />
    </
backgroundremove>
    <
highpass label="highpass">
        <
filter value="11" />
        <
scale value="24" />
    </
highpass>
    <
brightnesscontrast label="bc5">
        <
brightness value="-0.309804" />
        <
contrast value="0.623529" />
    </
brightnesscontrast>
    <
rectify label="rectify6">
        <
level value="126" />
    </
rectify>
    <
barreldistortioncorrection label="barreldistortioncorrection1">
        <
border_size value="100" />
    </
barreldistortioncorrection>
</
filtergraph>

Profile
 
 
Posted: 25 January 2008 07:46 AM   [ Ignore ]   [ # 9 ]
Avatar
RankRank
Joined  2007-04-03
Total Posts:  230
Moderator

Thanks, I’ll try to see if I can reproduce the issue later smile.

Btw I noticed some issues with your current filter chain.
Since you’re using the Highpass plugin Im asume that you’re using Rear Illumination.

Try using the following filter graph:

<filtergraph>
    <
vwcapture label="capture1">
        <
videostring value="pgr: 0 640 60 grey8 0 rgb" />
    </
vwcapture>
    <
mono label="mono2" />
    <
backgroundremove label="backgroundremove1">
        <
threshold value="10" />
    </
backgroundremove>
    <
simplehighpass label="simplehighpass2">
        <
blur value="11" />
        <
noise value="3" />
        <
noiseMethod value="1" />
    </
simplehighpass>
    <
scaler label="scaler3">
        <
level value="70" />
    </
scaler>
    <
rectify label="rectify4">
        <
level value="75" />
    </
rectify
    <
barreldistortioncorrection label="barreldistortioncorrection1">
        <
border_size value="100" />
    </
barreldistortioncorrection>   
</
filtergraph>


- You might need to change the values of the simplehighpass filter, the scaler filter and rectify filter.
- Due performance issues it is recommended to leave out the smooth filter.
- The simplehighpass works faster (and often better) than the highpass filter.
- The brightnessconstrast filter is not needed for rear illumination. If the output of the highpass filter is low, you can use the (optional!) scaler filter like in the graph presented above.

Let me know how these settings perform.

*edit* I just noticed that you’re using the grey8 format, you might even remove the mono plugin (if touchlib crashes after removal, it means that the output signal is not compatible with the 8bit greyscale used in touchlib/opencv. In that case just put it back).

 Signature 

My multitouch blog: http://www.multigesture.net
Howto: Compile touchlib on windows XP/Vista
Howto: Compile touchlib on Ubuntu Linux
Downloads: Touchlib SVN builds

Profile
 
 
Posted: 25 January 2008 07:59 AM   [ Ignore ]   [ # 10 ]
Rank
Joined  2007-09-20
Total Posts:  5
New Member

just tested your filtergraph but still the same problem, removing (mono label="mono2") lets the system crash. It almost seems like the programs does not remove the old registrations, it just add’s more so the memory uses an extra 30mb each second.

And btw you asumed right, I use rear illimunation.

Profile
 
 
Posted: 15 February 2008 11:26 AM   [ Ignore ]   [ # 11 ]
Avatar
RankRank
Joined  2007-04-03
Total Posts:  230
Moderator

diebassie, the memory bug is solved in the latest version. Ill compile a new binary tonight (but the code is on the svn).

I forgot to release some pointers wink

 Signature 

My multitouch blog: http://www.multigesture.net
Howto: Compile touchlib on windows XP/Vista
Howto: Compile touchlib on Ubuntu Linux
Downloads: Touchlib SVN builds

Profile
 
 
Posted: 16 February 2008 04:30 AM   [ Ignore ]   [ # 12 ]
Avatar
RankRank
Joined  2007-05-05
Total Posts:  198
Jr. Member

just have a one questions about this filter.

Does this work with a friefly setup using the ptgrey driver (vwcapture pgr: 0 640 .....) ?
I just ask because diebassie and brettf both use fireflys and i do not use the cmu driver..
Do you have to use the cmu driver for the distortion app, and afterwards switch drivers for the firefly?

Just want to make sure before I try this…

thanks

 Signature 

Blog: http://iad.projects.zhdk.ch/multitouch/
180 Project: http://www.timroth.de/180/

Profile
 
 
Posted: 16 February 2008 05:33 AM   [ Ignore ]   [ # 13 ]
Avatar
RankRank
Joined  2007-04-03
Total Posts:  230
Moderator
Tim Roth - 16 February 2008 04:30 AM

just have a one questions about this filter.

Does this work with a friefly setup using the ptgrey driver (vwcapture pgr: 0 640 .....) ?
I just ask because diebassie and brettf both use fireflys and i do not use the cmu driver..
Do you have to use the cmu driver for the distortion app, and afterwards switch drivers for the firefly?

Just want to make sure before I try this…

thanks

Yea if the ptgrey supports cmu, you could temporary use the cmu driver on your cam. Then start the barreldistortion tool to get the cameralens distortion values (camera.yml). After that you can return to the original drivers and run the touchlib config to do the real configuration.

 Signature 

My multitouch blog: http://www.multigesture.net
Howto: Compile touchlib on windows XP/Vista
Howto: Compile touchlib on Ubuntu Linux
Downloads: Touchlib SVN builds

Profile
 
 
Posted: 16 February 2008 01:47 PM   [ Ignore ]   [ # 14 ]
Rank
Joined  2007-11-01
Total Posts:  52
New Member

since i m using the latest 348 version the “backgroundremove4” filter doenst work anymore. it works for 3-4 times, then it doesnt recpature the screen anymore. some ideas?

Profile
 
 
Posted: 26 February 2008 03:31 AM   [ Ignore ]   [ # 15 ]
Rank
Joined  2007-09-20
Total Posts:  5
New Member
Falcon4ever - 15 February 2008 11:26 AM

diebassie, the memory bug is solved in the latest version. Ill compile a new binary tonight (but the code is on the svn).

I forgot to release some pointers wink

Thanks for the help, and the latest version is rev 348?? I lost count :p

Profile
 
 
   
1 of 2
1