image_transport usage

asked 2014-06-27 04:22:44 -0600

ROSkinect gravatar image

updated 2014-06-27 07:14:42 -0600

Hi there I'm using this callback function to subscribe to a topic

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

        cv_bridge::CvImagePtr cv_ptr2;

        try
        {
            cv_ptr2 = cv_bridge::toCvCopy(msg2, sensor_msgs::image_encodings::MONO8);
        }

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


        cv::imshow("OpenCV viewer ", cv_ptr2->image);

        cv::waitKey(3);

    }

My question is how can I do that using image_transport ?

edit retag flag offensive close merge delete

Comments

1

Image transport is only within ROS. After this import step you can use it.

davinci gravatar image davinci  ( 2014-06-28 10:52:04 -0600 )edit