当前位置: 软件>C/C++软件
面部地标探测器 Flandmark
本文导语: Flandmark 是一个开源实现面部地标探测器。提供 MATLAB 接口。 C++ 示例代码: #include "flandmark_detector.h" int main(int argc, char * argv[]) { // load flandmark model structure and initialize FLANDMARK_Model * model = flandmark_init("flandmark_model.dat"); ...
Flandmark 是一个开源实现面部地标探测器。提供 MATLAB 接口。
C++ 示例代码:
#include "flandmark_detector.h"
int main(int argc, char * argv[])
{
// load flandmark model structure and initialize
FLANDMARK_Model * model = flandmark_init("flandmark_model.dat");
// load input image
IplImage *img = cvLoadImage("photo.jpg");
// convert image to grayscale
IplImage *img_grayscale = cvCreateImage(cvSize(img->width, img->height), IPL_DEPTH_8U, 1);
cvCvtColor(img, img_grayscale, CV_BGR2GRAY);
// bbox with detected face (format: top_left_col top_left_row bottom_right_col bottom_right_row)
int bbox[] = {72, 72, 183, 183};
// detect facial landmarks (output are x, y coordinates of detected landmarks)
float * landmarks = (float*)malloc(2*model->data.options.M*sizeof(float));
flandmark_detect(img_grayscale, bbox, model, landmarks);
}
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。