i’m test ocr for implementention in another project.
here is just a website project Framework 4.8. join image for test in this post.
i’ve install Aspose.OCR from nuget packets.
and i make 2 tests, one is just ocr an image (from your sample) and another is find text in image.
the first when it’s run api.reconize(…) is long time and wait, wait … no error, no pass to the next instruction
Private Sub btnOcr_Click(sender As Object, e As EventArgs) Handles btnOcr.Click
dim license As License = new License()
license.SetLicense("Aspose.Total.lic")
dim filtres As PreprocessingFilter = New PreprocessingFilter()
filtres.Add(PreprocessingFilter.AutoDewarping)
filtres.Add(PreprocessingFilter.ContrastCorrectionFilter)
dim pj As OcrInput = New OcrInput(InputType.SingleImage, filtres)
dim fileName as string = "~/img/PJ175986.png"
fileName = Server.MapPath(fileName)
dim rawFile as byte() = IO.File.ReadAllBytes(fileName)
dim stream As Io.Stream = new io.MemoryStream(rawFile)
'pj.Add(stream)
pj.Add("D:\Dev\PJ175986.png")
Dim settings As RecognitionSettings = New RecognitionSettings()
settings.Language = Language.Fra
'settings.DetectAreasMode =DetectAreasMode.CURVED_TEXT
dim api as AsposeOcr = New AsposeOcr()
Dim results As List(Of RecognitionResult) = api.Recognize(pj,settings)
Dim text As String = results(0).GetSpellCheckCorrectedText(SpellCheckLanguage.Fra)
timg1.Text = text
End Sub
and i’ve make the other test, “find text” and i’ve got an error on api.ImageHasText :
System.TypeInitializationException : ‘Une exception a été levée par l’initialiseur de type pour ‘’.’
TypeInitializationException : Une exception a été levée par l’initialiseur de type pour ‘Microsoft.ML.OnnxRuntime.NativeMethods’.
EntryPointNotFoundException : Impossible de trouver le point d’entrée ‘OrtGetApiBase’ dans la DLL ‘onnxruntime’.
Cette exception a été levée à l’origine dans cette pile des appels :
Microsoft.ML.OnnxRuntime.NativeMethods.NativeMethods() dans NativeMethods.shared.cs
Private Sub btnSearch_Click(sender As Object, e As EventArgs) Handles btnSearch.Click
dim license As License = new License()
license.SetLicense("Aspose.Total.lic")
dim api as AsposeOcr = New AsposeOcr()
dim fileName as string = "D:\Dev\PJ175986.png"
if api.ImageHasText(fileName,"long")
Dim a =1
End If
End Sub
AposeOCR version is the last, and ML.OnnxRuntime is 1.18.1 (last)
PJ175986.jpg (122,1 Ko)