使用计算机视觉检测图像类型Detecting image types with Computer Vision

利用分析图像 API,计算机视觉可以分析图像的内容类型,指示图像是剪贴画还是线条图。With the Analyze Image API, Computer Vision can analyze the content type of images, indicating whether an image is clip art or a line drawing.

检测剪贴画Detecting clip art

计算机视觉可分析图像,并通过 0-3 的量表对图像为剪贴画的可能性进行评级,如下表中所示。Computer 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
00 Non-clip-artNon-clip-art
11 不明确Ambiguous
22 正常剪贴画Normal-clip-art
33 良好剪贴画Good-clip-art

剪贴画检测示例Clip art detection examples

以下 JSON 响应说明了计算机视觉将图像评级为剪贴画的可能性时返回的内容。The following JSON responses illustrates what Computer Vision returns when rating the likelihood of the example images being clip art.

一片奶酪的剪贴画

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

一座蓝色的房子和前院

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

检测线条图Detecting line drawings

计算机视觉分析图像并返回一个布尔值,该值指示图像是否为线条图。Computer Vision analyzes an image and returns a boolean value indicating whether the image is a line drawing.

线条图检测示例Line drawing detection examples

以下 JSON 响应说明了计算机视觉指示图像是否为线条图时返回的内容。The following JSON responses illustrates what Computer Vision returns when indicating whether the example images are line drawings.

狮子的线描图像

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

具有绿色背景的白色花卉

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

后续步骤Next steps

请参阅分析图像参考文档,了解如何检测图像类型。See the Analyze Image reference documentation to learn how to detect image types.