Skip to content

Commit

Permalink
Auto-run layout analysis in G8RecognitionOperation.
Browse files Browse the repository at this point in the history
Fixes #155.
  • Loading branch information
Kevin Conley committed Apr 3, 2015
1 parent 1fba58b commit 7d504de
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions TesseractOCR/G8RecognitionOperation.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ - (id) initWithLanguage:(NSString *)language
- (void)main
{
@autoreleasepool {
// Analyzing the layout must be performed before recognition
[self.tesseract analyseLayout];

[self.tesseract recognize];
}
}
Expand Down
9 changes: 9 additions & 0 deletions TesseractOCR/G8Tesseract.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,15 @@ extern NSInteger const kG8MaxCredibleResolution;
*/
- (NSString *)recognizedHOCRForPageNumber:(int)pageNumber;

/**
* Run Tesseract's page analysis on the target image.
*
* @note You must have a file called "osd.traineddata" in the "tessdata"
* folder to use this method. You can download this file from:
* https://code.google.com/p/tesseract-ocr/downloads/list
*/
- (void)analyseLayout;

/**
* The result of Tesseract's orientation analysis of the target image. See
* `G8Orientation` in G8Constants.h for the possible orientations.
Expand Down

0 comments on commit 7d504de

Please sign in to comment.