OpenCV for ZGE

Use of external libraries (DLLs) from ZGE.

Moderator: Moderators

StevenM
Posts: 149
Joined: Thu Jan 20, 2011 10:03 am

Memory Leaks

Postby StevenM » Sun Feb 01, 2015 7:49 pm

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.

User avatar
Rado1
Posts: 770
Joined: Wed May 05, 2010 12:16 pm

Re: Memory Leaks

Postby Rado1 » Sun Feb 01, 2015 10:31 pm

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.

StevenM
Posts: 149
Joined: Thu Jan 20, 2011 10:03 am

Postby StevenM » Mon Feb 02, 2015 2:14 am

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.

User avatar
Rado1
Posts: 770
Joined: Wed May 05, 2010 12:16 pm

Re: OpenCV for ZGE

Postby Rado1 » Wed May 04, 2016 7:54 am

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:



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.

StevenM
Posts: 149
Joined: Thu Jan 20, 2011 10:03 am

Re: OpenCV for ZGE

Postby StevenM » Mon May 16, 2016 2:44 am

Thank you! Downloading now. cool demo video - btw.

User avatar
13r4nd0m
Posts: 3
Joined: Wed Jul 26, 2017 4:43 pm

Re: OpenCV for ZGE

Postby 13r4nd0m » Mon Aug 07, 2017 6:02 pm

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.

User avatar
Rado1
Posts: 770
Joined: Wed May 05, 2010 12:16 pm

Re: OpenCV for ZGE

Postby Rado1 » Tue Aug 08, 2017 11:59 am

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.

User avatar
13r4nd0m
Posts: 3
Joined: Wed Jul 26, 2017 4:43 pm

Re: OpenCV for ZGE

Postby 13r4nd0m » Wed Aug 09, 2017 2:17 am

Thanks for replying. I'm away from my desktop right now but I will be back with a more specific example.

User avatar
13r4nd0m
Posts: 3
Joined: Wed Jul 26, 2017 4:43 pm

Re: OpenCV for ZGE

Postby 13r4nd0m » Thu Aug 10, 2017 5:22 am

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?
Attachments
demo3bitmapExample.zgeproj
(311.71 KiB) Downloaded 91 times


Return to “Extensions”

Who is online

Users browsing this forum: No registered users and 1 guest