feat(face): 添加人脸识别距离过滤功能
- 在FaceHelper中添加人脸宽度小于200像素时的过滤逻辑 - 当检测到人脸过小时自动清除左侧人脸数据 - 防止远距离小人脸影响识别准确性 - 保留原有的活体检测流程不变
This commit is contained in:
@@ -341,6 +341,14 @@ public class FaceHelper implements FaceListener {
|
|||||||
refreshTrackId(faceInfoList);
|
refreshTrackId(faceInfoList);
|
||||||
if (faceInfoList.isEmpty()) {
|
if (faceInfoList.isEmpty()) {
|
||||||
return facePreviewInfoList;
|
return facePreviewInfoList;
|
||||||
|
} else {
|
||||||
|
FaceInfo currentFaceInfo = faceInfoList.get(0);
|
||||||
|
// L.e("currentFaceInfo width=" + currentFaceInfo.getRect().width() +
|
||||||
|
// "---height" + currentFaceInfo.getRect().height());
|
||||||
|
if (currentFaceInfo.getRect().width() < 200) {//距离远(人脸小),不识别
|
||||||
|
clearLeftFace(facePreviewInfoList);
|
||||||
|
return facePreviewInfoList;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!onlyDetectLiveness) {
|
if (!onlyDetectLiveness) {
|
||||||
code = ftEngine.process(rgbNv21, previewSize.width, previewSize.height, FaceEngine.CP_PAF_NV21, faceInfoList,
|
code = ftEngine.process(rgbNv21, previewSize.width, previewSize.height, FaceEngine.CP_PAF_NV21, faceInfoList,
|
||||||
|
|||||||
Reference in New Issue
Block a user