title: Digital numbers recognition with Opencv + OCR on android
body: <p>i'm currently developing an android application to recognize digital numbers of an electricity meter. i've done most of the work but i still not getting a good result. 80% of the time i get a false one.</p>
  
  <p>This is an example (i'm testing with a kitchen scale which is very similar to the meter) :</p>
  
  <p><strong>Original photo :</strong>
  <a href="https://i.stack.imgur.com/RiXSo.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RiXSo.jpg" alt="enter image description here"></a></p>
  
  <p><strong>image after cropping and processing with OpenCV :</strong>
  <a href="https://i.stack.imgur.com/Ttswc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ttswc.png" alt="enter image description here"></a></p>
  
  <p><strong>image after OCR (expected result that was obtained after several shots) :</strong>
  <a href="https://i.stack.imgur.com/8s5ga.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8s5ga.png" alt="enter image description here"></a></p>
  
  <p><strong>image after OCR (unexpected result which is obtained often) :</strong>
  <a href="https://i.stack.imgur.com/iDljz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iDljz.png" alt="enter image description here"></a></p>
  
  <p><strong>Method used to process the image with OpenCV :</strong> </p>
  
  <pre><code>public Bitmap Bildverarbeitung (Bitmap image){
  
      Mat tmp = new Mat (image.getWidth(), image.getHeight(), CvType.CV_8UC1);
      Utils.bitmapToMat(image, tmp);
      Imgproc.cvtColor(tmp, tmp, Imgproc.COLOR_RGB2GRAY);
      Imgproc.GaussianBlur(tmp, tmp, new Size(3, 3), 0);
      Imgproc.threshold(tmp, tmp, 0, 255, Imgproc.THRESH_OTSU);
      Utils.matToBitmap(tmp, image);
      return image;
  }
  </code></pre>
  
  <p>I used two trained data but only one works better :</p>
  
  <p><a href="https://github.com/adri1992/Tesseract_sevenSegmentsLetsGoDigital" rel="nofollow noreferrer">traineddata that works good</a></p>
  
  <p><a href="https://github.com/arturaugusto/display_ocr" rel="nofollow noreferrer">traineddata that doesn't work</a></p>
  
  <p>can anyone help me get better results.. Is there any changes that i can do? or other methods that i can apply ? thanks in advance</p>