0
$\begingroup$

Rosanswers logo

Hi,

I'm trying to build face_detector from https://code.ros.org/svn/wg-ros-pkg/stacks/people/trunk/face_detector but it fails with the following error.

In file included from /opt/ros/electric/stacks/face_detector/src/face_detection.cpp:55:0:
/opt/ros/electric/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h: In statischer Elementfunktion »static sensor_msgs::Image_<std::allocator<void> >::Ptr sensor_msgs::CvBridge::cvToImgMsg(const IplImage*, std::string)«:
/opt/ros/electric/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:408:55: Warnung: »static bool sensor_msgs::CvBridge::fromIpltoRosImage(const IplImage*, sensor_msgs::Image&, std::string)« ist veraltet (deklariert bei /opt/ros/electric/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:307) [-Wdeprecated-declarations]
/opt/ros/electric/stacks/face_detector/src/face_detection.cpp: In Konstruktor  »people::FaceDetector::FaceDetector(std::string)«:
/opt/ros/electric/stacks/face_detector/src/face_detection.cpp:151:16: Warnung: »sensor_msgs::CvBridge::CvBridge()« ist veraltet (deklariert bei /opt/ros/electric/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:64) [-Wdeprecated-declarations]
/opt/ros/electric/stacks/face_detector/src/face_detection.cpp:151:16: Warnung: »sensor_msgs::CvBridge::CvBridge()« ist veraltet (deklariert bei /opt/ros/electric/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:64) [-Wdeprecated-declarations]
/opt/ros/electric/stacks/face_detector/src/face_detection.cpp:151:16: Warnung: »actionlib::SimpleActionServer<ActionSpec>::SimpleActionServer(ros::NodeHandle, std::string, actionlib::SimpleActionServer<ActionSpec>::ExecuteCallback) [with ActionSpec = face_detector::FaceDetectorAction_<std::allocator<void> >, std::string = std::basic_string<char>, actionlib::SimpleActionServer<ActionSpec>::ExecuteCallback = boost::function<void(const boost::shared_ptr<const face_detector::FaceDetectorGoal_<std::allocator<void> > >&)>, typename ActionSpec::_action_goal_type::_goal_type = face_detector::FaceDetectorGoal_<std::allocator<void> >]« ist veraltet (deklariert bei /opt/ros/electric/stacks/common/actionlib/include/actionlib/server/simple_action_server_imp.h:123) [-Wdeprecated-declarations]
[100%] Building CXX object CMakeFiles/face_detector.dir/src/faces.o
/opt/ros/electric/stacks/face_detector/src/faces.cpp: In Konstruktor »people::Faces::Faces()«:
/opt/ros/electric/stacks/face_detector/src/faces.cpp:48:18: Warnung: Übergabe von NULL an Nicht-Zeiger-Argument 1 von »std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>::size_type, const value_type&, const allocator_type&) [with _Tp = people::Face, _Alloc = std::allocator<people::Face>, std::vector<_Tp, _Alloc>::size_type = long unsigned int, std::vector<_Tp, _Alloc>::value_type = people::Face, std::vector<_Tp, _Alloc>::allocator_type = std::allocator<people::Face>]« [-Wconversion-null]
/opt/ros/electric/stacks/face_detector/src/faces.cpp: In Elementfunktion »void people::Faces::faceDetectionThread(uint)«:
/opt/ros/electric/stacks/face_detector/src/faces.cpp:154:52: Warnung: »void image_geometry::PinholeCameraModel::project3dToPixel(const Point3d&, cv::Point2d&) const« ist veraltet (deklariert bei /opt/ros/electric/stacks/vision_opencv/image_geometry/include/image_geometry/pinhole_camera_model.h:86) [-Wdeprecated-declarations]
/opt/ros/electric/stacks/face_detector/src/faces.cpp:155:52: Warnung: »void image_geometry::PinholeCameraModel::project3dToPixel(const Point3d&, cv::Point2d&) const« ist veraltet (deklariert bei /opt/ros/electric/stacks/vision_opencv/image_geometry/include/image_geometry/pinhole_camera_model.h:86) [-Wdeprecated-declarations]
Linking CXX executable ../bin/face_detector
/usr/bin/ld: CMakeFiles/face_detector.dir/src/face_detection.o: undefined reference to symbol 'boost::system::system_category()'
/usr/bin/ld: note: 'boost::system::system_category()' is defined in DSO /usr/lib/libboost_system.so.1.46.1 so try adding it to the linker command line
/usr/lib/libboost_system.so.1.46.1: could not read symbols: Invalid operation
collect2: ld gab 1 als Ende-Status zurück
make[3]: *** [../bin/face_detector] Fehler 1
make[3]: Verlasse Verzeichnis '/opt/ros/electric/stacks/face_detector/build'
make[2]: *** [CMakeFiles/face_detector.dir/all] Fehler 2
make[2]: Verlasse Verzeichnis '/opt/ros/electric/stacks/face_detector/build'
make[1]: *** [all] Fehler 2
make[1]: Verlasse Verzeichnis '/opt/ros/electric/stacks/face_detector/build'

My setup is:

Ubuntu 11.10 (64bit)
Kernel: 3.0.0-16-generic
GCC: gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1

Any help is appreciated.

Thank you. Markus


Originally posted by bajo on ROS Answers with karma: 206 on 2012-03-11

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

instead, create ur own package with the source code below #include <ros/ros.h> #include <opencv/cv.h> #include <opencv/highgui.h> #include <opencv/cvaux.h> #include <image_transport/image_transport.h> #include <cv_bridge/CvBridge.h> #include CvHaarClassifierCascade *cascade; CvMemStorage *storage;

int detectFaces( IplImage *img );

void imageCallback(const sensor_msgs::ImageConstPtr& msg) { sensor_msgs::CvBridge bridge;

IplImage *src ;

try { src = bridge.imgMsgToCv(msg, "bgr8"); } catch (sensor_msgs::CvBridgeException& e) { ROS_ERROR("Could not convert from '%s' to 'bgr8'.", msg->encoding.c_str()); }

if(src) {

    CvCapture *capture;
char      *filename = "/home/haarcascade_frontalface_alt.xml";
cascade = ( CvHaarClassifierCascade* )cvLoad( filename, 0, 0, 0 );
storage = cvCreateMemStorage( 0 );
//assert( cascade );

cvNamedWindow( "video", 1 );
 src->origin = 0;

    detectFaces( src );

    cvWaitKey(1);

} } int detectFaces( IplImage* img )
{

int i;

CvSeq *faces = cvHaarDetectObjects(img,cascade,storage,1.1,3,0 /*CV_HAAR_DO_CANNY_PRUNNING*/,
cvSize( 40, 40 ) );

for( i = 0 ; i < ( faces ? faces->total : 0 ) ; i++ ) 
{
    CvRect *r = ( CvRect* )cvGetSeqElem( faces, i );
    cvRectangle( img,cvPoint( r->x, r->y ),cvPoint( r->x + r->width, r->y + r->height ),                                                                                   CV_RGB( 255, 0, 0 ), 1, 8, 0 );
}

cvShowImage( "video", img );
    return 1;

}

int main(int argc, char **argv) { ros::init(argc, argv, "video"); ros::NodeHandle nh; cvStartWindowThread(); image_transport::ImageTransport it(nh); image_transport::Subscriber sub = it.subscribe("camera/image_raw", 1, imageCallback); ros::spin(); }


Originally posted by nandhini with karma: 46 on 2012-03-14

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.