Page 2 of 5 FirstFirst 1234 ... LastLast
Results 11 to 20 of 43

Thread: How to install these programs?

  1. #11
    Join Date
    Apr 2012
    Beans
    7,256

    Re: How to install these programs?

    The 'mkdir Build && cd Build' commands ONLY related to the (Cmake-based) build of the OpenCV library - no need to do those for the actual headtrack build, as far as I can see from the INSTALL file 'headtrack' just requires a simple 'make' in the same directory as the headtrack.c file

    Code:
    $ cd /usr/local/src/headtrack
    $ make
    However it looks like something has tried to do a 'make install' but taken your current directory as the install root (instead of the real system root '/') so that it has created a whole 'root tree' in the current dir i.e. ./usr, ./usr/bin etc.

    If you post the headtrack Makefile we can try to puzzle it out, or you can just remove the whole spurious tree from /usr/local/src/headtrack/headtrack down and try the 'make' command again

  2. #12
    Join Date
    Jan 2010
    Beans
    103

    Re: How to install these programs?

    Yes, /usr/local/src/headtrack/headtrack just duplicates /usr/local/src/headtrack/debian, which contains DEBIAN and usr folders.

    Makefile:

    CFLAGS= -msse -I/usr/include/X11 -W -msse2 -std=c99 -fomit-frame-pointer

    headtrack64: headtrack.c
    gcc $(CFLAGS) -fno-strict-aliasing -m64 -mtune=amdfam10 -Wno-unused-parameter -Wno-unused-value -Wno-unused-function -W -Wall -O3 -I/usr/include/X11 `pkg-config --cflags --libs opencv x11 gtk+-2.0 gthread-2.0` -o headtrack headtrack.c


    headtrack32: headtrack.c
    gcc -std=c99 -fno-strict-aliasing -Wno-unused-parameter -Wno-unused-value -Wno-unused-function -W -Wall -O2 -I/usr/include/X11 `pkg-config --cflags --libs opencv x11 gtk+-2.0 gthread-2.0` -m32 -o headtrack32 headtrack.c


    deb64: headtrack64
    mkdir -p ./debian/usr/bin
    mkdir -p ./debian/usr/share/headtrack
    cp headtrack ./debian/usr/bin/headtrack
    dpkg --build debian
    mv debian.deb headtrack.deb


    deb32: headtrack32
    mkdir -p ./debian/usr/bin
    mkdir -p ./debian/usr/share/headtrack
    cp headtrack32 ./debian/usr/bin/headtrack
    dpkg --build debian
    mv debian.deb headtrack.deb


    installdeb: deb64
    sudo dpkg -i headtrack.deb
    sudo cp /usr/share/doc/opencv-doc/examples/haarcascades/haarcascades/haarcascade_frontalface_alt.xml.gz /usr/local/headtrack/haarcascade_frontalface_alt.xml.gz
    sudo gunzip /usr/local/headtrack/haarcascade_frontalface_alt.xml.gz


    install: headtrack
    cp headtrack /usr/bin/headtrack


    install-fgfiles:
    cp fgfs/FG_ROOT/gui/dialogs/headtracking.xml $(FG_ROOT)/gui/dialogs/headtracking.xml
    mv $(FG_ROOT)/gui/menubar.xml $(FG_ROOT)/gui/menubar.xml.orignal
    cp fgfs/FG_ROOT/gui/menubar.xml $(FG_ROOT)/gui/menubar.xml
    cp fgfs/FG_ROOT/Protocol/headtrack.xml $(FG_ROOT)/Protocol/headtrack.xml

    install-nasfile:
    cp fgfs/headtracking.nas $(HOME)/.fgfs/Nasal/headtracking.nas


    uninstall:
    rm -f /usr/bin/headtrack


    clean:
    rm -f ./headtrack
    rm -f ./headtrack.deb
    rm -f ./headtrack32
    rm -f ./debian/usr/bin/headtrack


    run:
    ./headtrack

    Last edited by paulemony; May 9th, 2013 at 05:06 PM.

  3. #13
    Join Date
    Jan 2010
    Beans
    103

    Re: How to install these programs?

    P.S. Deleted sub-directory & tried "make" again:

    Code:
    $:/usr/local/src/headtrack$ makegcc -msse -I/usr/include/X11 -W -msse2 -std=c99 -fomit-frame-pointer  -fno-strict-aliasing -m64 -mtune=amdfam10 -Wno-unused-parameter -Wno-unused-value -Wno-unused-function -W -Wall -O3 -I/usr/include/X11 `pkg-config --cflags --libs opencv x11 gtk+-2.0 gthread-2.0` -o headtrack headtrack.c
    headtrack.c: In function ‘main’:
    headtrack.c:105:7: warning: variable ‘new_transmitterthread’ set but not used [-Wunused-but-set-variable]
    /tmp/cc7SSsHs.o: In function `main':
    headtrack.c:(.text.startup+0x247): undefined reference to `cvLoad'
    headtrack.c:(.text.startup+0x27a): undefined reference to `cvCreateImage'
    headtrack.c:(.text.startup+0x29a): undefined reference to `cvCreateImage'
    headtrack.c:(.text.startup+0x2ba): undefined reference to `cvCreateImage'
    headtrack.c:(.text.startup+0x2de): undefined reference to `cvCreateImage'
    headtrack.c:(.text.startup+0x2fe): undefined reference to `cvCreateImage'
    headtrack.c:(.text.startup+0x318): undefined reference to `cvNamedWindow'
    headtrack.c:(.text.startup+0x322): undefined reference to `cvGetWindowHandle'
    headtrack.c:(.text.startup+0x32f): undefined reference to `g_type_check_instance_cast'
    headtrack.c:(.text.startup+0x347): undefined reference to `g_signal_connect_data'
    headtrack.c:(.text.startup+0x3b8): undefined reference to `cvCreateMat'
    headtrack.c:(.text.startup+0x3d3): undefined reference to `cvCreateMat'
    headtrack.c:(.text.startup+0x3e6): undefined reference to `cvSetZero'
    headtrack.c:(.text.startup+0x3f2): undefined reference to `cvSetZero'
    headtrack.c:(.text.startup+0x41d): undefined reference to `cv2DRotationMatrix'
    headtrack.c:(.text.startup+0x448): undefined reference to `cv2DRotationMatrix'
    headtrack.c:(.text.startup+0x44f): undefined reference to `cvCreateMemStorage'
    headtrack.c:(.text.startup+0x46b): undefined reference to `cvCreateCameraCapture'
    headtrack.c:(.text.startup+0x4a5): undefined reference to `cvQueryFrame'
    headtrack.c:(.text.startup+0x4b9): undefined reference to `cvResize'
    headtrack.c:(.text.startup+0x4d1): undefined reference to `cvCvtColor'
    headtrack.c:(.text.startup+0x505): undefined reference to `cvHaarDetectObjects'
    headtrack.c:(.text.startup+0x753): undefined reference to `atan'
    headtrack.c:(.text.startup+0x79e): undefined reference to `atan'
    headtrack.c:(.text.startup+0x80f): undefined reference to `cvGetSeqElem'
    headtrack.c:(.text.startup+0x906): undefined reference to `cv2DRotationMatrix'
    headtrack.c:(.text.startup+0x938): undefined reference to `cv2DRotationMatrix'
    headtrack.c:(.text.startup+0xa14): undefined reference to `cvRectangle'
    headtrack.c:(.text.startup+0xc28): undefined reference to `cvRectangle'
    headtrack.c:(.text.startup+0xc3b): undefined reference to `cvFlip'
    headtrack.c:(.text.startup+0xc53): undefined reference to `cvPyrDown'
    headtrack.c:(.text.startup+0xc64): undefined reference to `cvShowImage'
    headtrack.c:(.text.startup+0xc6e): undefined reference to `cvWaitKey'
    headtrack.c:(.text.startup+0xc82): undefined reference to `cvReleaseMat'
    headtrack.c:(.text.startup+0xc8e): undefined reference to `cvReleaseMat'
    headtrack.c:(.text.startup+0xc9a): undefined reference to `cvReleaseHaarClassifierCascade'
    headtrack.c:(.text.startup+0xca6): undefined reference to `cvReleaseCapture'
    headtrack.c:(.text.startup+0xcb0): undefined reference to `cvDestroyWindow'
    headtrack.c:(.text.startup+0xcbc): undefined reference to `cvReleaseMemStorage'
    headtrack.c:(.text.startup+0xd98): undefined reference to `cvWarpAffine'
    headtrack.c:(.text.startup+0xdcc): undefined reference to `cvHaarDetectObjects'
    headtrack.c:(.text.startup+0xe4c): undefined reference to `cvWarpAffine'
    headtrack.c:(.text.startup+0xe80): undefined reference to `cvHaarDetectObjects'
    headtrack.c:(.text.startup+0xeae): undefined reference to `cvLoad'
    headtrack.c:(.text.startup+0xece): undefined reference to `cvLoad'
    collect2: ld returned 1 exit status
    make: *** [headtrack64] Error 1

  4. #14
    Join Date
    Apr 2012
    Beans
    7,256

    Re: How to install these programs?

    Well I don't see anything there that would have created those extra dirs - perhaps they were stubs that got left in the headtrack tarball (assuming you unpacked it from a tarball)?

    Regardless, there doesn't appear to be anything of value in them so I still suggest removing the /usr/local/src/headtrack/headtrack directory which is blocking creation of the identically named headtrack executable file, and then running either

    Code:
    make headtrack32
    Code:
    make headtrack64
    depending on your platform (if you just run 'make' with no target argument it looks like it will try to build the 64-bit version, since that's the default target in the Makefile)


    EDIT: just seen you most recent post, that's all looking good except there's a library order issue - the current linker doesn't attempt to resolve references like that so you will need to modify the Makefile a little to get everything in the right order manually:

    Code:
    headtrack64: headtrack.c
    gcc $(CFLAGS) -fno-strict-aliasing -m64 -mtune=amdfam10 -Wno-unused-parameter -Wno-unused-value -Wno-unused-function -W -Wall -O3 -I/usr/include/X11 `pkg-config --cflags --libs opencv x11 gtk+-2.0 gthread-2.0` -o headtrack headtrack.c
    to
    Code:
    headtrack64: headtrack.c
    gcc $(CFLAGS) -fno-strict-aliasing -m64 -mtune=amdfam10 -Wno-unused-parameter -Wno-unused-value -Wno-unused-function -W -Wall -O3 -I/usr/include/X11 `pkg-config --cflags opencv x11 gtk+-2.0 gthread-2.0` -o headtrack headtrack.c `pkg-config --libs opencv x11 gtk+-2.0 gthread-2.0`
    i.e. split the 'cflags' and 'libs' parts of pkg-config and put the 'libs' part AFTER the headtrack.c file (same for the 32-bit target if you want to build that)
    Last edited by steeldriver; May 9th, 2013 at 05:30 PM.

  5. #15
    Join Date
    Jan 2010
    Beans
    103

    Re: How to install these programs?

    OK, Makefile now:

    CFLAGS= -msse -I/usr/include/X11 -W -msse2 -std=c99 -fomit-frame-pointer



    headtrack64: headtrack.c
    gcc $(CFLAGS) -fno-strict-aliasing -m64 -mtune=amdfam10 -Wno-unused-parameter -Wno-unused-value -Wno-unused-function -W -Wall -O3 -I/usr/include/X11 `pkg-config --cflags opencv x11 gtk+-2.0 gthread-2.0` -o headtrack headtrack.c `pkg-config --libs opencv x11 gtk+-2.0 gthread-2.0`


    headtrack32: headtrack.c
    gcc -std=c99 -fno-strict-aliasing -Wno-unused-parameter -Wno-unused-value -Wno-unused-function -W -Wall -O2 -I/usr/include/X11 `pkg-config --cflags --libs opencv x11 gtk+-2.0 gthread-2.0` -m32 -o headtrack32 headtrack.c


    deb64: headtrack64
    mkdir -p ./debian/usr/bin
    mkdir -p ./debian/usr/share/headtrack
    cp headtrack ./debian/usr/bin/headtrack
    dpkg --build debian
    mv debian.deb headtrack.deb


    deb32: headtrack32
    mkdir -p ./debian/usr/bin
    mkdir -p ./debian/usr/share/headtrack
    cp headtrack32 ./debian/usr/bin/headtrack
    dpkg --build debian
    mv debian.deb headtrack.deb


    installdeb: deb64
    sudo dpkg -i headtrack.deb
    sudo cp /usr/share/doc/opencv-doc/examples/haarcascades/haarcascades/haarcascade_frontalface_alt.xml.gz /usr/local/headtrack/haarcascade_frontalface_alt.xml.gz
    sudo gunzip /usr/local/headtrack/haarcascade_frontalface_alt.xml.gz


    install: headtrack
    cp headtrack /usr/bin/headtrack


    install-fgfiles:
    cp fgfs/FG_ROOT/gui/dialogs/headtracking.xml $(FG_ROOT)/gui/dialogs/headtracking.xml
    mv $(FG_ROOT)/gui/menubar.xml $(FG_ROOT)/gui/menubar.xml.orignal
    cp fgfs/FG_ROOT/gui/menubar.xml $(FG_ROOT)/gui/menubar.xml
    cp fgfs/FG_ROOT/Protocol/headtrack.xml $(FG_ROOT)/Protocol/headtrack.xml

    install-nasfile:
    cp fgfs/headtracking.nas $(HOME)/.fgfs/Nasal/headtracking.nas


    uninstall:
    rm -f /usr/bin/headtrack


    clean:
    rm -f ./headtrack
    rm -f ./headtrack.deb
    rm -f ./headtrack32
    rm -f ./debian/usr/bin/headtrack


    run:
    ./headtrack

    However:

    Code:
    $:/usr/local/src/headtrack$ make headtrack64
    make: Nothing to be done for `headtrack64'.
    
    
    $:/usr/local/src/headtrack$ make headtrack
    cc -msse -I/usr/include/X11 -W -msse2 -std=c99 -fomit-frame-pointer     headtrack.c   -o headtrack
    headtrack.c:42:16: fatal error: cv.h: No such file or directory
    compilation terminated.
    make: *** [headtrack] Error 1
    
    
    $:/usr/local/src/headtrack$ make
    make: Nothing to be done for `headtrack64'.

  6. #16
    Join Date
    Apr 2012
    Beans
    7,256

    Re: How to install these programs?

    Hi again

    The Makefile seems like it needs some tidying up - there doesn't appear to be an actual 'headtrack' target, only the separate 'headtrack64' and 'headtrack32' targets. So when you try to 'make headtrack' it just guesses how to build it (or more precisely, it uses default rules for making an executable from a .c file) - which doesn't include any of the pkg-configs or other stuff (just the CFLAGS) - so it fails. And the 'clean' rules don't reflect the 32/64 bit distinction correctly.

    Since it's only a single .c file creating a single executable probably the easiest thing is to forget about 'make' altogether and just run the compiler directly e.g. gluing together (and rationalizing) all the options for the 64-bit build [I don't know if any of these options - except for the warnings (-Wxx) - are actually good to use BTW]

    Code:
    $ rm headtrack
    $ rm *.o
    $
    $ CFLAGS="-msse -msse2 -std=c99 -fomit-frame-pointer -fno-strict-aliasing -m64 -mtune=amdfam10 -Wall -Wextra -O3 -I/usr/include/X11 `pkg-config --cflags opencv x11 gtk+-2.0 gthread-2.0`"
    $ LIBS="`pkg-config --libs opencv x11 gtk+-2.0 gthread-2.0`"
    $ 
    $ gcc $CFLAGS -o headtrack  headtrack.c $LIBS

  7. #17
    Join Date
    Jan 2010
    Beans
    103

    Re: How to install these programs?

    Not sure I understand why the rm command, does the entire headtrack directory have to be removed?

    Command doesn't work anyway:

    Code:
    $:/usr/local/src$ rm headtrack
    rm: cannot remove `headtrack': Is a directory
    I suppose I could just erase it with nautilus?

    Another problem, dicovered that OpenCV-2.1.0 isn't installed after all even though it looked as if it was:

    Code:
    $:/usr/local/src/OpenCV-2.1.0/Build$ sudo make install[ 47%] Built target opencv_lapack
    [ 48%] Built target flann
    [ 51%] Built target zlib
    [ 54%] Built target cxcore
    [ 64%] Built target cv
    [ 68%] Built target highgui
    [ 70%] Built target ml
    [ 83%] Built target cvaux
    [ 84%] Built target cvhaartraining
    [ 84%] Built target createsamples
    [ 84%] Built target haartraining
    [ 84%] Built target performance
    [ 85%] Built target traincascade
    [ 85%] Built target cxts
    [ 96%] Built target cvtest
    [ 99%] Built target cxcoretest
    [100%] Built target mltest
    [100%] Built target cvpy
    Install the project...
    -- Install configuration: "RELEASE"
    -- Installing: /usr/local/share/opencv/OpenCVConfig.cmake
    -- Installing: /usr/local/lib/pkgconfig/opencv.pc
    -- Installing: /usr/local/lib/libcxcore.so.2.1.0
    -- Up-to-date: /usr/local/lib/libcxcore.so.2.1
    -- Up-to-date: /usr/local/lib/libcxcore.so
    -- Installing: /usr/local/include/opencv/cxcore.h
    -- Up-to-date: /usr/local/include/opencv/cxcore.hpp
    -- Up-to-date: /usr/local/include/opencv/cxerror.h
    -- Up-to-date: /usr/local/include/opencv/cxmat.hpp
    -- Up-to-date: /usr/local/include/opencv/cxmisc.h
    -- Up-to-date: /usr/local/include/opencv/cxoperations.hpp
    -- Up-to-date: /usr/local/include/opencv/cxtypes.h
    -- Up-to-date: /usr/local/include/opencv/cvver.h
    -- Up-to-date: /usr/local/include/opencv/cvwimage.h
    -- Up-to-date: /usr/local/include/opencv/cxflann.h
    -- Up-to-date: /usr/local/include/opencv/cvinternal.h
    -- Installing: /usr/local/lib/libcv.so.2.1.0
    -- Up-to-date: /usr/local/lib/libcv.so.2.1
    -- Up-to-date: /usr/local/lib/libcv.so
    -- Removed runtime path from "/usr/local/lib/libcv.so.2.1.0"
    -- Up-to-date: /usr/local/include/opencv/cv.h
    -- Up-to-date: /usr/local/include/opencv/cv.hpp
    -- Up-to-date: /usr/local/include/opencv/cvcompat.h
    -- Up-to-date: /usr/local/include/opencv/cvtypes.h
    -- Installing: /usr/local/lib/libcvaux.so.2.1.0
    -- Up-to-date: /usr/local/lib/libcvaux.so.2.1
    -- Up-to-date: /usr/local/lib/libcvaux.so
    -- Removed runtime path from "/usr/local/lib/libcvaux.so.2.1.0"
    -- Up-to-date: /usr/local/include/opencv/cvaux.h
    -- Up-to-date: /usr/local/include/opencv/cvaux.hpp
    -- Up-to-date: /usr/local/include/opencv/cvvidsurv.hpp
    -- Installing: /usr/local/lib/libml.so.2.1.0
    -- Up-to-date: /usr/local/lib/libml.so.2.1
    -- Up-to-date: /usr/local/lib/libml.so
    -- Removed runtime path from "/usr/local/lib/libml.so.2.1.0"
    -- Up-to-date: /usr/local/include/opencv/ml.h
    -- Installing: /usr/local/lib/libhighgui.so.2.1.0
    -- Up-to-date: /usr/local/lib/libhighgui.so.2.1
    -- Up-to-date: /usr/local/lib/libhighgui.so
    -- Removed runtime path from "/usr/local/lib/libhighgui.so.2.1.0"
    -- Up-to-date: /usr/local/include/opencv/highgui.h
    -- Up-to-date: /usr/local/include/opencv/highgui.hpp
    -- Installing: /usr/local/bin/opencv_haartraining
    -- Removed runtime path from "/usr/local/bin/opencv_haartraining"
    -- Installing: /usr/local/bin/opencv_createsamples
    -- Removed runtime path from "/usr/local/bin/opencv_createsamples"
    -- Installing: /usr/local/bin/opencv_performance
    -- Removed runtime path from "/usr/local/bin/opencv_performance"
    -- Installing: /usr/local/bin/opencv_traincascade
    -- Removed runtime path from "/usr/local/bin/opencv_traincascade"
    -- Up-to-date: /usr/local/share/opencv/doc/index.htm
    -- Up-to-date: /usr/local/share/opencv/doc/ChangeLog.htm
    -- Up-to-date: /usr/local/share/opencv/doc/haartraining.htm
    -- Up-to-date: /usr/local/share/opencv/doc/CMakeLists.txt
    -- Up-to-date: /usr/local/share/opencv/doc/license.txt
    -- Up-to-date: /usr/local/share/opencv/doc/packaging.txt
    -- Up-to-date: /usr/local/share/opencv/doc/README.txt
    -- Up-to-date: /usr/local/share/opencv/doc/opencv.jpg
    -- Up-to-date: /usr/local/share/opencv/doc/opencv-logo.png
    -- Up-to-date: /usr/local/share/opencv/doc/opencv-logo2.png
    -- Up-to-date: /usr/local/share/opencv/doc/opencv.pdf
    -- Up-to-date: /usr/local/share/opencv/doc/pattern.pdf
    -- Up-to-date: /usr/local/share/opencv/doc/papers/camshift.pdf
    -- Up-to-date: /usr/local/share/opencv/doc/papers/algo_tracking.pdf
    -- Up-to-date: /usr/local/share/opencv/doc/papers/avbpa99.ps
    -- Up-to-date: /usr/local/share/opencv/doc/vidsurv/Blob_Tracking_Tests.doc
    -- Up-to-date: /usr/local/share/opencv/doc/vidsurv/TestSeq.doc
    -- Up-to-date: /usr/local/share/opencv/doc/vidsurv/Blob_Tracking_Modules.doc
    -- Up-to-date: /usr/local/share/opencv/haarcascades/haarcascade_frontalface_alt_tree.xml
    -- Up-to-date: /usr/local/share/opencv/haarcascades/haarcascade_eye.xml
    -- Up-to-date: /usr/local/share/opencv/haarcascades/haarcascade_mcs_eyepair_small.xml
    -- Up-to-date: /usr/local/share/opencv/haarcascades/haarcascade_mcs_nose.xml
    -- Up-to-date: /usr/local/share/opencv/haarcascades/haarcascade_mcs_mouth.xml
    -- Up-to-date: /usr/local/share/opencv/haarcascades/haarcascade_mcs_righteye.xml
    -- Up-to-date: /usr/local/share/opencv/haarcascades/haarcascade_lowerbody.xml
    -- Up-to-date: /usr/local/share/opencv/haarcascades/haarcascade_mcs_upperbody.xml
    -- Up-to-date: /usr/local/share/opencv/haarcascades/haarcascade_mcs_eyepair_big.xml
    -- Up-to-date: /usr/local/share/opencv/haarcascades/haarcascade_mcs_lefteye.xml
    -- Up-to-date: /usr/local/share/opencv/haarcascades/haarcascade_frontalface_alt2.xml
    -- Up-to-date: /usr/local/share/opencv/haarcascades/haarcascade_upperbody.xml
    -- Up-to-date: /usr/local/share/opencv/haarcascades/haarcascade_eye_tree_eyeglasses.xml
    -- Up-to-date: /usr/local/share/opencv/haarcascades/haarcascade_lefteye_2splits.xml
    -- Up-to-date: /usr/local/share/opencv/haarcascades/haarcascade_frontalface_default.xml
    -- Up-to-date: /usr/local/share/opencv/haarcascades/haarcascade_frontalface_alt.xml
    -- Up-to-date: /usr/local/share/opencv/haarcascades/haarcascade_fullbody.xml
    -- Up-to-date: /usr/local/share/opencv/haarcascades/haarcascade_profileface.xml
    -- Up-to-date: /usr/local/share/opencv/haarcascades/haarcascade_righteye_2splits.xml
    -- Up-to-date: /usr/local/share/opencv/lbpcascades/lbpcascade_frontalface.xml
    -- Installing: /usr/local/lib/python2.7/site-packages/cv.so
    $:/usr/local/src/OpenCV-2.1.0/Build$ dpkg -s opencv
    Package `opencv' is not installed and no info is available.
    Use dpkg --info (= dpkg-deb --info) to examine archive files,
    and dpkg --contents (= dpkg-deb --contents) to list their contents.
    In a bind here, if I'd known this was going to be such hard work I wouldn't have bothered (it really shouldn't be this complicated, surely?), but on the other hand having spent so much time on it reluctant to abandon it if the solution is just around the corner.
    Last edited by paulemony; May 10th, 2013 at 12:40 PM.

  8. #18
    Join Date
    Apr 2012
    Beans
    7,256

    Re: How to install these programs?

    NOOOO! I meant to execute the rm command INSIDE your /src/headtrack directory - to delete the most recent heatrack executable. Sorry if that wasn't clear.

    I think you *will* be able to get headrack to build HOWEVER it's possible that it won't actually run without the OpenCV components that we had to exclude in order to get *that* to build.

    I'll post back again shortly - just wanted to clear up the confusion about the rm command ASAP

  9. #19
    Join Date
    Apr 2012
    Beans
    7,256

    Re: How to install these programs?

    OK here's a Makefile that should let you build headtrack from a (relative) local build of OpenCV-2.1.0 i.e. WITHOUT actually installing the old OpenCV libraries. It assumes that your local source tree looks like

    Code:
    $ tree -L 1
    .
    ├── headtrack
    ├── nlopt
    ├── OpenCV-2.1.0
    └── optpp
    
    4 directories, 0 files
    i.e. the top level headtrack and OpenCV-2.1.0 directories are untarred side-by-side. I got the headtrack distribution from https://git.gitorious.org/headtrack/headtrack.git , I hope that's the one we're dealing with here (there do seem to be some other possibly newer OpenCV based headtrack projects out there).

    Code:
    CC = gcc
    
    TRGT = headtrack
    
    SRCS = headtrack.c
    
    OBJS = $(SRCS:.c=.o)
    
    INSTDIR = /usr/bin
    
    
    CFLAGS := -std=c99 -Wall -Wextra -msse -msse2 \
        -fomit-frame-pointer -fno-strict-aliasing \
        -I/usr/include/X11 $(shell pkg-config --cflags gtk+-2.0 gthread-2.0)
    
    # to find the regularly-installed OpenCV
    #CFLAGS += $(shell pkg-config --cflags opencv) 
    # to find local version of OpenCV
    CFLAGS += -I../OpenCV-2.1.0/include/opencv
    
    ARCH := $(shell uname -m)
    ifeq ($(ARCH), x86_64)
      CFLAGS += -m64 -mtune=amdfam10 -O3
    else
      CFLAGS += -m32 -O2
    endif
    
    # to find the regularly-installed OpenCV
    #LPATH :=
    # to find local version of OpenCV
    LPATH := -L../OpenCV-2.1.0/Build/lib/
    
    #LIBS := $(shell pkg-config --libs opencv gtk+-2.0 gthread-2.0)
    LIBS := -lml -lcvaux -lhighgui -lcv  -lcxcore \
        $(shell pkg-config --libs gtk+-2.0 gthread-2.0)
    
    $(TRGT): $(OBJS)
        $(CC) $(OBJS) $(LPATH) $(LIBS) -o $@
    
    
    install: $(TRGT)
        cp $(TRGT) $(INSTALLDIR)/$(TRGT)
    
    uninstall: 
        rm -f $(INSTALLDIR)/$(TRGT)
    
    
    clean: 
        rm -f $(OBJS)
    
    cleaner: clean
        rm -f $(TRGT)
    
    cleanest: cleaner
    It worked for me on my 32-bit laptop with 12.04.2; I also got it to build in a 64-bit crunchbang VM although there are a few extra things that need fixing (due, I think, to having gcc-4.7 on that box - rather than the fact that it's 64-bit).

    Since you are not actually installing the OpenCV libraries into your 'system', in order to run the executable you will need to tell the dynamic linker where to find them - just for testing purposes I suggest you do that using LD_LIBRARY_PATH (it's oldskool, dirty, and frowned upon - but I think it's justified in this case) i.e.

    Code:
    steeldriver@alice-vm1:/usr/local/src/headtrack$ LD_LIBRARY_PATH=../OpenCV-2.1.0/Build/lib/ ./headtrack
    headtrack.c: Created socket. Destination = 127.0.0.1:49405!
    Sorry, cannot open camera.
    OpenCV Error: Null pointer (NULL array pointer is passed) in cvGetMat, file /usr/local/src/OpenCV-2.1.0/src/cxcore/cxarray.cpp, line 2376
    terminate called after throwing an instance of 'cv::Exception'
      what():  /usr/local/src/OpenCV-2.1.0/src/cxcore/cxarray.cpp:2376: error: (-27) NULL array pointer is passed in function cvGetMat
    
    Aborted
    steeldriver@alice-vm1:/usr/local/src/headtrack$
    As you can see it is bombing because I don't have any kind of camera / video device. It *may* bomb even *with* a valid camera since we had to exclude the video4linux component to get it to build - see how far you can get and we can review next steps.
    Last edited by steeldriver; May 10th, 2013 at 03:17 PM.

  10. #20
    Join Date
    Jan 2010
    Beans
    103

    Re: How to install these programs?

    Assume you meant remove the duplicate headtrack subfile, but I deleted that already, so carried on, got this far:

    Code:
    paul@paul-desktop:/usr/local/src$ tree -L 1.
    ├── headtrack
    ├── OpenCV-2.1.0
    └── OpenCV-2.1-Readme.txt
    Don't see nlopt or optpp, don't know if that matters. I replaced the Makefile in headtrack with the one you gave me (not sure if that's what I was supposed to do, and if it was what to do next):

    Code:
    paul@paul-desktop:/usr/local/src/headtrack$ makeMakefile:38: *** missing separator. Stop.

Page 2 of 5 FirstFirst 1234 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •