How to use OCR Google cloud vision

Mansour_Dalir 2,036 Reputation points
2024-06-03T17:25:55.55+00:00

I got this error

Grpc.Core.RpcException

HResult=0x80131500

Message=Status(StatusCode="Internal", Detail="Received RST_STREAM with error code 2", DebugException="Grpc.Core.Internal.CoreErrorDetailException: {"created":"@1717430193.968000000","description":"Error received from peer ipv4:142.250.186.42:443","file":"......\src\core\lib\surface\call.cc","file_line":953,"grpc_message":"Received RST_STREAM with error code 2","grpc_status":13}")

Source=mscorlib

StackTrace:

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at Google.Api.Gax.Grpc.ApiCallRetryExtensions.<>c__DisplayClass0_0`2.<<WithRetry>b__0>d.MoveNext()

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Google.Cloud.Vision.V1.ImageAnnotatorClient.<AnnotateAsync>d__76.MoveNext()

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Google.Cloud.Vision.V1.ImageAnnotatorClient.<AnnotateSingleFeatureTypeAsync>d__78`1.MoveNext()

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()

at Excel_Helper.frmOcrGoogle.VB$StateMachine_16_Button1_Click.MoveNext() in E:\Programing\Main Project\Excel Helper\Excel Helperok\Excel Helper\frmOcrGoogle.vb:line 7

Inner Exception 1:

CoreErrorDetailException: {"created":"@1717430193.968000000","description":"Error received from peer ipv4:142.250.186.42:443","file":"......\src\core\lib\surface\call.cc","file_line":953,"grpc_message":"Received RST_STREAM with error code 2","grpc_status":13}

Imports Google.Cloud.Vision.V1
Public Class frmOcrGoogle
    Private Async Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Environment.SetEnvironmentVariable("GOOGLE_APPLICATION_CREDENTIALS", "d:\rare-style-425306-h2-871e00f11ae0.json")
        Dim img = Await Image.FromFileAsync("d:\000002.bmp")
        Dim clint = Await ImageAnnotatorClient.CreateAsync()
        Dim TextAnn = Await clint.DetectTextAsync(img)'From here on, it doesn't move forward, it gets an error
        For Each anno In TextAnn
            TextBox1.AppendText($"{anno.Description} ")
        Next
    End Sub
End Class

I doubt this part: .json File .I don't know what this file is, but I got it from here User's image

        Environment.SetEnvironmentVariable("GOOGLE_APPLICATION_CREDENTIALS", "d:\rare-style-425306-h2-871e00f11ae0.json")
Community Center | Not monitored
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Olaf Helper 47,436 Reputation points
    2024-06-03T18:17:40.8466667+00:00

    How to use OCR Google cloud vision

    Then ask Google, they should know it better then Microsoft.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.