OK that looks good
I'm not sure how far you got in installing 2.1.0 from source but we should probably at least try to run the uninstall to minimize the chances of confusing the package management system. So go to your OpenCV 2.1.0 Build directory and
Code:
/usr/local/src/OpenCV-2.1.0-patched-V4L$ cd Build/
/usr/local/src/OpenCV-2.1.0-patched-V4L/Build$ sudo make uninstall
It should give you an output something like
Code:
Scanning dependencies of target uninstall
.
.
.
For example mine gives
Code:
Scanning dependencies of target uninstall
CMake Error at cmake_uninstall.cmake:6 (MESSAGE):
Cannot find install manifest:
"/usr/local/src/OpenCV-2.1.0-patched-V4L/Build/install_manifest.txt"
make[3]: *** [CMakeFiles/uninstall] Error 1
make[2]: *** [CMakeFiles/uninstall.dir/all] Error 2
make[1]: *** [CMakeFiles/uninstall.dir/rule] Error 2
make: *** [uninstall] Error 2
because I didn't actually install anything. If it either (1) finds no manifest (like mine) or finds it and successfully deletes everything then you can move on and install the above packages from the repositories, either via a package manager such as Synaptic or just with apt-get:
Code:
sudo apt-get install libopencv-dev libopencv-highgui-dev libcv-dev libhighgui-dev
Then you can EITHER start with a completely fresh copy of headtrack and patch both the headtrack.c source code and Makefile, or start from where you are and just patch headtrack.c - the only change I had to make to headtrack.c is that the cvHaarDetectObjects function now takes a max size as well as a min size for the target: I don't know what the 'right' thing to put in there is, but it seems to work OK if you just set the max size equal to the size of the image:
i.e.
Code:
faces = cvHaarDetectObjects( imggray, cascade, store, HAAR_SCALE, 2,
BIGGEST + ROUGH, SEARCH_SIZE);
becomes
Code:
faces = cvHaarDetectObjects( imggray, cascade, store, HAAR_SCALE, 2,
BIGGEST + ROUGH, SEARCH_SIZE, cvGetSize(imggray));
and so on (there are 3 such replacements in total). You can edit them manually or apply one of the attached patches; either
Code:
t61p:/usr/local/src$ cd headtrack
t61p:/usr/local/src/headtrack$ patch -p1 < ../patch-headtrack-OpenCV2.3.txt
t61p:/usr/local/src/headtrack$ make
or if you want to start over and patch the source code and the original Makefile (I have tidied up the Makefile and added back the flightgear stuff since yesterday so that would be my recommendation)
Code:
t61p:/usr/local/src$ cd headtrack
t61p:/usr/local/src/headtrack$ patch -p1 < ../patch-headtrack-OpenCV2.3-newmake.txt
t61p:/usr/local/src/headtrack$ make
both assuming that the patch file(s) are in the /usr/local/src directory on the same level as the top level headtrack directory.
Since this way builds against properly installed system libraries, there's no need for the LD_LIBRARY_PATH hack, if 'make' succeeds you should be able to run it with
Code:
t61p:/usr/local/src/headtrack$ ./headtrack
Or with the new Makefile you can 'make install' which will put it in the /usr/local/bin directory which is probably on your path so you can invoke from anywhere as
Good luck
Bookmarks