如何确定关键点本人在ORB描述符中的位置?

时间:2019-03-08 21:07:50

标签: c++ opencv dlib

我想在OpenCV中获取ORB描述符,但是我想自己确定KeyPoints的位置。为此,我使用了dlib中的“人脸地标检测”来查找人脸地标:

dlib::frontal_face_detector faceDetector = dlib::get_frontal_face_detector();

dlib::shape_predictor landmarkDetector;

const char* FaceLandmarksModel = "shape_predictor_68_face_landmarks.dat";
dlib::deserialize(FaceLandmarksModel) >> landmarkDetector;

Ptr<FeatureDetector> detector = ORB::create();
Ptr<DescriptorExtractor> descriptor = ORB::create();

Mat im = imread("pic.jpg", 1);
dlib::cv_image<dlib::bgr_pixel> dlibIm(im);

std::vector<dlib::rectangle> faceRects = faceDetector(dlibIm);

for (int i = 0; i < faceRects.size(); i++) 
{
    dlib::full_object_detection landmarks = landmarkDetector(dlibIm, faceRects[i]);
    //some code
    std::vector<KeyPoint> keypoints;
    detector->detect(im, keypoints);
}

现在,我的问题是,如何获取地标而不是将关键点作为KeyPoint?

0 个答案:

没有答案