TesseractRect top variable

Help
kihuynh
2007-09-19
2013-04-25
  • kihuynh
    kihuynh
    2007-09-19

    char* text = TessBaseAPI::TesseractRect(image.get_buffer(), image.get_bpp()/8,
                                              bytes_per_line, left, top,
                                              width, height);

    Wondering if anyone has tried modifying the left and top variables and were able to ocr the sub rectangle in an image. 

    I've modified the left, top, width, and height variable and all seems to work EXCEPT the top value.
    It seems that everytime I set the top to any value, it ALWAYS defaults to 0 (the top of the image).

    Has anyone been successful on ocr-ing a small portion of text in an image?

    i.e.,
    char* text = TessBaseAPI::TesseractRect(image.get_buffer(), image.get_bpp()/8,
                                              bytes_per_line, 108, 208,
                                              336, 82);
    the 208 value (top) always reads stuff starting at the top of the image.