将VNFaceObservation与Swift中存储的图像进行比较?

时间:2018-09-05 10:36:00

标签: swift arkit

我正在将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
                 }

               }
            }
         }

0 个答案:

没有答案