I am trying to use iOS 5 faceetection, and I found that when I run the code on the simulator, it detects a face with the correct frame. However, if I run the same code on the same image on the device, it returns the wrong sizes. Here is my code:
CIImage* image = [CIImage imageWithCGImage:someImage.CGImage]; NSDictionary *detectorOptions = [NSDictionary dictionaryWithObjectsAndKeys: CIDetectorAccuracyHigh, CIDetectorAccuracy, nil]; CIDetector* detector = [CIDetector detectorOfType:CIDetectorTypeFace context:nil options:detectorOptions]; NSArray *faceFeatures = [detector featuresInImage:image]; for (CIFeature *f in faceFeatures) { NSLog(@"Feature: %@", NSStringFromRect(f.bounds)); }
Exit from the simulator (correct): Function: {{78, 153}, {200, 200}}
Output from device (invalid): Function: {{104, 199}, {272, 272}}
This is mistake? Or am I using the face detection code incorrectly? I also tried using featuresInImage: parameters and passing in another dictionary with device orientation
source share