Detect a face while my cam is open

Home / Uncategorized / Detect a face while my cam is open

i need to build an app with just a cam view, and it should detect my cam is looking at a face, can anyone point me in the right direction? I have built something that detects a face on an image, but i need to work with a cam, here is what i have done so far:- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
NSString *path = [[NSBundle mainBundle] pathForResource:@"picture" ofType:@"JPG"];
NSURL *url = [NSURL fileURLWithPath:path];

CIContext *context = [CIContext contextWithOptions:nil];

CIImage *image = [CIImage imageWithContentsOfURL:url];

NSDictionary *options = @{CIDetectorAccuracy: CIDetectorAccuracyHigh};

CIDetector *detector = [CIDetector detectorOfType:CIDetectorTypeFace context:context options:options];

NSArray *features = [detector featuresInImage:image];



Read more

Leave a Reply

Your email address will not be published. Required fields are marked *