你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Image Analysis - Segment Stream

分析输入图像。 请求要么包含具有任何内容类型 ['image/*', 'application/octet-stream'] 的图像流,要么包含 JSON 有效负载,其中包含用于检索图像流的 URL 属性。 返回了内容类型为“image/png”的图像流,其中像素值取决于分析模式。 对于该模式,返回的图像与输入的图像具有相同的尺寸:foregroundMatting。 对于该模式,返回的图像与输入的图像的纵横比和尺寸相同,最大为 1600 万像素:backgroundRemoval。

POST /imageanalysis:segment?overload=stream&api-version=2023-04-01-preview
POST /imageanalysis:segment?overload=stream&mode={mode}&api-version=2023-04-01-preview

URI 参数

名称 必需 类型 说明
api-version
query True

string

请求的 API 版本。

mode
query

SegmentationMode

请求的分析模式。

请求正文

Media Types: "application/octet-stream", "image/jpeg", "image/gif", "image/tiff", "image/bmp", "image/png"

名称 类型 说明
body

string (byte)

图像流。

响应

名称 类型 说明
200 OK

file

成功

Media Types: "image/png", "application/json"

Other Status Codes

ErrorResponse

错误

Media Types: "image/png", "application/json"

标头

x-ms-error-code: string

示例

Segment_BackgroundRemoval_FromImageStream
Segment_ForegroundMatting_FromImageStream

Segment_BackgroundRemoval_FromImageStream

示例请求

POST /imageanalysis:segment?overload=stream&mode=foregroundMatting&api-version=2023-04-01-preview

"Ynl0ZXM="

示例响应

"Ynl0ZXM="

Segment_ForegroundMatting_FromImageStream

示例请求

POST /imageanalysis:segment?overload=stream&mode=foregroundMatting&api-version=2023-04-01-preview

"Ynl0ZXM="

示例响应

"Ynl0ZXM="

定义

名称 说明
ErrorResponse

发生错误时返回的响应。

ErrorResponseDetails

错误信息。

ErrorResponseInnerError

详细错误。

SegmentationMode

请求的分析模式。

ErrorResponse

发生错误时返回的响应。

名称 类型 说明
error

ErrorResponseDetails

错误信息。

ErrorResponseDetails

错误信息。

名称 类型 说明
code

string

错误代码。

details

ErrorResponseDetails[]

详细错误列表。

innererror

ErrorResponseInnerError

详细错误。

message

string

错误信息。

target

string

错误的目标。

ErrorResponseInnerError

详细错误。

名称 类型 说明
code

string

错误代码。

innererror

ErrorResponseInnerError

详细错误。

message

string

错误信息。

SegmentationMode

请求的分析模式。

说明
backgroundRemoval
foregroundMatting