Search code examples
vb.netleadtools-sdk

How to fix invalid Height/width error in Leadtools OCR Form recognise?


I am working on OMR Result software. I am using Leadtools 19 in vb.net. when I load scanned documents, Leadtools ocr engine recognize some documents successfully but in some documents its throw exception "Invalid height/width". I am using deskew and highquality rotate command to fix this. This commands remove this exception some time but not every time. I am using this code below

Note: All Images are same dpi(300) and resolution.

Dim command As ImageProcessing.Core.DeskewCommand = New         
ImageProcessing.Core.DeskewCommand
Command.Flags = DeskewCommandFlags.UseCheckDeskew Or
DeskewCommandFlags.UseLineDetectionCheckDeskew
Dim rcmd As HighQualityRotateCommand = New HighQualityRotateCommand
rcmd.Angle = command.Angle * 100

Solution

  • It looks like you already contacted LEADTOOLS Support via email and sent over the files that you are testing.

    The image that you are using is not common since you are OCRing an OMR form field with almost no text and the advantage engine excludes OMR fields from its calculations. I have forwarded this to engineering and they added a feature to not return an error in this situation.

    We will be contacting you via email as well with more information on the resolution.