Libtouch and more …
Today I saw this excellent HOWTO at http://ssandler.wordpress.com/mtmini/ on how to make your very own multi-touch pad, which is the coolest thing i’ve ever seen during the last two decades … *cough, cough* …
I haven’t made one myself yet, but I downloaded touchlib and I found it quite annoying that it used my built-in cam from my toshiba sattelite laptop however I plugged in another external one.
So, I did a quick fix to be able to use /dev/video1 … oh yeah, I tried this under Linux, more specifically Ubuntu, because I was lazy to setup all the libs with headers and shits under Windows.
In the CvCaptureFilter.cpp right in the void CvCaptureFilter::setParamater( … ) I added two more lines, so my version looks like this:
void CvCaptureFilter::setParameter(const char *name,
const char *value)
{
if(!capture)
{
if(strcmp( name, "source" ) == 0)
{
strcpy(source, value);
if(strcmp( value, "cam" ) == 0)
{
capture = cvCaptureFromCAM( CV_CAP_ANY );
}
else if(strcmp( value, "cam1" ) == 0)
{
capture = cvCaptureFromCAM( 1 );
}
else
{
capture = cvCaptureFromAVI(value);
}
}
}
}
With this done, i can just change in the “config.xml” the “source” to “cam1″ and make use of my other camera device on /dev/video1
That’s all I need
A few other thoughts … you can give an index from 0..99 to the cvCaptureFromCam( … ) and then it will try to find the first available driver for that particular device, or if you give something >=100 then it will try to use that particular driver with the first available video device; CV_CAP_ANY = 100 .
1 Comment »
Leave a comment
About
Blog moved to Szabster.net …
Formal Introduction: 100% Computer Science Geek, made from 100% pure and recyclable electrons.
Current Occupation: Software Engineer and a lot more
I speak fluently the following languages: Hungarian, Romanian, English, French, C/C++/C#, Delphi, HTML, CSS, JavaScript, PHP, MySQL, Python, and a lot more.
I am known as: Icebreaker, coder_master or Lone Wolf (Wolverine).
I can be also found on IRC: DynastyNet (network) as coderguy.
Favorite Quote: I’m never wrong. I thought I was wrong once but I was mistaken. - Jeff Mayer
My Favorite Linux Distribution is: Ubuntu
Place where I would like to relax: On the beach …
… and with who? : With a million naked girls.
My Personal Geek Code:
—–BEGIN GEEK CODE BLOCK—–
Version: 3.1.2
GCS/TW/IT dpu s: a? C++(++++) UBL
P+ L+(++) E— W+++ N+ o+
K- w++>+++ !O M V- PS+(+++) PE++
Y PGP>+ t+@ 5? X+ R>+++ !tv
b++(+++) DI? D+>+++$ G e h! r– y++
——END GEEK CODE BLOCK——
-
Archives
- May 2008 (15)
- April 2008 (12)
- March 2008 (7)
- February 2008 (11)
- January 2008 (3)
- December 2007 (2)
- November 2007 (8)
- October 2007 (6)
- August 2007 (1)
- July 2007 (2)
- May 2007 (1)
- April 2007 (6)
-
Categories
- 4k 64k
- Blogging
- box2d
- Chick
- Coding
- demo
- directx
- documents
- Download
- easter
- egg
- flash
- framework
- Free
- Friends
- Game
- Game Engine
- Gamer
- Games
- Geek
- humor
- Internet
- intro
- Linux
- mac
- macosx
- music
- Nerd
- Open Source
- OpenGL
- Operating System
- physics
- Poetry
- Programming
- rc
- Real Life
- resources
- Scene
- sdl
- skype
- Social Networking
- software
- sp1
- texture
- Toughts on things
- Ubuntu
- Uncategorized
- Vista
- web
- winamp
- Windows
- word
-
RSS
Entries RSS
Comments RSS




Hi, I’m glad you liked the video!
This is very interesting.
For people using dsvl, there’s a dsvl_config.xml file where you can change which camera is used. IF you think this is a better way, i’d love to talk and maybe we can commit something to the touchlib svn so it’s easier for people to switch between multiple cameras.
Right now, I just made a tutorial for editing dsvl_config.xml that will be included in the newest download package (hopefully released later today). This edit requires using graphedit and getting the camera’s “friendly_name.”
I’d welcome an easier way though.