29 ROS_ERROR(
"Human detection topic param does not exist");
43 rapp_platform_ros_communications::HumanDetectionRosSrv::Request& req,
44 rapp_platform_ros_communications::HumanDetectionRosSrv::Response& res)
46 std::vector<unsigned int [4]> history;
48 for(
unsigned int i = 0 ; i < humans.size() ; i++)
52 temp[0] = humans[i].x;
53 temp[1] = humans[i].y;
54 temp[2] = humans[i].x + humans[i].width;
55 temp[3] = humans[i].y + humans[i].height;
57 bool duplicate =
false;
58 for(
unsigned int j = 0 ; j < history.size() ; j++)
60 if(temp[0] == history[j][0] && temp[1] == history[j][1] &&
61 temp[2] == history[j][2] && temp[3] == history[j][3])
72 geometry_msgs::PointStamped up_left_corner;
73 geometry_msgs::PointStamped down_right_corner;
75 up_left_corner.point.x = temp[0];
76 up_left_corner.point.y = temp[1];
77 down_right_corner.point.x = temp[2];
78 down_right_corner.point.y = temp[3];
81 res.humans_up_left.push_back(up_left_corner);
82 res.humans_down_right.push_back(down_right_corner);
std::vector< cv::Rect > findHuman2D(std::string file_name)
Finds humans in an image retrieved from a file URL.
HumanDetector human_detector_
HumanDetection(void)
Default constructor.
bool humanDetectionCallback(rapp_platform_ros_communications::HumanDetectionRosSrv::Request &req, rapp_platform_ros_communications::HumanDetectionRosSrv::Response &res)
Serves the human detection ROS service callback.
std::string humanDetectionTopic_
ros::ServiceServer humanDetectionService_