dlib人臉68特徵點檢測提速 毫秒級

2021-09-23 15:37:50 字數 1422 閱讀 6113

參考文章:

把原本低速的dlib人臉檢測換成了高速的haar檢測,提速明顯,但是精度下降

#include #include #include #include #include #include #include #include #include #include #include #include #include //using namespace dlib;

using namespace std;

//using namespace cv;

double getdistance(cvpoint pointo, cvpoint pointa);

int main(int argc, char *ar**)

//載入人臉形狀探測器

dlib::shape_predictor sp;

dlib::deserialize("shape_predictor_68_face_landmarks.dat") >> sp;

cv::videocapture cam("3.mp4");

while (cam.isopened())

//獲取人臉68個特徵點部位分布

std::vectorshapes;

for (int i = 0; i < dets.size(); i++)

if (!shapes.empty())

} //上下嘴唇

cvpoint p66 = cvpoint(shapes[0].part(66).x(), shapes[0].part(66).y());

cvpoint p62 = cvpoint(shapes[0].part(62).x(), shapes[0].part(62).y());

//左眼上下

速度很快,無卡頓現象

基於Dlib庫的人臉68個特徵點檢測

利用dlib.get frontal face detector 獲取人臉框 利用dlib.shape predictor shape predictor 68 face landmarks.dat 獲取人臉68個特徵點 import numpy as np import cv2 import dl...

人臉特徵點檢測

參考 face alignment by explicit shape regression。演算法的實現原始碼在裡的explicitshaperegression.cpp裡面。下面貼上乙個檢測結果 人臉特徵點有不少應用,比如可以對齊人臉,或者做人臉變形。在人臉資料庫裡挑選了一些人臉,對齊它們,求出...

人臉識別Dlib 68個特徵點

前面說了怎麼開啟攝像頭框出人臉,接下來學習了一下人臉的68個特徵點 直接 import dlib import cv2 與人臉檢測相同,使用dlib自帶的frontal face detector作為人臉檢測器 detector dlib.get frontal face detector 使用官方...