Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

Get Area Of Interest - Get Area Of Interest

Service:
Azure AI Services
API Version:
3.2

This operation returns a bounding box around the most important area of the image. A successful response will be returned in JSON. If the request failed, the response contains an error code and a message to help determine what went wrong. Upon failure, the error code and an error message are returned. The error code could be one of InvalidImageUrl, InvalidImageFormat, InvalidImageSize, NotSupportedImage, FailedToProcess, Timeout, or InternalServerError.

POST {Endpoint}/vision/v3.2/areaOfInterest
With optional parameters:
POST {Endpoint}/vision/v3.2/areaOfInterest?model-version={model-version}

URI Parameters

Name In Required Type Description
Endpoint
path True

string

Supported Cognitive Services endpoints.

model-version
query

string

pattern: ^(latest|\d{4}-\d{2}-\d{2})(-preview)?$

Optional parameter to specify the version of the AI model. Accepted values are: "latest", "2021-04-01", "2021-05-01". Defaults to "latest".

Request Header

Name Required Type Description
Ocp-Apim-Subscription-Key True

string

Request Body

Name Required Type Description
url True

string

Publicly reachable URL of an image.

Responses

Name Type Description
200 OK

AreaOfInterestResult

The response includes the extracted area of interest in JSON format.

Other Status Codes

ComputerVisionErrorResponse

Error response.

Security

Ocp-Apim-Subscription-Key

Type: apiKey
In: header

Examples

Successful GetAreaOfInterest request

Sample request

POST https://westus.api.cognitive.microsoft.com/vision/v3.2/areaOfInterest


{
 "url": "{url}"
}

Sample response

Status code:
200
{
 "areaOfInterest": {
 "h": 951,
 "w": 950,
 "x": 160,
 "y": 0
 },
 "requestId": "ed2de1c6-fb55-4686-b0da-4da6e05d283f",
 "metadata": {
 "format": "Jpeg",
 "height": 951,
 "width": 1378
 },
 "modelVersion": "2021-04-01"
}

Definitions

Name Description
AreaOfInterestResult

Result of AreaOfInterest operation.

BoundingRect

A bounding box for an area inside an image.

ComputerVisionError

The API request error.

ComputerVisionErrorCodes

The error code.

ComputerVisionErrorResponse

The API error response.

ComputerVisionInnerError

Details about the API request error.

ComputerVisionInnerErrorCodeValue

The error code.

ImageMetadata

Image metadata.

ImageUrl

AreaOfInterestResult

Object

Result of AreaOfInterest operation.

Name Type Description
areaOfInterest

BoundingRect

A bounding box for an area of interest inside an image.

metadata

ImageMetadata

Image metadata.

modelVersion

string

pattern: ^(latest|\d{4}-\d{2}-\d{2})(-preview)?$

Version of the AI model.

requestId

string

Id of the REST API request.

BoundingRect

Object

A bounding box for an area inside an image.

Name Type Description
h

integer (int32)

Height measured from the top-left point of the area, in pixels.

w

integer (int32)

Width measured from the top-left point of the area, in pixels.

x

integer (int32)

X-coordinate of the top left point of the area, in pixels.

y

integer (int32)

Y-coordinate of the top left point of the area, in pixels.

ComputerVisionError

Object

The API request error.

Name Type Description
code

ComputerVisionErrorCodes

The error code.

innererror

ComputerVisionInnerError

Inner error contains more specific information.

message

string

A message explaining the error reported by the service.

ComputerVisionErrorCodes

Enumeration

The error code.

Value Description
InvalidRequest
InvalidArgument
InternalServerError
ServiceUnavailable

ComputerVisionErrorResponse

Object

The API error response.

Name Type Description
error

ComputerVisionError

Error contents.

ComputerVisionInnerError

Object

Details about the API request error.

Name Type Description
code

ComputerVisionInnerErrorCodeValue

The error code.

message

string

Error message.

ComputerVisionInnerErrorCodeValue

Enumeration

The error code.

Value Description
InvalidImageFormat
UnsupportedMediaType
InvalidImageUrl
NotSupportedFeature
NotSupportedImage
Timeout
InternalServerError
InvalidImageSize
BadArgument
DetectFaceError
NotSupportedLanguage
InvalidThumbnailSize
InvalidDetails
InvalidModel
CancelledRequest
NotSupportedVisualFeature
FailedToProcess
Unspecified
StorageException

ImageMetadata

Object

Image metadata.

Name Type Description
format

string

Image format.

height

integer (int32)

Image height, in pixels.

width

integer (int32)

Image width, in pixels.

ImageUrl

Object
Name Type Description
url

string

Publicly reachable URL of an image.