title: ocr- My image wont recognize in tesseract ocr
body: <p>Hi Im currently new in Tesseract-ocr and I want to recognize my image when i take a picture.. Im using ionic framework to do that.. The capturing of image is fine it works well but when I click the button for the functionality of the ocr it does nothing.. I just followed the docs in <a href="https://github.com/gustavomazzoni/cordova-plugin-tesseract" rel="nofollow noreferrer">https://github.com/gustavomazzoni/cordova-plugin-tesseract</a></p>
  
  <p>This is my html</p>
  
  <pre><code>&lt;ion-view view-title="OCR Testing"&gt;
      &lt;ion-content padding="true"&gt;
          &lt;button class="button button-block button-positive" ng-click="startOCR()"&gt;
              &lt;i class="icon ion-ios-camera"&gt;&lt;/i&gt; Scanbot OCR
          &lt;/button&gt;
          &lt;button class="button button-block button-positive" ng-click="scan()"&gt;
              &lt;i class="icon ion-ios-camera"&gt;&lt;/i&gt; Scan
          &lt;/button&gt;
          &lt;!--   &lt;button class="button button-block button-positive" ng-if="currentDocumentImage.originalImageFileUri" ng-click="startCroppingUi()"&gt;
        &lt;i class="icon ion-ios-crop-strong"&gt;&lt;/i&gt; Scanbot Cropping UI
      &lt;/button&gt;
   --&gt;
          &lt;!-- &lt;img ng-if="currentDocumentImage.imageFileUri" src="{{currentDocumentImage.imageFileUri}}" class="img-big-thumbnail padding"&gt; --&gt;
          &lt;img ng-if="image" src="{{image}}" class="img-big-thumbnail padding"&gt;
          &lt;code&gt;{{text}}&lt;/code&gt;
  
      &lt;/ion-content&gt;
      &lt;/ion-views&gt;
  </code></pre>
  
  <p>and this is my controller</p>
  
  <pre><code>.controller('ScanbotOCRCtrl', function($scope, $cordovaCamera, DemoImageStorage, PhotoLibrary) {
  
      $scope.startOCR = function() {
  
        $scope.imageData = '';
  
          var options = {
              quality: 90,
              destinationType: Camera.DestinationType.DATA_URL,
              sourceType: Camera.PictureSourceType.CAMERA,
              allowEdit: true,
              encodingType: Camera.EncodingType.JPEG,
              targetWidth: 500,
              targetHeight: 500,
              popoverOptions: CameraPopoverOptions,
              saveToPhotoAlbum: false
                  // correctOrientation: true
          };
  
          $cordovaCamera.getPicture(options).then(function(imageData) {
              $scope.image = "data:image/jpeg;base64," + imageData;
              $scope.text = null;
  
              $timeout(function() {
                  // DOM has finished rendering
                  // insert here the call to TesseractPlugin.recognizeText function to recognize the text
                  $scope.imageData = $scope.image;
  
              });
  
  
          }, function(err) {
              // error
              console.log('ERROR with camera plugin. Error: ' + err);
          });
  
      };
  
  
      $scope.scan = function() {
  
          window.TesseractPlugin.recognizeText($scope.imageData, language, function(recognizedText) {
              $scope.text = recognizedText;
              alert(recognizedText);
          }, function(reason) {
              console.log('Error on recognizing text from image. ' + reason);
          });
  
  
      }
  </code></pre>