Re: [ros-users] cvBridge + opencv memory leak problem

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Suat Gedikli
Date:  
To: ros-users
Subject: Re: [ros-users] cvBridge + opencv memory leak problem
Hi,

but what about the iplimage "test" which you are creating within your
callback funtion but dont releas ?

Suat

Am Samstag, den 22.05.2010, 16:54 -0700 schrieb chriss lei:
> Hello Radu,
>
> I'm well aware of using cvReleaseImage..
> Memory leak happens even if I use a single function on IplImage converted
> from sensor_msgs.
> Here's my callback function to illustrate. Usage of cvCopy here introduces
> memory blowup problem.
>
> void callback(const sensor_msgs::CameraInfo::ConstPtr& info,
>                 const sensor_msgs::ImageConstPtr& left,
>                 const stereo_msgs::DisparityImageConstPtr& disparity_msg)
>     {

>     
>         im_left = left_bridge.imgMsgToCv(left, "passthrough");

>
>         disp_bridge.fromImage(disparity_msg->image, "passthrough");
>         dispImg = disp_bridge.toIpl();    

>         
>         cvShowImage("left", im_left);

>
>         IplImage* test = NULL;
>         test = cvCreateImage(cvGetSize(dispImg), dispImg->depth, 1);
>         cvCopy(dispImg, test);
>         cvShowImage("disp", test);
>        }

>
> Also, I'm not supposed to deallocate any IplImages that are converted from
> sensor_msgs as described in cvBridge tutorial.
> Is there a way to use opencv functions on IplImages and not use cv::Mat ?
>