开发者

How do I make MODI not identify rotated images?

I have a VBScript script that looks like this:

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

It uses MODI to OCR a tif file. However, MODI automatically identifies rotated images and I do not want it to work this way. What I basically want is for it to OCR properly only when the image is properly rotated. There is an option in the gui of MODI that you can uncheck开发者_如何学C: "Auto Rotate", but it seems that this only works for the manual process. Any ideas how I can prevent my script from identifying rotated images?


The MODI's OCR method has three parameters:

expression.OCR(LangId, OCROrientImage, OCRStraightenImage)

The description for the 2nd parameter, OCROrientImage, states:

OCROrientImage Optional Boolean. Specifies whether the OCR engine attempts to determine the orientation of the page. Default is true.

Try setting this parameter to False and see if it helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜