
--- scribo/ChangeLog | 4 ++++ scribo/scribo/text/recognition.hh | 11 +++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/scribo/ChangeLog b/scribo/ChangeLog index 4574778..360f65d 100644 --- a/scribo/ChangeLog +++ b/scribo/ChangeLog @@ -1,5 +1,9 @@ 2011-01-25 Guillaume Lazzara <z@lrde.epita.fr> + * scribo/text/recognition.hh: Make use of TessBaseAPI::setImage. + +2011-01-25 Guillaume Lazzara <z@lrde.epita.fr> + * scribo/text/recognition.hh: Fix invalid free(). 2011-01-25 Guillaume Lazzara <z@lrde.epita.fr> diff --git a/scribo/scribo/text/recognition.hh b/scribo/scribo/text/recognition.hh index 7a72ee4..59f269e 100644 --- a/scribo/scribo/text/recognition.hh +++ b/scribo/scribo/text/recognition.hh @@ -180,14 +180,13 @@ namespace scribo line_image.ncols(), // n cols line_image.nrows()); // n rows # else // HAVE_TESSERACT_3 - char* s = tess.TesseractRect( + tess.SetImage( (unsigned char*) line_image.buffer(), - sizeof (bool), // Pixel size. - line_image.ncols() * sizeof (bool), // Row_offset - 0, // Left - 0, // Top line_image.ncols(), // n cols - line_image.nrows()); // n rows + line_image.nrows(), // n rows + sizeof (bool), // Pixel size. + line_image.ncols() * sizeof (bool)); // Row_offset + char* s = tess.GetUTF8Text(); # endif // ! HAVE_TESSERACT_2 if (s != 0) -- 1.5.6.5