Ask Your Question

Running multiple CascadeClassifiers - possible to reuse scaling?

asked 2018-11-14 00:04:19 -0500

I'm throwing the kitchen sink at recognising faces by running every *face*.xml CascadeClassifier on every frame of a video (and the eyes, mouth, and smile finders!) to see which performs the best. I noticed that the docs mentioned the scaling as a large chunk of the CPU effort, which got me wondering:

  1. Is it really? Or is the majority of the time in the actual face-detecting steps for each scaled size?
  2. If it IS a big part of the time, can I somehow reuse the scaling step across all my various classifiers?

If there is an easy way to do it (like pre-calculating a pyramid?) - great! If not, no worries, this doesn't have to be realtime.

Java/Kotlin,OpenCV 3.x

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2018-11-14 08:15:40 -0500

berak gravatar image

no, you can't reuse anything between different classifier instances. but you can try to reduce the cpu effort by:

  • using ROI's (e.g. only searching for eyes inside a previously detected face region, not from the whole image)
  • choosing minSize() and maxSize() wisely (those determine, which "stump" (or part) of the image pyramid is used)
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-11-14 00:04:19 -0500

Seen: 22 times

Last updated: Nov 14 '18