ofxFaceTracker Ubuntu

I can’t get ofxFaceTracker to run on Ubuntu 12.04 64-bit, these are some of the errors I get:

obj/x86_64Debug/addons/ofxCv/libs/ofxCv/src/Helpers.o: In function ofxCv::makeMatrix(cv::Mat, cv::Mat)': /home/numessanguis/of_v0.8.4_linux64_release/addons/ofxFaceTracker/FaceOSC/../../../addons/ofxCv/libs/ofxCv/src/Helpers.cpp:13: undefined reference tocv::Rodrigues(cv::_InputArray const&, cv::_OutputArray const&, cv::_OutputArray const&)’

/home/numessanguis/of_v0.8.4_linux64_release/libs/openFrameworksCompiled/project/…/…/…/libs/openFrameworks/video/ofGstVideoGrabber.cpp:66: undefined reference to `udev_new’

/home/numessanguis/of_v0.8.4_linux64_release/libs/openFrameworksCompiled/project/…/…/…/libs/openFrameworks/video/ofGstVideoGrabber.cpp:189: undefined reference to `gst_structure_get_value’

These are the steps I took:

  1. Get of_v0.8.4_linux64_release
  2. Get ofxFaceTracker from github and put this in the addon folder
  3. sudo ./install_dependencies.sh, sudo ./install_codecs.sh, ./compileOF.sh (no problems)
  4. Install latest CodeBlocks for Ubuntu 12.04 through ppa:damien-moore/codeblocks
  5. Adjust config.make
  6. Open FaceOSC-linux.cbp with CodeBlocks
  7. ‘Build’ in CodeBlocks

Probably the problem
I think that I’m lacking something in my config.make file or it may be something else.
This is my make file:

# add custom variables to this file

# OF_ROOT allows to move projects outside apps/* just set this variable to the
# absoulte path to the OF root folder

OF_ROOT = ../../..


# USER_CFLAGS allows to pass custom flags to the compiler
# for example search paths like:
# USER_CFLAGS = -I src/objects

USER_CFLAGS = -I/opt/ros/hydro/include/opencv -I/opt/ros/hydro/include -I/opt/ros/hydro/include/opencv2


# USER_LDFLAGS allows to pass custom flags to the linker
# for example libraries like:
# USER_LD_FLAGS = libs/libawesomelib.a

USER_LDFLAGS =


# use this to add system libraries for example:
# USER_LIBS = -lpango

USER_LIBS = -L/opt/ros/hydro/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_flann -lopencv_legacy -lopencv_ml -lopencv_objdetect -lopencv_ts -lopencv_video


# change this to add different compiler optimizations to your project

USER_COMPILER_OPTIMIZATION = -march=native -mtune=native -Os


EXCLUDE_FROM_SOURCE="bin,.xcodeproj,obj,.git"

I would really like to get this addon to work, so help is greatly appreciated :smile:
NumesSanguis

It looks like your gstreamer components are out of date or your dependencies are not met. Ubuntu 12 is a bit out of date at this point – is there a chance you could use Ubuntu 14+?

Unfortunately I’m working with ROS (Robot Architecture) and our modules are not yet for Ubuntu, so for now I’m stuck with Ubuntu 12.04. I can look up how I can manual update gstreamer, but I think for the problem is that in my config.make file I don’t properly point to the packages. However I don’t know what I have to put by:
USER_CFLAGS =
USER_LDFLAGS =
USER_LIBS =
(Sorry I’m new to this)

You shouldn’t need to modify anything in config.make in this case. This seems to be a problem compiler 0.8.4 on Ubuntu 12 –

Just one quick check – did you run the install_dependencies.sh scriptp per the install guide? Also, you might want to run it again to make sure everything is up to date. If that doesn’t work, I’ll have to defer to @arturoc to see if he has any ideas.

I ran it again (following the guide), but nothing has been upgraded/installed, still same error.

Actually I already modified it, 'USER_CFLAGS = ’ was initially empty and adding OpenCV solved already some issues. Also adding '‘USER_CFLAGS = -I/usr/include/GL’, ‘USER_LIBS = -lGLEW’ solved some undefined references.

Thank you for your help though! Guess I’m waiting for @arturo then :stuck_out_tongue:

i think the makefiles in that addon examples are not up to date. try to recreate them with the project generator or just copy the Makefile and config.make from scripts/linux/templates

If you can run the openframeworks examples
you should be good to go
Download OfxFacetracker
Download OfxCV
Copy them into the addon folder
Lauch Project generator. add ofxfracetracker, ofxopenCV, and ofxCv.
Just did with a fresh installed ubuntu and it worked.

hope it helps

Thank you arturo and peko, this probably solved the problem I had. A new project runs without errors.

However now I transfered the files (config.make, MakeFile, main.cpp + ofApp.cpp + ofApp.h --> src, added libs folder to bin) into the FaceOSC folder of ofxFaceTracker.
I have another problem now when running FaceOSC-linux.cbp. I get this error:
obj/linux64/Debug/src/testApp.o: In function ~Mat': /opt/ros/hydro/include/opencv2/core/mat.hpp:278: undefined reference tocv::fastFree(void*)’

I have to mention that I didn’t instal OpenCv normally, but it was included in ROS, so my path is different. However this should be okay if I include the right path. So my guess is I have to include the following somewhere:
-L/opt/ros/hydro/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_flann -lopencv_legacy -lopencv_ml -lopencv_objdetect -lopencv_ts -lopencv_video

However where do I put this?
If something else is the problem I can try to normally install OpenCv, but I would prefer to only have it once installed.

just add them in config.make as PLATFORM_LDFLAGS

I almost fixed all errors with this:

PROJECT_LDFLAGS=-Wl,-rpath=./libs -L/opt/ros/hydro/lib -lopencv_calib3d -lopencv_contrib  -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_gpu -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_nonfree -lopencv_objdetect -lopencv_ocl -lopencv_photo -lopencv_stitching -lopencv_superres -lopencv_ts -lopencv_video -lopencv_videostab

The only 2 remaining errors are:

 ../../../addons/obj/linux64/Debug/ofxCv/libs/ofxCv/src/Flow.o: In function `ofxCv::FlowPyrLK::calcFlow(cv::Mat, cv::Mat)':
/home/numessanguis/of_v0.8.4_linux64_release/apps/myApps/ofxFaceTracker2/../../../addons/ofxCv/libs/ofxCv/src/Flow.cpp:132: undefined reference to `cv::calcOpticalFlowPyrLK(cv::_InputArray const&, cv::_InputArray const&, cv::_InputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, cv::Size_<int>, int, cv::TermCriteria, double, int, double)'
../../../addons/obj/linux64/Debug/ofxCv/libs/ofxCv/src/Calibration.o: In function `ofxCv::Calibration::calibrate()':
/home/numessanguis/of_v0.8.4_linux64_release/apps/myApps/ofxFaceTracker2/../../../addons/ofxCv/libs/ofxCv/src/Calibration.cpp:241: undefined reference to `cv::calibrateCamera(cv::_InputArray const&, cv::_InputArray const&, cv::Size_<int>, cv::_OutputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, int)'

And I think the cause is either I have to add some other lib to PROJECT_LDFLAGS= or I my OpenCv version is slightly different (2.4.9 included in ROS Hydro)
I report back if I can solve it.

you should be including the paths to the opencv headers in the include search paths in PROJECT_CFLAGS. if you haven’t done that and it’s compiling probably you have a different version of opencv installed in the system and it’s getting the headers from there and the libraries from ros

I forgot to mention that I put this by CFLAGS:
PROJECT_CFLAGS = -I/opt/ros/hydro/include/opencv -I/opt/ros/hydro/include -I/opt/ros/hydro/include/opencv2

Is this enough?