资源简介
VS2010+opencv2.4.3利用HOG特征训练级联分类器,训练步骤网上有很多,这是训练代码,在属性-命令-命令参数中输入训练参数即可。
代码片段和文件信息
#include “opencv2/core/core.hpp“
#include “opencv2/core/internal.hpp“
#include “boost.h“
#include “cascadeclassifier.h“
#include
#include “cxmisc.h“
using namespace std;
static inline double
logRatio( double val )
{
const double eps = 1e-5;
val = max( val eps );
val = min( val 1. - eps );
return log( val/(1. - val) );
}
#define CV_CMP_FLT(ij) (i < j)
static CV_IMPLEMENT_QSORT_EX( icvSortFlt float CV_CMP_FLT const float* )
#define CV_CMP_NUM_IDX(ij) (aux[i] < aux[j])
static CV_IMPLEMENT_QSORT_EX( icvSortIntAux int CV_CMP_NUM_IDX const float* )
static CV_IMPLEMENT_QSORT_EX( icvSortUShAux unsigned short CV_CMP_NUM_IDX const float* )
#define CV_THRESHOLD_EPS (0.00001F)
static const int MinBlockSize = 1 << 16;
static const int BlockSizeDelta = 1 << 10;
// TODO remove this code duplication with ml/precomp.hpp
static int CV_CDECL icvCmpIntegers( const void* a const void* b )
{
return *(const int*)a - *(const int*)b;
}
static CvMat* cvPreprocessIndexArray( const CvMat* idx_arr int data_arr_size bool check_for_duplicates=false )
{
CvMat* idx = 0;
CV_FUNCNAME( “cvPreprocessIndexArray“ );
__BEGIN__;
int i idx_total idx_selected = 0 step type prev = INT_MIN is_sorted = 1;
uchar* srcb = 0;
int* srci = 0;
int* dsti;
if( !CV_IS_MAT(idx_arr) )
CV_ERROR( CV_StsBadArg “Invalid index array“ );
if( idx_arr->rows != 1 && idx_arr->cols != 1 )
CV_ERROR( CV_StsBadSize “the index array must be 1-dimensional“ );
idx_total = idx_arr->rows + idx_arr->cols - 1;
srcb = idx_arr->data.ptr;
srci = idx_arr->data.i;
type = CV_MAT_TYPE(idx_arr->type);
step = CV_IS_MAT_CONT(idx_arr->type) ? 1 : idx_arr->step/CV_ELEM_SIZE(type);
switch( type )
{
case CV_8UC1:
case CV_8SC1:
// idx_arr is array of 1‘s and 0‘s -
// i.e. it is a mask of the selected components
if( idx_total != data_arr_size )
CV_ERROR( CV_StsUnmatchedSizes
“Component mask should contain as many elements as the total number of input variables“ );
for( i = 0; i < idx_total; i++ )
idx_selected += srcb[i*step] != 0;
if( idx_selected == 0 )
CV_ERROR( CV_StsOutOfRange “No components/input_variables is selected!“ );
break;
case CV_32SC1:
// idx_arr is array of integer indices of selected components
if( idx_total > data_arr_size )
CV_ERROR( CV_StsOutOfRange
“index array may not contain more elements than the total number of input variables“ );
idx_selected = idx_total;
// check if sorted already
for( i = 0; i < idx_total; i++ )
{
int val = srci[i*step];
if( val >= prev )
{
is_sorted = 0;
break;
}
prev = val;
}
break;
default:
CV_ERROR( CV_StsUnsupportedFormat “Unsupported index a
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-06-27 11:27 cascadeclassifier_train\
目录 0 2015-06-27 11:25 cascadeclassifier_train\cascadeclassifier_train\
文件 14700544 2015-06-27 11:27 cascadeclassifier_train\cascadeclassifier_train.sdf
文件 936 2014-12-29 15:57 cascadeclassifier_train\cascadeclassifier_train.sln
文件 27136 2015-06-27 11:27 cascadeclassifier_train\cascadeclassifier_train.suo
文件 56144 2012-07-28 06:59 cascadeclassifier_train\cascadeclassifier_train\boost.cpp
文件 3494 2012-10-18 06:56 cascadeclassifier_train\cascadeclassifier_train\boost.h
文件 19598 2012-07-28 06:59 cascadeclassifier_train\cascadeclassifier_train\cascadeclassifier.cpp
文件 3789 2012-10-18 06:56 cascadeclassifier_train\cascadeclassifier_train\cascadeclassifier.h
文件 5588 2014-12-29 15:59 cascadeclassifier_train\cascadeclassifier_train\cascadeclassifier_train.vcxproj
文件 2643 2014-12-29 15:57 cascadeclassifier_train\cascadeclassifier_train\cascadeclassifier_train.vcxproj.filters
文件 677 2015-06-27 10:47 cascadeclassifier_train\cascadeclassifier_train\cascadeclassifier_train.vcxproj.user
文件 1470 2012-10-18 06:56 cascadeclassifier_train\cascadeclassifier_train\CMakeLists.txt
目录 0 2015-06-27 11:27 cascadeclassifier_train\cascadeclassifier_train\Debug\
文件 615953 2015-06-27 11:27 cascadeclassifier_train\cascadeclassifier_train\Debug\boost.obj
文件 564472 2015-06-27 11:27 cascadeclassifier_train\cascadeclassifier_train\Debug\cascadeclassifier.obj
文件 3402 2015-06-27 10:47 cascadeclassifier_train\cascadeclassifier_train\Debug\cascadeclassifier_train.Build.CppClean.log
文件 406 2015-06-27 10:47 cascadeclassifier_train\cascadeclassifier_train\Debug\cascadeclassifier_train.exe.em
文件 472 2015-06-27 11:27 cascadeclassifier_train\cascadeclassifier_train\Debug\cascadeclassifier_train.exe.em
文件 381 2015-06-27 11:27 cascadeclassifier_train\cascadeclassifier_train\Debug\cascadeclassifier_train.exe.intermediate.manifest
文件 73 2015-06-27 11:27 cascadeclassifier_train\cascadeclassifier_train\Debug\cascadeclassifier_train.lastbuildstate
文件 3644 2015-06-27 11:27 cascadeclassifier_train\cascadeclassifier_train\Debug\cascadeclassifier_train.log
文件 236 2015-06-27 10:47 cascadeclassifier_train\cascadeclassifier_train\Debug\cascadeclassifier_train_manifest.rc
文件 14146 2015-06-27 11:27 cascadeclassifier_train\cascadeclassifier_train\Debug\cl.command.1.tlog
文件 382954 2015-06-27 11:27 cascadeclassifier_train\cascadeclassifier_train\Debug\CL.read.1.tlog
文件 12550 2015-06-27 11:27 cascadeclassifier_train\cascadeclassifier_train\Debug\CL.write.1.tlog
文件 352425 2015-06-27 11:27 cascadeclassifier_train\cascadeclassifier_train\Debug\features.obj
文件 410692 2015-06-27 11:27 cascadeclassifier_train\cascadeclassifier_train\Debug\haarfeatures.obj
文件 326281 2015-06-27 11:27 cascadeclassifier_train\cascadeclassifier_train\Debug\HOGfeatures.obj
文件 2399 2014-12-26 16:49 cascadeclassifier_train\cascadeclassifier_train\Debug\HOG_train.Build.CppClean.log
文件 57 2014-12-26 16:50 cascadeclassifier_train\cascadeclassifier_train\Debug\HOG_train.lastbuildstate
............此处省略51个文件信息
相关资源
- VS+QT+Opencv可视化编程
- 最全的OpenCV源代码
- 基于Opencv的红外运动目标识别与跟踪
- mingw编译的opencv库
- 基于ORB算法的特征提取和匹配(VS20
- 基于SIFT算法的特征提取(VS2015+OpenC
- 超像素分割SLIC(简单线性迭代聚类)
- VS2013+opencv2.4.10提取SURF_BOW特征使用s
- VS2013+OpenCV2.4.10提取傅里叶描述子特征
- VS2013+OPENCV2.4.10 提取HOG特征使用SVM多分
- OPENCV中团块跟踪
- OpenCV.3.Computer.Vision.Application.Programmi
- opencv车牌识别
- QT5.7 + OPENCV3.2 + 动态条形码识别
- 颜色识别中各颜色阈值快速查找小程
- opencv已经编译好直接可以用的连接库
- opencv双目通过特征提取恢复深度
- opencv火焰检测识别230808
- opencv 张正友相机标定源代码及标定照
- opencv3.4+opencv_contrib3.4+cuda10.0+tbb+win10
- SURF算法+单应矩阵+RANSAC算法实现拼接
- 相机标定单目、双目.zip
- opencv-3.4.1-vc14_vc15.exe(OpenCV VS14.15安装
- OpenCV3.4.1-1安装包
- 从车道线检测项目入门opencv
- opencv安装
- opencv4.0.0.0
- frozen_east_text_detection.pb
- 车牌识别系统opencv版
- OpenCV4.0.0包含Contrib完整包
评论
共有 条评论