bgr8 input for RGBDOdometry node

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

bgr8 input for RGBDOdometry node

yanmingz
Hi Mathieu,

When checking the performance difference between standalone version and ros version, I found that the color image input to RGBDOdometry node is converted to grey-level image before the callback function is called.

I read your code, but can't find where the conversion is done or set to be done.

Could you tell me how I can input the color image to the callback function? Thank you very much.

Best regards
Yanming

Reply | Threaded
Open this post in threaded view
|

Re: bgr8 input for RGBDOdometry node

matlabbe
Administrator
Hi Yanming,

In ROS, the conversion is done here:
cv_bridge::CvImageConstPtr ptrImage = cv_bridge::toCvShare(image, image->encoding.compare(sensor_msgs::image_encodings::TYPE_8UC1)==0?"":"mono8");
Visual odometry uses gray-scale images so it is why they are converted to mono8 if they are bgr8 or rgb8. If they are not converted here, they will be in Odometry implementation like in the standalone version (OdometryOpticalFlow here and OdometryBOW indirectly from Memory object used here).

Regards,
Mathieu