在pytesseract的上下文中,在配置tesseract以识别单位数字和限制单个数字和限制输出对数字可能会提出质疑。 To address this issue, we delve into the specifics of Tesseract's configuration options.
Tesseract Page Segmentation Modes
Tesseract offers various page segmentation modes (psm) to handle diverse text layouts.对于单个字符识别,合适的PSM为10。此模式将图像视为单个字符。将数字限制为数字,我们可以利用tessedit_char_char_char_char_whitelist configuration参数。通过将0123456789指定为白名单,Tesseract将仅接受这些字符。
示例示例示例usage示例是image_to_string的示例,具有image_to_string,具有多个配置选项: lang ='eng',box = false, config =' - PSM 10 -OEM 3 -C TESSEDIT_CHAR_WHITELIST = 0123456789')
通过将PSM设置为10并使用字符Whitelist,此配置可确保Tesseract可以识别单个数字,同时将输出限制为数值。此外,Lang指定语言,框禁用文本框边界,OEM选择了OCR引擎。
免责声明: 提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发到邮箱:[email protected] 我们会第一时间内为您处理。
Copyright© 2022 湘ICP备2022001581号-3