请告诉我在此代码中是否有任何错误。
faceDetectorOptions = [CIDetectorAccuracy: CIDetectorAccuracyLow]
faceDetector = CIDetector(ofType: CIDetectorTypeFace, context: nil, options: faceDetectorOptions )
let pixelBuffer : CVPixelBufferRef = CMSampleBufferGetImageBuffer(sampleBuffer)!
let attachments : CFDictionaryRef = CMCopyDictionaryOfAttachments(kCFAllocatorDefault, sampleBuffer, CMAttachmentMode(kCMAttachmentMode_ShouldPropagate))!
let ciImage : CIImage = CIImage(CVPixelBuffer: pixelBuffer, options: attachments as? [String : AnyObject])
let imageOptions = [CIDetectorSmile : true, CIDetectorEyeBlink : true , CIDetectorImageOrientation : 6 ]
let features = faceDetector.featuresInImage(ciImage, options: imageOptions)
我无法检测到任何面孔,它可能会起作用。 任何建议将不胜感激!