16 #include <cv_bridge/cv_bridge.h> 19 #include <sensor_msgs/Image.h> 20 #include <sensor_msgs/image_encodings.h> 31 const std_msgs::Header& msg_header, sensor_msgs::Image& left,
32 sensor_msgs::Image& right, stereo_msgs::DisparityImage& disparity)
37 cv_bridge::CvImage img_bridge;
39 CvImage(left.header, sensor_msgs::image_encodings::BGR8, cvImgL);
40 img_bridge.toImageMsg(left);
41 left.encoding =
"bgr8";
42 left.header = msg_header;
49 cv_bridge::CvImage img_bridge2;
51 CvImage(right.header, sensor_msgs::image_encodings::BGR8, cvImgR);
52 img_bridge2.toImageMsg(right);
53 right.encoding =
"bgr8";
54 right.header = msg_header;
62 cv_bridge::CvImage img_bridge3;
63 img_bridge3 = CvImage(
64 disparity.header, sensor_msgs::image_encodings::BGR8, cvImgD);
65 img_bridge3.toImageMsg(disparity.image);
66 disparity.image.encoding =
"bgr8";
67 disparity.image.header = msg_header;
mrpt::img::CImage imageDisparity
Disparity image, only contains a valid image if hasImageDisparity == true.
mrpt::img::CImage imageLeft
Image from the left camera (this image will be ALWAYS present)
cv::Mat & asCvMatRef()
Get a reference to the internal cv::Mat, which can be resized, etc.
size_t getHeight() const override
Returns the height of the image in pixels.
bool hasImageDisparity
Whether imageDisparity actually contains data (Default upon construction: false)
size_t getWidth() const override
Returns the width of the image in pixels.
Observation class for either a pair of left+right or left+disparity images from a stereo camera...
bool toROS(const mrpt::obs::CObservationGPS &obj, const std_msgs::Header &msg_header, sensor_msgs::NavSatFix &msg)
Convert mrpt::obs::CObservationGPS -> sensor_msgs/NavSatFix The user must supply the "msg_header" fie...
ROS message: http://docs.ros.org/api/sensor_msgs/html/msg/NavSatFix.html MRPT message: https://github...
mrpt::img::CImage imageRight
Image from the right camera, only contains a valid image if hasImageRight == true.