Menu

Issue with iterator

Help
Juan Diego
2015-01-11
2015-01-16
  • Juan Diego

    Juan Diego - 2015-01-11

    Hi,

    When I run something like:

        Pointer utf8Text = TessAPI1.TessBaseAPIGetUTF8Text(handle);
        String result = utf8Text.getString(0);
        TessAPI1.TessDeleteText(utf8Text);
        System.out.println(result);
    

    I get the result fine and according to the original file. However, when I try:

        TessAPI1.TessResultIterator ri = TessAPI1.TessBaseAPIGetIterator(handle);
        TessAPI1.TessPageIterator pi = TessAPI1.TessResultIteratorGetPageIterator(ri);
        TessAPI1.TessPageIteratorBegin(pi);
    
        Pointer ptr = TessAPI1.TessResultIteratorGetUTF8Text(ri, TessAPI1.TessPageIteratorLevel.RIL_WORD);
    

    I get a value of null for ptr. What could be wrong? (BTW, if I run exactly the same code trying to read the famous eurotext.tif it works perfectly).

    Thanks.

     
  • Quan Nguyen

    Quan Nguyen - 2015-01-16

    If it worked with the sample image files, then it could be something wrong with your test image. Have you tried stepping through Tess4J's unit tests?

     

Log in to post a comment.