ITADN

[Enhancement] Return information from OSD only (tessedit_pageseg_mode=0)

#78Opendzastera 创建于 2025-08-21
D
dzasteracommented
When running tesseract with tessedit_page_seg=0 as an engine option the data returned are incomplete and do not contain the expected information on the script type or orientation of the page. By default an empty string is returned and with HOCR=TRUE the result only describes some minimal information about the document. I don't know enough Cpp to be positive, but I believe this is due to ocr_pix() returning either GetHOCRText() or GetUTF8Text() from the tesseract api and does not include GetOsdText(). Output currently: `> tesseract::ocr(asdf.pdf, engine = tesseract::tesseract(options = list(tessedit_pageseg_mode=0)))` `Converting page 1 to asdf.png... done!` `[1] ""` Ideally, the output would be a data frame containing the information returned from GetOsdText(), but the raw string is easy enough to parse that it may not be worth it. I have no good ideas for how to return the information when HOCR=TRUE or even if that option should be honored in this case.
0 条评论