Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Pointer image multi-channel access

Using that simple program how can I access to different channels:

void imageCallback(const sensor_msgs::ImageConstPtr& msg)
    {

        cv_bridge::CvImagePtr cv_ptr;
        try
        {
            cv_ptr = cv_bridge::toCvCopy(msg, sensor_msgs::image_encodings::BGR8);
        }

        catch (cv_bridge::Exception& e)
        {
            ROS_ERROR("cv_bridge exception: %s", e.what());
            return;
        }


        cv::imshow("OpenCV viewer uEye RGB", cv_ptr->image);
        cv::waitKey(3);

    }

How can I access to different channel using cv_ptr ?