我成功完成了本教程:Tesseract OCR Tutorial for iOS 。它使用 Tesseract OCR iOS framework .
该应用程序与教程提供的示例图像配合得很好,但我自己测试的图像都不起作用(输出是乱码)。
要进行故障排除,文档建议 toggling a configuration variable tessedit_write_images
为 true
(或使用configfile get.images
)查看要处理的图像文件。但我不知道在哪里设置 bool 值,并且不确定在哪里放置或如何使用配置文件。
在 Xcode 中的文件中搜索“tessedit_write_images”不会返回任何内容。
最佳答案
您可以通过作为命令行选项或在配置文件中提供来设置配置变量
使用命令行选项
$tesseract input.jpg output.txt --oem 2 -l eng -c tessedit_write_images=1
-c configvar=value
Set value for control parameter. Multiple -c arguments are allowed.
使用配置文件 (myConfig) 选项
$ tesseract Lord_Saraswathi.jpg text --oem 2 -l eng myConfig
$ cat myConfig
tessedit_write_images 1
关于ios - 如何在 Tesseract 中使用配置变量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66072973/