22 #include <opencv/highgui.h> 25 #include <sensor_msgs/Image.h> 28 #include <mrpt/version.h> 29 #if MRPT_VERSION>=0x199 30 using namespace mrpt::img;
43 namespace stereo_image
55 sensor_msgs::Image &left, sensor_msgs::Image &right,
56 stereo_msgs::DisparityImage &disparity)
60 CImage temp_img = obj.imageLeft;
61 Mat cvImg = cv::cvarrToMat(temp_img.getAs<IplImage>());
65 left.encoding =
"bgr8";
66 left.header = msg_header;
67 left.height = (int) obj.imageLeft.getHeight();
68 left.width = (int) obj.imageRight.getWidth();
71 CImage temp_img2 = obj.imageRight;
72 Mat cvImg2 = cv::cvarrToMat(temp_img2.getAs<IplImage>());
76 right.encoding =
"bgr8";
77 right.header = msg_header;
78 right.height = (int) obj.imageLeft.getHeight();
79 right.width = (int) obj.imageRight.getWidth();
81 if(obj.hasImageDisparity)
83 CImage temp_disp = obj.imageDisparity;
84 Mat cvImg3 = cv::cvarrToMat(temp_disp.getAs<IplImage>());
88 disparity.image.encoding =
"bgr8";
89 disparity.image.header = msg_header;
90 disparity.image.height = (int) obj.imageDisparity.getHeight();
91 disparity.image.width = (int) obj.imageDisparity.getWidth();
bool mrpt2ros(const CObservationGPS &obj, const std_msgs::Header &msg_header, sensor_msgs::NavSatFix &msg)
File includes methods for converting CNetworkOfPoses*DInf <=> NetworkOfPoses message types...
sensor_msgs::ImagePtr toImageMsg() const