资源简介
自己写的关于人体检测的第一个opencv程序,适合初学者学习
代码片段和文件信息
#include “opencv2/imgproc/imgproc.hpp“
#include “opencv2/objdetect/objdetect.hpp“
#include “opencv2/highgui/highgui.hpp“
#include“opencv/cv.h“
#include
#include
#include
using namespace cv;
using namespace std;
int main(int argcchar** argv)
{
CvCapture* capture=cvCreateFileCapture(“E:\\31.avi“);
IplImage* frame;
HOGDescriptor hog;
hog.setSVMDetector(HOGDescriptor::getDefaultPeopleDetector());
cvNamedWindow(“win“);
size_t k=1;
while(1)
{
frame=cvQueryframe(capture);
if(!frame)
break;
vector found found_filtered;
double t = (double)getTickCount();
hog.detectMultiScale(frame found 0 Size(88) Size(3232)1.05 2);
//效果太差,为了提高精度这几个参数应该怎么设置????????
t = (double)getTickCount() - t;
printf(“frame %d : time = %gms\n“ k++t
- 上一篇:《C++ GUI QT编程》教程配套
- 下一篇:C语言实现唯一可译码
评论
共有 条评论