我在哪里可以找到适用于OpenCV的面部基准点

我在哪里可以找到适用于OpenCV的面部基准点

本文介绍了我在哪里可以找到适用于OpenCV的面部基准点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找已经训练好的面部基准点(左眼的左上角,左眼的右上角,右眼的左上角,右眼的右上角,嘴的左上角,嘴的右上角, ,鼻子的中央和右侧).
有谁知道我在哪里可以下载已经训练有素的hacascascades来与OpenCV的VJ功能一起使用?

I am looking for already trained haarcascades of facial fiducial points (left corner of left eye, right corner of left eye, left corner of right eye, right corner of right eye, left corner of mouth, right corner of mouth, left, center and right side of nose).
Does anyone know where can I download an already trained haarcascades to use with OpenCV's VJ function?

推荐答案

如果我不太误会,HaarCascade可以处理不具有特定点的对象. opencv数据文件夹中已经有鼻子,眼睛和嘴巴的分类器.您可以使用它们来检测眼睛,鼻子和嘴巴,而不是通过使用精心设计的,精心设计的检测算法(利用您的想象力和头脑)来发现它们的角.

If I m not so badly mistaken, HaarCascade works with objects not with specific points. There are already classifiers for nose,eye and mouth within opencv data folder. You can detect eyes,nose and mouth with them, than you can find corners of them by using specifically well and wise crafted detection algorithms (use your imagination and mind).

这里是一个例子;

CascadeClassifier cascade;
cascade.load("haarcascade_eye.xml");

Mat im = imread("photo.jpg",0); //0 flag for grayscale

vector<Rect> eyes;
cascade.detectMultiScale(im, eyes, 1.2, 3);

for (int i = 0; i < eyes.size(); i++)
{
    Rect r = eyes[i];
    rectangle(im, Point(r.x, r.y), Point(r.x + r.width, r.y+r.height),CV_RGB(0,255,0));
}

imshow("im",im);

此示例在加载的图像中查找眼睛.寻找嘴巴和鼻子也很相似.它找到它们为矩形,然后将这些矩形绘制为图像.我不知道这些矩形是否足以满足您的需求,但是您是否需要更具体的点,例如鼻子中心;您将需要进行更多处理.

This example finds the eyes in the loaded image. Finding mouth and nose is also similar. It finds them as rectangle and we draw these rectangles to image. I don't know if these rectangles are enough for you but if you want more specific points, like center of nose; you will need to do more processing.

这篇关于我在哪里可以找到适用于OpenCV的面部基准点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 14:31