seetaFace集成使用

seeta::FaceAlignment 是中科视拓开放的商用级人脸识别库 。包括,识别,检测,对齐等多个核心模块 。 https://github.com/seetafaceengine/SeetaFace6

集成环境

ndk-r14b ,

makelist文件:

1
2
3
add_subdirectory(src/main/cpp/alignment)

target_link_libraries 添加 seeta_fa_lib

build.gradle文件 :

1
2
//                arguments "-DANDROID_STL=c++_shared"
arguments "-DANDROID_STL=gnustl_static"

使用 :

初始化 :

Ptrseeta::FaceAlignment faceAlignment;

faceAlignment = makePtrseeta::FaceAlignment(“seeta_fa_v1.1.bin”);

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
		seeta::FacialLandmark points[5];
seeta::ImageData imageData(gray.cols, gray.rows);
//
imageData.data = gray.data;
seeta::FaceInfo faceInfo;
seeta::Rect bbox;

bbox.x = x;
bbox.y = y;
bbox.width = width;
bbox.height = height;

faceInfo.bbox = bbox;
//检测 人眼 等五个点
faceAlignment->PointDetectLandmarks(imageData, faceInfo, points);

error: htapp.cc:3026:9: error: call to ‘abs’ is ambiguous :
abs 改成 fabs 即可

https://github.com/kongxs/tomato/tree/camera2