Ask Your Question
0

Unable to build face_detector for Electric

asked 2012-03-11 03:02:23 -0600

bajo gravatar image

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 ...
(more)
edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2012-03-14 00:01:58 -0600

nandhini gravatar image

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 <cassert>

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(); }

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Stats

Asked: 2012-03-11 03:02:23 -0600

Seen: 351 times

Last updated: Mar 14 '12