4、dlib学习笔记--提取人脸特征点(68点,opencv画图)
2018-01-26 15:00
1801 查看
一、效果图
参照
二、开发环境
(1)windows 10;
(2)Qt 5.8;
(3)opencv3.2;
(4)dlib 19.7;
(5)C++
三、代码
参照
二、开发环境
(1)windows 10;
(2)Qt 5.8;
(3)opencv3.2;
(4)dlib 19.7;
(5)C++
三、代码
// #include <iostream> #include <dlib/opencv.h> #include <opencv2/opencv.hpp> #include <opencv2/core.hpp> #include <opencv2/highgui.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; int main() { // 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; while(1) { cv::VideoCapture cap("wse.jpeg"); if (!cap.isOpened()) { std::cout << "Unable to connect to camera" << std::endl; return 1; } cv::Mat temp; cap >> temp; 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 i = 0; i < 68; i++) { circle(temp, cvPoint(shapes[0].part(i).x(), shapes[0].part(i).y()), 3, cv::Scalar(0, 0, 255), -1); // shapes[0].part(i).x();//68个 } } //Display it all on the screen cv::imshow("", temp); cv::waitKey(33); } } //
相关文章推荐
- Dlib提取人脸特征点(68点,opencv画图)
- Dlib提取人脸特征点(68点,opencv画图)
- OpenCV2学习笔记(十二):特征提取算法SIFT与SURF
- Dlib + python + opencv 实时人脸68特征点提取
- 【OpenCV学习笔记 018】SIFT特征提取分析和DoG角点检测
- OpenCV2学习笔记(十二):特征提取算法SIFT与SURF
- OpenCV学习笔记:基于Haar特征的人脸检测
- OpenCV学习笔记(二)——特征提取与描述
- OpenCV2学习笔记(十四):ORB特征提取
- opencv-python 学习笔记2:实现目光跟随(又叫人脸跟随)
- C++之Dlib库实现68个特征点人脸的提取(根据Dlib官网例程改写)
- OpenCv学习笔记(四):使用split函数提取彩色图像的三个通道
- 模式识别 学习笔记:第八章 特征提取
- opencv 特征点提取算法 SIFT SURF ORB FAST LBP学习(二)
- 深度学习笔记7 Working with Large Images 卷积特征提取
- Kinect开发学习笔记之(四)提取颜色数据并用OpenCV显示
- iOS开发之opencv学习笔记三:训练一套自己的特征库
- OpenCV学习笔记(一):使用CascadeClassifier检测人脸
- python OpenCV学习笔记(四):鼠标画图
- opencv-python 学习笔记2:实现目光跟随(又叫人脸跟随)