You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I working on a project where I would like to find bold text in an image (medical repport).
For this Im using WordFontAttributes trhough the following function:
def get_words_info(image_path, tessdata_path):
"""
get path to image and path to tessdata and return dict with info about each word
"""
api = PyTessBaseAPI(path=tessdata_path)
with PyTessBaseAPI(path=tessdata_path) as api:
api.SetImageFile(image_path)
api.Recognize()
iter = api.GetIterator()
level = RIL.WORD
result = []
for r in iterate_level(iter, level):
element = r.GetUTF8Text(level)
word_attributes = r.WordFontAttributes()
base_line = r.BoundingBox(level)
print(base_line)
if element:
word_attributes['word'] = element
word_attributes['position'] = base_line
result.append(word_attributes)
return result
I tried this bold detection on several images on jpg format. For some the bold text is detected nicely but for some other like the picture bellow the bold text is not detected (bold boolean to false in the resust)
here is the exemple for the doctor name in bold at the bottom right :
I working on a project where I would like to find bold text in an image (medical repport).
For this Im using WordFontAttributes trhough the following function:
I tried this bold detection on several images on jpg format. For some the bold text is detected nicely but for some other like the picture bellow the bold text is not detected (bold boolean to false in the resust)
here is the exemple for the doctor name in bold at the bottom right :
Does someone know why the bold detection is not consistent ?
Thanks
The text was updated successfully, but these errors were encountered: