From 803006bf8650e4a1525a735b334a1e5c2dfcb777 Mon Sep 17 00:00:00 2001 From: Winona Azure <38537084+wiazur@users.noreply.github.com> Date: Thu, 29 Aug 2019 18:47:13 -0700 Subject: [PATCH] Updated endpoint --- dotnet/ComputerVision/RecognizeText/Program.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dotnet/ComputerVision/RecognizeText/Program.cs b/dotnet/ComputerVision/RecognizeText/Program.cs index 3d19ab8..4473d9e 100644 --- a/dotnet/ComputerVision/RecognizeText/Program.cs +++ b/dotnet/ComputerVision/RecognizeText/Program.cs @@ -11,9 +11,9 @@ namespace Microsoft.Azure.CognitiveServices.Samples.ComputerVision.RecognizeText public class Program { - public const string subscriptionKey = ""; //Insert your Cognitive Services subscription key here - public const string endpoint = "https://westus.api.cognitive.microsoft.com"; // You must use the same Azure region that you generated your subscription keys for. Free trial subscription keys are generated in the westus region. - + public const string subscriptionKey = Environment.GetEnvironmentVariable("COMPUTER_VISION_SUBSCRIPTION_KEY"); + public const string endpoint = Environment.GetEnvironmentVariable("COMPUTER_VISION_ENDPOINT"); + static void Main(string[] args) { RecognizeTextSample.RunAsync(endpoint, subscriptionKey).Wait(5000); @@ -28,8 +28,8 @@ public class RecognizeTextSample public static async Task RunAsync(string endpoint, string key) { Console.WriteLine("Recognizing text from the images:"); - - string imageFilePath = @"Images\handwritten_text.jpg"; // See this repo's readme.md for info on how to get these images. Alternatively, you can just set the path to any appropriate image on your machine. + // See this repo's readme.md for info on how to get these images. Or, set the path to any appropriate image on your machine. + string imageFilePath = @"Images\handwritten_text.jpg"; string remoteImageUrl = "https://github.com/Azure-Samples/cognitive-services-sample-data-files/raw/master/ComputerVision/Images/printed_text.jpg"; await RecognizeTextFromStreamAsync(imageFilePath, endpoint, key, "Handwritten"); //the last parameter is whether the text that has to be extracted is printed or handwritten