ComputerVisionClient class

Extends

Constructors

ComputerVisionClient(ServiceClientCredentials, string, ServiceClientOptions)

Initializes a new instance of the ComputerVisionClient class.

Inherited Properties

credentials
endpoint

Methods

analyzeImage(string, ComputerVisionClientAnalyzeImageOptionalParams)

This operation extracts a rich set of visual features based on the image content. Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. Within your request, there is an optional parameter to allow you to choose which features to return. By default, image categories are returned in the response. A successful response will be returned in JSON. If the request failed, the response will contain an error code and a message to help understand what went wrong.

analyzeImage(string, ComputerVisionClientAnalyzeImageOptionalParams, ServiceCallback<ImageAnalysis>)
analyzeImage(string, ServiceCallback<ImageAnalysis>)
analyzeImageByDomain(string, string, ComputerVisionClientAnalyzeImageByDomainOptionalParams)

This operation recognizes content within an image by applying a domain-specific model. The list of domain-specific models that are supported by the Computer Vision API can be retrieved using the /models GET request. Currently, the API provides following domain-specific models: celebrities, landmarks. Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. A successful response will be returned in JSON. If the request failed, the response will contain an error code and a message to help understand what went wrong.

analyzeImageByDomain(string, string, ComputerVisionClientAnalyzeImageByDomainOptionalParams, ServiceCallback<DomainModelResults>)
analyzeImageByDomain(string, string, ServiceCallback<DomainModelResults>)
analyzeImageByDomainInStream(string, HttpRequestBody, ComputerVisionClientAnalyzeImageByDomainInStreamOptionalParams)

This operation recognizes content within an image by applying a domain-specific model. The list of domain-specific models that are supported by the Computer Vision API can be retrieved using the /models GET request. Currently, the API provides following domain-specific models: celebrities, landmarks. Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. A successful response will be returned in JSON. If the request failed, the response will contain an error code and a message to help understand what went wrong.

analyzeImageByDomainInStream(string, HttpRequestBody, ComputerVisionClientAnalyzeImageByDomainInStreamOptionalParams, ServiceCallback<DomainModelResults>)
analyzeImageByDomainInStream(string, HttpRequestBody, ServiceCallback<DomainModelResults>)
analyzeImageInStream(HttpRequestBody, ComputerVisionClientAnalyzeImageInStreamOptionalParams)

This operation extracts a rich set of visual features based on the image content. Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. Within your request, there is an optional parameter to allow you to choose which features to return. By default, image categories are returned in the response. A successful response will be returned in JSON. If the request failed, the response will contain an error code and a message to help understand what went wrong.

analyzeImageInStream(HttpRequestBody, ComputerVisionClientAnalyzeImageInStreamOptionalParams, ServiceCallback<ImageAnalysis>)
analyzeImageInStream(HttpRequestBody, ServiceCallback<ImageAnalysis>)
describeImage(string, ComputerVisionClientDescribeImageOptionalParams)

This operation generates a description of an image in human readable language with complete sentences. The description is based on a collection of content tags, which are also returned by the operation. More than one description can be generated for each image. Descriptions are ordered by their confidence score. Descriptions may include results from celebrity and landmark domain models, if applicable. Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. A successful response will be returned in JSON. If the request failed, the response will contain an error code and a message to help understand what went wrong.

describeImage(string, ComputerVisionClientDescribeImageOptionalParams, ServiceCallback<ImageDescription>)
describeImage(string, ServiceCallback<ImageDescription>)
describeImageInStream(HttpRequestBody, ComputerVisionClientDescribeImageInStreamOptionalParams)

This operation generates a description of an image in human readable language with complete sentences. The description is based on a collection of content tags, which are also returned by the operation. More than one description can be generated for each image. Descriptions are ordered by their confidence score. Descriptions may include results from celebrity and landmark domain models, if applicable. Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. A successful response will be returned in JSON. If the request failed, the response will contain an error code and a message to help understand what went wrong.

describeImageInStream(HttpRequestBody, ComputerVisionClientDescribeImageInStreamOptionalParams, ServiceCallback<ImageDescription>)
describeImageInStream(HttpRequestBody, ServiceCallback<ImageDescription>)
detectObjects(string, ComputerVisionClientDetectObjectsOptionalParams)

Performs object detection on the specified image. Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. A successful response will be returned in JSON. If the request failed, the response will contain an error code and a message to help understand what went wrong.

detectObjects(string, ComputerVisionClientDetectObjectsOptionalParams, ServiceCallback<DetectResult>)
detectObjects(string, ServiceCallback<DetectResult>)
detectObjectsInStream(HttpRequestBody, ComputerVisionClientDetectObjectsInStreamOptionalParams)

Performs object detection on the specified image. Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. A successful response will be returned in JSON. If the request failed, the response will contain an error code and a message to help understand what went wrong.

detectObjectsInStream(HttpRequestBody, ComputerVisionClientDetectObjectsInStreamOptionalParams, ServiceCallback<DetectResult>)
detectObjectsInStream(HttpRequestBody, ServiceCallback<DetectResult>)
generateThumbnail(number, number, string, ComputerVisionClientGenerateThumbnailOptionalParams)

This operation generates a thumbnail image with the user-specified width and height. By default, the service analyzes the image, identifies the region of interest (ROI), and generates smart cropping coordinates based on the ROI. Smart cropping helps when you specify an aspect ratio that differs from that of the input image. A successful response contains the thumbnail image binary. 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, InvalidThumbnailSize, NotSupportedImage, FailedToProcess, Timeout, or InternalServerError.

generateThumbnail(number, number, string, ComputerVisionClientGenerateThumbnailOptionalParams, ServiceCallback<void>)
generateThumbnail(number, number, string, ServiceCallback<void>)
generateThumbnailInStream(number, number, HttpRequestBody, ComputerVisionClientGenerateThumbnailInStreamOptionalParams)

This operation generates a thumbnail image with the user-specified width and height. By default, the service analyzes the image, identifies the region of interest (ROI), and generates smart cropping coordinates based on the ROI. Smart cropping helps when you specify an aspect ratio that differs from that of the input image. A successful response contains the thumbnail image binary. 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, InvalidThumbnailSize, NotSupportedImage, FailedToProcess, Timeout, or InternalServerError.

generateThumbnailInStream(number, number, HttpRequestBody, ComputerVisionClientGenerateThumbnailInStreamOptionalParams, ServiceCallback<void>)
generateThumbnailInStream(number, number, HttpRequestBody, ServiceCallback<void>)
getAreaOfInterest(string, ComputerVisionClientGetAreaOfInterestOptionalParams)

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.

getAreaOfInterest(string, ComputerVisionClientGetAreaOfInterestOptionalParams, ServiceCallback<AreaOfInterestResult>)
getAreaOfInterest(string, ServiceCallback<AreaOfInterestResult>)
getAreaOfInterestInStream(HttpRequestBody, ComputerVisionClientGetAreaOfInterestInStreamOptionalParams)

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.

getAreaOfInterestInStream(HttpRequestBody, ComputerVisionClientGetAreaOfInterestInStreamOptionalParams, ServiceCallback<AreaOfInterestResult>)
getAreaOfInterestInStream(HttpRequestBody, ServiceCallback<AreaOfInterestResult>)
getReadResult(string, RequestOptionsBase)

This interface is used for getting OCR results of Read operation. The URL to this interface should be retrieved from 'Operation-Location' field returned from Read interface.

getReadResult(string, RequestOptionsBase, ServiceCallback<ReadOperationResult>)
getReadResult(string, ServiceCallback<ReadOperationResult>)
listModels(RequestOptionsBase)

This operation returns the list of domain-specific models that are supported by the Computer Vision API. Currently, the API supports following domain-specific models: celebrity recognizer, landmark recognizer. A successful response will be returned in JSON. If the request failed, the response will contain an error code and a message to help understand what went wrong.

listModels(RequestOptionsBase, ServiceCallback<ListModelsResult>)
listModels(ServiceCallback<ListModelsResult>)
read(string, ComputerVisionClientReadOptionalParams)

Use this interface to get the result of a Read operation, employing the state-of-the-art Optical Character Recognition (OCR) algorithms optimized for text-heavy documents. When you use the Read interface, the response contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your 'GetReadResult' operation to access OCR results.​

read(string, ComputerVisionClientReadOptionalParams, ServiceCallback<void>)
read(string, ServiceCallback<void>)
readInStream(HttpRequestBody, ComputerVisionClientReadInStreamOptionalParams)

Use this interface to get the result of a Read operation, employing the state-of-the-art Optical Character Recognition (OCR) algorithms optimized for text-heavy documents. When you use the Read interface, the response contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your 'GetReadResult' operation to access OCR results.​

readInStream(HttpRequestBody, ComputerVisionClientReadInStreamOptionalParams, ServiceCallback<void>)
readInStream(HttpRequestBody, ServiceCallback<void>)
recognizePrintedText(boolean, string, ComputerVisionClientRecognizePrintedTextOptionalParams)

Optical Character Recognition (OCR) detects text in an image and extracts the recognized characters into a machine-usable character stream. Upon success, the OCR results will be returned. Upon failure, the error code together with an error message will be returned. The error code can be one of InvalidImageUrl, InvalidImageFormat, InvalidImageSize, NotSupportedImage, NotSupportedLanguage, or InternalServerError.

recognizePrintedText(boolean, string, ComputerVisionClientRecognizePrintedTextOptionalParams, ServiceCallback<OcrResult>)
recognizePrintedText(boolean, string, ServiceCallback<OcrResult>)
recognizePrintedTextInStream(boolean, HttpRequestBody, ComputerVisionClientRecognizePrintedTextInStreamOptionalParams)

Optical Character Recognition (OCR) detects text in an image and extracts the recognized characters into a machine-usable character stream. Upon success, the OCR results will be returned. Upon failure, the error code together with an error message will be returned. The error code can be one of InvalidImageUrl, InvalidImageFormat, InvalidImageSize, NotSupportedImage, NotSupportedLanguage, or InternalServerError.

recognizePrintedTextInStream(boolean, HttpRequestBody, ComputerVisionClientRecognizePrintedTextInStreamOptionalParams, ServiceCallback<OcrResult>)
recognizePrintedTextInStream(boolean, HttpRequestBody, ServiceCallback<OcrResult>)
tagImage(string, ComputerVisionClientTagImageOptionalParams)

This operation generates a list of words, or tags, that are relevant to the content of the supplied image. The Computer Vision API can return tags based on objects, living beings, scenery or actions found in images. Unlike categories, tags are not organized according to a hierarchical classification system, but correspond to image content. Tags may contain hints to avoid ambiguity or provide context, for example the tag "ascomycete" may be accompanied by the hint "fungus". Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. A successful response will be returned in JSON. If the request failed, the response will contain an error code and a message to help understand what went wrong.

tagImage(string, ComputerVisionClientTagImageOptionalParams, ServiceCallback<TagResult>)
tagImage(string, ServiceCallback<TagResult>)
tagImageInStream(HttpRequestBody, ComputerVisionClientTagImageInStreamOptionalParams)

This operation generates a list of words, or tags, that are relevant to the content of the supplied image. The Computer Vision API can return tags based on objects, living beings, scenery or actions found in images. Unlike categories, tags are not organized according to a hierarchical classification system, but correspond to image content. Tags may contain hints to avoid ambiguity or provide context, for example the tag "ascomycete" may be accompanied by the hint "fungus". Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. A successful response will be returned in JSON. If the request failed, the response will contain an error code and a message to help understand what went wrong.

tagImageInStream(HttpRequestBody, ComputerVisionClientTagImageInStreamOptionalParams, ServiceCallback<TagResult>)
tagImageInStream(HttpRequestBody, ServiceCallback<TagResult>)

Inherited Methods

sendOperationRequest(OperationArguments, OperationSpec, ServiceCallback<any>)

Send an HTTP request that is populated using the provided OperationSpec.

sendRequest(RequestPrepareOptions | WebResourceLike)

Send the provided httpRequest.

Constructor Details

ComputerVisionClient(ServiceClientCredentials, string, ServiceClientOptions)

Initializes a new instance of the ComputerVisionClient class.

new ComputerVisionClient(credentials: ServiceClientCredentials, endpoint: string, options?: ServiceClientOptions)

Parameters

credentials

ServiceClientCredentials

Subscription credentials which uniquely identify client subscription.

endpoint

string

Supported Cognitive Services endpoints.

options

ServiceClientOptions

The parameter options

Inherited Property Details

credentials

credentials: ServiceClientCredentials

Property Value

ServiceClientCredentials

Inherited From ComputerVisionClientContext.credentials

endpoint

endpoint: string

Property Value

string

Inherited From ComputerVisionClientContext.endpoint

Method Details

analyzeImage(string, ComputerVisionClientAnalyzeImageOptionalParams)

This operation extracts a rich set of visual features based on the image content. Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. Within your request, there is an optional parameter to allow you to choose which features to return. By default, image categories are returned in the response. A successful response will be returned in JSON. If the request failed, the response will contain an error code and a message to help understand what went wrong.

function analyzeImage(url: string, options?: ComputerVisionClientAnalyzeImageOptionalParams): Promise<AnalyzeImageResponse>

Parameters

url

string

Publicly reachable URL of an image.

options
ComputerVisionClientAnalyzeImageOptionalParams

The optional parameters

Returns

Promise<Models.AnalyzeImageResponse>

analyzeImage(string, ComputerVisionClientAnalyzeImageOptionalParams, ServiceCallback<ImageAnalysis>)

function analyzeImage(url: string, options: ComputerVisionClientAnalyzeImageOptionalParams, callback: ServiceCallback<ImageAnalysis>)

Parameters

url

string

Publicly reachable URL of an image.

options
ComputerVisionClientAnalyzeImageOptionalParams

The optional parameters

callback

ServiceCallback<ImageAnalysis>

The callback

analyzeImage(string, ServiceCallback<ImageAnalysis>)

function analyzeImage(url: string, callback: ServiceCallback<ImageAnalysis>)

Parameters

url

string

Publicly reachable URL of an image.

callback

ServiceCallback<ImageAnalysis>

The callback

analyzeImageByDomain(string, string, ComputerVisionClientAnalyzeImageByDomainOptionalParams)

This operation recognizes content within an image by applying a domain-specific model. The list of domain-specific models that are supported by the Computer Vision API can be retrieved using the /models GET request. Currently, the API provides following domain-specific models: celebrities, landmarks. Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. A successful response will be returned in JSON. If the request failed, the response will contain an error code and a message to help understand what went wrong.

function analyzeImageByDomain(model: string, url: string, options?: ComputerVisionClientAnalyzeImageByDomainOptionalParams): Promise<AnalyzeImageByDomainResponse>

Parameters

model

string

The domain-specific content to recognize.

url

string

Publicly reachable URL of an image.

Returns

Promise<Models.AnalyzeImageByDomainResponse>

analyzeImageByDomain(string, string, ComputerVisionClientAnalyzeImageByDomainOptionalParams, ServiceCallback<DomainModelResults>)

function analyzeImageByDomain(model: string, url: string, options: ComputerVisionClientAnalyzeImageByDomainOptionalParams, callback: ServiceCallback<DomainModelResults>)

Parameters

model

string

The domain-specific content to recognize.

url

string

Publicly reachable URL of an image.

callback

ServiceCallback<DomainModelResults>

The callback

analyzeImageByDomain(string, string, ServiceCallback<DomainModelResults>)

function analyzeImageByDomain(model: string, url: string, callback: ServiceCallback<DomainModelResults>)

Parameters

model

string

The domain-specific content to recognize.

url

string

Publicly reachable URL of an image.

callback

ServiceCallback<DomainModelResults>

The callback

analyzeImageByDomainInStream(string, HttpRequestBody, ComputerVisionClientAnalyzeImageByDomainInStreamOptionalParams)

This operation recognizes content within an image by applying a domain-specific model. The list of domain-specific models that are supported by the Computer Vision API can be retrieved using the /models GET request. Currently, the API provides following domain-specific models: celebrities, landmarks. Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. A successful response will be returned in JSON. If the request failed, the response will contain an error code and a message to help understand what went wrong.

function analyzeImageByDomainInStream(model: string, image: HttpRequestBody, options?: ComputerVisionClientAnalyzeImageByDomainInStreamOptionalParams): Promise<AnalyzeImageByDomainInStreamResponse>

Parameters

model

string

The domain-specific content to recognize.

image

HttpRequestBody

An image stream.

Returns

Promise<Models.AnalyzeImageByDomainInStreamResponse>

analyzeImageByDomainInStream(string, HttpRequestBody, ComputerVisionClientAnalyzeImageByDomainInStreamOptionalParams, ServiceCallback<DomainModelResults>)

function analyzeImageByDomainInStream(model: string, image: HttpRequestBody, options: ComputerVisionClientAnalyzeImageByDomainInStreamOptionalParams, callback: ServiceCallback<DomainModelResults>)

Parameters

model

string

The domain-specific content to recognize.

image

HttpRequestBody

An image stream.

callback

ServiceCallback<DomainModelResults>

The callback

analyzeImageByDomainInStream(string, HttpRequestBody, ServiceCallback<DomainModelResults>)

function analyzeImageByDomainInStream(model: string, image: HttpRequestBody, callback: ServiceCallback<DomainModelResults>)

Parameters

model

string

The domain-specific content to recognize.

image

HttpRequestBody

An image stream.

callback

ServiceCallback<DomainModelResults>

The callback

analyzeImageInStream(HttpRequestBody, ComputerVisionClientAnalyzeImageInStreamOptionalParams)

This operation extracts a rich set of visual features based on the image content. Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. Within your request, there is an optional parameter to allow you to choose which features to return. By default, image categories are returned in the response. A successful response will be returned in JSON. If the request failed, the response will contain an error code and a message to help understand what went wrong.

function analyzeImageInStream(image: HttpRequestBody, options?: ComputerVisionClientAnalyzeImageInStreamOptionalParams): Promise<AnalyzeImageInStreamResponse>

Parameters

image

HttpRequestBody

An image stream.

Returns

Promise<Models.AnalyzeImageInStreamResponse>

analyzeImageInStream(HttpRequestBody, ComputerVisionClientAnalyzeImageInStreamOptionalParams, ServiceCallback<ImageAnalysis>)

function analyzeImageInStream(image: HttpRequestBody, options: ComputerVisionClientAnalyzeImageInStreamOptionalParams, callback: ServiceCallback<ImageAnalysis>)

Parameters

image

HttpRequestBody

An image stream.

callback

ServiceCallback<ImageAnalysis>

The callback

analyzeImageInStream(HttpRequestBody, ServiceCallback<ImageAnalysis>)

function analyzeImageInStream(image: HttpRequestBody, callback: ServiceCallback<ImageAnalysis>)

Parameters

image

HttpRequestBody

An image stream.

callback

ServiceCallback<ImageAnalysis>

The callback

describeImage(string, ComputerVisionClientDescribeImageOptionalParams)

This operation generates a description of an image in human readable language with complete sentences. The description is based on a collection of content tags, which are also returned by the operation. More than one description can be generated for each image. Descriptions are ordered by their confidence score. Descriptions may include results from celebrity and landmark domain models, if applicable. Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. A successful response will be returned in JSON. If the request failed, the response will contain an error code and a message to help understand what went wrong.

function describeImage(url: string, options?: ComputerVisionClientDescribeImageOptionalParams): Promise<DescribeImageResponse>

Parameters

url

string

Publicly reachable URL of an image.

options
ComputerVisionClientDescribeImageOptionalParams

The optional parameters

Returns

Promise<Models.DescribeImageResponse>

describeImage(string, ComputerVisionClientDescribeImageOptionalParams, ServiceCallback<ImageDescription>)

function describeImage(url: string, options: ComputerVisionClientDescribeImageOptionalParams, callback: ServiceCallback<ImageDescription>)

Parameters

url

string

Publicly reachable URL of an image.

options
ComputerVisionClientDescribeImageOptionalParams

The optional parameters

callback

ServiceCallback<ImageDescription>

The callback

describeImage(string, ServiceCallback<ImageDescription>)

function describeImage(url: string, callback: ServiceCallback<ImageDescription>)

Parameters

url

string

Publicly reachable URL of an image.

callback

ServiceCallback<ImageDescription>

The callback

describeImageInStream(HttpRequestBody, ComputerVisionClientDescribeImageInStreamOptionalParams)

This operation generates a description of an image in human readable language with complete sentences. The description is based on a collection of content tags, which are also returned by the operation. More than one description can be generated for each image. Descriptions are ordered by their confidence score. Descriptions may include results from celebrity and landmark domain models, if applicable. Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. A successful response will be returned in JSON. If the request failed, the response will contain an error code and a message to help understand what went wrong.

function describeImageInStream(image: HttpRequestBody, options?: ComputerVisionClientDescribeImageInStreamOptionalParams): Promise<DescribeImageInStreamResponse>

Parameters

image

HttpRequestBody

An image stream.

Returns

Promise<Models.DescribeImageInStreamResponse>

describeImageInStream(HttpRequestBody, ComputerVisionClientDescribeImageInStreamOptionalParams, ServiceCallback<ImageDescription>)

function describeImageInStream(image: HttpRequestBody, options: ComputerVisionClientDescribeImageInStreamOptionalParams, callback: ServiceCallback<ImageDescription>)

Parameters

image

HttpRequestBody

An image stream.

callback

ServiceCallback<ImageDescription>

The callback

describeImageInStream(HttpRequestBody, ServiceCallback<ImageDescription>)

function describeImageInStream(image: HttpRequestBody, callback: ServiceCallback<ImageDescription>)

Parameters

image

HttpRequestBody

An image stream.

callback

ServiceCallback<ImageDescription>

The callback

detectObjects(string, ComputerVisionClientDetectObjectsOptionalParams)

Performs object detection on the specified image. Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. A successful response will be returned in JSON. If the request failed, the response will contain an error code and a message to help understand what went wrong.

function detectObjects(url: string, options?: ComputerVisionClientDetectObjectsOptionalParams): Promise<DetectObjectsResponse>

Parameters

url

string

Publicly reachable URL of an image.

options
ComputerVisionClientDetectObjectsOptionalParams

The optional parameters

Returns

Promise<Models.DetectObjectsResponse>

detectObjects(string, ComputerVisionClientDetectObjectsOptionalParams, ServiceCallback<DetectResult>)

function detectObjects(url: string, options: ComputerVisionClientDetectObjectsOptionalParams, callback: ServiceCallback<DetectResult>)

Parameters

url

string

Publicly reachable URL of an image.

options
ComputerVisionClientDetectObjectsOptionalParams

The optional parameters

callback

ServiceCallback<DetectResult>

The callback

detectObjects(string, ServiceCallback<DetectResult>)

function detectObjects(url: string, callback: ServiceCallback<DetectResult>)

Parameters

url

string

Publicly reachable URL of an image.

callback

ServiceCallback<DetectResult>

The callback

detectObjectsInStream(HttpRequestBody, ComputerVisionClientDetectObjectsInStreamOptionalParams)

Performs object detection on the specified image. Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. A successful response will be returned in JSON. If the request failed, the response will contain an error code and a message to help understand what went wrong.

function detectObjectsInStream(image: HttpRequestBody, options?: ComputerVisionClientDetectObjectsInStreamOptionalParams): Promise<DetectObjectsInStreamResponse>

Parameters

image

HttpRequestBody

An image stream.

Returns

Promise<Models.DetectObjectsInStreamResponse>

detectObjectsInStream(HttpRequestBody, ComputerVisionClientDetectObjectsInStreamOptionalParams, ServiceCallback<DetectResult>)

function detectObjectsInStream(image: HttpRequestBody, options: ComputerVisionClientDetectObjectsInStreamOptionalParams, callback: ServiceCallback<DetectResult>)

Parameters

image

HttpRequestBody

An image stream.

callback

ServiceCallback<DetectResult>

The callback

detectObjectsInStream(HttpRequestBody, ServiceCallback<DetectResult>)

function detectObjectsInStream(image: HttpRequestBody, callback: ServiceCallback<DetectResult>)

Parameters

image

HttpRequestBody

An image stream.

callback

ServiceCallback<DetectResult>

The callback

generateThumbnail(number, number, string, ComputerVisionClientGenerateThumbnailOptionalParams)

This operation generates a thumbnail image with the user-specified width and height. By default, the service analyzes the image, identifies the region of interest (ROI), and generates smart cropping coordinates based on the ROI. Smart cropping helps when you specify an aspect ratio that differs from that of the input image. A successful response contains the thumbnail image binary. 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, InvalidThumbnailSize, NotSupportedImage, FailedToProcess, Timeout, or InternalServerError.

function generateThumbnail(width: number, height: number, url: string, options?: ComputerVisionClientGenerateThumbnailOptionalParams): Promise<GenerateThumbnailResponse>

Parameters

width

number

Width of the thumbnail, in pixels. It must be between 1 and 1024. Recommended minimum of 50.

height

number

Height of the thumbnail, in pixels. It must be between 1 and 1024. Recommended minimum of 50.

url

string

Publicly reachable URL of an image.

options
ComputerVisionClientGenerateThumbnailOptionalParams

The optional parameters

Returns

Promise<Models.GenerateThumbnailResponse>

generateThumbnail(number, number, string, ComputerVisionClientGenerateThumbnailOptionalParams, ServiceCallback<void>)

function generateThumbnail(width: number, height: number, url: string, options: ComputerVisionClientGenerateThumbnailOptionalParams, callback: ServiceCallback<void>)

Parameters

width

number

Width of the thumbnail, in pixels. It must be between 1 and 1024. Recommended minimum of 50.

height

number

Height of the thumbnail, in pixels. It must be between 1 and 1024. Recommended minimum of 50.

url

string

Publicly reachable URL of an image.

options
ComputerVisionClientGenerateThumbnailOptionalParams

The optional parameters

callback

ServiceCallback<void>

The callback

generateThumbnail(number, number, string, ServiceCallback<void>)

function generateThumbnail(width: number, height: number, url: string, callback: ServiceCallback<void>)

Parameters

width

number

Width of the thumbnail, in pixels. It must be between 1 and 1024. Recommended minimum of 50.

height

number

Height of the thumbnail, in pixels. It must be between 1 and 1024. Recommended minimum of 50.

url

string

Publicly reachable URL of an image.

callback

ServiceCallback<void>

The callback

generateThumbnailInStream(number, number, HttpRequestBody, ComputerVisionClientGenerateThumbnailInStreamOptionalParams)

This operation generates a thumbnail image with the user-specified width and height. By default, the service analyzes the image, identifies the region of interest (ROI), and generates smart cropping coordinates based on the ROI. Smart cropping helps when you specify an aspect ratio that differs from that of the input image. A successful response contains the thumbnail image binary. 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, InvalidThumbnailSize, NotSupportedImage, FailedToProcess, Timeout, or InternalServerError.

function generateThumbnailInStream(width: number, height: number, image: HttpRequestBody, options?: ComputerVisionClientGenerateThumbnailInStreamOptionalParams): Promise<GenerateThumbnailInStreamResponse>

Parameters

width

number

Width of the thumbnail, in pixels. It must be between 1 and 1024. Recommended minimum of 50.

height

number

Height of the thumbnail, in pixels. It must be between 1 and 1024. Recommended minimum of 50.

image

HttpRequestBody

An image stream.

Returns

Promise<Models.GenerateThumbnailInStreamResponse>

generateThumbnailInStream(number, number, HttpRequestBody, ComputerVisionClientGenerateThumbnailInStreamOptionalParams, ServiceCallback<void>)

function generateThumbnailInStream(width: number, height: number, image: HttpRequestBody, options: ComputerVisionClientGenerateThumbnailInStreamOptionalParams, callback: ServiceCallback<void>)

Parameters

width

number

Width of the thumbnail, in pixels. It must be between 1 and 1024. Recommended minimum of 50.

height

number

Height of the thumbnail, in pixels. It must be between 1 and 1024. Recommended minimum of 50.

image

HttpRequestBody

An image stream.

callback

ServiceCallback<void>

The callback

generateThumbnailInStream(number, number, HttpRequestBody, ServiceCallback<void>)

function generateThumbnailInStream(width: number, height: number, image: HttpRequestBody, callback: ServiceCallback<void>)

Parameters

width

number

Width of the thumbnail, in pixels. It must be between 1 and 1024. Recommended minimum of 50.

height

number

Height of the thumbnail, in pixels. It must be between 1 and 1024. Recommended minimum of 50.

image

HttpRequestBody

An image stream.

callback

ServiceCallback<void>

The callback

getAreaOfInterest(string, ComputerVisionClientGetAreaOfInterestOptionalParams)

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.

function getAreaOfInterest(url: string, options?: ComputerVisionClientGetAreaOfInterestOptionalParams): Promise<GetAreaOfInterestResponse>

Parameters

url

string

Publicly reachable URL of an image.

options
ComputerVisionClientGetAreaOfInterestOptionalParams

The optional parameters

Returns

Promise<Models.GetAreaOfInterestResponse>

getAreaOfInterest(string, ComputerVisionClientGetAreaOfInterestOptionalParams, ServiceCallback<AreaOfInterestResult>)

function getAreaOfInterest(url: string, options: ComputerVisionClientGetAreaOfInterestOptionalParams, callback: ServiceCallback<AreaOfInterestResult>)

Parameters

url

string

Publicly reachable URL of an image.

options
ComputerVisionClientGetAreaOfInterestOptionalParams

The optional parameters

callback

ServiceCallback<AreaOfInterestResult>

The callback

getAreaOfInterest(string, ServiceCallback<AreaOfInterestResult>)

function getAreaOfInterest(url: string, callback: ServiceCallback<AreaOfInterestResult>)

Parameters

url

string

Publicly reachable URL of an image.

callback

ServiceCallback<AreaOfInterestResult>

The callback

getAreaOfInterestInStream(HttpRequestBody, ComputerVisionClientGetAreaOfInterestInStreamOptionalParams)

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.

function getAreaOfInterestInStream(image: HttpRequestBody, options?: ComputerVisionClientGetAreaOfInterestInStreamOptionalParams): Promise<GetAreaOfInterestInStreamResponse>

Parameters

image

HttpRequestBody

An image stream.

Returns

Promise<Models.GetAreaOfInterestInStreamResponse>

getAreaOfInterestInStream(HttpRequestBody, ComputerVisionClientGetAreaOfInterestInStreamOptionalParams, ServiceCallback<AreaOfInterestResult>)

function getAreaOfInterestInStream(image: HttpRequestBody, options: ComputerVisionClientGetAreaOfInterestInStreamOptionalParams, callback: ServiceCallback<AreaOfInterestResult>)

Parameters

image

HttpRequestBody

An image stream.

callback

ServiceCallback<AreaOfInterestResult>

The callback

getAreaOfInterestInStream(HttpRequestBody, ServiceCallback<AreaOfInterestResult>)

function getAreaOfInterestInStream(image: HttpRequestBody, callback: ServiceCallback<AreaOfInterestResult>)

Parameters

image

HttpRequestBody

An image stream.

callback

ServiceCallback<AreaOfInterestResult>

The callback

getReadResult(string, RequestOptionsBase)

This interface is used for getting OCR results of Read operation. The URL to this interface should be retrieved from 'Operation-Location' field returned from Read interface.

function getReadResult(operationId: string, options?: RequestOptionsBase): Promise<GetReadResultResponse>

Parameters

operationId

string

Id of read operation returned in the response of the 'Read' interface.

options

RequestOptionsBase

The optional parameters

Returns

Promise<Models.GetReadResultResponse>

getReadResult(string, RequestOptionsBase, ServiceCallback<ReadOperationResult>)

function getReadResult(operationId: string, options: RequestOptionsBase, callback: ServiceCallback<ReadOperationResult>)

Parameters

operationId

string

Id of read operation returned in the response of the 'Read' interface.

options

RequestOptionsBase

The optional parameters

callback

ServiceCallback<ReadOperationResult>

The callback

getReadResult(string, ServiceCallback<ReadOperationResult>)

function getReadResult(operationId: string, callback: ServiceCallback<ReadOperationResult>)

Parameters

operationId

string

Id of read operation returned in the response of the 'Read' interface.

callback

ServiceCallback<ReadOperationResult>

The callback

listModels(RequestOptionsBase)

This operation returns the list of domain-specific models that are supported by the Computer Vision API. Currently, the API supports following domain-specific models: celebrity recognizer, landmark recognizer. A successful response will be returned in JSON. If the request failed, the response will contain an error code and a message to help understand what went wrong.

function listModels(options?: RequestOptionsBase): Promise<ListModelsResponse>

Parameters

options

RequestOptionsBase

The optional parameters

Returns

Promise<Models.ListModelsResponse>

listModels(RequestOptionsBase, ServiceCallback<ListModelsResult>)

function listModels(options: RequestOptionsBase, callback: ServiceCallback<ListModelsResult>)

Parameters

options

RequestOptionsBase

The optional parameters

callback

ServiceCallback<ListModelsResult>

The callback

listModels(ServiceCallback<ListModelsResult>)

function listModels(callback: ServiceCallback<ListModelsResult>)

Parameters

callback

ServiceCallback<ListModelsResult>

The callback

read(string, ComputerVisionClientReadOptionalParams)

Use this interface to get the result of a Read operation, employing the state-of-the-art Optical Character Recognition (OCR) algorithms optimized for text-heavy documents. When you use the Read interface, the response contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your 'GetReadResult' operation to access OCR results.​

function read(url: string, options?: ComputerVisionClientReadOptionalParams): Promise<ReadResponse>

Parameters

url

string

Publicly reachable URL of an image.

options
ComputerVisionClientReadOptionalParams

The optional parameters

Returns

Promise<ReadResponse>

Promise<Models.ReadResponse>

read(string, ComputerVisionClientReadOptionalParams, ServiceCallback<void>)

function read(url: string, options: ComputerVisionClientReadOptionalParams, callback: ServiceCallback<void>)

Parameters

url

string

Publicly reachable URL of an image.

options
ComputerVisionClientReadOptionalParams

The optional parameters

callback

ServiceCallback<void>

The callback

read(string, ServiceCallback<void>)

function read(url: string, callback: ServiceCallback<void>)

Parameters

url

string

Publicly reachable URL of an image.

callback

ServiceCallback<void>

The callback

readInStream(HttpRequestBody, ComputerVisionClientReadInStreamOptionalParams)

Use this interface to get the result of a Read operation, employing the state-of-the-art Optical Character Recognition (OCR) algorithms optimized for text-heavy documents. When you use the Read interface, the response contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your 'GetReadResult' operation to access OCR results.​

function readInStream(image: HttpRequestBody, options?: ComputerVisionClientReadInStreamOptionalParams): Promise<ReadInStreamResponse>

Parameters

image

HttpRequestBody

An image stream.

options
ComputerVisionClientReadInStreamOptionalParams

The optional parameters

Returns

Promise<Models.ReadInStreamResponse>

readInStream(HttpRequestBody, ComputerVisionClientReadInStreamOptionalParams, ServiceCallback<void>)

function readInStream(image: HttpRequestBody, options: ComputerVisionClientReadInStreamOptionalParams, callback: ServiceCallback<void>)

Parameters

image

HttpRequestBody

An image stream.

options
ComputerVisionClientReadInStreamOptionalParams

The optional parameters

callback

ServiceCallback<void>

The callback

readInStream(HttpRequestBody, ServiceCallback<void>)

function readInStream(image: HttpRequestBody, callback: ServiceCallback<void>)

Parameters

image

HttpRequestBody

An image stream.

callback

ServiceCallback<void>

The callback

recognizePrintedText(boolean, string, ComputerVisionClientRecognizePrintedTextOptionalParams)

Optical Character Recognition (OCR) detects text in an image and extracts the recognized characters into a machine-usable character stream. Upon success, the OCR results will be returned. Upon failure, the error code together with an error message will be returned. The error code can be one of InvalidImageUrl, InvalidImageFormat, InvalidImageSize, NotSupportedImage, NotSupportedLanguage, or InternalServerError.

function recognizePrintedText(detectOrientation: boolean, url: string, options?: ComputerVisionClientRecognizePrintedTextOptionalParams): Promise<RecognizePrintedTextResponse>

Parameters

detectOrientation

boolean

Whether detect the text orientation in the image. With detectOrientation=true the OCR service tries to detect the image orientation and correct it before further processing (e.g. if it's upside-down).

url

string

Publicly reachable URL of an image.

Returns

Promise<Models.RecognizePrintedTextResponse>

recognizePrintedText(boolean, string, ComputerVisionClientRecognizePrintedTextOptionalParams, ServiceCallback<OcrResult>)

function recognizePrintedText(detectOrientation: boolean, url: string, options: ComputerVisionClientRecognizePrintedTextOptionalParams, callback: ServiceCallback<OcrResult>)

Parameters

detectOrientation

boolean

Whether detect the text orientation in the image. With detectOrientation=true the OCR service tries to detect the image orientation and correct it before further processing (e.g. if it's upside-down).

url

string

Publicly reachable URL of an image.

callback

ServiceCallback<OcrResult>

The callback

recognizePrintedText(boolean, string, ServiceCallback<OcrResult>)

function recognizePrintedText(detectOrientation: boolean, url: string, callback: ServiceCallback<OcrResult>)

Parameters

detectOrientation

boolean

Whether detect the text orientation in the image. With detectOrientation=true the OCR service tries to detect the image orientation and correct it before further processing (e.g. if it's upside-down).

url

string

Publicly reachable URL of an image.

callback

ServiceCallback<OcrResult>

The callback

recognizePrintedTextInStream(boolean, HttpRequestBody, ComputerVisionClientRecognizePrintedTextInStreamOptionalParams)

Optical Character Recognition (OCR) detects text in an image and extracts the recognized characters into a machine-usable character stream. Upon success, the OCR results will be returned. Upon failure, the error code together with an error message will be returned. The error code can be one of InvalidImageUrl, InvalidImageFormat, InvalidImageSize, NotSupportedImage, NotSupportedLanguage, or InternalServerError.

function recognizePrintedTextInStream(detectOrientation: boolean, image: HttpRequestBody, options?: ComputerVisionClientRecognizePrintedTextInStreamOptionalParams): Promise<RecognizePrintedTextInStreamResponse>

Parameters

detectOrientation

boolean

Whether detect the text orientation in the image. With detectOrientation=true the OCR service tries to detect the image orientation and correct it before further processing (e.g. if it's upside-down).

image

HttpRequestBody

An image stream.

Returns

Promise<Models.RecognizePrintedTextInStreamResponse>

recognizePrintedTextInStream(boolean, HttpRequestBody, ComputerVisionClientRecognizePrintedTextInStreamOptionalParams, ServiceCallback<OcrResult>)

function recognizePrintedTextInStream(detectOrientation: boolean, image: HttpRequestBody, options: ComputerVisionClientRecognizePrintedTextInStreamOptionalParams, callback: ServiceCallback<OcrResult>)

Parameters

detectOrientation

boolean

Whether detect the text orientation in the image. With detectOrientation=true the OCR service tries to detect the image orientation and correct it before further processing (e.g. if it's upside-down).

image

HttpRequestBody

An image stream.

callback

ServiceCallback<OcrResult>

The callback

recognizePrintedTextInStream(boolean, HttpRequestBody, ServiceCallback<OcrResult>)

function recognizePrintedTextInStream(detectOrientation: boolean, image: HttpRequestBody, callback: ServiceCallback<OcrResult>)

Parameters

detectOrientation

boolean

Whether detect the text orientation in the image. With detectOrientation=true the OCR service tries to detect the image orientation and correct it before further processing (e.g. if it's upside-down).

image

HttpRequestBody

An image stream.

callback

ServiceCallback<OcrResult>

The callback

tagImage(string, ComputerVisionClientTagImageOptionalParams)

This operation generates a list of words, or tags, that are relevant to the content of the supplied image. The Computer Vision API can return tags based on objects, living beings, scenery or actions found in images. Unlike categories, tags are not organized according to a hierarchical classification system, but correspond to image content. Tags may contain hints to avoid ambiguity or provide context, for example the tag "ascomycete" may be accompanied by the hint "fungus". Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. A successful response will be returned in JSON. If the request failed, the response will contain an error code and a message to help understand what went wrong.

function tagImage(url: string, options?: ComputerVisionClientTagImageOptionalParams): Promise<TagImageResponse>

Parameters

url

string

Publicly reachable URL of an image.

options
ComputerVisionClientTagImageOptionalParams

The optional parameters

Returns

Promise<TagImageResponse>

Promise<Models.TagImageResponse>

tagImage(string, ComputerVisionClientTagImageOptionalParams, ServiceCallback<TagResult>)

function tagImage(url: string, options: ComputerVisionClientTagImageOptionalParams, callback: ServiceCallback<TagResult>)

Parameters

url

string

Publicly reachable URL of an image.

options
ComputerVisionClientTagImageOptionalParams

The optional parameters

callback

ServiceCallback<TagResult>

The callback

tagImage(string, ServiceCallback<TagResult>)

function tagImage(url: string, callback: ServiceCallback<TagResult>)

Parameters

url

string

Publicly reachable URL of an image.

callback

ServiceCallback<TagResult>

The callback

tagImageInStream(HttpRequestBody, ComputerVisionClientTagImageInStreamOptionalParams)

This operation generates a list of words, or tags, that are relevant to the content of the supplied image. The Computer Vision API can return tags based on objects, living beings, scenery or actions found in images. Unlike categories, tags are not organized according to a hierarchical classification system, but correspond to image content. Tags may contain hints to avoid ambiguity or provide context, for example the tag "ascomycete" may be accompanied by the hint "fungus". Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. A successful response will be returned in JSON. If the request failed, the response will contain an error code and a message to help understand what went wrong.

function tagImageInStream(image: HttpRequestBody, options?: ComputerVisionClientTagImageInStreamOptionalParams): Promise<TagImageInStreamResponse>

Parameters

image

HttpRequestBody

An image stream.

options
ComputerVisionClientTagImageInStreamOptionalParams

The optional parameters

Returns

Promise<Models.TagImageInStreamResponse>

tagImageInStream(HttpRequestBody, ComputerVisionClientTagImageInStreamOptionalParams, ServiceCallback<TagResult>)

function tagImageInStream(image: HttpRequestBody, options: ComputerVisionClientTagImageInStreamOptionalParams, callback: ServiceCallback<TagResult>)

Parameters

image

HttpRequestBody

An image stream.

options
ComputerVisionClientTagImageInStreamOptionalParams

The optional parameters

callback

ServiceCallback<TagResult>

The callback

tagImageInStream(HttpRequestBody, ServiceCallback<TagResult>)

function tagImageInStream(image: HttpRequestBody, callback: ServiceCallback<TagResult>)

Parameters

image

HttpRequestBody

An image stream.

callback

ServiceCallback<TagResult>

The callback

Inherited Method Details

sendOperationRequest(OperationArguments, OperationSpec, ServiceCallback<any>)

Send an HTTP request that is populated using the provided OperationSpec.

function sendOperationRequest(operationArguments: OperationArguments, operationSpec: OperationSpec, callback?: ServiceCallback<any>): Promise<RestResponse>

Parameters

operationArguments

OperationArguments

The arguments that the HTTP request's templated values will be populated from.

operationSpec

OperationSpec

The OperationSpec to use to populate the httpRequest.

callback

ServiceCallback<any>

The callback to call when the response is received.

Returns

Promise<RestResponse>

Inherited From ComputerVisionClientContext.sendOperationRequest

sendRequest(RequestPrepareOptions | WebResourceLike)

Send the provided httpRequest.

function sendRequest(options: RequestPrepareOptions | WebResourceLike): Promise<HttpOperationResponse>

Parameters

options

RequestPrepareOptions | WebResourceLike

Returns

Promise<HttpOperationResponse>

Inherited From ComputerVisionClientContext.sendRequest