我是靠谱客的博主 傻傻纸鹤,这篇文章主要介绍opencv例程源代码-电脑摄像头人脸识别-facedetect.cpp,现在分享给大家,希望可以做个参考。

源代码在opencv中的例程里面,文件路径如下:
opencvsourcessamplescppfacedetect.cpp。
(PS:所用OpenCV版本为3.4.5)
VS2017运行会提示错误,fopen。This function or variable may be unsafe。
是因为以前的函数安全性不够,所以微软重写了新的函数。
解决方法-百度经验

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#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内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(74)

评论列表共有 0 条评论

立即
投稿
返回
顶部