2

AVFoundation を使用して、カメラ ロールから取得した画像に対して顔認識を実行したいと考えています。そもそも、これは可能ですか?

ライブカメラストリームを入力として使用してこれを行う方法に関する多くのチュートリアルを見つけました。それらを調べたところ、AVCaptureInputDevice を画像にバインドする方法が見つかりませんでした。

PS CoreImage を使用したくありません。実際には、CoreImage を捨てて、AVFoundation の顔認識を使用したいと考えています。

本当にありがとうございました。

4

1 に答える 1

0

CoreImageの何が問題になっていますか?同じ検出器を使用します。

NSURL *url = [NSURL URLWithString:@"..."];
CIImage *img = [CIImage imageWithContentsOfURL:url]; // uiImageObj.CIImage
CIContext *context = [CIContext contextWithOptions:nil];
NSDictionary *detectorOptions = [[NSDictionary alloc] initWithObjectsAndKeys:CIDetectorAccuracyLow, CIDetectorAccuracy, nil];
CIDetector *detector = [CIDetector detectorOfType:CIDetectorTypeFace context:context options:detectorOptions];
NSArray *features = [detector featuresInImage:img];
于 2012-10-27T16:05:23.587 に答える