chili-epfl / attention-tracker

136 stars 97 forks source link

installation on Ubuntu 16.04 and ROS kinetic #14

Closed alexis-jacq closed 8 years ago

alexis-jacq commented 8 years ago

Whatever the version of OpenCV I use (I tried 2.4.9 and 2.4.13) I obtain this error of compilation:

/home/alexis/catkin_ws/src/attention-tracker/src/head_pose_estimation.cpp: In member function ‘head_pose HeadPoseEstimation::pose(size_t) const’: /home/alexis/catkin_ws/src/attention-tracker/src/head_pose_estimation.cpp:152:13: error: ‘ITERATIVE’ is not a member of ‘cv’ cv::ITERATIVE);

If I change the parameter cv::ITERATIVE by CV_ITERATIVE in the call of solvePnP in head_pose_estimation.cpp it solves this issue.

Then, it is head_pose_estimation_test.cpp that throw errors of compilation:

CMakeFiles/head_pose_test.dir/samples/head_pose_estimation_test.cpp.o: In function `main':

head_pose_estimation_test.cpp:(.text.startup+0x15d): undefined reference to cv::String::allocate(unsigned long)' head_pose_estimation_test.cpp:(.text.startup+0x177): undefined reference tocv::namedWindow(cv::String const&, int)' head_pose_estimation_test.cpp:(.text.startup+0x17f): undefined reference to cv::String::deallocate()' head_pose_estimation_test.cpp:(.text.startup+0x59d): undefined reference tocv::String::allocate(unsigned long)' head_pose_estimation_test.cpp:(.text.startup+0x5b7): undefined reference to cv::imshow(cv::String const&, cv::_InputArray const&)' head_pose_estimation_test.cpp:(.text.startup+0x5bf): undefined reference tocv::String::deallocate()' head_pose_estimation_test.cpp:(.text.startup+0x750): undefined reference to cv::String::deallocate()' head_pose_estimation_test.cpp:(.text.startup+0x764): undefined reference tocv::String::deallocate()' /home/alexis/catkin_ws/devel/lib/libhead_pose_estimation.so: undefined reference to `cv::line(cv::InputOutputArray const&, cv::Point, cv::Point, cv::Scalar const&, int, int, int)'

/home/alexis/catkin_ws/devel/lib/libhead_pose_estimation.so: undefined reference to _IplImage::_IplImage(cv::Mat const&)' /home/alexis/catkin_ws/devel/lib/libhead_pose_estimation.so: undefined reference tocv::error(int, cv::String const&, char const, char const, int)' /home/alexis/catkin_ws/devel/lib/libhead_pose_estimation.so: undefined reference to cv::putText(cv::_InputOutputArray const&, cv::String const&, cv::Point_<int>, int, double, cv::Scalar_<double>, int, int, bool)' /home/alexis/catkin_ws/devel/lib/libhead_pose_estimation.so: undefined reference tocv::circle(cv::InputOutputArray const&, cv::Point, int, cv::Scalar_ const&, int, int, int)' /home/alexis/catkin_ws/devel/lib/libhead_pose_estimation.so: undefined reference to `cv::InputArray::getMat(int) const'

if I add a line in the CMakeliste to show the OpenCV libraries used I have:

-- OpenCV version: 2.4.9.1 -- OpenCV libraries: opencv_core;opencv_imgproc;opencv_calib3d;opencv_highgui

alexis-jacq commented 8 years ago

And Finally, if I compile without tests I can install everything but when I launch the ROS nodes I have this error as soon as a face is detected:

[head_pose_estimation-10] process has died [pid 10442, exit code -11, cmd /home/alexis/catkin_ws/devel/lib/attention_tracker/estimate /image:=/camera/image_raw name:=head_pose_estimation log:=/home/alexis/.ros/log/d9cc30ca-4356-11e6-8136-68f72846768a/head_pose_estimation-10.log]. log file: /home/alexis/.ros/log/d9cc30ca-4356-11e6-8136-68f72846768a/head_pose_estimation-10*.log

alexis-jacq commented 8 years ago

Ok problem solved if I use only OpenCV3.

I've just modified ros_head_pose_estimator.hpp and CMakelist.txt to also build the ROS nodes under OpenCV3.