博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
功能3:读取摄像头视频,人脸检测
阅读量:4298 次
发布时间:2019-05-27

本文共 695 字,大约阅读时间需要 2 分钟。



#include 
#include
using namespace std;using namespace cv;string xmlPath = "E:\\opencv\\sources\\data\\haarcascades\\haarcascade_frontalface_default.xml";//haarcascade_frontalface_defaultint main(){ CascadeClassifier detector; bool bstatue = detector.load(xmlPath); if (!bstatue) { cout<<"load xml文件失败"<
faces; //读入视频 //VideoCapture capture("face.mp4"); VideoCapture capture(0); //循环显示 while(true) { Mat frame; //定义一个Mat变量,用于存储每一帧的图像 capture>>frame; //读取当前帧 detector.detectMultiScale(frame,faces,1.1,3,0,Size(30,30)); for (size_t t = 0; t < faces.size(); t++) { rectangle(frame,faces[t],Scalar(0,0,255),2,8); } imshow("人脸检测",frame); waitKey(10); } return 0;}

 

转载地址:http://tosws.baihongyu.com/

你可能感兴趣的文章
详细理解“>/dev/null 2>&1”
查看>>
suse如何创建定时任务?
查看>>
suse搭建ftp服务器方法
查看>>
centos虚拟机设置共享文件夹并通过我的电脑访问[增加smbd端口修改]
查看>>
文件拷贝(IFileOperation::CopyItem)
查看>>
MapReduce的 Speculative Execution机制
查看>>
大数据学习之路------借助HDP SANDBOX开始学习
查看>>
Hadoop基础学习:基于Hortonworks HDP
查看>>
为什么linux安装程序 都要放到/usr/local目录下
查看>>
Hive安装前扫盲之Derby和Metastore
查看>>
永久修改PATH环境变量的几种办法
查看>>
大数据学习之HDP SANDBOX开始学习
查看>>
Hive Beeline使用
查看>>
Centos6安装图形界面(hdp不需要,hdp直接从github上下载数据即可)
查看>>
CentOS7 中把yum源更换成163源
查看>>
关于yum Error: Cannot retrieve repository metadata (repomd.xml) for repository:xxxxxx.
查看>>
linux下载github中的文件
查看>>
HDP Sandbox里面git clone不了数据(HTTP request failed)【目前还没解决,所以hive的练习先暂时搁置了】
查看>>
动态分区最佳实践(一定要注意实践场景)
查看>>
HIVE—索引、分区和分桶的区别
查看>>