【dlib】人脸68特征点检测
2017-07-04 17:00
344 查看
有部分转自:http://blog.csdn.net/zmdsjtu/article/details/53454071
VS2012 dlib库:http://download.csdn.net/detail/qq_15947787/9885919
源码如下:http://download.csdn.net/detail/qq_15947787/9888611(包含shape_predictor_68_face_landmarks.dat)
运行时x64 Release速度可以接受,Debug下检测速度很慢很慢
将dlib人脸68特征点检测与caffe结合,能做出很好玩的程序,附上大神的:
VS2012 dlib库:http://download.csdn.net/detail/qq_15947787/9885919
源码如下:http://download.csdn.net/detail/qq_15947787/9888611(包含shape_predictor_68_face_landmarks.dat)
运行时x64 Release速度可以接受,Debug下检测速度很慢很慢
#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 { // Load face detection and pose estimation models. frontal_face_detector detector = get_frontal_face_detector(); shape_predictor pose_model; deserialize("shape_predictor_68_face_landmarks.dat") >> pose_model; // Grab and process frames until the main window is closed by the user. // Grab a frame cv::Mat temp; //cap >> temp; temp = cv::imread("1.jpg", 1); cv_image<bgr_pixel> cimg(temp); // Detect faces std::vector<rectangle> faces = detector(cimg); // Find the pose of each face. std::vector<full_object_detection> shapes; for (unsigned long i = 0; i < faces.size(); ++i) shapes.push_back(pose_model(cimg, faces[i])); if (!shapes.empty()) { for (int j = 0; j < shapes.size(); j++) { for (int i = 0; i < 68; i++) { circle(temp, cvPoint(shapes[j].part(i).x(), shapes[j].part(i).y()), 3, cv::Scalar(0, 0, 255), -1); putText(temp, to_string(i), cvPoint(shapes[j].part(i).x(), shapes[j].part(i).y()), CV_FONT_HERSHEY_PLAIN, 1, cv::Scalar(255, 0, 0),1,4); } } } //Display it all on the screen imshow("Dlib特征点", temp); imwrite("Dlib特征点.jpg", temp); cv::waitKey(0); } catch (serialization_error& e) { cout << "You need dlib's default face landmarking model file to run this example." << endl; cout << "You can get it from the following URL: " << endl; cout << " http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2" << endl; cout << endl << e.what() << endl; } }
将dlib人脸68特征点检测与caffe结合,能做出很好玩的程序,附上大神的:
相关文章推荐
- Dlib + python + opencv 实时人脸68特征点提取
- opencv结合dlib进行人脸特征点的检测
- dlib python人脸检测 特征点定位
- Dlib人脸特征点检测(速度优化)
- Dlib人脸特征点检测(速度优化)
- Dlib机器学习库学习系列三人脸对齐(特征点检测)
- Dlib人脸特征点检测性能测试(光照+各部分功能模块运行时间)
- dlib 04 dlib自带demo 基于HOG的人脸特征检测
- python 3利用Dlib 19.7实现摄像头人脸检测特征点标定
- 人脸检测、提取特征点(dlib下的三个例子)
- Haar、pico、npd、dlib等多种人脸检测特征及算法结果比较
- 关于人脸检测中的Haar特征提取
- 基于Gabor特征提取和人工智能神经网络的人脸检测matlab代码
- 人脸检测—Haar特征与积分图
- 怎样让机器学会检测人脸——2、Haar特征
- dlib人脸检测功能介绍
- 浅析人脸检测之Haar分类器方法:Haar特征、积分图、 AdaBoost 、级联
- C++之Dlib库实现68个特征点人脸的提取(根据Dlib官网例程改写)
- 人脸特征点检测:SDM
- dlib人脸训练和关键点检测