title: How to properly extract orientation info of the image using Tesseract 3.04?
body: <p>I have Tesseract 3.04 static build and am trying to extract orientation info using the code provided in <a href="https://github.com/tesseract-ocr/tesseract/wiki/APIExample" rel="nofollow">official samples</a>:</p>
  
  <pre><code> const char* inputfile = "/usr/src/tesseract/testing/eurotext.tif";
    tesseract::Orientation orientation;
    tesseract::WritingDirection direction;
    tesseract::TextlineOrder order;
    float deskew_angle;
  
    PIX *image = pixRead(inputfile);
    tesseract::TessBaseAPI *api = new tesseract::TessBaseAPI();
    api-&gt;Init("/usr/src/tesseract/", "eng");
    api-&gt;SetPageSegMode(tesseract::PSM_AUTO_OSD);
    api-&gt;SetImage(image);
    api-&gt;Recognize(0);
  
    tesseract::PageIterator* it =  api-&gt;AnalyseLayout();
    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>My application crashes on extraction on the following line:</p>
  
  <pre><code>it-&gt;Orientation(&amp;orientation, &amp;direction, &amp;order, &amp;deskew_angle);
  </code></pre>
  
  <p>What is going wrong in this code?</p>
  
  <p>Thanks!</p>