22 #include <geometry_msgs/Point.h> 25 #include <sensor_msgs/Image.h> 27 #include <std_msgs/Header.h> 31 #include <opencv2/highgui/highgui.hpp> 32 #include <opencv2/imgproc/imgproc.hpp> 33 #include <opencv2/objdetect/objdetect.hpp> 36 #include <darknet_ros_msgs/BoundingBox.h> 37 #include <darknet_ros_msgs/BoundingBoxes.h> 38 #include <darknet_ros_msgs/CheckForObjectsAction.h> 39 #include <darknet_ros_msgs/ObjectCount.h> 43 #include "cublas_v2.h" 44 #include "cuda_runtime.h" 51 #include "cost_layer.h" 52 #include "detection_layer.h" 55 #include "region_layer.h" 64 extern "C" int show_image(image p,
const char* name,
int ms);
70 float x,
y, w, h, prob;
233 void setupNetwork(
char* cfgfile,
char* weightfile,
char* datafile,
float thresh,
char** names,
int classes,
int delay,
char* prefix,
234 int avg_frames,
float hier,
int w,
int h,
int frames,
int fullscreen);
int sizeNetwork(network *net)
Bounding box of the detected object.
image mat_to_image(cv::Mat m)
image_transport::ImageTransport imageTransport_
Advertise and subscribe to image topics.
detection * avgPredictions(network *net, int *nboxes)
boost::shared_mutex mutexImageStatus_
ros::Publisher objectPublisher_
std::vector< std::vector< RosBox_ > > rosBoxes_
Detected objects.
std::shared_ptr< CheckForObjectsActionServer > CheckForObjectsActionServerPtr
bool isCheckingForObjects() const
std_msgs::Header headerBuff_[3]
void cameraCallback(const sensor_msgs::ImageConstPtr &msg)
void * detectLoop(void *ptr)
bool getImageStatus(void)
ros::Publisher detectionImagePublisher_
Publisher of the bounding box image.
bool enableConsoleOutput_
int frameWidth_
Camera related parameters.
boost::shared_mutex mutexImageCallback_
boost::shared_mutex mutexActionStatus_
void setupNetwork(char *cfgfile, char *weightfile, char *datafile, float thresh, char **names, int classes, int delay, char *prefix, int avg_frames, float hier, int w, int h, int frames, int fullscreen)
int numClasses_
Class labels.
void * displayInThread(void *ptr)
cv::Mat image_to_mat(image im)
void checkForObjectsActionPreemptCB()
std::vector< std::string > classLabels_
YoloObjectDetector(ros::NodeHandle nh)
ros::Publisher boundingBoxesPublisher_
void rememberNetwork(network *net)
darknet_ros_msgs::BoundingBoxes boundingBoxesResults_
CheckForObjectsActionServerPtr checkForObjectsActionServer_
Check for objects action server.
int show_image(image p, const char *name, int ms)
void * displayLoop(void *ptr)
ros::NodeHandle nodeHandle_
ROS node handle.
bool publishDetectionImage(const cv::Mat &detectionImage)
image_transport::Subscriber imageSubscriber_
ROS subscriber and publisher.
std_msgs::Header imageHeader_
CvMatWithHeader_ getCvMatWithHeader()
void checkForObjectsActionGoalCB()
boost::shared_mutex mutexNodeStatus_
std::vector< int > rosBoxCounter_