C++之Dlib库实现68个特征点人脸的提取(根据Dlib官网例程改写)

本文档展示了如何使用C++和Dlib库从图像中检测和提取68个人脸特征点。通过加载预训练的shape_predictor模型,程序能够检测图像中的脸部并显示对应的面部特征点。此外,程序还能够保存标准化大小的人脸切片。
摘要由CSDN通过智能技术生成
#include <fstream>  
#include <string>  
#include <iostream>  

#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>
#include <dlib/image_io.h>
#include <opencv2/core/core.hpp>  
#include <dlib/timer.h>

#include "highgui.h"

using namespace dlib;
using namespace std;

// ----------------------------------------------------------------------------------------

int main()
{  
	try
	{
		// We need a face detector.  We will use this to get bounding boxes for
		// each face in an image.
		frontal_face_detector detector = get_frontal_face_detector();

		// And we also need a shape_predictor.  This is the tool that will predict face
		// landmark positions given an image and face bounding box.  Here we are just
		// loading the model from the shape_predictor_68_fac
  • 1
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值