JS技术

正式使用opencv里的训练和检测 - opencv_createsamples、opencv_traincascade(5)

字号+ 作者:H5之家 来源:H5之家 2015-12-15 08:44 我要评论( )

Boosted 分类器的类型: DAB-DiscreteAdaBoost,RAB-RealAdaBoost,LB-LogitBoost,GAB-GentleAdaBoost -minHitRatemin_hit_rate 分类器的每一级希望得到的最小检测率(正样本被判成正样本的比例)。总的检测率大约为

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 Detection

The 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:

haarfeatures.png

image

 

1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。

相关文章
  • AngularJS使用HTML5摄像头拍照

    AngularJS使用HTML5摄像头拍照

    2016-02-23 09:42

  • 从Container内存监控限制到CPU使用率限制方案 - 走在前往架构师的路上 - 博客频道 - CSDN.NET 走

    从Container内存监控限制到CPU使用率限制方案 - 走在前往架构师的路

    2015-12-15 09:09

  • 数据抽取工具Kettle使用 - 唐僧打怪兽 - 博客频道 - CSDN.NET 唐僧打怪兽 热爱互联网,编程,比如:J

    数据抽取工具Kettle使用 - 唐僧打怪兽 - 博客频道 - CSDN.NET 唐僧打

    2015-12-14 15:37

  • Oracle数据库Decode()函数的使用方法 - 周泽辉的CSDN博客... - 博客频道 - CSDN.NET 周

    Oracle数据库Decode()函数的使用方法 - 周泽辉的CSDN博客... - 博客

    2015-12-14 15:05

网友点评