opencv2-5利用摄像头进行人脸识别

本文介绍了OpenCV2中进行人脸识别的步骤,包括使用VideoCapture打开摄像头,CascadeClassifier进行人脸检测,detectMultiScale检测人脸并调整尺度,以及使用Ellipse绘制检测到的人脸轮廓。详细讲解了VideoCapture类的成员函数,如open、isOpened和release,并展示了detectMultiScale函数的参数含义。
摘要由CSDN通过智能技术生成

1)VideoCapture()

2)CascadeClassifier

3)detectMultiScale()

4)Ellipse()


//---------------------------------【头文件、命名空间包含部分】----------------------------
// 描述:包含程序所使用的头文件和命名空间
//-------------------------------------------------------------------------------------------------
#include "opencv2/objdetect/objdetect.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <iostream>
#include <stdio.h>
using namespace std;
using namespace cv;
void detectAndDisplay( Mat frame );
//--------------------------------【全局变量声明】----------------------------------------------
// 描述:声明全局变量
//-------------------------------------------------------------------------------------------------
//注意,需要把"haarcascade_frontalface_alt.xml"和"haarcascade_eye_tree_eyeglasses.xml"这两个文件复制到工程路径下
S
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值