[ros-users] cvBridge + opencv memory leak problem

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
Delete this message
Reply to this message
Author: Chriss Lei
Date:  
To: ros-users
Subject: [ros-users] cvBridge + opencv memory leak problem
Hello.

I'm using cvbridge to get camera images and using some opencv functions for
image processing.
However, memory blows up whenever I use opencv functions on IplImages
converted from the imgMsgToCv method.
Using cvCopy, cvCloneImage, cvNormalize, etc... any one of these good' ol
opencv functions on IplImage blows up the memory.

So I referred to stereo view.cpp file in
http://www.ros.org/doc/api/image_view/html/stereo__view_8cpp_source.html#l00340
It seems like the file uses the new cv::Mat_ data structure to perform
operations on images.

Should I always use the new opencv2.1 image data structure( cv::Mat ) if I
want to work on opencv images converted from sensor_msgs::Image ?
Or is there a way to work with the IplImages ?

Thanks.