0

I am using EmguCV's CascadeClassifier to detect faces in an image using DetectMultiScale, and while detecting the first image takes a while (around 3-5 seconds), the subsequent images only take about 0.3-0.7 seconds. I initialized the classifier on load to see if that changed anything but it didn't seem to make a difference.

Is there any way I could speed up the time of the the first image?

  • if you are running this project from visual studio solution ,it will be like that.But you run it from exe(i.e in actual use of project) , you may not get this problem.try that. – hariprasad Sep 03 '16 at 04:27
  • Nope, even running the binaries is slow at first, then fast. – Anubhav Srivastava Sep 05 '16 at 12:09
  • if you running cascadeclassifier on gpu, then it may be the cuda which is initialing that slowly for the first time but not actual opencv algorithm. – hariprasad Sep 06 '16 at 04:09

1 Answers1

0

I think it´s the dynamical assembly loading. .Net only loads the needed EmguCV assembly if needed. So first time you use any EmguCV Code it loads the whole assembly. This may take a while. You could initialize the assembly using emguCV right after program start in a seperate thread. While Loading you could do other init stuff.

Maybe there is also an option on references to load the assembly right from the start.

Chris S.
  • 37
  • 8