raffaeldantas / tesseract-ocr

Automatically exported from code.google.com/p/tesseract-ocr
Other
1 stars 0 forks source link

IOS OCR tesseract not release the memory after being nil and using ACR #1371

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.when looping tesseract function to recognize multiple images
2.
3.

What is the expected output? What do you see instead?
the expected to release the memory for ever instant object of tesseract however 
the memory is increased every time we create instant tesseract object

Please use labels and text to provide additional information.
example code in objective see, this function is looped for multiple images 
however the app is crash because of memory problem

   -(void)recognizeImageWithTesseract:(UIImage *)img
    {

     UIImage *testb = [img blackAndWhite];

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

       tesseract.delegate = self;
         [tesseract setVariableValue:@"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+-/*._=':!)(" forKey:@"tessedit_char_whitelist"]; //limit search
        [tesseract setImage:testb];
        [tesseract recognize];
         recognizedText = [tesseract recognizedText];
        tesseract = nil; //deallocate and free all memory
}

Original issue reported on code.google.com by hossam.h...@gmail.com on 2 Nov 2014 at 10:43

GoogleCodeExporter commented 9 years ago
see first point in 
https://code.google.com/p/tesseract-ocr/wiki/FAQ#Rules_and_advices

Original comment by zde...@gmail.com on 7 Feb 2015 at 7:23