opencv结合dlib进行人脸特征点的检测

本文探讨了使用OpenCV和Dlib进行人脸特征点检测时遇到的速度问题,指出需要GPU加速以提升效率。并提及存在一种能在毫秒级别实现人脸识别的方法,详情见链接。
摘要由CSDN通过智能技术生成
#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
  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值