Question

I'm working on an iphone app that uses Abbyy OCR.

Using the wrapper class for iphone there is a method :

[ocrManager recognizeImage:[choosenImage image] withCallback:self];

a UIImage is passed as a parameter which is used to recognize characters. But every time i receive exception "Required Data File Missed".

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

    [picker dismissModalViewControllerAnimated:YES];
    [[UIApplication sharedApplication] setStatusBarHidden:NO];
    if(check == 1)
    {
        return;
    }
    check = 1;
    UIImage *image = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
    [choosenImage setImage:image];
    [process setHidden:NO];
    NSString *filePath = [[NSBundle mainBundle] pathForResource:@"license" ofType:@""];
    NSData *license = [[NSData alloc] initWithContentsOfFile:filePath];
    CMocrManager *ocrManager = [CMocrManager createManager:license];

    NSSet *languages = [[NSSet alloc] initWithArray:[NSArray arrayWithObject:@"English"]];
    [ocrManager setLanguages:languages];
    [ocrManager setDefaultImageResolution:0];
    @try {
        [ocrManager recognizeImage:[choosenImage image] withCallback:self];
    }
    @catch (NSException *exception) {
        NSString *ex = exception.reason;
    }

    CMocrLayout* recognitionResult = [ocrManager copyRecognitionResults];
    NSArray* strings = [recognitionResult copyStrings];

}

the image can be seen on UIImageView but when I pass it to recognizeImage method it throws the exception.

I've been researching a lot but unable to find a solution. Any help is appreciated.

Was it helpful?

Solution

My name is Nikolay Khlebinsky, i work @ ABBYY.

"Required Data File Missed" error message is displayed when resource files are missing (keywords, patterns or dictionaries). Refer to «How to Work with the ABBYY Mobile OCR Engine Library on the iPhone» help article for project organization guide. You can also look for iPhone project sample in the engine distributive.

If you would still experience any difficulties, please visit our technical support contacts page at http://www.abbyy.com/support/contacts/ Choose your country and your product, hit 'Search' and you'll get contacts of the proper ABBYY representatives. Contacting them is the fastest way to solve technical issues.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top