-
@Tariq-Abuhashim commented on Fri Jun 24 2016 IplImage* cvImageL allocates the memory, and cvReleaseImage( &cvImageL ) is supposed to release it. Looks like it only deletes the pointer, but not the physical memory allocated. ==8172== LEAK SUMMARY: Any ideas on how to empty the allocated memory ? @pattacini commented on Fri Jun 24 2016 It seems unrelated to |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Therefore, look up the |
Beta Was this translation helpful? Give feedback.
-
It seems strange that BTW: the way I have found most convenient to pass a YARP Image to OpenCV is by creating a Mat object and initialize it from a IplImage pointer, i.e.: ImageOf<PixelRgb> image;
// fill image content
Mat image_cv((IplImage *)image.getIplImage());
// now image_cv can be used in opencv In my understanding this is quite efficient because You just have to be careful because Is there any better method? @vtikha |
Beta Was this translation helpful? Give feedback.
-
Don't know about the leak, but just a small side comment on YARP + OpenCV. I basically use the same approach as @lornat75, with the addition of cvarrToMat to make the code portable between OpenCV 2 and 3: Mat image_cv;
image_cv = cvarrToMat(static_cast<IplImage*>(image_yarp->getIplImage())); |
Beta Was this translation helpful? Give feedback.
-
...and of course C++ style casts... I am getting old 👴 |
Beta Was this translation helpful? Give feedback.
Hi @Tariq-Abuhashim
cvReleaseImage
should actually free up the memory, if I'm not mistaken.However, I'd warmly recommend you to rely on the C++ layer of OpenCV, thus replacing the use of
*IplImage
withMat
.Therefore, look up the
imread
method, which should basically do whatcvLoadImage
is used to.