Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef _SALIENCYMAPRUDINAC_H_INCLUDED_
00012 #define _SALIENCYMAPRUDINAC_H_INCLUDED_
00013
00014
00015 #include <ros/ros.h>
00016 #include "image_transport/image_transport.h"
00017 #include <cv_bridge/cv_bridge.h>
00018 #include <sensor_msgs/image_encodings.h>
00019 #include <sensor_msgs/fill_image.h>
00020 #include <geometry_msgs/Point.h>
00021
00022
00023 #include "cv.h"
00024 #include "opencv2/highgui/highgui.hpp"
00025
00026 using namespace cv;
00027 using namespace std;
00028 namespace enc = sensor_msgs::image_encodings;
00029
00030 class saliencyMapRudinac
00031 {
00032 protected:
00033 ros::NodeHandle nh_;
00034 ros::Publisher point_pub_;
00035 image_transport::ImageTransport it_;
00036 image_transport::Subscriber image_sub_;
00037 image_transport::Publisher saliencymap_pub_;
00038
00039
00040 public:
00041 saliencyMapRudinac() : nh_("~"), it_(nh_)
00042 {
00043 image_sub_ = it_.subscribe("/rgbimage_in", 1, &saliencyMapRudinac::imageCB, this);
00044 saliencymap_pub_= it_.advertise("/saliency/image", 1);
00045 point_pub_ = nh_.advertise<geometry_msgs::Point>("/saliency/salientpoint", 1);
00046 }
00047
00048 ~saliencyMapRudinac()
00049 {
00050 nh_.shutdown();
00051 }
00052
00053 void imageCB(const sensor_msgs::ImageConstPtr& msg_ptr);
00054 void calculateSaliencyMap(const Mat* src, Mat* dst);
00055
00056 private:
00057 Mat r,g,b,RG,BY,I;
00058 void createChannels(const Mat* src);
00059 void createSaliencyMap(const Mat src, Mat* dst);
00060 };
00061 #endif