title: Orientation and script detection (OSD) using Tesseract in Android
body: <p>I am an android developer and i am integrating Tesseract for OCR scanning. for my application i have the requirement to detect the OCR from any angle of phone and in any mode (portrait or landscape) mode of phone. For this I am trying to get orientation and skew angle of the OCR and based on that i will deskew the image and process the OCR.</p>
  
  <p>I have gone though various post to find the way to get the Orientation but was unable to succeed. As per one of the post it is mentioned to get the orientation and skew angle using the following logic:</p>
  
  <pre><code>inputfile = "/usr/src/tesseract-3.02/eurotextUpsideDown.png";
  image = pixRead(inputfile);
  
  api-&gt;Init("/usr/src/tesseract-3.02/", "eng");
  api-&gt;SetPageSegMode(tesseract::PSM_AUTO_OSD);
  api-&gt;SetImage(image);
  api-&gt;Recognize(0);
  
  tesseract::PageIterator* it =  api-&gt;AnalyseLayout();
  tesseract::Orientation orientation;
  tesseract::WritingDirection direction;
  tesseract::TextlineOrder order;
  float deskew_angle;
  
  it-&gt;Orientation(&amp;orientation, &amp;direction, &amp;order, &amp;deskew_angle);
  printf("Orientation: %d;\nWritingDirection: %d\nTextlineOrder: %d\n" \
         "Deskew angle: %.4f\n",
         orientation, direction, order, deskew_angle);
  </code></pre>
  
  <p>But in android I cannot find the supported method <code>AnalyseLayout()</code> in the <code>TessBaseApi.java</code> class.</p>
  
  <p>I want to get the logic to process the image in way so that i can deskew the image and process it. </p>
  
  <p>any information will be of great help.</p>