资源简介
opencv2.4.9+vs2013,行人检测代码,针对视频检测,若想测图片只需将读入视频部分转为读入图片,且需要对视频进行压缩(如格式工厂等,或在opencv内部实现),太大的、清晰度高视频速度较慢。

代码片段和文件信息
#include “opencv2/imgproc/imgproc.hpp“
#include “opencv2/objdetect/objdetect.hpp“
#include “opencv2/highgui/highgui.hpp“
#include “cv.h“
#include
#include
#include
using namespace cv;
using namespace std;
void dealMat(Mat img) {
namedWindow(“people detector“);
HOGDescriptor hog;
hog.setSVMDetector(HOGDescriptor::getDefaultPeopleDetector());
fflush(stdout);
vector found found_filtered;
double t = (double)getTickCount();
// run the detector with default parameters. to get a higher hit-rate
// (and more false alarms respectively) decrease the hitThreshold and
// groupThreshold (set groupThreshold to 0 to turn off the grouping completely).
hog.detectMultiScale(img found 0 Size(8 8) Size(32 32) 1.05 2);
t = (double)getTickCount() - t;
printf(“tdetection time = %gms\n“ t*1000. / cv::getTickFrequency());
size_t i j;
for (i = 0; i < found.size(); i++) {
Rect r = found[i];
for (j = 0; j < found.size(); j++)
if (j != i && (r & found[j]) == r)
break;
if (j == found.size())
found_filtered.push_back(r);
}
for (i = 0; i < found_filtered.size(); i++) {
Rect r = found_filtered[i];
// the HOG detector returns slightly larger rectangles than the real objects.
// so we slightly shrink the rectangles to get a nicer output.
r.x += cvRound(r.width*0.1);
r.width = cvRound(r.width*0.8);
r.y += cvRound(r.height*0.07);
r.height = cvRound(r.height*0.8);
rectangle(img r.tl() r.br() cv::Scalar(0 255 0) 3);
}
imshow(“people detector“ img);
waitKey(20);
}
int main(int argc char** argv) {
VideoCapture capture(“D:\\1_1.mpg“);
Mat img;
while (capture.read(img)) {
dealMat(img);
}
return 0;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
I.A.... 1115520 2016-07-14 09:48 check\check\1_1.mpg
文件 4227 2016-07-27 10:21 check\check\check.vcxproj
I.A.... 961 2016-07-27 10:21 check\check\check.vcxproj.filters
I.A.... 1780 2016-07-27 09:22 check\check\checkmain.cpp
I.A.... 1920 2016-07-27 10:21 check\check\Debug\check.log
I.A.... 155 2016-07-27 10:21 check\check\Debug\check.tlog\check.lastbuildstate
I.A.... 658 2016-07-27 10:21 check\check\Debug\check.tlog\cl.command.1.tlog
I.A.... 17864 2016-07-27 10:21 check\check\Debug\check.tlog\CL.read.1.tlog
I.A.... 368 2016-07-27 10:21 check\check\Debug\check.tlog\CL.write.1.tlog
I.A.... 1876 2016-07-27 10:21 check\check\Debug\check.tlog\li
I.A.... 5404 2016-07-27 10:21 check\check\Debug\check.tlog\li
I.A.... 336 2016-07-27 10:21 check\check\Debug\check.tlog\li
I.A.... 306843 2016-07-27 10:21 check\check\Debug\checkmain.obj
I.A.... 625664 2016-07-27 10:21 check\check\Debug\vc120.idb
I.A.... 1257472 2016-07-27 10:21 check\check\Debug\vc120.pdb
I.A.... 15138816 2016-07-27 10:22 check\check.sdf
I.A.... 961 2016-07-27 10:20 check\check.sln
I.A..H. 19456 2016-07-27 10:22 check\check.v12.suo
I.A.... 91648 2016-07-27 10:21 check\Debug\check.exe
I.A.... 489768 2016-07-27 10:21 check\Debug\check.ilk
I.A.... 1708032 2016-07-27 10:21 check\Debug\check.pdb
I..D... 0 2016-07-27 10:21 check\check\Debug\check.tlog
I..D... 0 2016-07-27 10:21 check\check\Debug
I..D... 0 2016-07-28 11:40 check\check
I..D... 0 2016-07-27 10:21 check\Debug
I..D... 0 2016-07-28 11:40 check
----------- --------- ---------- ----- ----
20789729 26
- 上一篇:INCOSE系统工程手册第4版
- 下一篇:CMS模板置标使用手册.doc
相关资源
- 基于OpenCV的数字识别468815
- 使用opencv去掉二值化图像中黑色面积
- opencv环境配置
- win10 64位下编译的opencv4.5.5库,opencv
- NVIDIAOpticalFlowSDK-79c6cee80a2df9a196f20afd6
- opencv_contrib-3.4.0.zip
- opencv2.4.9源码分析——SIFT
- 用两个摄像头实现,双目标定,双目
- opencv_traincascade训练分类器,手势识别
- opencv3.0交叉编译用parallel.cpp
- 基于opencv的图像识别识别图像中的色
- 基于openCV的识别特定颜色区域
- 基于OpenCV的分水岭算法实现
- QT+opencv+OCR 身份证号码,银行卡号识别
- opencv视频特定颜色区域识别
- 把RGB转换为HSV和HSI然后根据黄色和蓝
- opencv视觉测距
- 基于Qt和opencv的身份证号码识别系统
- opencv_ffmpeg249.dll
- SfM稀疏三维点云重建--完整工程文件
- 基于opencv的数人头程序源代码
- 利用OpenCV中的Stitcher类实现全景图像拼
- opencv实现的sift算法源码,包含了图像
- openCV 上的小波变换
- 基于OPENCV的车牌识别系统设计
- 617张国内车牌60-17bmp图片用于OpenCV正样
- hog特征提取,c版本代码
- 基于Qt5.8+OpenCV3.2的Basler多相机触发开
- 基于Opencv实现的图像纠偏
- ImageWatch2019.vsix
评论
共有 条评论