Re: [ros-users] cv_bridge question

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
Delete this message
Reply to this message
Author: User discussions
Date:  
To: User discussions
Subject: Re: [ros-users] cv_bridge question
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;
    cvi.toImageMsg(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
>
> https://code.ros.org/mailman/listinfo/ros-users