Public Member Functions | Static Public Member Functions
sensor_msgs::CvBridge Class Reference

Old C++ API. Use cv_bridge::CvImage, toCvCopy(), toCvShare() instead. More...

#include <CvBridge.h>

List of all members.

Public Member Functions

bool fromImage (const Image &rosimg, std::string desired_encoding="passthrough")
IplImage * imgMsgToCv (sensor_msgs::Image::ConstPtr rosimg, std::string desired_encoding="passthrough")
IplImage * toIpl ()

Static Public Member Functions

static ROS_DEPRECATED
sensor_msgs::Image::Ptr 
cvToImgMsg (const IplImage *source, std::string encoding="passthrough")
static ROS_DEPRECATED bool fromIpltoRosImage (const IplImage *source, sensor_msgs::Image &dest, std::string encoding="passthrough")

Detailed Description

Old C++ API. Use cv_bridge::CvImage, toCvCopy(), toCvShare() instead.

Definition at line 54 of file CvBridge.h.


Member Function Documentation

static ROS_DEPRECATED sensor_msgs::Image::Ptr sensor_msgs::CvBridge::cvToImgMsg ( const IplImage *  source,
std::string  encoding = "passthrough" 
) [inline, static]

Convert an OpenCV CvArr type (that is, an IplImage or CvMat) to a ROS sensor_msgs::Image message.

Parameters:
sourceAn OpenCV IplImage or CvMat
encodingThe encoding of the image data, one of the following strings:
  • "passthrough"
  • "rgb8"
  • "rgba8"
  • "bgr8"
  • "bgra8"
  • "mono8"
  • "mono16"

If encoding is "passthrough", then the message has the same encoding as the image's OpenCV type. Otherwise encoding must be one of the strings "rgb8", "bgr8", "rgba8", "bgra8", "mono8" or "mono16", in which case the OpenCV image must have the appropriate type:

  • CV_8UC3 (for "rgb8", "bgr8"),
  • CV_8UC4 (for "rgba8", "bgra8"),
  • CV_8UC1 (for "mono8"), or
  • CV_16UC1 (for "mono16")

This function returns a sensor_msgs::Image message on success, or raises CvBridgeException on failure.

Definition at line 405 of file CvBridge.h.

bool sensor_msgs::CvBridge::fromImage ( const Image &  rosimg,
std::string  desired_encoding = "passthrough" 
) [inline]

Converts a ROS Image into an OpenCV IPL Image.

This method will be deprecated and removed in a future release. Use method imgMsgToCv instead.

Parameters:
rosimgThe ROS Image message
desired_encodingimage encoding. See method imgMsgToCv for details.

Definition at line 190 of file CvBridge.h.

static ROS_DEPRECATED bool sensor_msgs::CvBridge::fromIpltoRosImage ( const IplImage *  source,
sensor_msgs::Image &  dest,
std::string  encoding = "passthrough" 
) [inline, static]

Converts an OpenCV IPL Image into a ROS Image that can be sent 'over the wire'.

Parameters:
sourceThe original Ipl Image that we want to copy from
destThe ROS Image message that we want to copy to
encodingimage encoding. See method cvToImgMsg for details.

Definition at line 307 of file CvBridge.h.

IplImage* sensor_msgs::CvBridge::imgMsgToCv ( sensor_msgs::Image::ConstPtr  rosimg,
std::string  desired_encoding = "passthrough" 
) [inline]

Convert a sensor_msgs::Image message to an OpenCV IplImage.

Parameters:
rosimgA sensor_msgs::Image message
desired_encodingThe encoding of the image data, one of the following strings:
  • "passthrough"
  • "rgb8"
  • "rgba8"
  • "bgr8"
  • "bgra8"
  • "mono8"
  • "mono16"

If desired_encoding is "passthrough", then the returned image has the same format as img_msg. Otherwise desired_encoding must be one of the strings "rgb8", "bgr8", "rgba8", "bgra8", "mono8" or "mono16", in which case this method converts the image using cvCvtColor (http://opencv.willowgarage.com/documentation/image_processing.html#cvCvtColor) (if necessary) and the returned image has a type as follows:

  • CV_8UC3 (for "rgb8", "bgr8"),
  • CV_8UC4 (for "rgba8", "bgra8"),
  • CV_8UC1 (for "mono8"), or
  • CV_16UC1 (for "mono16")

This function returns an OpenCV IplImage on success, or raises CvBridgeException on failure.

Definition at line 440 of file CvBridge.h.

IplImage* sensor_msgs::CvBridge::toIpl ( ) [inline]

Returns the OpenCV IPL Image created by method fromImage.

This method will be deprecated and removed in a future release. Use method imgMsgToCv instead.

Definition at line 177 of file CvBridge.h.


The documentation for this class was generated from the following file:


cv_bridge
Author(s): Patrick Mihelich, James Bowman
autogenerated on Sat Dec 28 2013 17:53:16