我可以使用OCR来检测字体样式(粗体,斜体)吗? [英] Can I use OCR to detect font style (bold, italic)?
问题描述
我对使用OCR从简单文本中提取粗体和斜体字感兴趣.例如,如果我输入一个清晰的图像,其文字如下:
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."
我想要这样的输出:bold("brown","jumps"),italic("lazy")
I would like to get an output like so: bold("brown", "jumps"), italic("lazy")
我已经考虑过使用OCRopus或Tesseract进行此操作,但是文档不多,我无法确定是否可行,或者怎么做.
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.
推荐答案
在Tesseract 3.0.1中,从主干开始就有这样的功能.新类已添加到API-ResultIterator
中,该类具有您感兴趣的以下功能:
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).
实际上,您可以从此处查看.
这篇关于我可以使用OCR来检测字体样式(粗体,斜体)吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!