Azure Cognitive Services: Exploring Cognitive Vision

https://miro.medium.com/max/1200/0*TQeico18hzDc979Q

Original Source Here

Computer Vision API

The Computer Vision API provides the power of algorithms to process images and returns the insights using pre-trained model APIs. It enables you to find out if an image has obscene content or need to find all the faces in an image. It also helps by evaluating image features and colors, image content categorization, and also generating the image description by using the inbuilt API capabilities.

Computer Vision API for image analysis

The Analyze endpoint of the API extracts a rich set of visual features based on the image content. The request sample is shown below:

curl "https://<region>.api.cognitive.microsoft.com/vision/v2.0/analyze?visualFeatures=Categories,Description&details=Landmarks" \
-H "Ocp-Apim-Subscription-Key: $key" \
-H "Content-Type: application/json" \
-d "{'url' : '/images/mountains.jpg'}" \
| jq '.'
curl "https://<region>.api.cognitive.microsoft.com/vision/v2.0/analyze?visualFeatures=Adult,Description" \
-H "Ocp-Apim-Subscription-Key: $key" \
-H "Content-Type: application/json" \
-d "{'url' : '/images/people.png'}" \
| jq '.'

For more information about the analyze operation, see the Analyze Image reference documentation.

Computer Vision API to generate image thumbnails

Additionally, the Computer Vision API can also intelligently generate images thumbnails for displaying large images effectively, using Thumbnail endpoint: https://<region&gt;.api.cognitive.microsoft.com/vision/v2.0/generateThumbnail. The request sample is shown below:

curl "https://<region>.api.cognitive.microsoft.com/vision/v2.0/generateThumbnail?width=100&height=100&smartCropping=true" \
-H "Ocp-Apim-Subscription-Key: $key" \
-H "Content-Type: application/json" \
-d "{'url' : '/images/dog.png'}" \
-o thumbnail.jpg

For more information about the generateThumbnails operation, see the Get Thumbnail reference documentation.

Computer Vision API to extract printed text

The ocr operation of the API detects printed text in an image and extracts the characters, then converts it into a character stream for downstream application consumption. The requested URL has the following format: https://<region&gt;.api.cognitive.microsoft.com/vision/v2.0/ocr?language=<...>&detectOrientation=<...> . The request sample is shown below:

curl "https://<region>.api.cognitive.microsoft.com/vision/v2.0/ocr" \
-H "Ocp-Apim-Subscription-Key: $key" \
-H "Content-Type: application/json" \
-d "{'url' : '/images/ebook.png'}" \
| jq '.'

For more information about the ocr operation, see the OCR reference documentation.

Computer Vision API to extract handwritten text

The recognizeText operation unlike the OCR operation detects and extracts handwritten & calligraphic text, from notes, letters, whiteboards, forms, and other sources. The requested URL has the following format:

https://<region&gt;.api.cognitive.microsoft.com/vision/v2.0/recognizeText?mode=[Printed|Handwritten]

Request to dump the output to the console:

curl "https://<region>.api.cognitive.microsoft.com/vision/v2.0/recognizeText?mode=Handwritten" \
-H "Ocp-Apim-Subscription-Key: $key" \
-H "Content-Type: application/json" \
-d "{'url' : '/images/handwriting.jpg'}" \
-D -

For more information about the recognizeText operation, see the Recognize Handwritten Text reference documentation.

AI/ML

Trending AI/ML Article Identified & Digested via Granola by Ramsey Elbasheer; a Machine-Driven RSS Bot

%d bloggers like this: