Blog.phpwnage  
Blog.phpwnage > Compiz Webcam Head Tracking A blog by Kevin Lange, UIUC Class of 2013
  Compiz Webcam Head Tracking Mar 9, 2009 - klange  
  I've let this go unposted for far too long now, so I think I better get this up now.

So, you want to install the HeadTracking plugin for Compiz, 'eh? Well, then, you'll want to follow this guide to keep out of trouble.

Update: This commit should work.

So what do I need?
- This commit of OpenCV
- All Compiz -dev packages (compiz-dev, compiz-fusion-dev, compiz-bcop - whatever applies)
- Any required dependencies for OpenCV (I do not have a list, if you encounter a missing library when compiling, post a comment here and I will start making a list)
- All Compiz -dev packages (compiz-dev, compiz-fusion-dev, compiz-bcop - whatever applies)
- The plugin itself (which has been adjusted for this particular commit of OpenCV - if you get an error with retrieveFrame because you have a newer OpenCV, please use this)
- All Compiz -dev packages (compiz-dev, compiz-fusion-dev, compiz-bcop - whatever applies)
- A camera that works with OpenCV (please check the list if you are having issues after compiling)
- Did I mention you need the Compiz -dev packages and compiz-bcop/compiz-fusion-bcop?

Compiling...
So now we can compile: first build OpenCV:
Code:
./configure
make && sudo make install

If you have any issues, post them as comments here - be sure to grab on dependencies you are missing and post them here.
When OpenCV is done (it may take quite some time), ensure your environment is ready to build Compiz plugins (this shouldn't take any extra work).
Then compile the plugin:
Code:
make && make install

If you have issues here and the error messages do not say "facedetect.c" or something to that effect, you probably missed a Compiz -dev package. Check your distribution's documentation for any extra information on compiling Compiz plugins, or see the Compiz Wiki.

Configuring...
If you've reached this point, you're ready to configure the plugin. This takes quite a bit of trial-and-error to get things to look smooth. The biggest suggestion I can make is to increase the width and field-of-view options - their defaults are way too low. If your display appears corrupt, it's probably because the camera is set to point extremely far away or extremely close: if the display appears flipped, it's probably too close. If the display is corrupt or doesn't seem to update, it's probably too far away. Adjust the width and see if it helps. If no set of values seems to work, you can contact me and we can do some debugging to find appropriate settings for your camera.

But I'm still having problems!
Please, post your issues here - don't post on other forums, as if there's a topic for "Headtracking", solving issue is probably not its purpose.


Discuss this news post here.
(24 comments)
 
  Comment on this Article  
 
JayLee Hi everyone here.I am so glad to come in here,good to see you all.

Ed Hardy nfl jerseys collection blog
durkheim I'm trying to compile the plugin for compiz that allows head tracking.
I'm using Ubuntu 10.04 "Lucid".

I tried with the source code  from git using

git clone git://git.compiz-fusion.org/users/klange/headtracking</pre>

Compilation works fine, but when it tries to link
the following happens:

~/headtracking/headtracking$ sudo make
convert : headtracking.xml.in -> build/headtracking.xml
bcop'ing : build/headtracking.xml -> build/headtracking_options.h
bcop'ing : build/headtracking.xml -> build/headtracking_options.c
schema : build/headtracking.xml -> build/compiz-headtracking.schema
compiling : facedetect.c -> build/facedetect.lo
compiling : headtracking.c -> build/headtracking.lo
compiling : build/headtracking_options.c -> build/headtracking_options.lo
linking : build/libheadtracking.la/usr/bin/ld: cannot find -lcvaux
collect2: ld returned 1 exit status
make: *** [build/libheadtracking.la] Erreur 1

I searched the interwebs for an answer but can't figure out why
-lcvaux option is missing from the linker...

Any help will be much appreciated.

Thanks,
David
Frankenfatz Ran into the following error during make on Ubuntu  9.10

"
<pre class="message">> /bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../.. -I. -I../../cxcore/include -I../.. -DNDEBUG -fno-strict-aliasing -Wall -g -fopenmp -O2 -g -MT cxalloc.lo -MD -MP -MF .deps/cxalloc.Tpo -c -o cxalloc.lo cxalloc.cpp
> g++ -DHAVE_CONFIG_H -I. -I../.. -I. -I../../cxcore/include -I../.. -DNDEBUG -fno-strict-aliasing -Wall -g -fopenmp -O2 -g -MT cxalloc.lo -MD -MP -MF .deps/cxalloc.Tpo -c cxalloc.cpp -fPIC -DPIC -o .libs/cxalloc.o
> In file included from _cxcore.h:60,
> from cxalloc.cpp:42:
> ../../cxcore/include/cxmisc.h:133:6: error: #elif with no expression
> make[4]: *** [cxalloc.lo] Error 1
> make[4]: Leaving directory `/build/tbm/opencv-1.0.0/cxcore/src'
> make[3]: *** [all-recursive] Error 1
"

Corrected by editing /cxcore/cxmisc.h

On line 133:

-#elif
+#else

</pre>
kelemvor Hi!

I've installed openCV and the plugin, but I still can't get it to work.

When I enable the plugin in Compiz it stacks the windows in Z, but doesn't follow my head.

My setup is:
Ubuntu 10.04
Asus eee 1000he

If I start Cheese a little green light turn on next to my integrated webcam, but not when the plugin is turned on and Cheese is closed.

Any ideas?
Guest opencv/otherlibs/highgui/gstappsink.c -> build/opencv/otherlibs/highgui/gstappsink.loopencv/otherlibs/highgui/gstappsink.c:20:21: error: gst/gst.h: No such file or directory
What should I do?
Guest You also need libtool to install the plugin

Gausie
amadeus266
Originally posted by Guest
Hey there, I have opencv and the plugin installed. The plugin is working in that the windows on screen move back and forth (z-axis) as expected when switching between windows. My webcam turns on only when I open camorama and has no effect on the screen. What am I missing?


update: webcam turns on automatically now, deb keys work, but still no headtracking.
Guest Hey there, I have opencv and the plugin installed. The plugin is working in that the windows on screen move back and forth (z-axis) as expected when switching between windows. My webcam turns on only when I open camorama and has no effect on the screen. What am I missing?
klange This could take a while, then, hit me up on the IM of your choice later today.
Guest > Enable crash reporting in Compiz, that will give more useful information...

How do I do that?

I've tried enabling the "Crash Handler" plugin, which by default should dump reports to /tmp.

I can verify the plugin is running via "lsof" but am not getting anything in /tmp, or anywhere else that  I can see.

I've tried searching the Compiz Fusion forum with no luck.
(More Comments)
 
(C) 2010 Kevin Lange [ RSS ][ Mobile ][ PHPwnage ][ PHP 5 ]