#include "pch.h" //vs2015 为“stdafx.h”
#include <iostream>
#include <opencv2/opencv.hpp>
#include <opencv2/dpm.hpp>
#include <opencv2/dnn/all_layers.hpp>
using namespace cv;
using namespace cv::dpm;//contrip模块
using namespace std;
const string model_path = "inriaperson.xml";//opencv_contrip/modules/dpm/samples/data/中包含
int main()
{ //通常情况下,在实例化目标时,需要提供级联的检测器的名称
Ptr<DPMDetector> detector = DPMDetector::create(vector<string>(1, model_path));
Scalar color(0, 255, 255);
Mat frame;
//时间计算
double t = (double)getTickCount();
vector<DPMDetector::ObjectDetection> qs;
Mat image = imread("1.jpg");
frame = image.clone();
detector->detect(image, qs);
t = ((double)getTickCount() - t) / getTickFrequency();
cout &