Skip to content
This repository has been archived by the owner on Aug 12, 2020. It is now read-only.

Commit

Permalink
Changed location of call to startTesseract
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanbrown committed Jan 14, 2010
1 parent 3dbf3b5 commit af2bdc0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
14 changes: 8 additions & 6 deletions OCRDemo/Classes/OCRDemoViewController.mm
Expand Up @@ -19,7 +19,6 @@ @implementation OCRDemoViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
// Custom initialization
[self startTesseract];

}
return self;
Expand All @@ -33,18 +32,21 @@ - (void)didReceiveMemoryWarning {
// Release any cached data, images, etc that aren't in use.
}

- (void)viewDidUnload {
- (void)viewDidLoad {
[super viewDidLoad];

// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}


- (void)dealloc {
[super dealloc];
[iv release];
iv = nil;
[label release];
label = nil;
[super dealloc];

}


Expand Down Expand Up @@ -124,7 +126,7 @@ - (NSString *) ocrImage: (UIImage *) uiImage
const UInt8 *imageData = CFDataGetBytePtr(data);

// this could take a while. maybe needs to happen asynchronously.
char* text = tess->TesseractRect(imageData,(int)bytes_per_pixel,(int)bytes_per_line, 0, 0,(int)imageSize.width, (int)imageSize.height);
char* text = tess->TesseractRect(imageData,(int)bytes_per_pixel,(int)bytes_per_line, 0, 0,(int) imageSize.height,(int) imageSize.width);

// Do something useful with the text!
NSLog(@"Converted text: %@",[NSString stringWithCString:text encoding:NSUTF8StringEncoding]);
Expand All @@ -145,8 +147,8 @@ -(UIImage *)resizeImage:(UIImage *)image {

int width, height;

width = [image size].width;
height = [image size].height;
width = 640;//[image size].width;
height = 640;//[image size].height;

CGContextRef bitmap;

Expand Down
4 changes: 3 additions & 1 deletion OCRDemo/OCRDemo.xcodeproj/project.pbxproj
Expand Up @@ -226,6 +226,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CODE_SIGN_IDENTITY = "iPhone Developer: Nolan Brown (255RW6M7GM)";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
Expand All @@ -236,7 +237,8 @@
"-stdc++",
);
PREBINDING = NO;
SDKROOT = iphoneos3.1;
PROVISIONING_PROFILE = "01F260E9-D5AB-4C46-9A15-7770A72FAB18";
SDKROOT = iphoneos3.0;
};
name = Debug;
};
Expand Down

0 comments on commit af2bdc0

Please sign in to comment.