I am working on an app where I have to read QR Code from still image. Following is the code that I have used to read the QR Code:
CIImage *ciimage = [CIImage imageWithCGImage:[getRotatedImage CGImage]];
NSDictionary *detectorOptions = @{ CIDetectorAccuracy : CIDetectorAccuracyHigh };
CIDetector *faceDetector = [CIDetector detectorOfType:CIDetectorTypeQRCode context:nil options:detectorOptions];
NSArray *features = [faceDetector featuresInImage:ciimage];
CIQRCodeFeature *faceFeature;
for(faceFeature in features)
{
NSString *str = [NSString stringWithFormat:@"%@",faceFeature.messageString];
break;
}
This code is working fine for some QR Code but some time it is not working with still image and return blank array. I have searched a lot and also see the Apple forum they have also described the same code that I have used. I am also attaching the image that is not decoded. Please any body has any type of information regarding this then share with me. It would be very appreciated. Thanks in advance.
I just tested your image locally, and I can confirm, the QR code isn't read. I believe your problem is the QR code. It seems that maybe the logo is interfering with the CIDetector. I replaced your QR Code with another QR code, and it worked.
This logs:
Found feature: http://en.m.wikipedia.org