次の方法で共有


Image Analysis - Segment

入力イメージを分析します。 要求には、任意のコンテンツ タイプ ['image/*'、'application/octet-stream']、またはイメージ ストリームの取得に使用する url プロパティを含む JSON ペイロードが含まれます。 コンテンツ タイプ 'image/png' の画像ストリームが返されます。ピクセル値は分析モードによって異なります。 返されるイメージのサイズは、モードの入力イメージ (foregroundMatting) と同じです。 返される画像は、入力画像と同じ縦横比と同じ寸法を持ち、モードでは最大 16 メガピクセルの制限があります:backgroundRemoval。

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

URI パラメーター

名前 / 必須 説明
api-version
query True

string

要求された API バージョン。

mode
query

SegmentationModeApiModel

要求された分析モード。 次のいずれか:backgroundRemoval、foregroundMatting。

要求本文

名前 必須 説明
url True

string

イメージのパブリックに到達可能な URL。

応答

名前 説明
200 OK

file

Success

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

Other Status Codes

ErrorResponse

エラー

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

ヘッダー

x-ms-error-code: string

Segment_BackgroundRemoval_FromImageUrl
Segment_ForegroundMatting_FromImageUrl

Segment_BackgroundRemoval_FromImageUrl

要求のサンプル

POST /imageanalysis:segment?mode=backgroundRemoval&api-version=2023-02-01-preview

{
  "url": "{image url}"
}

応答のサンプル

"Ynl0ZXM="

Segment_ForegroundMatting_FromImageUrl

要求のサンプル

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

{
  "url": "{image url}"
}

応答のサンプル

"Ynl0ZXM="

定義

名前 説明
ErrorResponse

エラーが発生したときに返される応答。

ErrorResponseDetails

エラー情報。

ErrorResponseInnerError

詳細なエラー。

ImageUrl

分析対象の画像を指す URL を含む JSON ドキュメント。

SegmentationModeApiModel

要求された分析モード。 次のいずれか:backgroundRemoval、foregroundMatting。

ErrorResponse

エラーが発生したときに返される応答。

名前 説明
error

ErrorResponseDetails

エラー情報。

ErrorResponseDetails

エラー情報。

名前 説明
code

string

エラー コード。

details

ErrorResponseDetails[]

詳細なエラーの一覧。

innererror

ErrorResponseInnerError

詳細なエラー。

message

string

エラー メッセージ。

target

string

エラーのターゲット。

ErrorResponseInnerError

詳細なエラー。

名前 説明
code

string

エラー コード。

innererror

ErrorResponseInnerError

詳細なエラー。

message

string

エラー メッセージ。

ImageUrl

分析対象の画像を指す URL を含む JSON ドキュメント。

名前 説明
url

string

イメージのパブリックに到達可能な URL。

SegmentationModeApiModel

要求された分析モード。 次のいずれか:backgroundRemoval、foregroundMatting。

名前 説明
backgroundRemoval

string

foregroundMatting

string