Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Most likely that switch to C++ version will not help. I don't have experience with EMGU, but most likely that they use thin wrappers for OpenCV, that means that C# classes keep everything on the native level and memory footprint of classes doesn't differ significantly. But I may be wrong about their particular implementation...

So, you should investigate why your app is consuming so much memory. I can suggest you the following:

  1. Check how memory consumption changes if you disable Face Detectors one by one, but stay with multiple cameras and other pipeline. May be detectors itself doesn't consume RAM, may be your problem in other parts of application.
  2. Check that you don't do memory (image, matrix) allocations on every iteration. You should preallocate all required buffers and reuse them between iterations. You can also analyze the behaviour of the garbage collector, may be your implementation forces it to continuously delete reallocated memory.
  3. Do not keep copies of color images. Convert them to the grayscale from the very beginning and do all the processing in this format.
  4. You can also try to use smaller resolution as icedecker suggests, but control the quality.
  5. And you can try to use LBP cascade instead of Haar. May be its memory footprint will be smaller.