Compartilhar via


Image Moderation - OCR File Input

Returns any text found in the image for the specified language. If no language is specified in the input, the detection defaults to English.

POST {Endpoint}/contentmoderator/moderate/v1.0/ProcessImage/OCR?overload=stream&language={language}
POST {Endpoint}/contentmoderator/moderate/v1.0/ProcessImage/OCR?overload=stream&language={language}&CacheImage={CacheImage}&enhanced={enhanced}

URI Parameters

Name In Required Type Description
Endpoint
path True

string

Supported Azure Cognitive Services endpoints (protocol and host name, such as https://westus.api.cognitive.microsoft.com).

language
query True

string

Language of the terms.

CacheImage
query

boolean

Whether to retain the submitted image for future use. If it's omitted, the default is false.

enhanced
query

boolean

When it's set to true, the image goes through additional processing to come with additional candidates.

The image or TIFF file is not supported when enhanced is set to true.

Note: This affects the response time.

Request Header

Media Types: "image/gif", "image/jpeg", "image/png", "image/bmp", "image/tiff"

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

string

Request Body

Media Types: "image/gif", "image/jpeg", "image/png", "image/bmp", "image/tiff"

Name Type Description
ImageStream

object

Image file.

Responses

Name Type Description
200 OK

OCR

Found text and list of candidate text.

Other Status Codes

APIError

Error response.

Security

Ocp-Apim-Subscription-Key

Type: apiKey
In: header

Definitions

Name Description
APIError

Error information that the API returns.

Candidate

Optical character recognition (OCR) candidate text.

Error

Error body.

KeyValuePair

Key/value pair object properties.

OCR

Contains the text found in an image for the specified language.

Status

Status properties.

APIError

Error information that the API returns.

Name Type Description
Error

Error

Error body.

Candidate

Optical character recognition (OCR) candidate text.

Name Type Description
Confidence

number

Confidence level.

Text

string

Text found.

Error

Error body.

Name Type Description
Code

string

Message

string

KeyValuePair

Key/value pair object properties.

Name Type Description
Key

string

Key parameter.

Value

string

Value parameter.

OCR

Contains the text found in an image for the specified language.

Name Type Description
CacheId

string

Cache ID.

Candidates

Candidate[]

List of candidate text.

Language

string

ISO 639-3 code.

Metadata

KeyValuePair[]

Array of key/value pairs.

Status

Status

Evaluation status.

Text

string

Found text.

TrackingId

string

Tracking ID.

Status

Status properties.

Name Type Description
Code

integer

Status code.

Description

string

Status description.

Exception

string

Exception status.