I am trying to use google cloud vision api text detection.
using System;
using Google.Apis.Auth.OAuth2;
using Google.Cloud.Vision.V1;
using Google.Api.Gax.Grpc;
namespace blablabla
{
class Program
{
static void Main(string[] args)
{
string filePath = @"D:\Manisha\Pictures\1.png";
var image = Image.FromFile(filePath);
var client = ImageAnnotatorClient.Create();
var response = client.DetectText(image);
foreach (var annotation in response)
{
if (annotation.Description != null)
Console.WriteLine(annotation.Description);
}
Console.ReadLine();
}
}
}
I am getting the following error at
"var client = ImageAnnotatorClient.Create();"
"The Application Default Credentials are not available. They are available if running in Google Compute Engine. Otherwise, the environment variable GOOGLE_APPLICATION_CREDENTIALS must be defined pointing to a file defining the credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information."
I have set the GOOGLE_APPLICATION_CREDENTIALS to the json file path. Where am i actually going wrong. Am i missing some important steps?
var credential = GoogleCredential.GetApplicationDefault();- Dan WilsonImageAnnotatorClient. - Dan Wilson