Tesseract iOS camera low accuracy

307 views
Skip to first unread message

Nick Porter

unread,
Feb 23, 2014, 8:33:40 PM2/23/14
to tesser...@googlegroups.com

When I use an image taken with the camera on the iPhone and send it to tesseract the accuracy is horrible it is all garbage text, but when I choose the same image from the photo library I get great accuracy.

How can I improve tesseracts accuracy from a picture take with the camera? Here is what I am doing to the image before sending


- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {






   
UIImage *image = info[UIImagePickerControllerOriginalImage];

   
CGFloat newWidth = 1200;

   
CGSize newSize = CGSizeMake(newWidth, newWidth);

    image
= [image resizedImage:newSize interpolationQuality:kCGInterpolationHigh];




   
Tesseract* tesseract = [[Tesseract alloc]initWithLanguage:@"eng"];

   
[tesseract setVariableValue:@"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@#&*()-_:." forKey:@"tessedit_char_whitelist"];

   
[tesseract setVariableValue:@"`~!%^*[]{}<>?|" forKey:@"tessedit_char_blacklist"];

   
[tesseract setImage:image];

   
[tesseract recognize];

   
NSLog(@"%@", [tesseract recognizedText]);




   
[picker dismissViewControllerAnimated:YES completion:NULL];




}


PARVEZ QURESHI

unread,
Aug 20, 2015, 2:48:10 PM8/20/15
to tesseract-ocr
I am also seeing same kind of issue. If I embed the image inside iOS application and pass on black & white version of the image duly scaled to 640 px then tesseract works with quite a good accuracy. On the other hand same code failed to extract any text when capturing the same image using IOS camera. Can anybody tell what is causing tesseract to get failed while using camera?
Reply all
Reply to author
Forward
0 new messages