#include <dlib/opencv.h>
#include <opencv2/opencv.hpp>
#include <dlib/image_processing/frontal_face_detector.h>
#include <dlib/image_processing/render_face_detections.h>
#include <dlib/image_processing.h>
#include <dlib/gui_widgets.h>
using namespace dlib;
using namespace std;
int main()
{
try
{
printf("加载人脸检测和姿态估计模型");
frontal_face_detector detector = get_frontal_face_detector();
shape_predictor pose_model;
printf("读取人脸特征点的训练资料");
deserialize("shape_predictor_68_face_landmarks.dat") >> pose_model;
cv::Mat temp;
temp=cv::imread("1.jpg");
cv_image<bgr_pixel> cimg(temp);
// 检测人脸
printf("\n检测人脸");
std::vector<rectangle> faces = detector(cimg);
// 找出每张脸的状态。
std::vector<full_object_dete
opencv结合dlib进行人脸特征点的检测
最新推荐文章于 2024-06-28 23:10:33 发布
本文探讨了使用OpenCV和Dlib进行人脸特征点检测时遇到的速度问题,指出需要GPU加速以提升效率。并提及存在一种能在毫秒级别实现人脸识别的方法,详情见链接。
摘要由CSDN通过智能技术生成