Skip to content

Commit bfb18d2

Browse files
author
StevenPuttemans
committed
add explanation to detectMultiScale overload functionality
1 parent a2fed4c commit bfb18d2

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

modules/objdetect/include/opencv2/objdetect.hpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,21 @@ class CV_EXPORTS_W CascadeClassifier
294294
Size maxSize=Size() );
295295

296296
/** @overload
297-
if `outputRejectLevels` is `true` returns `rejectLevels` and `levelWeights`
297+
This function allows you to retrieve the final stage decision certainty of classification.
298+
For this, one needs to set `outputRejectLevels` on true and provide the `rejectLevels` and `levelWeights` parameter.
299+
For each resulting detection, `levelWeights` will then contain the certainty of classification at the final stage.
300+
This value can then be used to separate strong from weaker classifications.
301+
302+
A code sample on how to use it efficiently can be found below:
303+
@code
304+
Mat img;
305+
vector<double> weights;
306+
vector<int> levels;
307+
vector<Rect> detections;
308+
CascadeClassifier model("/path/to/your/model.xml");
309+
model.detectMultiScale(img, detections, levels, weights, 1.1, 3, 0, Size(), Size(), true);
310+
cerr << "Detection " << detections[0] << " with weight " << weights[0] << endl;
311+
@endcode
298312
*/
299313
CV_WRAP_AS(detectMultiScale3) void detectMultiScale( InputArray image,
300314
CV_OUT std::vector<Rect>& objects,

0 commit comments

Comments
 (0)