Piyachet Kanda
Piyachet Kanda

Reputation: 149

C# - How to use Tesseract 3.0 Wrapper to get bounding box of each characters?

I am currently using this wrapper for my basic implementation of Tesseract. But I'm a little confused with the loops in the examples. It seems like there is no other help or documentation about the wrapper. Is there a way to get the bounding box of each characters?

Upvotes: 2

Views: 1801

Answers (1)

nguyenq
nguyenq

Reputation: 8355

Using 3.2 alpha:

List<Rectangle> GetSegmentedRegions(Bitmap image, PageIteratorLevel level)
{
    using (var engine = new TesseractEngine(Datapath, Language, EngineMode.Default))
    {
        using (var page = engine.Process(image))
        {
            List<Rectangle> boxes = page.GetSegmentedRegions(level);
            return boxes;
        }
    }
}

Upvotes: 3

Related Questions