你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
ComputerVisionClient class
- 扩展
构造函数
Computer |
初始化 ComputerVisionClient 类的新实例。 |
继承属性
credentials | |
endpoint |
方法
继承的方法
send |
发送使用提供的 OperationSpec 填充的 HTTP 请求。 |
send |
发送提供的 httpRequest。 |
构造函数详细信息
ComputerVisionClient(ServiceClientCredentials, string, ServiceClientOptions)
初始化 ComputerVisionClient 类的新实例。
new ComputerVisionClient(credentials: ServiceClientCredentials, endpoint: string, options?: ServiceClientOptions)
参数
- credentials
- ServiceClientCredentials
唯一标识客户端订阅的订阅凭据。
- endpoint
-
string
支持的认知服务终结点。
- options
- ServiceClientOptions
参数选项
继承属性详细信息
credentials
credentials: ServiceClientCredentials
属性值
endpoint
方法详细信息
analyzeImage(string, ComputerVisionClientAnalyzeImageOptionalParams)
此作基于图像内容提取一组丰富的视觉特征。 支持两种输入方法 - (1) 上传图像或指定图像 URL(2)。 在请求中,有一个可选参数,可用于选择要返回的功能。 默认情况下,图像类别在响应中返回。 成功响应将以 JSON 形式返回。 如果请求失败,响应将包含错误代码和一条消息,以帮助了解出了什么问题。
function analyzeImage(url: string, options?: ComputerVisionClientAnalyzeImageOptionalParams): Promise<AnalyzeImageResponse>
参数
- url
-
string
图像的可公开访问 URL。
可选参数
返回
Promise<AnalyzeImageResponse>
Promise<Models.AnalyzeImageResponse>
analyzeImage(string, ComputerVisionClientAnalyzeImageOptionalParams, ServiceCallback<ImageAnalysis>)
function analyzeImage(url: string, options: ComputerVisionClientAnalyzeImageOptionalParams, callback: ServiceCallback<ImageAnalysis>)
参数
- url
-
string
图像的可公开访问 URL。
可选参数
- callback
回调
analyzeImage(string, ServiceCallback<ImageAnalysis>)
function analyzeImage(url: string, callback: ServiceCallback<ImageAnalysis>)
参数
- url
-
string
图像的可公开访问 URL。
- callback
回调
analyzeImageByDomain(string, string, ComputerVisionClientAnalyzeImageByDomainOptionalParams)
此作通过应用特定于域的模型来识别图像中的内容。 可以使用 /models GET 请求检索计算机视觉 API 支持的特定于域的模型列表。 目前,API 提供以下特定于域的模型:名人、地标。 支持两种输入方法 - (1) 上传图像或指定图像 URL(2)。 成功响应将以 JSON 形式返回。 如果请求失败,响应将包含错误代码和一条消息,以帮助了解出了什么问题。
function analyzeImageByDomain(model: string, url: string, options?: ComputerVisionClientAnalyzeImageByDomainOptionalParams): Promise<AnalyzeImageByDomainResponse>
参数
- model
-
string
要识别的特定于域的内容。
- url
-
string
图像的可公开访问 URL。
返回
Promise<AnalyzeImageByDomainResponse>
Promise<Models.AnalyzeImageByDomainResponse>
analyzeImageByDomain(string, string, ComputerVisionClientAnalyzeImageByDomainOptionalParams, ServiceCallback<DomainModelResults>)
function analyzeImageByDomain(model: string, url: string, options: ComputerVisionClientAnalyzeImageByDomainOptionalParams, callback: ServiceCallback<DomainModelResults>)
参数
- model
-
string
要识别的特定于域的内容。
- url
-
string
图像的可公开访问 URL。
- callback
回调
analyzeImageByDomain(string, string, ServiceCallback<DomainModelResults>)
function analyzeImageByDomain(model: string, url: string, callback: ServiceCallback<DomainModelResults>)
参数
- model
-
string
要识别的特定于域的内容。
- url
-
string
图像的可公开访问 URL。
- callback
回调
analyzeImageByDomainInStream(string, HttpRequestBody, ComputerVisionClientAnalyzeImageByDomainInStreamOptionalParams)
此作通过应用特定于域的模型来识别图像中的内容。 可以使用 /models GET 请求检索计算机视觉 API 支持的特定于域的模型列表。 目前,API 提供以下特定于域的模型:名人、地标。 支持两种输入方法 - (1) 上传图像或指定图像 URL(2)。 成功响应将以 JSON 形式返回。 如果请求失败,响应将包含错误代码和一条消息,以帮助了解出了什么问题。
function analyzeImageByDomainInStream(model: string, image: HttpRequestBody, options?: ComputerVisionClientAnalyzeImageByDomainInStreamOptionalParams): Promise<AnalyzeImageByDomainInStreamResponse>
参数
- model
-
string
要识别的特定于域的内容。
- image
- HttpRequestBody
图像流。
返回
Promise<AnalyzeImageByDomainInStreamResponse>
Promise<Models.AnalyzeImageByDomainInStreamResponse>
analyzeImageByDomainInStream(string, HttpRequestBody, ComputerVisionClientAnalyzeImageByDomainInStreamOptionalParams, ServiceCallback<DomainModelResults>)
function analyzeImageByDomainInStream(model: string, image: HttpRequestBody, options: ComputerVisionClientAnalyzeImageByDomainInStreamOptionalParams, callback: ServiceCallback<DomainModelResults>)
参数
- model
-
string
要识别的特定于域的内容。
- image
- HttpRequestBody
图像流。
- callback
回调
analyzeImageByDomainInStream(string, HttpRequestBody, ServiceCallback<DomainModelResults>)
function analyzeImageByDomainInStream(model: string, image: HttpRequestBody, callback: ServiceCallback<DomainModelResults>)
参数
- model
-
string
要识别的特定于域的内容。
- image
- HttpRequestBody
图像流。
- callback
回调
analyzeImageInStream(HttpRequestBody, ComputerVisionClientAnalyzeImageInStreamOptionalParams)
此作基于图像内容提取一组丰富的视觉特征。 支持两种输入方法 - (1) 上传图像或指定图像 URL(2)。 在请求中,有一个可选参数,可用于选择要返回的功能。 默认情况下,图像类别在响应中返回。 成功响应将以 JSON 形式返回。 如果请求失败,响应将包含错误代码和一条消息,以帮助了解出了什么问题。
function analyzeImageInStream(image: HttpRequestBody, options?: ComputerVisionClientAnalyzeImageInStreamOptionalParams): Promise<AnalyzeImageInStreamResponse>
参数
- image
- HttpRequestBody
图像流。
返回
Promise<AnalyzeImageInStreamResponse>
Promise<Models.AnalyzeImageInStreamResponse>
analyzeImageInStream(HttpRequestBody, ComputerVisionClientAnalyzeImageInStreamOptionalParams, ServiceCallback<ImageAnalysis>)
function analyzeImageInStream(image: HttpRequestBody, options: ComputerVisionClientAnalyzeImageInStreamOptionalParams, callback: ServiceCallback<ImageAnalysis>)
参数
- image
- HttpRequestBody
图像流。
- callback
回调
analyzeImageInStream(HttpRequestBody, ServiceCallback<ImageAnalysis>)
function analyzeImageInStream(image: HttpRequestBody, callback: ServiceCallback<ImageAnalysis>)
参数
- image
- HttpRequestBody
图像流。
- callback
回调
describeImage(string, ComputerVisionClientDescribeImageOptionalParams)
此作使用完整的句子以人类可读语言生成图像的说明。 说明基于内容标记的集合,该集合也由作返回。 可以为每个图像生成多个说明。 说明按置信度分数排序。 说明可能包括名人和具有里程碑意义的域模型的结果(如果适用)。 支持两种输入方法 - (1) 上传图像或指定图像 URL(2)。 成功响应将以 JSON 形式返回。 如果请求失败,响应将包含错误代码和一条消息,以帮助了解出了什么问题。
function describeImage(url: string, options?: ComputerVisionClientDescribeImageOptionalParams): Promise<DescribeImageResponse>
参数
- url
-
string
图像的可公开访问 URL。
可选参数
返回
Promise<DescribeImageResponse>
Promise<Models.DescribeImageResponse>
describeImage(string, ComputerVisionClientDescribeImageOptionalParams, ServiceCallback<ImageDescription>)
function describeImage(url: string, options: ComputerVisionClientDescribeImageOptionalParams, callback: ServiceCallback<ImageDescription>)
参数
- url
-
string
图像的可公开访问 URL。
可选参数
- callback
回调
describeImage(string, ServiceCallback<ImageDescription>)
function describeImage(url: string, callback: ServiceCallback<ImageDescription>)
参数
- url
-
string
图像的可公开访问 URL。
- callback
回调
describeImageInStream(HttpRequestBody, ComputerVisionClientDescribeImageInStreamOptionalParams)
此作使用完整的句子以人类可读语言生成图像的说明。 说明基于内容标记的集合,该集合也由作返回。 可以为每个图像生成多个说明。 说明按置信度分数排序。 说明可能包括名人和具有里程碑意义的域模型的结果(如果适用)。 支持两种输入方法 - (1) 上传图像或指定图像 URL(2)。 成功响应将以 JSON 形式返回。 如果请求失败,响应将包含错误代码和一条消息,以帮助了解出了什么问题。
function describeImageInStream(image: HttpRequestBody, options?: ComputerVisionClientDescribeImageInStreamOptionalParams): Promise<DescribeImageInStreamResponse>
参数
- image
- HttpRequestBody
图像流。
返回
Promise<DescribeImageInStreamResponse>
Promise<Models.DescribeImageInStreamResponse>
describeImageInStream(HttpRequestBody, ComputerVisionClientDescribeImageInStreamOptionalParams, ServiceCallback<ImageDescription>)
function describeImageInStream(image: HttpRequestBody, options: ComputerVisionClientDescribeImageInStreamOptionalParams, callback: ServiceCallback<ImageDescription>)
参数
- image
- HttpRequestBody
图像流。
- callback
回调
describeImageInStream(HttpRequestBody, ServiceCallback<ImageDescription>)
function describeImageInStream(image: HttpRequestBody, callback: ServiceCallback<ImageDescription>)
参数
- image
- HttpRequestBody
图像流。
- callback
回调
detectObjects(string, ComputerVisionClientDetectObjectsOptionalParams)
对指定的图像执行对象检测。 支持两种输入方法 - (1) 上传图像或指定图像 URL(2)。 成功响应将以 JSON 形式返回。 如果请求失败,响应将包含错误代码和一条消息,以帮助了解出了什么问题。
function detectObjects(url: string, options?: ComputerVisionClientDetectObjectsOptionalParams): Promise<DetectObjectsResponse>
参数
- url
-
string
图像的可公开访问 URL。
可选参数
返回
Promise<DetectObjectsResponse>
Promise<Models.DetectObjectsResponse>
detectObjects(string, ComputerVisionClientDetectObjectsOptionalParams, ServiceCallback<DetectResult>)
function detectObjects(url: string, options: ComputerVisionClientDetectObjectsOptionalParams, callback: ServiceCallback<DetectResult>)
参数
- url
-
string
图像的可公开访问 URL。
可选参数
- callback
回调
detectObjects(string, ServiceCallback<DetectResult>)
function detectObjects(url: string, callback: ServiceCallback<DetectResult>)
参数
- url
-
string
图像的可公开访问 URL。
- callback
回调
detectObjectsInStream(HttpRequestBody, ComputerVisionClientDetectObjectsInStreamOptionalParams)
对指定的图像执行对象检测。 支持两种输入方法 - (1) 上传图像或指定图像 URL(2)。 成功响应将以 JSON 形式返回。 如果请求失败,响应将包含错误代码和一条消息,以帮助了解出了什么问题。
function detectObjectsInStream(image: HttpRequestBody, options?: ComputerVisionClientDetectObjectsInStreamOptionalParams): Promise<DetectObjectsInStreamResponse>
参数
- image
- HttpRequestBody
图像流。
返回
Promise<DetectObjectsInStreamResponse>
Promise<Models.DetectObjectsInStreamResponse>
detectObjectsInStream(HttpRequestBody, ComputerVisionClientDetectObjectsInStreamOptionalParams, ServiceCallback<DetectResult>)
function detectObjectsInStream(image: HttpRequestBody, options: ComputerVisionClientDetectObjectsInStreamOptionalParams, callback: ServiceCallback<DetectResult>)
参数
- image
- HttpRequestBody
图像流。
- callback
回调
detectObjectsInStream(HttpRequestBody, ServiceCallback<DetectResult>)
function detectObjectsInStream(image: HttpRequestBody, callback: ServiceCallback<DetectResult>)
参数
- image
- HttpRequestBody
图像流。
- callback
回调
generateThumbnail(number, number, string, ComputerVisionClientGenerateThumbnailOptionalParams)
此作生成具有用户指定宽度和高度的缩略图。 默认情况下,服务会分析图像,识别感兴趣的区域(ROI),并根据 ROI 生成智能裁剪坐标。 指定与输入图像不同的纵横比时,智能裁剪会有所帮助。 成功的响应包含缩略图图像二进制文件。 如果请求失败,响应将包含错误代码和一条消息,以帮助确定出了什么问题。 失败后,将返回错误代码和错误消息。 错误代码可以是 InvalidImageUrl、InvalidImageFormat、InvalidImageSize、InvalidThumbnailSize、NotSupportedImage、FailedToProcess、Timeout 或 InternalServerError 之一。
function generateThumbnail(width: number, height: number, url: string, options?: ComputerVisionClientGenerateThumbnailOptionalParams): Promise<GenerateThumbnailResponse>
参数
- width
-
number
缩略图的宽度(以像素为单位)。 它必须介于 1 到 1024 之间。 建议的最小值为 50。
- height
-
number
缩略图的高度(以像素为单位)。 它必须介于 1 到 1024 之间。 建议的最小值为 50。
- url
-
string
图像的可公开访问 URL。
可选参数
返回
Promise<GenerateThumbnailResponse>
Promise<Models.GenerateThumbnailResponse>
generateThumbnail(number, number, string, ComputerVisionClientGenerateThumbnailOptionalParams, ServiceCallback<void>)
function generateThumbnail(width: number, height: number, url: string, options: ComputerVisionClientGenerateThumbnailOptionalParams, callback: ServiceCallback<void>)
参数
- width
-
number
缩略图的宽度(以像素为单位)。 它必须介于 1 到 1024 之间。 建议的最小值为 50。
- height
-
number
缩略图的高度(以像素为单位)。 它必须介于 1 到 1024 之间。 建议的最小值为 50。
- url
-
string
图像的可公开访问 URL。
可选参数
- callback
-
ServiceCallback<void>
回调
generateThumbnail(number, number, string, ServiceCallback<void>)
function generateThumbnail(width: number, height: number, url: string, callback: ServiceCallback<void>)
参数
- width
-
number
缩略图的宽度(以像素为单位)。 它必须介于 1 到 1024 之间。 建议的最小值为 50。
- height
-
number
缩略图的高度(以像素为单位)。 它必须介于 1 到 1024 之间。 建议的最小值为 50。
- url
-
string
图像的可公开访问 URL。
- callback
-
ServiceCallback<void>
回调
generateThumbnailInStream(number, number, HttpRequestBody, ComputerVisionClientGenerateThumbnailInStreamOptionalParams)
此作生成具有用户指定宽度和高度的缩略图。 默认情况下,服务会分析图像,识别感兴趣的区域(ROI),并根据 ROI 生成智能裁剪坐标。 指定与输入图像不同的纵横比时,智能裁剪会有所帮助。 成功的响应包含缩略图图像二进制文件。 如果请求失败,响应将包含错误代码和一条消息,以帮助确定出了什么问题。 失败后,将返回错误代码和错误消息。 错误代码可以是 InvalidImageUrl、InvalidImageFormat、InvalidImageSize、InvalidThumbnailSize、NotSupportedImage、FailedToProcess、Timeout 或 InternalServerError 之一。
function generateThumbnailInStream(width: number, height: number, image: HttpRequestBody, options?: ComputerVisionClientGenerateThumbnailInStreamOptionalParams): Promise<GenerateThumbnailInStreamResponse>
参数
- width
-
number
缩略图的宽度(以像素为单位)。 它必须介于 1 到 1024 之间。 建议的最小值为 50。
- height
-
number
缩略图的高度(以像素为单位)。 它必须介于 1 到 1024 之间。 建议的最小值为 50。
- image
- HttpRequestBody
图像流。
返回
Promise<GenerateThumbnailInStreamResponse>
Promise<Models.GenerateThumbnailInStreamResponse>
generateThumbnailInStream(number, number, HttpRequestBody, ComputerVisionClientGenerateThumbnailInStreamOptionalParams, ServiceCallback<void>)
function generateThumbnailInStream(width: number, height: number, image: HttpRequestBody, options: ComputerVisionClientGenerateThumbnailInStreamOptionalParams, callback: ServiceCallback<void>)
参数
- width
-
number
缩略图的宽度(以像素为单位)。 它必须介于 1 到 1024 之间。 建议的最小值为 50。
- height
-
number
缩略图的高度(以像素为单位)。 它必须介于 1 到 1024 之间。 建议的最小值为 50。
- image
- HttpRequestBody
图像流。
- callback
-
ServiceCallback<void>
回调
generateThumbnailInStream(number, number, HttpRequestBody, ServiceCallback<void>)
function generateThumbnailInStream(width: number, height: number, image: HttpRequestBody, callback: ServiceCallback<void>)
参数
- width
-
number
缩略图的宽度(以像素为单位)。 它必须介于 1 到 1024 之间。 建议的最小值为 50。
- height
-
number
缩略图的高度(以像素为单位)。 它必须介于 1 到 1024 之间。 建议的最小值为 50。
- image
- HttpRequestBody
图像流。
- callback
-
ServiceCallback<void>
回调
getAreaOfInterest(string, ComputerVisionClientGetAreaOfInterestOptionalParams)
此作返回图像最重要的区域周围的边界框。 成功响应将以 JSON 形式返回。 如果请求失败,响应将包含错误代码和一条消息,以帮助确定出了什么问题。 失败后,将返回错误代码和错误消息。 错误代码可以是 InvalidImageUrl、InvalidImageFormat、InvalidImageSize、NotSupportedImage、FailedToProcess、Timeout 或 InternalServerError 之一。
function getAreaOfInterest(url: string, options?: ComputerVisionClientGetAreaOfInterestOptionalParams): Promise<GetAreaOfInterestResponse>
参数
- url
-
string
图像的可公开访问 URL。
可选参数
返回
Promise<GetAreaOfInterestResponse>
Promise<Models.GetAreaOfInterestResponse>
getAreaOfInterest(string, ComputerVisionClientGetAreaOfInterestOptionalParams, ServiceCallback<AreaOfInterestResult>)
function getAreaOfInterest(url: string, options: ComputerVisionClientGetAreaOfInterestOptionalParams, callback: ServiceCallback<AreaOfInterestResult>)
参数
- url
-
string
图像的可公开访问 URL。
可选参数
- callback
回调
getAreaOfInterest(string, ServiceCallback<AreaOfInterestResult>)
function getAreaOfInterest(url: string, callback: ServiceCallback<AreaOfInterestResult>)
参数
- url
-
string
图像的可公开访问 URL。
- callback
回调
getAreaOfInterestInStream(HttpRequestBody, ComputerVisionClientGetAreaOfInterestInStreamOptionalParams)
此作返回图像最重要的区域周围的边界框。 成功响应将以 JSON 形式返回。 如果请求失败,响应将包含错误代码和一条消息,以帮助确定出了什么问题。 失败后,将返回错误代码和错误消息。 错误代码可以是 InvalidImageUrl、InvalidImageFormat、InvalidImageSize、NotSupportedImage、FailedToProcess、Timeout 或 InternalServerError 之一。
function getAreaOfInterestInStream(image: HttpRequestBody, options?: ComputerVisionClientGetAreaOfInterestInStreamOptionalParams): Promise<GetAreaOfInterestInStreamResponse>
参数
- image
- HttpRequestBody
图像流。
返回
Promise<GetAreaOfInterestInStreamResponse>
Promise<Models.GetAreaOfInterestInStreamResponse>
getAreaOfInterestInStream(HttpRequestBody, ComputerVisionClientGetAreaOfInterestInStreamOptionalParams, ServiceCallback<AreaOfInterestResult>)
function getAreaOfInterestInStream(image: HttpRequestBody, options: ComputerVisionClientGetAreaOfInterestInStreamOptionalParams, callback: ServiceCallback<AreaOfInterestResult>)
参数
- image
- HttpRequestBody
图像流。
- callback
回调
getAreaOfInterestInStream(HttpRequestBody, ServiceCallback<AreaOfInterestResult>)
function getAreaOfInterestInStream(image: HttpRequestBody, callback: ServiceCallback<AreaOfInterestResult>)
参数
- image
- HttpRequestBody
图像流。
- callback
回调
getReadResult(string, RequestOptionsBase)
此接口用于获取读取作的 OCR 结果。 应从从读取接口返回的“Operation-Location”字段检索此接口的 URL。
function getReadResult(operationId: string, options?: RequestOptionsBase): Promise<GetReadResultResponse>
参数
- operationId
-
string
在“读取”接口的响应中返回的读取作的 ID。
- options
- RequestOptionsBase
可选参数
返回
Promise<GetReadResultResponse>
Promise<Models.GetReadResultResponse>
getReadResult(string, RequestOptionsBase, ServiceCallback<ReadOperationResult>)
function getReadResult(operationId: string, options: RequestOptionsBase, callback: ServiceCallback<ReadOperationResult>)
参数
- operationId
-
string
在“读取”接口的响应中返回的读取作的 ID。
- options
- RequestOptionsBase
可选参数
- callback
回调
getReadResult(string, ServiceCallback<ReadOperationResult>)
function getReadResult(operationId: string, callback: ServiceCallback<ReadOperationResult>)
参数
- operationId
-
string
在“读取”接口的响应中返回的读取作的 ID。
- callback
回调
listModels(RequestOptionsBase)
此作返回计算机视觉 API 支持的特定于域的模型的列表。 目前,API 支持以下特定于域的模型:名人识别器、地标识别器。 成功响应将以 JSON 形式返回。 如果请求失败,响应将包含错误代码和一条消息,以帮助了解出了什么问题。
function listModels(options?: RequestOptionsBase): Promise<ListModelsResponse>
参数
- options
- RequestOptionsBase
可选参数
返回
Promise<ListModelsResponse>
Promise<Models.ListModelsResponse>
listModels(RequestOptionsBase, ServiceCallback<ListModelsResult>)
function listModels(options: RequestOptionsBase, callback: ServiceCallback<ListModelsResult>)
参数
- options
- RequestOptionsBase
可选参数
- callback
回调
listModels(ServiceCallback<ListModelsResult>)
function listModels(callback: ServiceCallback<ListModelsResult>)
参数
- callback
回调
read(string, ComputerVisionClientReadOptionalParams)
使用此接口获取读取作的结果,并采用针对文本密集型文档优化的最先进的光学字符识别(OCR)算法。 使用读取接口时,响应包含名为“Operation-Location”的字段。 “Operation-Location”字段包含必须用于“GetReadResult”作以访问 OCR 结果的 URL。
function read(url: string, options?: ComputerVisionClientReadOptionalParams): Promise<ReadResponse>
参数
- url
-
string
图像的可公开访问 URL。
可选参数
返回
Promise<ReadResponse>
Promise<Models.ReadResponse>
read(string, ComputerVisionClientReadOptionalParams, ServiceCallback<void>)
function read(url: string, options: ComputerVisionClientReadOptionalParams, callback: ServiceCallback<void>)
参数
- url
-
string
图像的可公开访问 URL。
可选参数
- callback
-
ServiceCallback<void>
回调
read(string, ServiceCallback<void>)
function read(url: string, callback: ServiceCallback<void>)
参数
- url
-
string
图像的可公开访问 URL。
- callback
-
ServiceCallback<void>
回调
readInStream(HttpRequestBody, ComputerVisionClientReadInStreamOptionalParams)
使用此接口获取读取作的结果,并采用针对文本密集型文档优化的最先进的光学字符识别(OCR)算法。 使用读取接口时,响应包含名为“Operation-Location”的字段。 “Operation-Location”字段包含必须用于“GetReadResult”作以访问 OCR 结果的 URL。
function readInStream(image: HttpRequestBody, options?: ComputerVisionClientReadInStreamOptionalParams): Promise<ReadInStreamResponse>
参数
- image
- HttpRequestBody
图像流。
可选参数
返回
Promise<ReadInStreamResponse>
Promise<Models.ReadInStreamResponse>
readInStream(HttpRequestBody, ComputerVisionClientReadInStreamOptionalParams, ServiceCallback<void>)
function readInStream(image: HttpRequestBody, options: ComputerVisionClientReadInStreamOptionalParams, callback: ServiceCallback<void>)
参数
- image
- HttpRequestBody
图像流。
可选参数
- callback
-
ServiceCallback<void>
回调
readInStream(HttpRequestBody, ServiceCallback<void>)
function readInStream(image: HttpRequestBody, callback: ServiceCallback<void>)
参数
- image
- HttpRequestBody
图像流。
- callback
-
ServiceCallback<void>
回调
recognizePrintedText(boolean, string, ComputerVisionClientRecognizePrintedTextOptionalParams)
光学字符识别(OCR)检测图像中的文本,并将识别的字符提取到计算机可用字符流中。 成功后,将返回 OCR 结果。 失败后,将返回错误代码和错误消息。 错误代码可以是 InvalidImageUrl、InvalidImageFormat、InvalidImageSize、NotSupportedImage、NotSupportedLanguage 或 InternalServerError 之一。
function recognizePrintedText(detectOrientation: boolean, url: string, options?: ComputerVisionClientRecognizePrintedTextOptionalParams): Promise<RecognizePrintedTextResponse>
参数
- detectOrientation
-
boolean
是否检测图像中的文本方向。 借助 detectOrientation=true,OCR 服务会尝试检测图像方向,并在进一步处理之前对其进行更正(例如,如果它倒置)。
- url
-
string
图像的可公开访问 URL。
返回
Promise<RecognizePrintedTextResponse>
Promise<Models.RecognizePrintedTextResponse>
recognizePrintedText(boolean, string, ComputerVisionClientRecognizePrintedTextOptionalParams, ServiceCallback<OcrResult>)
function recognizePrintedText(detectOrientation: boolean, url: string, options: ComputerVisionClientRecognizePrintedTextOptionalParams, callback: ServiceCallback<OcrResult>)
参数
- detectOrientation
-
boolean
是否检测图像中的文本方向。 借助 detectOrientation=true,OCR 服务会尝试检测图像方向,并在进一步处理之前对其进行更正(例如,如果它倒置)。
- url
-
string
图像的可公开访问 URL。
- callback
回调
recognizePrintedText(boolean, string, ServiceCallback<OcrResult>)
function recognizePrintedText(detectOrientation: boolean, url: string, callback: ServiceCallback<OcrResult>)
参数
- detectOrientation
-
boolean
是否检测图像中的文本方向。 借助 detectOrientation=true,OCR 服务会尝试检测图像方向,并在进一步处理之前对其进行更正(例如,如果它倒置)。
- url
-
string
图像的可公开访问 URL。
- callback
回调
recognizePrintedTextInStream(boolean, HttpRequestBody, ComputerVisionClientRecognizePrintedTextInStreamOptionalParams)
光学字符识别(OCR)检测图像中的文本,并将识别的字符提取到计算机可用字符流中。 成功后,将返回 OCR 结果。 失败后,将返回错误代码和错误消息。 错误代码可以是 InvalidImageUrl、InvalidImageFormat、InvalidImageSize、NotSupportedImage、NotSupportedLanguage 或 InternalServerError 之一。
function recognizePrintedTextInStream(detectOrientation: boolean, image: HttpRequestBody, options?: ComputerVisionClientRecognizePrintedTextInStreamOptionalParams): Promise<RecognizePrintedTextInStreamResponse>
参数
- detectOrientation
-
boolean
是否检测图像中的文本方向。 借助 detectOrientation=true,OCR 服务会尝试检测图像方向,并在进一步处理之前对其进行更正(例如,如果它倒置)。
- image
- HttpRequestBody
图像流。
返回
Promise<RecognizePrintedTextInStreamResponse>
Promise<Models.RecognizePrintedTextInStreamResponse>
recognizePrintedTextInStream(boolean, HttpRequestBody, ComputerVisionClientRecognizePrintedTextInStreamOptionalParams, ServiceCallback<OcrResult>)
function recognizePrintedTextInStream(detectOrientation: boolean, image: HttpRequestBody, options: ComputerVisionClientRecognizePrintedTextInStreamOptionalParams, callback: ServiceCallback<OcrResult>)
参数
- detectOrientation
-
boolean
是否检测图像中的文本方向。 借助 detectOrientation=true,OCR 服务会尝试检测图像方向,并在进一步处理之前对其进行更正(例如,如果它倒置)。
- image
- HttpRequestBody
图像流。
- callback
回调
recognizePrintedTextInStream(boolean, HttpRequestBody, ServiceCallback<OcrResult>)
function recognizePrintedTextInStream(detectOrientation: boolean, image: HttpRequestBody, callback: ServiceCallback<OcrResult>)
参数
- detectOrientation
-
boolean
是否检测图像中的文本方向。 借助 detectOrientation=true,OCR 服务会尝试检测图像方向,并在进一步处理之前对其进行更正(例如,如果它倒置)。
- image
- HttpRequestBody
图像流。
- callback
回调
tagImage(string, ComputerVisionClientTagImageOptionalParams)
此作将生成与提供的图像内容相关的字词或标记列表。 计算机视觉 API 可以根据图像中找到的对象、生物、风景或作返回标记。 与类别不同,标记不是根据分层分类系统组织的,而是对应于图像内容。 标记可能包含提示以避免歧义或提供上下文,例如标记“ascomycete”可能附带提示“fungus”。 支持两种输入方法 - (1) 上传图像或指定图像 URL(2)。 成功响应将以 JSON 形式返回。 如果请求失败,响应将包含错误代码和一条消息,以帮助了解出了什么问题。
function tagImage(url: string, options?: ComputerVisionClientTagImageOptionalParams): Promise<TagImageResponse>
参数
- url
-
string
图像的可公开访问 URL。
可选参数
返回
Promise<TagImageResponse>
Promise<Models.TagImageResponse>
tagImage(string, ComputerVisionClientTagImageOptionalParams, ServiceCallback<TagResult>)
function tagImage(url: string, options: ComputerVisionClientTagImageOptionalParams, callback: ServiceCallback<TagResult>)
参数
- url
-
string
图像的可公开访问 URL。
可选参数
- callback
回调
tagImage(string, ServiceCallback<TagResult>)
function tagImage(url: string, callback: ServiceCallback<TagResult>)
参数
- url
-
string
图像的可公开访问 URL。
- callback
回调
tagImageInStream(HttpRequestBody, ComputerVisionClientTagImageInStreamOptionalParams)
此作将生成与提供的图像内容相关的字词或标记列表。 计算机视觉 API 可以根据图像中找到的对象、生物、风景或作返回标记。 与类别不同,标记不是根据分层分类系统组织的,而是对应于图像内容。 标记可能包含提示以避免歧义或提供上下文,例如标记“ascomycete”可能附带提示“fungus”。 支持两种输入方法 - (1) 上传图像或指定图像 URL(2)。 成功响应将以 JSON 形式返回。 如果请求失败,响应将包含错误代码和一条消息,以帮助了解出了什么问题。
function tagImageInStream(image: HttpRequestBody, options?: ComputerVisionClientTagImageInStreamOptionalParams): Promise<TagImageInStreamResponse>
参数
- image
- HttpRequestBody
图像流。
可选参数
返回
Promise<TagImageInStreamResponse>
Promise<Models.TagImageInStreamResponse>
tagImageInStream(HttpRequestBody, ComputerVisionClientTagImageInStreamOptionalParams, ServiceCallback<TagResult>)
function tagImageInStream(image: HttpRequestBody, options: ComputerVisionClientTagImageInStreamOptionalParams, callback: ServiceCallback<TagResult>)
参数
- image
- HttpRequestBody
图像流。
可选参数
- callback
回调
tagImageInStream(HttpRequestBody, ServiceCallback<TagResult>)
function tagImageInStream(image: HttpRequestBody, callback: ServiceCallback<TagResult>)
参数
- image
- HttpRequestBody
图像流。
- callback
回调
继承的方法详细信息
sendOperationRequest(OperationArguments, OperationSpec, ServiceCallback<any>)
发送使用提供的 OperationSpec 填充的 HTTP 请求。
function sendOperationRequest(operationArguments: OperationArguments, operationSpec: OperationSpec, callback?: ServiceCallback<any>): Promise<RestResponse>
参数
- operationArguments
- OperationArguments
将从中填充 HTTP 请求的模板化值的参数。
- operationSpec
- OperationSpec
用于填充 httpRequest 的 OperationSpec。
- callback
-
ServiceCallback<any>
收到响应时要调用的回调。
返回
Promise<RestResponse>
sendRequest(RequestPrepareOptions | WebResourceLike)
发送提供的 httpRequest。
function sendRequest(options: RequestPrepareOptions | WebResourceLike): Promise<HttpOperationResponse>
参数
- options
返回
Promise<HttpOperationResponse>