Skip to content

Latest commit

 

History

History
114 lines (91 loc) · 3.13 KB

concept-detecting-image-types.md

File metadata and controls

114 lines (91 loc) · 3.13 KB
title titleSuffix description author manager ms.service ms.topic ms.date ms.author
Image type detection - Azure AI Vision
Azure AI services
Concepts related to the image type detection feature of the Azure AI Vision API.
PatrickFarley
nitinme
azure-ai-vision
conceptual
01/19/2024
pafarley

Image type detection

With the Analyze Image 3.2 API, Azure AI Vision can analyze the content type of images and indicate whether an image is clip art or a line drawing.

Clip art detection

Azure AI Vision analyzes an image and rates the likelihood of the image being clip art on a scale of 0 to 3, as described in the following table.

Value Meaning
0 Non-clip-art
1 Ambiguous
2 Normal-clip-art
3 Good-clip-art

Clip art detection examples

The following JSON responses illustrates what Azure AI Vision returns when rating the likelihood of the example images being clip art.

A clip art image of a slice of cheese

{
    "imageType": {
        "clipArtType": 3,
        "lineDrawingType": 0
    },
    "requestId": "88c48d8c-80f3-449f-878f-6947f3b35a27",
    "metadata": {
        "height": 225,
        "width": 300,
        "format": "Jpeg"
    }
}

A blue house and the front yard

{
    "imageType": {
        "clipArtType": 0,
        "lineDrawingType": 0
    },
    "requestId": "a9c8490a-2740-4e04-923b-e8f4830d0e47",
    "metadata": {
        "height": 200,
        "width": 300,
        "format": "Jpeg"
    }
}

Line drawing detection

Azure AI Vision analyzes an image and returns a boolean value indicating whether the image is a line drawing.

Line drawing detection examples

The following JSON responses illustrates what Azure AI Vision returns when indicating whether the example images are line drawings.

A line drawing image of a lion

{
    "imageType": {
        "clipArtType": 2,
        "lineDrawingType": 1
    },
    "requestId": "6442dc22-476a-41c4-aa3d-9ceb15172f01",
    "metadata": {
        "height": 268,
        "width": 300,
        "format": "Jpeg"
    }
}

A white flower with a green background

{
    "imageType": {
        "clipArtType": 0,
        "lineDrawingType": 0
    },
    "requestId": "98437d65-1b05-4ab7-b439-7098b5dfdcbf",
    "metadata": {
        "height": 200,
        "width": 300,
        "format": "Jpeg"
    }
}

Use the API

The image type detection feature is part of the Analyze Image 3.2 API. You can call this API through a native SDK or through REST calls. Include ImageType in the visualFeatures query parameter. Then, when you get the full JSON response, simply parse the string for the contents of the "imageType" section.