sensor_msgs::Image to sensor_msgs::ImagePtr
Hi, it might be simple so apologies for this post... but I can't find the solution.
I would like to get the sensor_msgs::Image::Ptr of a sensor_msgs::Image. Basically I would like to do the conversion of a sensor_msgs::Image to an cv IplImage using:
sensor_msgs::CvBridge bridge_;
bridge_.imgMsgToCv
which takes actually
sensor_msgs::Image::ConstPtr
as found in CvBridge.h (diamondback)
IplImage* imgMsgToCv(sensor_msgs::Image::ConstPtr rosimg, std::string desired_encoding = "passthrough")
and hence my failing.
Basically, I would like to do the following:
sensor_msgs::CvBridge bridge_;
sensor_msgs::Image image_msg = <to a sensor_msgs::Image>;
sensor_msgs::Image::Ptr rosimg;
missing statement??
bridge_.imgMsgToCv(rosimg, "bgr8");
Many thanks.