Ask Your Question

Evaluation model of Haar cascade classifier

asked 2015-11-22 05:21:12 -0500

Corto gravatar image

Good morning all. I create a classifier following this guide and i have the file .xml. How can i do the evaluation model of the classificator? In opencv 2.4.10 there is opencv_performance but i use opencv 3.0 and the file performance is not present. Someone can help me?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2015-11-23 08:08:45 -0500

The evaluation tool of OpenCV is not available for all newer models. Even if it was present in OpenCV 2.4, it only worked for the old haartraining models and not for the models generated by traincascade application. It is still on my and others todo list to reshape the evaluation tool to something useful, but haven't found the time to do so.

In the meantime, you should create - A personal test set - A ground truth of that test set - The detection output on the test set

Then you can calculate precision recall measures for different score thresholds and perform a PR curve evaluation. The book OpenCV 3 Blueprints discusses how you can do that in detail.

edit flag offensive delete link more


Just curious, how did the performance application worked? I mean, I guess it was developed for some specific objects and it couldn't be used for new custom-trained models, am I right?

LorenaGdL gravatar imageLorenaGdL ( 2015-11-23 10:18:39 -0500 )edit

Ok thanks for help! I have another question, with opencv v 2.4.10 i create a new file .xml with opencv_traincascade but when i run opencv_performance give me this error

OpenCV Error: Unspecified error (The node does not represent a user object (unknown type?)) in cvRead, file C:\builds\2_4_PackSlave-win32-vc12-shared\opencv\modules\core\src\persistence.cpp, line 4991

I use the command, opencv\build\x86\vc12\bin\opencv_performance -data stop.xml -info positivesoutput.txt, i think the -info file is the error, but i don't understand.

Corto gravatar imageCorto ( 2015-11-23 14:28:00 -0500 )edit

@Corto IT DOES NOT WORK, please read my answer again. @LorenaGdL it depended on a set of ground truth annotations, a set of detections and then retrieved values for true positives, true negatives, false positives and false negatives. It then calculated needed values for making ROC curves and PR curves. It was developed for the old haartraining model types, and did not work anymore afterwards.

StevenPuttemans gravatar imageStevenPuttemans ( 2015-11-24 02:48:36 -0500 )edit

oh sorry, i read you message again. Thanks for help!

Corto gravatar imageCorto ( 2015-11-24 03:28:37 -0500 )edit

Could you accept my answer?

StevenPuttemans gravatar imageStevenPuttemans ( 2015-11-24 04:02:59 -0500 )edit

Yes! Your answer it's ok!

Corto gravatar imageCorto ( 2016-01-12 03:59:29 -0500 )edit

answered 2015-11-23 00:40:16 -0500

belgraviton gravatar image

You can use cv::BaseCascadeClassifier::detectMultiScale() function in C++ program. Another method is to use python or Matlab interface to CascadeClassifier.

edit flag offensive delete link more


This is not correct.

StevenPuttemans gravatar imageStevenPuttemans ( 2015-11-23 08:05:42 -0500 )edit

Question Tools

1 follower


Asked: 2015-11-22 05:21:12 -0500

Seen: 1,015 times

Last updated: Nov 23 '15