OSD (Orientation and script detection) in android

75 views
Skip to first unread message

Ankit Aggarwal

unread,
Apr 27, 2016, 2:28:11 AM4/27/16
to tesseract-ocr
Hi Team,

I am an android developer and i am integrating Tesseract for OCR scanning. for my application i have the requirement to detect the orientation of the Ocr and based and that process the OCR.
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 using the following logic :

inputfile = "/usr/src/tesseract-3.02/eurotextUpsideDown.png";
    image = pixRead(inputfile);

    api->Init("/usr/src/tesseract-3.02/", "eng");
    api->SetPageSegMode(tesseract::PSM_AUTO_OSD);
    api->SetImage(image);
    api->Recognize(0);

    tesseract::PageIterator* it =  api->AnalyseLayout();
    tesseract::Orientation orientation;
    tesseract::WritingDirection direction;
    tesseract::TextlineOrder order;
    float deskew_angle;

    it->Orientation(&orientation, &direction, &order, &deskew_angle);
    printf("Orientation: %d;\nWritingDirection: %d\nTextlineOrder: %d\n" \
           "Deskew angle: %.4f\n",
           orientation, direction, order, deskew_angle);


But in android I cannot find the supported method AnalyseLayout() in the TessBaseApi.java class. Can some one help me to find the solution for this or can some one tell me the
api or the logic to get this.

Will be a great help for me. 


Thanks,
Ankit
Reply all
Reply to author
Forward
0 new messages