概述
源代码在opencv中的例程里面,文件路径如下:
opencvsourcessamplescppfacedetect.cpp。
(PS:所用OpenCV版本为3.4.5)
VS2017运行会提示错误,fopen。This function or variable may be unsafe。
是因为以前的函数安全性不够,所以微软重写了新的函数。
解决方法-百度经验
#include "opencv2/objdetect.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
using namespace std;
using namespace cv;
static void help()
{
cout << "nThis program demonstrates the use of cv::CascadeClassifier class to detect objects (Face + eyes). You can use Haar or LBP features.n"
"This classifier can recognize many kinds of rigid objects, once the appropriate classifier is trained.n"
"It's most known use is for faces.n"
"Usage:n"
"./facedetect [--cascade=<cascade_path> this is the primary trained classifier such as frontal face]n"
" [--nested-cascade[=nested_cascade_path this an optional secondary classifier such as eyes]]n"
" [--scale=<image scale greater or equal to 1, try 1.3 for example>]n"
" [--try-flip]n"
" [filename|camera_index]nn"
"see facedetect.cmd for one call:n"
"./facedetect --cascade="data/haarcascades/haarcascade_frontalface_alt.xml" --nested-cascade="data/haarcascades/haarcascade_eye_tree_eyeglasses.xml" --scale=1.3nn"
"During execution:ntHit any key to quit.n"
"tUsing OpenCV version " << CV_VERSION << "n&#
最后
以上就是傻傻纸鹤为你收集整理的opencv例程源代码-电脑摄像头人脸识别-facedetect.cpp的全部内容,希望文章能够帮你解决opencv例程源代码-电脑摄像头人脸识别-facedetect.cpp所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复