Q:

Face Detection algorithm is not working if I click a snap from landscape mode

I have used the below code to detect face from an image:
-(void)markFaces:(UIImageView *)imagePick {

CIImage* image = [CIImage imageWithCGImage:imagePick.image.CGImage];
CIDetector* detector = [CIDetector detectorOfType:CIDetectorTypeFace 
                                          context:nil options:[NSDictionary dictionaryWithObject:CIDetectorAccuracyHigh forKey:CIDetectorAccuracy]];
NSDictionary* imageOptions = [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:6] forKey:CIDetectorImageOrientation];
NSLog(@"imageOptions %@",imageOptions);
NSArray* features = [detector featuresInImage:image options:imageOptions];

if([features count] > 0)
{
    NSLog(@"Face Found");
}
else
{
    NSLog(@"Face not Found");        
}
}

and this algorithm is not working if I click a snap from landscape mode. Why? Any help would be appreciated.
Thanks in Advance

A:

I think the problem is in this line:
NSDictionary* imageOptions = [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:6] forKey:CIDetectorImageOrientation];

You are actually telling it to look for portrait orientations only as the number you are passing is 6.
The documentation in the header file says that:

// Options that can be used with -[CIDetector featuresInImage:options:]
/* The value for this key is an integer NSNumber from 1..8 such as that
   found in kCGImagePropertyOrientation.  If present, the detection will be done
   based on that orientation but the coordinates in the returned features will
   still be based on those of the image. */

And the options are 

It's annoying that featuresInImage:options: is not documented (I'll have to file a bug now that I've seen it)

