我正在将ARkit与Vision Framework结合使用。我在[VNFaceObservation]中检测到人脸。但是如何将这些面孔与存储的图像进行比较以验证用户身份。
guard let capturedImage = sceneView.session.currentFrame?.capturedImage else { return }
let image = CIImage.init(cvPixelBuffer: capturedImage)
let detectFaceRequest = VNDetectFaceRectanglesRequest { (request, error) in
DispatchQueue.main.async {
//Loop through the resulting faces and add a red UIView on top of them.
if let faces = request.results as? [VNFaceObservation] {
for face in faces {
// How to compare these faces with store image to authticate user
}
}
}
}