資源簡介
自己寫的關于人體檢測的第一個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語言實現唯一可譯碼
評論
共有 條評論