Is CvImagePtr invariable?

asked 2019-08-20 04:44:14 -0500

TheBee gravatar image

updated 2019-08-20 05:07:57 -0500

I am using toCvCopy to work with my camera data. Basically i am writing a small camera adapter which subscribes to the camera and stores the sensor_msgs::ImageConstPtr with toCVCopy. The adapter shares the CvImagePtr when the GetImagePtr() function is called. A friend of mine pointed out that using the CvImagePtr is risky because the data the pointer is pointing to could change when new camera data has been recieved, which is why I should store and share the image data differently (for example storing the whole image data myself).

Now I am wondering if this is true. What is the best way to store and share image data (performance-wise)?

Thanks a lot!

edit retag flag offensive close merge delete

Comments

Can you clarify whether this is a ROS-related question? OpenCV may be used with ROS, but this is not an OpenCV support forum.

gvdhoorn gravatar image gvdhoorn  ( 2019-08-20 04:56:29 -0500 )edit

Well i am using it with ROS so i thought it might be better here as some other people might wonder the same (i tried googling but couldnt find anything). I see that its not really ROS specific, i´ll ask on a different forum if its against the rules.

TheBee gravatar image TheBee  ( 2019-08-20 05:05:46 -0500 )edit

It's not necessarily completely "against the rules", but there may be a forum where you'd get an answer sooner.

gvdhoorn gravatar image gvdhoorn  ( 2019-08-20 06:55:26 -0500 )edit