Skip to content

Commit

Permalink
Merge pull request #49 from wiazur/patch-9
Browse files Browse the repository at this point in the history
Updated endpoint
  • Loading branch information
wiazur authored Sep 26, 2019
2 parents 3a485be + 803006b commit 55d08b5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions dotnet/ComputerVision/RecognizeText/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ namespace Microsoft.Azure.CognitiveServices.Samples.ComputerVision.RecognizeText

public class Program
{
public const string subscriptionKey = "<your training key here>"; //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);
Expand All @@ -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
Expand Down

0 comments on commit 55d08b5

Please sign in to comment.