Here's a snippet from something I just wrote

Mat scratch;  // part of the state of the node -- if the image size stays constant, it will only allocate once

    //PROCESS THE IMAGE
    if (img_bridge_.fromImage(*msg, "bgr8"))
    {
        Mat I = img_bridge_.toIpl();
        I.copyTo(scratch);
. . .
you don't have to deallocate ever (you could ... using scratch.release() but you almost never need to



On Sat, May 22, 2010 at 6:39 PM, chriss lei <lei.chriss@gmail.com> wrote:

Thank you.

I obviously forgot to release the image.

Also, converting cv::Mat into IplImage also worked.

I guess I'll slowly migrate towards using cv::Mat.
--
View this message in context: http://ros-users.122217.n3.nabble.com/cvBridge-opencv-memory-leak-problem-tp837144p837271.html
Sent from the ROS-Users mailing list archive at Nabble.com.

------------------------------------------------------------------------------

_______________________________________________
ros-users mailing list