为 Android 应用程序进行人脸检测
想要实时检测摄像头预览流中的人脸吗?那么,您来对了地方。 FaceDetector 是一款库,其功能包括:
Fotoapparat 检测人脸非常简单:Fotoapparat
.with(context)
.into(cameraView)
.frameProcessor(
FaceDetectorProcessor
.with(context)
.build()
)
.build()若要在相机视图上顶部显示检测到的面部,请按照以下步骤设置布局。
创建 FaceDetectorProcessor:
Java:
FaceDetectorProcessor processor = FaceDetectorProcessor.with(this)
.listener(faces -> {
rectanglesView.setRectangles(faces); // (Optional) Show detected faces on the view.
// ... or do whatever you want with the result
})
.build()或 Kotlin:
private val processor = FaceDetectorProcessor.with(this)
.listener({ faces ->
rectanglesView.setRectangles(faces) // (Optional) Show detected faces on the view.
// ... or do whatever you want with the result
})
.build()暂无开放 Issues,或尚未同步最近议题。