资源简介
Opencv中文网Yu老师的人脸识别VS2015工程,opencv环境自己配置,Release下有可执行文件。
代码片段和文件信息
/*
The MIT License (MIT)
Copyright (c) 2015-2017 Shiqi Yu
shiqi.yu@gmail.com
Permission is hereby granted free of charge to any person obtaining a copy
of this software and associated documentation files (the “Software“) to deal
in the Software without restriction including without limitation the rights
to use copy modify merge publish distribute sublicense and/or sell
copies of the Software and to permit persons to whom the Software is
furnished to do so subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS“ WITHOUT WARRANTY OF ANY KIND EXPRESS OR
IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER
LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING FROM
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/* API接口函数说明
int * facedetect_multiview( unsigned char * gray_image_data int width int height int step
float scale
int min_neighbors
int min_size
int max_size=0);
/*API
1.it can detect side view faces but slower than facedetect_frontal().
facedetect_multiview
2.it‘s fast but cannot detect side view faces
facedetect_frontal
3.it can detect side view faces better but slower than facedetect_multiview().
facedetect_multiview_reinforce
4.it can detect faces with bad illumination.
facedetect_frontal_surveillance
*/
#include
#include
#include “facedetect-dll.h“
//#pragma comment(lib“libfacedetect.lib“)
#pragma comment(lib“libfacedetect-x64.lib“)
//define the buffer size. Do not change the size!
#define DETECT_BUFFER_SIZE 0x20000
using namespace cv;
int main(int argc char* argv[])
{
//if (argc != 2)
//{
// printf(“Usage: %s \n“ argv[0]);
// return -1;
//}
while (1)
{
Mat gray image dstImage;
//load an image and convert it to gray (single-channel)
/* image = imread(argv[1]);*/
//image = imread(“00.jpeg“);// keliamoniz1.jpg face.jpeg
//if (image.empty())
//{
// fprintf(stderr “Can not load the image file %s.\n“ argv[1]);
// return -1;
//}
VideoCapture capture(0); //从摄像头读入视频
capture >> image;
//namedWindow(“原图“ CV_WINDOW_AUTOSIZE);
//imshow(“原图“ image);
cvtColor(image gray CV_BGR2GRAY);//转化为灰度图
equalizeHist(gray gray);//直方图均衡化,增加对比度方便处理
int * pResults = NULL;
//pBuffer is used in the detection functions.
//If you call functions in multiple threads please create one buffer for each thread!
unsigned char * pBuffer = (unsigned char *)malloc(DETECT_BUFFER_SIZE); //动态内存分配
if (!pBuffer)
{
fprintf(stderr “Can no
- 上一篇:《微型计算机原理与接口技术第3版》冯博琴 教学课件
- 下一篇:射频天线设计基础
相关资源
- 基于OpenCV的数字识别468815
- 使用opencv去掉二值化图像中黑色面积
- opencv环境配置
- win10 64位下编译的opencv4.5.5库,opencv
- NVIDIAOpticalFlowSDK-79c6cee80a2df9a196f20afd6
- opencv_contrib-3.4.0.zip
- opencv2.4.9源码分析——SIFT
- 用两个摄像头实现,双目标定,双目
- opencv_traincascade训练分类器,手势识别
- opencv3.0交叉编译用parallel.cpp
- 基于opencv的图像识别识别图像中的色
- 基于openCV的识别特定颜色区域
- 基于OpenCV的分水岭算法实现
- QT+opencv+OCR 身份证号码,银行卡号识别
- opencv视频特定颜色区域识别
- 把RGB转换为HSV和HSI然后根据黄色和蓝
- opencv视觉测距
- 基于Qt和opencv的身份证号码识别系统
- opencv_ffmpeg249.dll
- SfM稀疏三维点云重建--完整工程文件
- 基于opencv的数人头程序源代码
- 利用OpenCV中的Stitcher类实现全景图像拼
- opencv实现的sift算法源码,包含了图像
- openCV 上的小波变换
- 基于OPENCV的车牌识别系统设计
- 617张国内车牌60-17bmp图片用于OpenCV正样
- hog特征提取,c版本代码
- 基于Qt5.8+OpenCV3.2的Basler多相机触发开
- 基于Opencv实现的图像纠偏
- ImageWatch2019.vsix
评论
共有 条评论