How to convert ROS image message to OpenCV image array(circle buffer)?

asked 2017-02-14 00:32:52 -0500

Nelson Wu gravatar image

updated 2017-02-14 00:50:04 -0500

We usually use the below code to convert ROS image message to OpenCV image

cv_bridge::CvImagePtr cv_ptr; cv_ptr = cv_bridge::toCvCopy(msg, "bgr8"

I need save ROS image message to a circular buffer for time delay. But I didn't know how coding that converting ROS image message to OpenCV image array(circular buffer). Does anyone help me ?

Thanks

edit retag flag offensive close merge delete

Comments

what do you mean by circular buffer ? let say your image is named "image" if i understand your question you need to convert an image from ros (image.png,or jpg ...) to opencv (image.mat) to use it in a buffer

kesuke gravatar image kesuke  ( 2018-03-27 10:28:45 -0500 )edit