1 image - 10 haar classifiers - process image once [closed]
Hi, I created 10 Haar classifiers for recognizing digits. Because of that I got to create 10 CascadeClassifier objects and run detectMultiScale 10 times in order to find a number in a single Mat. I was thinking to investigate if there is a point in creating a new class CascadeClassifierGroup that would allow to load many classifiers and detect objects for each of them in a single run, taking into account cache friendliness etc. But before doing that, I wanted to ask if you see some better option in terms of performance.
no there is no point doing that, you cannot share anything between your classifiers. that's why the whole approach won't scale.
also note, that those haar classifiers are "on the way out", 4.0 does no more come with tools to train them, the gpu version was removed entirely, etc. (this was one of the last remainders of the arcane c-api code, which noone wants to maintain)
Thanks @berak, that also explains why I saw no improvement when using UMat with detectMultiScale. Is there any migration path, suggested ways to go when Haar Classifiers wont be supported anymore?
there is no opencl optimization for this(i'm wrong)idk. this depends very much on your application. (will you really need numbers only ?)
opencv has a couple of ways to detect text, ranging from simple MSER to dnn based EAST (and a whole text module in contrib). networks, or a simple SVM will also be better at the classification part.
last, there are e.g. SSD networks(able to do detection & classification in one go), that can be retrained for your goal.
I am handling 7-segment digits (power usage counter). I tried several OCR libraries, unfortunately, recognitions have poor quality. Haar classifier was successful but a bit slow, when running 10 classifiers sequentially. Anyway, I'll check methods that you suggested. Thanks! (-:
interesting to hear, that the current approach worked for you !
see this repo