#include "opencv2/objdetect.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
#include <stdio.h>
using namespace cv;
using namespace std;
void DetectAndDraw(Mat& img, CascadeClassifier& cascade, double scale);
int main()
{
CascadeClassifier faceCascade;
double scale = 4;
int nRet = 0;
VideoCapture capture;
capture.open("/home/pi/test.mp4");
if (!capture.isOpened())
{
cout << "open camera failed. " << endl;
return -1;
}
cout << "open camera succeed. " << endl;
nRet = faceCascade.load("/home/pi/opencv- 3.4.1/data/haarcascades/haarcascade_frontalface_alt2.xml");
nRet = faceCascade.load("/home/pi/opencv- 3.4.1/data/haarcascades/haarcascade_frontalface_alt2.xml");
if (!nRet)
{
printf("load xml failed.\n");
return -1;
}
Mat frame;
vector<Rect> face
在树莓派下的opencv用(C++)对视频做人脸检测和人脸模糊处理
最新推荐文章于 2021-12-17 15:39:00 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)