title: Tesseract taking a lot of time to process on iOS - UPDATED
body: <p>I am working with <code>tesseractOCR</code> on <code>iOS</code>. I have configured it successfully and i am able to read text successfully too, however, i have 2 issues:</p>
  
  <ol>
  <li><p>the processing is taking a lot of time - almost 2 minutes (on iPhone 4S) everytime i try it, and around a minute on iPhone 5 for the first time, but does it in around 10 seconds from second time onwards.. and i need to get it done in around 3-4 seconds.</p></li>
  <li><p>when i activate the camera, i need a limited camera screen space using which a user can click an image (because he needs to read only a word). I am not able to achieve this. can someone please suggest how to do this?</p></li>
  </ol>
  
  <p>here's where i use the <code>UIImagePicker</code> control to activate the camera and take a snap</p>
  
  <pre><code>- (IBAction)buttonPressed:(id)sender {
  
      UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
      imagePickerController.delegate = self;
  
      if ([UIImagePickerController isCameraDeviceAvailable:UIImagePickerControllerCameraDeviceRear])
      {
          imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
          imagePickerController.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;
  
          [self presentViewController:imagePickerController
                             animated:YES
                           completion:nil];
      }
      else
      {
          UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Functionality Not Available" message:@"your device is not capable of taking photographs" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
          [alert show];
      }
  }
  </code></pre>
  
  <p>Here's where i send the reference of the clicked photograph to the required method</p>
  
  <pre><code>- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
  {
      self.selectedImage = [info objectForKey:UIImagePickerControllerOriginalImage];
      [self dismissViewControllerAnimated:YES completion:^{
          [self presentViewController:second animated:NO completion:NULL];
      }];
  
      [second getImageToShow:self.selectedImage];
  }
  </code></pre>
  
  <p>Here's where all the processing takes place</p>
  
  <pre><code>-(void)getImageToShow:(UIImage *)image
  {
      self.shownImage.image = image;
  
      dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0),
  
                     ^{ __block
  
      Tesseract* tesseract = [[Tesseract alloc] initWithDataPath:@"tessdata" language:@"eng"];
      [tesseract setVariableValue:@"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" forKey:@"tessedit_read_image"];
  
      [tesseract setImage:self.shownImage.image];
      [tesseract recognize];
  
  dispatch_async(dispatch_get_main_queue(), ^{
      NSLog(@" the text is %@", [tesseract recognizedText]);
      [self.processedLabel setText:[tesseract recognizedText]];
      [tesseract clear];
                         });
  
                     });
  }
  </code></pre>
  
  <p><em>*</em><code>processedLabel</code> is where i need to show the text to the user.</p>
  
  <p>Please help..</p>