Forum > Beginners

Tesseract OCR library not loaded

(1/1)

TomTom:
Hello
I have problem running example from Tesseract. I'm not sure if I copied all files to right places.
So my project looks sth like this

--- Code: ---..
bin\tessdata
bin\samples
bin\<all the dlls provided with tesseract>
<pas files from tesseract>
unit.pas

--- End code ---

Projects is compiling but when I hit the button I get exception message saying that 'Tesseract library is not loaded'
My code is simple...

--- Code: ---procedure TForm1.Button1Click(Sender: TObject);
begin
   Tesseract := TTesseractOCR4.Create;
  try
    if Tesseract.Initialize('tessdata' + PathDelim, 'eng') then
    begin
      Tesseract.SetImage('samples' + PathDelim + 'eng-text.png');
      Memo1.lines.add(Tesseract.RecognizeAsText);
    end;
  finally
    Tesseract.Free;
  end;
end; 
--- End code ---

I appreciate any help :)

af0815:
The first question is still simple - is the bitness of the tesseract libs the same you compile your project for ? Eg. 64 Bit libs for 64 bit Target.

The libs should be in the same place your compiled binary is, for the firsts tests.

TomTom:
Yes, that was the issue. I installed Laz 32bit and it works fine. Thank You :)
Now I need to find a way to restrict tesseract to search/recognize only digits :). My goal is to read only numeric values from JPG files. Sadly some of them are handwritten and quality of those JPG files is sometimes bad. But I have a starting point now.

Navigation

[0] Message Index

Go to full version