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];
}