-
Notifications
You must be signed in to change notification settings - Fork 639
Open
Description
The relevant function instance of the header file cv_bridge.h :
`CV_BRIDGE_EXPORT CvImagePtr toCvCopy(
const sensor_msgs::msg::CompressedImage & source,
const std::string & encoding = std::string());
/**
- \brief Convert an immutable sensor_msgs::msg::Image message to an OpenCV-compatible CvImage, sharing
- the image data if possible.
- If the source encoding and desired encoding are the same, the returned CvImage will share
- the image data with \a source without copying it. The returned CvImage cannot be modified, as that
- could modify the \a source data.
- \param source A shared_ptr to a sensor_msgs::msg::Image message
- \param encoding The desired encoding of the image data, one of the following strings:
-
- \c "mono8"
-
- \c "bgr8"
-
- \c "bgra8"
-
- \c "rgb8"
-
- \c "rgba8"
-
- \c "mono16"
- If \a encoding is the empty string (the default), the returned CvImage has the same encoding
- as \a source.`
The comments are misleadingly stating that types like 32FC1 are not allowed. Nonetheless, the implementation does not seem to forbid that, and it would also make little sense to do so.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels