我有一个如下所示的 VBScript 脚本:
Const ForAppending = 8
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile("C:\OCRresults.txt", ForAppending, True)
set miDoc=CreateObject("MODI.Document")
miDoc.Create ("C:\PathToTifScreenshot.tif")
miDoc.Images(0).OCR
set miLayout = miDoc.Images(0).Layout
stringOut=miLayout.Text
objTextFile.WriteLine stringOut
DoOCR = stringOut
Set miLayout = Nothing
Set miDoc = Nothing
Set objFSO = Nothing
它使用 MODI 对 tif 文件进行 OCR。然而,MODI 会自动识别旋转图像,我不希望它以这种方式工作。我基本上想要的是只有当图像正确旋转时才能正确进行 OCR。 MODI 的 gui 中有一个选项可以取消选中:“自动旋转”,但似乎这只适用于手动过程。有什么想法可以阻止我的脚本识别旋转图像吗?
最佳答案
莫迪的OCR
方法有三个参数:
expression.OCR(LangId, OCROrientImage, OCRStraightenImage)
第二个参数 OCROrientImage 的描述指出:
OCROrientImage Optional Boolean. Specifies whether the OCR engine attempts to determine the orientation of the page. Default is true.
尝试将此参数设置为 False,看看是否有帮助。
关于vbscript - 如何让 MODI 不识别旋转图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3343890/