LEADTOOLS Support
Document
Document SDK Questions
Help! Help! Problem with rasterOCR.GetRecognizedCharacters
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Wednesday, October 27, 2004 11:42:11 PM(UTC)
Groups: Registered
Posts: 1
Hi. Hit a problem with the method: rasterOCR.GetRecognizedCharacters(0)
It keeps telling me at the line in bold that “Object reference not set to an instance of an object.“
Can anyone help me please? Thanks!
Dim codecs As Codecs.RasterCodecs = New Codecs.RasterCodecs
Dim myImage As IRasterImage
Dim info As CodecsImageInfo
Dim oFile As System.IO.File
Dim oRead As System.IO.StreamReader
oRead = oFile.OpenText(fileName)
codecs.CodecsPath = "C:\Inetpub\wwwroot\OCRService\bin"
info = codecs.GetInformation(oRead.BaseStream,
True)
myImage = codecs.Load(oRead.BaseStream, 0, CodecsLoadByteOrder.RgbOrGray, 1, -1)
Dim rasterOCR As Ocr.RasterOcr = New Ocr.RasterOcr
rasterOCR.StartUp()
rasterOCR.SpellLanguageID = Leadtools.Ocr.RasterOcrLanguage.English
rasterOCR.RecognitionDataFileName = "C:\Inetpub\wwwroot\OCRService\bin\testX.rdf"
Dim CodecsCommand As Codecs.RasterCodecs = New Codecs.RasterCodecs
Dim rasterPageCount As Integer
rasterPageCount = myImage.PageCount
Dim isLocked As Boolean
isLocked = RasterSupport.IsLocked(RasterSupportType.Ocr)
rasterOCR.AddPage(myImage, -1)
Dim pageCount As Integer
pageCount = rasterOCR.PageCount
'required
'auto locate zone
rasterOCR.ZoneParser = Leadtools.Ocr.RasterOcrPageParser.Auto
rasterOCR.FindZones(0)
Dim zoneCount0 As Integer
zoneCount0 = rasterOCR.GetZonesCount(0)
rasterOCR.Recognize(0, 1)
Dim i As Integer
Dim myString As String
Dim recognizedChars() As Ocr.RasterOcrRecognizedCharacters
recognizedChars = rasterOCR.GetRecognizedCharacters(0)
#2
Posted
:
Monday, July 18, 2005 10:19:32 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
Hello,
I checked the code in a small VB.Net v14 project and its working fine.
Try the latest .Net patches, which you can get by sending your toolkit serial number to our support email address (don't post it here).
The build version of the LEADTOOLS .Net DLLs is 14.1.0.11
I am attaching the VB.NET project that I used in testing.
Thanks,
Maen Badwan
LEADTOOLS Technical Support
Edited by moderator Thursday, April 6, 2017 3:39:51 PM(UTC)
| Reason: Not specified
LEADTOOLS Support
Document
Document SDK Questions
Help! Help! Problem with rasterOCR.GetRecognizedCharacters
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.