[ros-users] cv_bridge question

Kevin Walchko kevin.walchko at gmail.com
Tue Sep 20 23:26:01 UTC 2011

Well I don't know how to do cv::Mat_<cv::Vec3d> but this is what I do for a regular cv::Mat.

  cv::Mat cv_image;	// image from camera
  cv_bridge::CvImage cvi;
  ros::Time time = ros::Time::now();		

        // convert OpenCV image to ROS message
        cv_bridge::CvImage cvi;			
        cvi.header.stamp = time;
        cvi.header.frame_id = "camera";
        cvi.encoding = "bgr8";
        cvi.image = cv_image;

    sensor_msgs::Image im;

On Sep 20, 2011, at 10:44 AM, Aditya Gadre wrote:

> Hi all,
> I am new to ROS/OpenCV and have a question about using cv_bridge. What would be the correct encoding to use for cv::Mat_<cv::Vec3d> matrix type.
> Thank you,
> - Aditya
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20110920/bbb1edb7/attachment-0004.html>

More information about the ros-users mailing list