logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Paul Rayman  
#1 Posted : Wednesday, September 7, 2016 9:33:09 PM(UTC)
Paul Rayman

Rank: Administration

Groups: Administrators
Joined: 1/5/2016(UTC)
Posts: 1,011

Thanks: 5 times
Was thanked: 121 time(s) in 118 post(s)
Question
Is it to possible to get the word coordinates after the ocr process?

Answer
Yes it is. Please look at code below
Code:

using (var api = OcrApi.Create())
{
    using (var bmp = Bitmap.FromFile(@"d:\0\test.png") as Bitmap)
    {

        api.Init();
        api.SetImage(bmp);
        api.Recognize();

        var iterator = api.Iterator;
        do
        {
            //Gets bounding rectangle of the current object at the given level.
            var rect = iterator.PageIterator.GetBoundingBox(Patagames.Ocr.Enums.PageIteratorLevel.RIL_WORD);
            var word = iterator.GetUtf8Text(Patagames.Ocr.Enums.PageIteratorLevel.RIL_WORD);
        }
        while (iterator.Next(Patagames.Ocr.Enums.PageIteratorLevel.RIL_WORD));
    }
}
Users browsing this topic
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.