-
大小: 19.47MB文件类型: .zip金币: 1下载: 0 次发布日期: 2023-08-06
- 语言: 其他
- 标签: opencv hog+pca+svm C++ 代码
资源简介
基于hog+pca+svm行人检测源码,包括训练以及检测的所有的代码,希望可以帮助到需要的人。
代码片段和文件信息
#include “cppHoG.h“
#include “opencv2/highgui/highgui.hpp“
#include
#include
int iPosWindows =0; int iNegWindows=0;
//constructor
CcppHoG :: CcppHoG(Size sWinSizeSize sBlockSizeSize sBlockStrideSize sWinStrideSize sCellSizeint iBinsenGamacorrect enGammaCorstyleenBlockNormstyle enNormstylefloat fGaussSigmadouble dBlockThreshold)
{
this->sWinSize = sWinSize;
this->sBlockStride = sBlockStride;
this->sWinStride = sWinStride;
this->sBlockSize = sBlockSize;
this->sCellSize = sCellSize;
this->iBins = iBins;
this->enGammaCorstyle = enGammaCorstyle;
this->enNormstyle = enNormstyle;
m_fGaussSigma = fGaussSigma;
this->dBlockThreshold = dBlockThreshold;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////
//compute the img‘s gradient
//this is not limited to the img of 64*158 size
//grad stores the gradient of each pixel
//angle means the angle of gradient
//paddingTL paddingBR is the padding scale which is mentioned in the paper
////////////////////////////////////////////////////////////////////////////////////////////////////////
void CcppHoG :: computeGradient(const Mat& mImg Mat& mGrad Mat& mAngle
Size sPaddingTL Size sPaddingBR) const
{
// assert the img is either 1 channel or 3 channel
uchar ucChannels =mImg.channels();
assert(ucChannels == 1 || ucChannels == 3);
// compute the size after padding
Size newSize(mImg.cols + sPaddingTL.width + sPaddingBR.width mImg.rows + sPaddingBR.height + sPaddingTL.height);
//both the mGrad and mAngle have two channels
mGrad.create(newSizeCV_32FC2);
mAngle.create(newSizeCV_8UC2);
// a vector contains the color scalar 0-255;
Mat_ _mScalar(1256);
const float *mScalar = &_mScalar(00);
//the following method is to make gamacorrection
//as you will see this is an efficiency algorithm
//e.g. if the pixel value is 36 and GamaSqrt is chosen
//the new value = _mScalar(old value);
//so much sqrt functions will be ignored.
if(enGammaCorstyle == GamaSqrt)
{
for(int i = 0; i < 256; i++)
_mScalar(0i) = std::sqrt(float(i));
}
else if(enGammaCorstyle == NoGama)
{
for(int j = 0; j < 256; j++)
_mScalar(0j) = (float)j;
}
//because of the padding we need two more variants iXmapiYMap.
//what‘s more when take the edge into account a new virtual edge will
//be used. here is a simple example help to understand better.
/*
suppose the img‘s matrix is the simple form
[123;
456;
789;]
and the paddings are 1and adding the virtual edge
the img‘s size should be 7*7
so the padded form should be as follows
[
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2012-06-11 12:34 cppHoG-raw-RBF-PCA\
目录 0 2012-06-20 11:49 cppHoG-raw-RBF-PCA\cppHoG-raw-RBF\
目录 0 2012-06-20 12:24 cppHoG-raw-RBF-PCA\cppHoG-raw-RBF\cppHoG\
目录 0 2012-06-20 12:01 cppHoG-raw-RBF-PCA\cppHoG-raw-RBF\cppHOG-setup\
文件 36832 2012-06-20 12:26 cppHoG-raw-RBF-PCA\cppHoG-raw-RBF\cppHOG-setup\cppHOG-setup.vdproj
目录 0 2012-06-20 12:26 cppHoG-raw-RBF-PCA\cppHoG-raw-RBF\cppHOG-setup\Debug\
文件 5242368 2012-06-20 12:26 cppHoG-raw-RBF-PCA\cppHoG-raw-RBF\cppHOG-setup\Debug\cppHOG-setup.msi
文件 460800 2012-06-20 12:26 cppHoG-raw-RBF-PCA\cppHoG-raw-RBF\cppHOG-setup\Debug\setup.exe
文件 766 2006-09-06 13:35 cppHoG-raw-RBF-PCA\cppHoG-raw-RBF\cppHOG-setup\hans.ico
目录 0 2012-06-20 11:49 cppHoG-raw-RBF-PCA\cppHoG-raw-RBF\cppHOG-setup\Release\
文件 14420992 2012-06-20 12:30 cppHoG-raw-RBF-PCA\cppHoG-raw-RBF\cppHoG.ncb
文件 1190 2012-06-20 11:49 cppHoG-raw-RBF-PCA\cppHoG-raw-RBF\cppHoG.sln
文件 79360 2012-06-20 12:30 cppHoG-raw-RBF-PCA\cppHoG-raw-RBF\cppHoG.suo
文件 115622 2012-06-05 01:01 cppHoG-raw-RBF-PCA\cppHoG-raw-RBF\cppHoG\cppHoG.cpp
文件 4132 2012-06-03 22:57 cppHoG-raw-RBF-PCA\cppHoG-raw-RBF\cppHoG\cppHoG.h
文件 4435 2012-06-11 21:36 cppHoG-raw-RBF-PCA\cppHoG-raw-RBF\cppHoG\cppHoG.vcproj
文件 1405 2012-04-16 17:13 cppHoG-raw-RBF-PCA\cppHoG-raw-RBF\cppHoG\cppHoG.vcproj.HP21.Administrator.user
文件 1415 2012-06-20 12:30 cppHoG-raw-RBF-PCA\cppHoG-raw-RBF\cppHoG\cppHoG.vcproj.lishan-pc.xiaoxiaolishan.user
文件 26738 2005-04-21 21:06 cppHoG-raw-RBF-PCA\cppHoG-raw-RBF\cppHoG\crop001007a.png
文件 19453 2012-04-18 21:59 cppHoG-raw-RBF-PCA\cppHoG-raw-RBF\cppHoG\crop_000010a.png
目录 0 2012-06-20 12:24 cppHoG-raw-RBF-PCA\cppHoG-raw-RBF\cppHoG\Debug\
文件 7432 2012-06-20 12:24 cppHoG-raw-RBF-PCA\cppHoG-raw-RBF\cppHoG\Debug\BuildLog.htm
文件 663 2012-06-04 09:36 cppHoG-raw-RBF-PCA\cppHoG-raw-RBF\cppHoG\Debug\cppHoG.exe.em
文件 728 2012-06-04 09:36 cppHoG-raw-RBF-PCA\cppHoG-raw-RBF\cppHoG\Debug\cppHoG.exe.em
文件 621 2012-06-20 12:24 cppHoG-raw-RBF-PCA\cppHoG-raw-RBF\cppHoG\Debug\cppHoG.exe.intermediate.manifest
文件 904387 2012-06-05 01:01 cppHoG-raw-RBF-PCA\cppHoG-raw-RBF\cppHoG\Debug\cppHoG.obj
文件 197979 2012-06-20 12:24 cppHoG-raw-RBF-PCA\cppHoG-raw-RBF\cppHoG\Debug\mainDetect.obj
文件 65 2012-06-20 12:24 cppHoG-raw-RBF-PCA\cppHoG-raw-RBF\cppHoG\Debug\mt.dep
文件 945152 2012-06-20 12:24 cppHoG-raw-RBF-PCA\cppHoG-raw-RBF\cppHoG\Debug\vc90.idb
文件 618496 2012-06-20 12:24 cppHoG-raw-RBF-PCA\cppHoG-raw-RBF\cppHoG\Debug\vc90.pdb
文件 441202 2012-06-04 09:36 cppHoG-raw-RBF-PCA\cppHoG-raw-RBF\cppHoG\Debug\wBlockCache.obj
............此处省略48个文件信息
相关资源
- OMG的DDS标准的使用
- Kmeans的opencv实现
- 基于TCP、QT带虚拟键盘的多功能聊天系
- 基于VS2017+opencv3.4.3的立体匹配SGBM与
-
fr
ameLessWinApiQt无边框窗口调用winAP - edgenet.tar.gz
- OpenCV345_build_MinGW32bit
- 我们自己写的浏览器源代码
- Opencv+VS米粒图像处理实验源代码
- opencv3人脸识别正/负样本
- ACE编程超全面
- VTK使用手册VTKUsersGuide
- 学习opencv3273835
- Learning OpenCV 3
- 基于opencv的人脸识别
- LearningOpenCV3ComputervisioninC.pdf
- 人脸识别.rar
- OpenCV 3和Qt5计算机视觉应用开发英文版
- 海康工业相机二次开发源码 + OpenCV3
- 人脸自动分割.
- Opencv3.4SUFR纵向图像平滑拼接
- VS+CSocket实现网络聊天,可发文件Wor
- 基于Winpcap实现抓取数据包
- OpenCV Linux依赖库ippicv_linux_20151201.tgz
- 使用OpenCV 手势识别
- 南京公交线路查询
- win32平台的opencv3.3.0
- 图像细化算法
- Visual C 6.0
- OpenCV-2.1.0-win32-vs2008
评论
共有 条评论