First Test apose OCR : api.reconize no response and crash in Find text in image

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)

@conan76

Is it possible that you can share your sample project with us? You can create a .zip of the project and upload here after removing packages from it. We will restore the packages on our side and test the scenario accordingly.

Sample project send.

It’s a sample project for future possible implementation on our website asp.net (vb.net/sql) and future/current implementation in Wpf application (C#,sql) because user can copy part of text and describe terrain, parcels implementation for construct zone of houses.

OCR.7z (3,6 Mo)

@conan76

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): OCRNET-873

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.