After connecting to your Azure AI Vision resource endpoint, your client application can use the service to perform image analysis tasks.
Note the following requirements for image analysis:
- The image must be presented in JPEG, PNG, GIF, or BMP format.
- The file size of the image must be less than 4 megabytes (MB).
- The dimensions of the image must be greater than 50 x 50 pixels.
Submitting an image for analysis
To analyze an image, you can use the Analyze Image REST method or the equivalent method in the SDK for your preferred programming language, specifying the visual features you want to include in the analysis.
C#Copy
using Azure.AI.Vision.ImageAnalysis;
ImageAnalysisClient client = new ImageAnalysisClient(
"<YOUR_RESOURCE_ENDPOINT>",
new AzureKeyCredential("<YOUR_AUTHORIZATION_KEY>"));
ImageAnalysisResult result = client.Analyze(
<IMAGE_DATA_BYTES>, // Binary data from your image file
VisualFeatures.Caption | VisualFeatures.Tags,
new ImageAnalysisOptions { GenderNeutralCaption = true });
Leave a Reply