Boosted分类器的类型: DAB - Discrete AdaBoost,RAB - Real AdaBoost,LB - LogitBoost, GAB - Gentle AdaBoost
-minHitRate<min_hit_rate>
分类器的每一级希望得到的最小检测率(正样本被判成正样本的比例)。总的检测率大约为 min_hit_rate^number_of_stages。可以设很高,如0.999
-maxFalseAlarmRate<max_false_alarm_rate>
分类器的每一级希望得到的最大误检率(负样本被判成正样本的比例)。总的误检率大约为 max_false_alarm_rate^number_of_stages。可以设较低,如0.5
-weightTrimRate<weight_trim_rate>
Specifies whether trimming should be used and its weight. 一个还不错的数值是0.95
-maxDepth<max_depth_of_weak_tree>
-maxWeakCount<max_weak_tree_count>
每一级中的弱分类器的最大数目。The boosted classifier (stage) will have so many weak trees (<=maxWeakCount), as needed to achieve the given-maxFalseAlarmRate
类Haar特征参数:
-mode<BASIC(default)| CORE|ALL>
5、detectMultiScale函数参数说明
该函数会在输入图像的不同尺度中检测目标:
image -输入的灰度图像,
objects -被检测到的目标矩形框向量组,
scaleFactor -为每一个图像尺度中的尺度参数,默认值为1.1
minNeighbors
flags -CV_HAAR_DO_CANNY_PRUNING,利用Canny边缘检测器来排除一些边缘很少或者很多的图像区域;
CV_HAAR_SCALE_IMAGE,按比例正常检测;
CV_HAAR_FIND_BIGGEST_OBJECT,只检测最大的物体;
CV_HAAR_DO_ROUGH_SEARCH,只做粗略检测。默认值是0
minSize和maxSize -用来限制得到的目标区域的范围(先找maxsize,再用1.1参数缩小,直到小于minSize终止检测)
6、opencv关于Haar介绍
(haarfeatures.cpp ——opencv3.0)
Detailed Description Haar Feature-based Cascade Classifier for Object DetectionThe object detector described below has been initially proposed by Paul Viola [pdf] and improved by Rainer Lienhart [pdf] .
First, a classifier (namely a cascade of boosted classifiers working with haar-like features) is trained with a few hundred sample views of a particular object (i.e., a face or a car), called positive examples, that are scaled to the same size (say, 20x20), and negative examples - arbitrary images of the same size.
After a classifier is trained, it can be applied to a region of interest (of the same size as used during the training) in an input image. The classifier outputs a "1" if the region is likely to show the object (i.e., face/car), and "0" otherwise. To search for the object in the whole image one can move the search window across the image and check every location using the classifier. The classifier is designed so that it can be easily "resized" in order to be able to find the objects of interest at different sizes, which is more efficient than resizing the image itself. So, to find an object of an unknown size in the image the scan procedure should be done several times at different scales.
The word "cascade" in the classifier name means that the resultant classifier consists of several simpler classifiers (stages) that are applied subsequently to a region of interest until at some stage the candidate is rejected or all the stages are passed. The word "boosted" means that the classifiers at every stage of the cascade are complex themselves and they are built out of basic classifiers using one of four different boosting techniques (weighted voting). Currently Discrete Adaboost, Real Adaboost, Gentle Adaboost and Logitboost are supported. The basic classifiers are decision-tree classifiers with at least 2 leaves. Haar-like features are the input to the basic classifiers, and are calculated as described below. The current algorithm uses the following Haar-like features:
image