From bfb18d29a6f0890956c739ae6dd2c6f179a0e60d Mon Sep 17 00:00:00 2001 From: StevenPuttemans Date: Mon, 6 Feb 2017 10:38:03 +0100 Subject: [PATCH] add explanation to detectMultiScale overload functionality --- modules/objdetect/include/opencv2/objdetect.hpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/modules/objdetect/include/opencv2/objdetect.hpp b/modules/objdetect/include/opencv2/objdetect.hpp index cd444d2..432bee4 100644 --- a/modules/objdetect/include/opencv2/objdetect.hpp +++ b/modules/objdetect/include/opencv2/objdetect.hpp @@ -294,7 +294,21 @@ public: Size maxSize=Size() ); /** @overload - if `outputRejectLevels` is `true` returns `rejectLevels` and `levelWeights` + This function allows you to retrieve the final stage decision certainty of classification. + For this, one needs to set `outputRejectLevels` on true and provide the `rejectLevels` and `levelWeights` parameter. + For each resulting detection, `levelWeights` will then contain the certainty of classification at the final stage. + This value can then be used to separate strong from weaker classifications. + + A code sample on how to use it efficiently can be found below: + @code + Mat img; + vector weights; + vector levels; + vector detections; + CascadeClassifier model("/path/to/your/model.xml"); + model.detectMultiScale(img, detections, levels, weights, 1.1, 3, 0, Size(), Size(), true); + cerr << "Detection " << detections[0] << " with weight " << weights[0] << endl; + @endcode */ CV_WRAP_AS(detectMultiScale3) void detectMultiScale( InputArray image, CV_OUT std::vector& objects, -- 2.7.4