Patagames Software Support Forum
»
Tesseract.Net SDK
»
F.A.Q.
»
How to extract single characters, with box position, accuracy and font type
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,105
Thanks: 7 times Was thanked: 130 time(s) in 127 post(s)
|
QuestionI need example, or description how to read documents. I need as result single characters, with box position, accuracy and font type(from tessadata definition), which was used for reading. Thank you. AnswerHi, Please look at sample below. Also you can find documentation here: https://tesseract.patagames.com/helpand class diagram here: https://tesseract.pataga...6a-b024-d838a5562cc9.htmCode:
using (var api = OcrApi.Create())
{
using (var bmp = Bitmap.FromFile(@"test.jpg") as Bitmap)
{
api.Init();
api.SetImage(bmp);
api.Recognize();
api.PageSegmentationMode = Patagames.Ocr.Enums.PageSegMode.PSM_SINGLE_CHAR;
var iterator = api.Iterator;
do
{
string character = iterator.ChoiceIterator.Utf8Text;
float accuracy = iterator.ChoiceIterator.Confidence;
string fontName = iterator.WordFontName;
var rect = iterator.PageIterator.GetBoundingBox(Patagames.Ocr.Enums.PageIteratorLevel.RIL_SYMBOL);
}
while (iterator.Next(Patagames.Ocr.Enums.PageIteratorLevel.RIL_SYMBOL));
}
}
Edited by user 9 years ago
| Reason: Not specified
|
|
|
|
Patagames Software Support Forum
»
Tesseract.Net SDK
»
F.A.Q.
»
How to extract single characters, with box position, accuracy and font type
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close