| services | cognitive-services, computer vision |
|---|---|
| platforms | dotnet, c# |
| author | easyj2j |
This repository provides the latest sample code for Cognitive Services Computer Vision SDK quickstarts. These samples target the Microsoft.Azure.CognitiveServices.Vision.ComputerVision 3.2.0 client library.
These samples demonstrate how to use the Computer Vision client library for C# to perform the following actions:
- Analyze an image
- Extract handwritten or printed text from an image
- Generate a thumbnail of an image
Two image input methods are demonstrated for each sample:
- Uploading a local image
- Specifying the URL of a remote image
- You need a subscription key for the Computer Vision service to run the samples. You can get free trial subscription keys from Try Cognitive Services. For more information, see How to obtain subscription keys.
- Any edition of Visual Studio 2017.
- Clone or download the repository.
- Navigate to the ComputerVision folder.
- Double-click the ComputerVision.sln file to open the solution in Visual Studio.
- Install the Computer Vision client library NuGet package.
- On the top menu, click Tools, select NuGet Package Manager, then Manage NuGet Packages for Solution.
- Click the Browse tab, and in the Search box type "Microsoft.Azure.CognitiveServices.Vision.ComputerVision".
- Select Microsoft.Azure.CognitiveServices.Vision.ComputerVision when it displays, then click the checkbox next to your project name, and Install.
- Select the project to run by doing one of the following actions:
- Use the dropdown combobox in the top menu to select the project.
- Right-click the project and select Set as StartUp Project.
- Open the Program.cs file associated with the project.
- Replace
<Subscription Key>with your valid subscription key. - Change
computerVision.Endpointto the Azure region associated with your subscription keys, if necessary. - For ExtractText, optionally set
textRecognitionModetoTextRecognitionMode.Printed. - Optionally, replace <
LocalImage>with the path and file name of a local image (will be ignored if not set). - Optionally, set
remoteImageUrlto a different image. - Run the program.