title: Enhance readability of TessBaseAPI.getUTF8Text()
body: <p>I tried to use Tesseract OCR via Tess-Two in Android to recognize text from an image (developed using Android Studio).</p>
  
  <p>In gradle, I added the following line into dependencies section:</p>
  
  <pre><code>compile 'com.rmtheis:tess-two:5.4.1'
  </code></pre>
  
  <p>Then, in the main activity's <code>onCreate()</code>, I have the following codes to initialize the library and load an image:</p>
  
  <pre><code>    final String lang = "eng";
      TessBaseAPI baseAPI = new TessBaseAPI();
      boolean initResult = baseAPI.init(Environment.getExternalStorageDirectory().getPath(), lang);
      if(initResult) {
          InputStream is = null;
          try {
              is = getAssets().open("test2.jpg");
              final Drawable drw = Drawable.createFromStream(is, null);
              Bitmap bmp = ((BitmapDrawable) drw).getBitmap();
  
              baseAPI.setDebug(true);
              baseAPI.setImage(bmp);
              ImageView imageView = (ImageView)findViewById(R.id.imageView);
              imageView.setImageBitmap(bmp);
  
              String recognizedText = baseAPI.getUTF8Text().trim();
              Log.d(TAG, recognizedText);
              TextView textView = (TextView) findViewById(R.id.txt_debug);
              textView.setText(recognizedText);
              baseAPI.end();
          } catch (FileNotFoundException nfe) {
              Log.d(TAG, "File Not Found");
              nfe.printStackTrace();
          } catch (IOException ioe) {
              Log.d(TAG, "Unable to open the file");
              ioe.printStackTrace();
          }
      } else {
          Log.d("OCR", "Unable to init Base API");
      }
  </code></pre>
  
  <p>Last, I put the JPEG in the asset folder (<code>app/src/main/assets/</code>). Here is the JPEG, basically a paragraph of text.</p>
  
  <p><a href="https://i.stack.imgur.com/0UQTK.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0UQTK.jpg" alt="JPEG"></a></p>
  
  <p>However, the OCR result is (pretty much garbage):</p>
  
  <pre><code>OWW WW ON
  R W WWW WK
  KW MK
  214
  3 W5 HE WM
  M WW WWW
  LFNWW VW QTY
  VM ACNL 19 WE NH
  5 332152391
  HQ W M W
  </code></pre>
  
  <p>How to improve readability of the scan?</p>
  
  <p>I tried the following Page Sec Mode, but the results are <em>empty</em>:</p>
  
  <pre><code>// Automatic page segmentation with orientation and script detection
  baseAPI.setPageSegMode(TessBaseAPI.PageSegMode.PSM_AUTO_OSD);
  // Treat the image as a single text line
  baseAPI.setPageSegMode(TessBaseAPI.PageSegMode.PSM_SINGLE_LINE);
  </code></pre>