Dlib人脸关键点检测顺序
2016-10-20 17:47
666 查看
dlib19.2 只可以使用VS2015update3进行cmake,不然会提示你c++11特性不能够支持,导致编译不通过。
- 人脸关键点检测关键代码
最好参考一下这篇博客Opencv与dlib联合进行人脸关键点检测与识别Mat ProcessFace::DrawDetectedFace(){ Mat imgDrawFace = srcImage;//这个变量是指向待检测人脸的图片 for (int i = 0; i < (detectedFaceData ? *detectedFaceData : 0); i++) { short * p = ((short*)(detectedFaceData + 1)) + 6 * i; Rect opencvRect(p[0], p[1], p[2], p[3]); int x = p[0]; int y = p[1]; int w = p[2]; int h = p[3]; int neighbors = p[4]; printf("face_rect=[%d, %d, %d, %d], neighbors=%d\n", x, y, w, h, neighbors); Point left(x, y); Point right(x + w, y + h); cv::rectangle(imgDrawFace, left, right, Scalar(230, 255, 0), 4); dlib::rectangle dlibRect((long)opencvRect.tl().x, (long)opencvRect.tl().y, (long)opencvRect.br().x - 1, (long)opencvRect.br().y - 1); dlib::full_object_detection shape = sp(dlib::cv_image<uchar>(srcGrayImage), dlibRect); for (int i = 0; i<shape.num_parts(); i++) { shape.part(0).x(); //point pt = shape.part(i); int x = shape.part(i).x(); int y = shape.part(i).y(); char str[3]; itoa(i, str, 10); line(imgDrawFace, Point(shape.part(i).x(), shape.part(i).y()), Point(shape.part(i).x(), shape.part(i).y()), Scalar(0, i*3, 255), 2); putText(imgDrawFace, str, Point(shape.part(i).x(), shape.part(i).y()), FONT_HERSHEY_DUPLEX, 0.5, Scalar(0, 255, 0), 2); } //std::vector<dlib::full_object_detection> shapes; //shapes.push_back(shape);//把点保存在了shape中 //dlib::array<dlib::array2d<dlib::rgb_pixel>> face_chips; //extract_image_chips(dlib::cv_image<uchar>(srcGrayImage), get_face_chip_details(shapes), face_chips); //imgDrawFace = dlib::toMat(face_chips[0]); //cvtColor(imgDrawFace, imgDrawFace, CV_BGR2GRAY); } return imgDrawFace; }
- 人脸68个关键点分布情况
相关文章推荐
- python下通过dlib和opencv实现人脸对齐(包括关键点检测和仿射变换)
- Dlib库中实现正脸人脸关键点(landmark)检测的测试代码
- Opencv与dlib联合进行人脸关键点检测与识别【转】
- Dlib库中实现正脸人脸关键点(landmark)检测的测试代码
- 用dlib和opencv进行不同角度人脸检测及68个关键点提取(Python)
- dlib人脸训练和关键点检测
- 人脸关键点检测 ubuntu 16.04 + DLib + GPU(CUDA9 + cudnn7.0.5)
- dlib人脸关键点检测的模型分析与压缩
- dlib python 人脸检测与关键点标记
- Opencv与dlib联合进行人脸关键点检测与识别
- Dlib人脸检测及关键点描述的python实现
- C++ Dlib Landmark 人脸关键点检测
- dlib人脸检测
- 人脸识别,人脸关键点检测算法
- 人脸数据库大全(包括人脸识别、关键点检测、表情识别,人脸姿态等等)
- python dlib学习(三):调用cnn人脸检测
- dlib19.9+opencv3.4的人脸检测验证
- 人脸关键点检测-递归编解码网络
- 人脸关键点检测
- tf-6 .人脸关键点检测