【发布时间】:2013-11-27 19:44:47
【问题描述】:
我正在编写 OSX Mavericks 上的一些人脸检测代码,并尝试利用 CIDetector 提供的跨多个静止图像功能的新的(截至 10.8 版)人脸跟踪。
我的基本人脸检测工作正常,如下所示:
- (void)captureOutput:(AVCaptureOutput *)captureOutput
didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
fromConnection:(AVCaptureConnection *)connection {
CVImageBufferRef imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer);
CIImage *image = [CIImage imageWithCVImageBuffer:imageBuffer];
CIDetector *faceDetector = [CIDetector detectorOfType:CIDetectorTypeFace
context:nil
options:@{ CIDetectorAccuracy : CIDetectorAccuracyHigh,
CIDetectorTracking : @YES
}];
NSArray *features = [faceDetector featuresInImage:image];
for ( CIFaceFeature *feature in features ) {
if (feature.hasTrackingID) {
NSLog(@"tracking id: %@", @(feature.trackingID));
}
}
}
功能列表确实已正确填充,但该 trackingID 似乎从未出现。 有没有人在小牛队得到这个工作?它在山狮上以同样的方式失败。
我在这里看到了一个类似的问题 (CIFaceFeature trackingID is always coming same for multiple faces),但我没有在那里学到任何新东西。
对于它的价值,它似乎在 iOS 上运行正常。
【问题讨论】:
标签: macos cocoa face-detection osx-mavericks core-image