Can I use OCR to detect font style (bold, italic)? [closed]

让人想犯罪 __ 提交于 2019-12-03 06:08:02

问题


I am interested in using OCR to extract bold and italic words from a simple text. For example, if I input a clear image with text like so:

"The quick brown fox jumps over the lazy dog."

I would like to get an output like so: bold("brown", "jumps"), italic("lazy")

I have looked into doing this with OCRopus or Tesseract, but the documentation is poor and I can't tell if it's possible, or how to do it if it is.


回答1:


There is such function in Tesseract 3.0.1, from trunk. A new class is added to the API - ResultIterator, which has the following function you are interested in:

 WordFontAttributes(bool* is_bold,
                    bool* is_italic,
                    bool* is_underlined,
                    bool* is_monospace,
                    bool* is_serif,
                    bool* is_smallcaps,
                    int* pointsize,
                    int* font_id).  

Actually you can see it yourself from here.




回答2:


The Tesseract 3.0x's XML-based hOCR format includes character attributes. You may want to try that.

http://code.google.com/p/tesseract-ocr/issues/detail?id=377#c5



来源:https://stackoverflow.com/questions/5163329/can-i-use-ocr-to-detect-font-style-bold-italic

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!