Is there a way to use a trained CascadeClassifier for just classification in OpenCV 3.x?

asked 2020-02-10 00:12:12 -0500

yogeshmurthy_ gravatar image

I have trained a cascade classifier on my own dataset using opencv_traincascade application as explained here. I now want to use this trained model only for classification, not detection.

However I can't seem to find the setImage and runAt methods, which were present in OpenCV 2.x but seemingly not in OpenCV 3.x.

Are they deliberately removed from this version? Is there any other way to perform classification using my trained cascade?

edit retag flag offensive close merge delete

Comments

1

I now want to use this trained model only for classification, not detection.

can you explain, why ? what is the "context" ?

what would the input for this be ? a cropped image ?

berak gravatar imageberak ( 2020-02-10 05:48:16 -0500 )edit
1

imho, the closest thing you can do is : set minSize() == maxSize() == cropped_image.size(), this way at least it won't try to build an image pyramid

berak gravatar imageberak ( 2020-02-10 06:00:09 -0500 )edit

Yes, I've got crops already, just need to know if the object is present or not. I need something that runs fast because I've got to process about 300-500 small crops (24x32) in 1-2 seconds. Is setting the min and max sizes efficient in that context?

yogeshmurthy_ gravatar imageyogeshmurthy_ ( 2020-02-10 06:16:56 -0500 )edit