Reputation: 91
I'm using Delphi Tesseract wrapper which is available at https://github.com/CloudDelphi/TTesseractOCR4. Based on example here: Get font of recognized character with Tesseract-OCR I should call api.GetIterator()
method to get WordFontAttributes()
. As I see Delphi wrapper does not support api.GetIterator()
directly but has TTesseractPageLayout.AnalyseLayout
function to access GetIterator()
.
In OnRecognizeEnd
I call AnalyseLayout
, which returns words' texts but not font names:
Tesseract.PageLayout.AnalyseLayout;
for TesseractWord in Tesseract.PageLayout.Words do
begin
memo1.Lines.Add(TesseractWord.Text);
memo1.Lines.Add(TesseractWord.FontName);
end;
Could you please help me to resolve the issue?
Upvotes: 1
Views: 540
Reputation: 450
It seems that you are using tesseract version >= 4.0.0.0. On those versions, the recognition is done with neural networks (LSTM engine), so the font name is not available. The latest version that you can get the font name, is version 3, which uses the old engine.
You can read about it in the following links (user summited issues on official github repo):
Upvotes: 1