Some of the heuristics in zxing fail on high resolution photos. The primary zxing use case is a relatively low res preview from a camera phone. The heuristics will sometimes misinterpret various kinds of noise in higher res images. The solution is to low-pass filter the images. Naive downsampling will usually do well enough.
On Mar 25, 2013, at 2:18 AM, Pavel Sergeyev <
xblxt...@gmail.com> wrote:
> I can't recognize QR code on some photos taken from standart iPhone Camera.
>
> Steps I did:
>
> 1) I Made a photo with standart iPhone Camera application and saved it to standart photo gallery. ( IPhone 4s. Resolution of the photo is 3264 : 2448. QR code is taking 70% of the photo.)
>
> 2) I took this photo into my variable photoImage of type UIImage* in my application. I used this UIImgePickerControllerDelegate method:
> - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
>
> self.photoImage = [info objectForKey:UIImagePickerControllerOriginalImage];
> [self dismissViewControllerAnimated:YES completion:nil];
> }
> 3) Then I tried to decode this UIImage using zXing decoder. I used this part of my code:
> Decoder *decoder = [Decoder new];
> NSMutableSet *readers = [NSMutableSet set];
> QRCodeReader* qrcodeReader = [QRCodeReader new];
> [readers addObject:qrcodeReader];
> [qrcodeReader release];
>
> decoder.readers = readers;
> decoder.delegate = self;
>
> [decoder decodeImage:photoImage];
>
> [decoder release];
>
> Then DecoderDelegate method was called:
> - (void)decoder:(Decoder *)decoder failedToDecodeImage:(UIImage *)image usingSubset:(UIImage *)subset reason:(NSString *)reason
>
> But I am sure my photo has high quality and QR code. So, the question is: why didn't zXing decoder recognize my photoImage?
> Is there any way to improve my code for avoiding this?
>
> Thanks in advance.
>
> You received this message because you are subscribed to the Google Groups "zxing" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to