Page 2 of 2

Memory Leaks

Posted: Sun Feb 01, 2015 7:49 pm
by StevenM
The problem is that both versions of OpenCV have memory leaks in very basic functions such as cvtColor(). Running of such a program results in many page faults and memory consumption is increasing. StevenM do you have the same experience?
No, I haven't had this issue with Python, but memory management is a lot more complicated in c++. I've seen this issue pop up for a lot of c++ users, and some furious about it - but it does look like these problems have solutions. OpenCV is used in a lot of serious applications and is updated quite a bit. A memory leak like that should certainly not exist.

Re: Memory Leaks

Posted: Sun Feb 01, 2015 10:31 pm
by Rado1
StevenM wrote:A memory leak like that should certainly not exist.
Hmmm, all C++ source code examples to detect objects I downloaded had identical problems and some of them crashed after some minutes of working. Anyway, I started to debug the dll and to identify memory leaks with VLD tool.

Posted: Mon Feb 02, 2015 2:14 am
by StevenM
Rado1 wrote:
StevenM wrote:A memory leak like that should certainly not exist.
Hmmm, all C++ source code examples to detect objects I downloaded had identical problems and some of them crashed after some minutes of working. Anyway, I started to debug the dll and to identify memory leaks with VLD tool.
crashed in minutes...Oh, thats bad, especially when the code looks fine.

If you haven't already - Do check out the OpenCV Question and Answers too. Someone else should have had a similar or identical problem.

Re: OpenCV for ZGE

Posted: Wed May 04, 2016 7:54 am
by Rado1
Latest updates: I updated the ZgeCV library to have better performance and more straightforward API - it uses pointers (xptr) instead of original integer handles for internal OpenCV objects. It is build on OpenCV 2.4.12, because it produces much smaller DLL than OpenCV 3.1.0. When testing, there are no (or very little ???) memory leaks as previously. It can run for long time without memory allocation problems or crashes. Also I updated all demo projects and added a new one:

[youtube]https://www.youtube.com/watch?v=zmsOj8G7UzQ[/youtube]

Please note that the video was captured during normal daylight when contrast between my hands and the wall behind me was not so big and also only one side of fingers was illuminated. During nights, when there is dark around and my hands are illuminated by lamp, I can achieve much better results and faster hand detection.

You can download DLL and demo projects from here.

Have fun! ... comments are welcome.

Re: OpenCV for ZGE

Posted: Mon May 16, 2016 2:44 am
by StevenM
Thank you! Downloading now. cool demo video - btw.

Re: OpenCV for ZGE

Posted: Mon Aug 07, 2017 6:02 pm
by 13r4nd0m
Nicely done, OpenCV can be a pain to to get up and running on some platforms. The demo's are spot on :D I was wondering if other sources of images besides webcams could be used as input? Ideally, I would like to get some OpenCV functionality to work together with FL Studio/Visualizer. I'm pretty new to working with ZGE and OpenGL so any tips or tricks would be appreciated.

Re: OpenCV for ZGE

Posted: Tue Aug 08, 2017 11:59 am
by Rado1
Hi, any image can be taken as a source to OpenCV; camera/video is the most complex input. Which platform you want to target? And what functionality you would like to achieve with OpenCV? If you are more precise I could maybe help you.

Re: OpenCV for ZGE

Posted: Wed Aug 09, 2017 2:17 am
by 13r4nd0m
Thanks for replying. I'm away from my desktop right now but I will be back with a more specific example.

Re: OpenCV for ZGE

Posted: Thu Aug 10, 2017 5:22 am
by 13r4nd0m
I want to target windows platforms, specifically I want to develop effect plugins for fl studio's zgameeditor visualizer. The facial/object detection functionality found in your demo3 project is exactly what I need. Attached is demo3 but with an additional component called tgtBitmap. Could you show me how to use the tgtBitmap as input instead of the camera?