资源简介

利用OpenCV在VS2015平台下对进行人脸识别,包含整个工程文件

资源截图

代码片段和文件信息

#include   
#include  
using namespace std;
using namespace cv;
int main(int argc char** argv)
{
Mat src = imread(“me.jpg“);
namedWindow(“input_image window“ WINDOW_AUTOSIZE);
imshow(“inputimage“ src);
CascadeClassifier detector;
//detector.load(“E:\\SOFTWARE\\opencv\\sources\\data\\haarcascades\\haarcascade_eye.xml“);//检测眼睛
//detector.load(“E:\\SOFTWARE\\opencv\\sources\\data\\haarcascades\\haarcascade_eye_tree_eyeglasses.xml“);
//detector.load(“E:\\SOFTWARE\\opencv\\sources\\data\\haarcascades\\haarcascade_frontalcatface.xml“);
//detector.load(“E:\\SOFTWARE\\opencv\\sources\\data\\haarcascades\\haarcascade_frontalcatface_extended.xml“);
detector.load(“D:\\Software\\opencv343\\sources\\data\\haarcascades\\haarcascade_frontalface_alt.xml“);//人脸检测(有效)
//detector.load(“E:\\SOFTWARE\\opencv\\sources\\data\\haarcascades\\haarcascade_frontalface_alt_tree.xml“);
//detector.load(“E:\\SOFTWARE\\opencv\\sources\\data\\haarcascades\\haarcascade_frontalface_alt2.xml“);
//detector.load(“E:\\SOFTWARE\\opencv\\sources\\data\\haarcascades\\haarcascade_frontalface_default.xml“);
//detector.load(“E:\\SOFTWARE\\opencv\\sources\\data\\haarcascades\\haarcascade_fullbody.xml“);
//detector.load(“E:\\SOFTWARE\\opencv\\sources\\data\\haarcascades\\haarcascade_lefteye_2splits.xml“);
//detector.load(“E:\\SOFTWARE\\opencv\\sources\\data\\haarcascades\\haarcascade_licence_plate_rus_16stages.xml“);
//detector.load(“E:\\SOFTWARE\\opencv\\sources\\data\\haarcascades\\haarcascade_lowerbody.xml“);
//detector.load(“E:\\SOFTWARE\\opencv\\sources\\data\\haarcascades\\haarcascade_profileface.xml“);
//detector.load(“E:\\SOFTWARE\\opencv\\sources\\data\\haarcascades\\haarcascade_righteye_2splits.xml“);
//detector.load(“E:\\SOFTWARE\\opencv\\sources\\data\\haarcascades\\haarcascade_russian_plate_number.xml“);
//detector.load(“E:\\SOFTWARE\\opencv\\sources\\data\\haarcascades\\haarcascade_smile.xml“);
//detector.load(“E:\\SOFTWARE\\opencv\\sources\\data\\haarcascades\\haarcascade_upperbody.xml“);


vectorfaces;
detector.detectMultiScale(src faces 1.1 3 0 Size(30 30));
for (size_t t = 0; t < faces.size(); t++)
{
rectangle(src faces[t] Scalar(0 0 255) 2 8);

}
namedWindow(“result window“ WINDOW_AUTOSIZE);
imshow(“result“ src);
imwrite(“face_recog.jpg“ src);
waitKey(0);
return 0;
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-01-10 16:03  image_face_detection - 副本\
     目录           0  2019-01-10 16:03  image_face_detection - 副本\.vs\
     目录           0  2019-01-10 16:03  image_face_detection - 副本\.vs\peizhi\
     目录           0  2019-01-10 16:03  image_face_detection - 副本\.vs\peizhi\v14\
     文件       30208  2019-01-09 16:24  image_face_detection - 副本\.vs\peizhi\v14\.suo
     目录           0  2019-01-10 16:03  image_face_detection - 副本\Debug\
     目录           0  2019-01-10 16:03  image_face_detection - 副本\peizhi\
     目录           0  2019-01-10 16:03  image_face_detection - 副本\peizhi\Debug\
     目录           0  2019-01-10 16:03  image_face_detection - 副本\peizhi\Debug\peizhi.tlog\
     文件        2718  2019-01-09 16:23  image_face_detection - 副本\peizhi\main.cpp
     文件        7376  2018-12-06 16:50  image_face_detection - 副本\peizhi\peizhi.vcxproj
     文件         945  2018-12-06 16:50  image_face_detection - 副本\peizhi\peizhi.vcxproj.filters
     目录           0  2019-01-10 16:03  image_face_detection - 副本\peizhi\x64\
     目录           0  2019-01-10 16:03  image_face_detection - 副本\peizhi\x64\Debug\
     文件      544056  2019-01-09 16:23  image_face_detection - 副本\peizhi\x64\Debug\main.obj
     文件         236  2019-01-09 16:23  image_face_detection - 副本\peizhi\x64\Debug\peizhi.log
     目录           0  2019-01-10 16:03  image_face_detection - 副本\peizhi\x64\Debug\peizhi.tlog\
     文件        2658  2019-01-09 16:23  image_face_detection - 副本\peizhi\x64\Debug\peizhi.tlog\CL.command.1.tlog
     文件      119210  2019-01-09 16:23  image_face_detection - 副本\peizhi\x64\Debug\peizhi.tlog\CL.read.1.tlog
     文件        1302  2019-01-09 16:23  image_face_detection - 副本\peizhi\x64\Debug\peizhi.tlog\CL.write.1.tlog
     文件        5418  2019-01-09 16:23  image_face_detection - 副本\peizhi\x64\Debug\peizhi.tlog\link.command.1.tlog
     文件        6170  2019-01-09 16:23  image_face_detection - 副本\peizhi\x64\Debug\peizhi.tlog\link.read.1.tlog
     文件        1274  2019-01-09 16:23  image_face_detection - 副本\peizhi\x64\Debug\peizhi.tlog\link.write.1.tlog
     文件         227  2019-01-09 16:23  image_face_detection - 副本\peizhi\x64\Debug\peizhi.tlog\peizhi.lastbuildstate
     文件     1510400  2019-01-09 16:23  image_face_detection - 副本\peizhi\x64\Debug\vc140.idb
     文件     2330624  2019-01-09 16:23  image_face_detection - 副本\peizhi\x64\Debug\vc140.pdb
     目录           0  2019-01-10 16:03  image_face_detection - 副本\peizhi\x64\Release\
     文件     3752664  2018-12-06 16:59  image_face_detection - 副本\peizhi\x64\Release\main.obj
     文件         467  2018-12-06 16:59  image_face_detection - 副本\peizhi\x64\Release\peizhi.log
     目录           0  2019-01-10 16:03  image_face_detection - 副本\peizhi\x64\Release\peizhi.tlog\
     文件         658  2018-12-06 16:59  image_face_detection - 副本\peizhi\x64\Release\peizhi.tlog\CL.command.1.tlog
............此处省略19个文件信息

评论

共有 条评论