29 ROS_ERROR(
"Face detection topic param does not exist");
43 rapp_platform_ros_communications::FaceDetectionRosSrv::Request& req,
44 rapp_platform_ros_communications::FaceDetectionRosSrv::Response& res)
46 std::vector<unsigned int [4]> history;
50 for(
unsigned int i = 0 ; i < faces.size() ; i++)
56 temp[2] = faces[i].x + faces[i].width;
57 temp[3] = faces[i].y + faces[i].height;
59 bool duplicate =
false;
60 for(
unsigned int j = 0 ; j < history.size() ; j++)
62 if(temp[0] == history[j][0] && temp[1] == history[j][1] &&
63 temp[2] == history[j][2] && temp[3] == history[j][3])
74 geometry_msgs::PointStamped up_left_corner;
75 geometry_msgs::PointStamped down_right_corner;
77 up_left_corner.point.x = temp[0];
78 up_left_corner.point.y = temp[1];
79 down_right_corner.point.x = temp[2];
80 down_right_corner.point.y = temp[3];
82 res.faces_up_left.push_back(up_left_corner);
83 res.faces_down_right.push_back(down_right_corner);
ros::ServiceServer faceDetectionService_
bool faceDetectionCallback(rapp_platform_ros_communications::FaceDetectionRosSrv::Request &req, rapp_platform_ros_communications::FaceDetectionRosSrv::Response &res)
Serves the face detection ROS service callback.
std::vector< cv::Rect > findFaces(std::string file_name, bool fast=false)
Finds faces in an image retrieved from a file URL.
std::string faceDetectionTopic_
FaceDetection(void)
Default constructor.
FaceDetector face_detector_