class CvBridge(object):
The CvBridge is an object that converts between OpenCV Images and ROS Image messages.
Method | __init__ |
Undocumented |
Method | compressed |
Convert a sensor_msgs::CompressedImage message to an OpenCV :cpp:type:`cv::Mat`. |
Method | cv2 |
Convert an OpenCV :cpp:type:`cv::Mat` type to a ROS sensor_msgs::CompressedImage message. |
Method | cv2 |
Convert an OpenCV :cpp:type:`cv::Mat` type to a ROS sensor_msgs::Image message. |
Method | cvtype2 |
Undocumented |
Method | dtype |
Undocumented |
Method | encoding |
Undocumented |
Method | encoding |
Undocumented |
Method | imgmsg |
Convert a sensor_msgs::Image message to an OpenCV :cpp:type:`cv::Mat`. |
Instance Variable | cvdepth |
Undocumented |
Instance Variable | cvtype |
Undocumented |
Instance Variable | numpy |
Undocumented |
Convert a sensor_msgs::CompressedImage message to an OpenCV :cpp:type:`cv::Mat`.
If desired_encoding is "passthrough", then the returned image has the same format as img_msg. Otherwise desired_encoding must be one of the standard image encodings
This function returns an OpenCV :cpp:type:`cv::Mat` message on success, or raises cv_bridge.CvBridgeError
on failure.
If the image only has one channel, the shape has size 2 (width and height)
Parameters | |
cmprs | A :cpp:type:`sensor_msgs::CompressedImage` message |
desired | The encoding of the image data, one of the following strings:
|
Returns | |
:cpp:type:`cv::Mat` | Undocumented |
Raises | |
CvBridgeError | when conversion is not possible. |
Convert an OpenCV :cpp:type:`cv::Mat` type to a ROS sensor_msgs::CompressedImage message.
This function returns a sensor_msgs::Image message on success, or raises cv_bridge.CvBridgeError
on failure.
Parameters | |
cvim | An OpenCV :cpp:type:`cv::Mat` |
dst | The format of the image data, one of the following strings:
|
Returns | |
A sensor_msgs.msg.CompressedImage message | Undocumented |
Raises | |
CvBridgeError | when the cvim has a type that is incompatible with format |
Convert an OpenCV :cpp:type:`cv::Mat` type to a ROS sensor_msgs::Image message.
If encoding is "passthrough", then the message has the same encoding as the image's OpenCV type. Otherwise desired_encoding must be one of the standard image encodings
This function returns a sensor_msgs::Image message on success, or raises cv_bridge.CvBridgeError
on failure.
Parameters | |
cvim | An OpenCV :cpp:type:`cv::Mat` |
encoding | The encoding of the image data, one of the following strings:
|
header | A std_msgs.msg.Header message |
Returns | |
A sensor_msgs.msg.Image message | Undocumented |
Raises | |
CvBridgeError | when the cvim has a type that is incompatible with encoding |
Convert a sensor_msgs::Image message to an OpenCV :cpp:type:`cv::Mat`.
If desired_encoding is "passthrough", then the returned image has the same format as img_msg. Otherwise desired_encoding must be one of the standard image encodings
This function returns an OpenCV :cpp:type:`cv::Mat` message on success, or raises cv_bridge.CvBridgeError
on failure.
If the image only has one channel, the shape has size 2 (width and height)
Parameters | |
img | A :cpp:type:`sensor_msgs::Image` message |
desired | The encoding of the image data, one of the following strings:
|
Returns | |
:cpp:type:`cv::Mat` | Undocumented |
Raises | |
CvBridgeError | when conversion is not possible. |