Quantcast
Viewing latest article 7
Browse Latest Browse All 10

Answer by himanshu_chawla for Getting the bounding box of the recognized words using python-tesseract

Some examples are answered aove which can be used with pytesseract, however to use tesserocr python library you can use code given below to find individual word and their bounding boxes:-

    with PyTessBaseAPI(psm=6, oem=1) as api:            level = RIL.WORD            api.SetImageFile(imagePath)            api.Recognize()            ri = api.GetIterator()            while(ri.Next(level)):                word = ri.GetUTF8Text(level)                boxes = ri.BoundingBox(level)                print(word,"word")                print(boxes,"coords")

Viewing latest article 7
Browse Latest Browse All 10

Trending Articles