tencent cloud

文字识别

购买指南
计费概述
欠费说明
错误码计费说明
快速入门
操作指引
快速接入指引
服务端 API 文档
History
Introduction
API Category
调用方式
Document Intelligent APIs
Card and Document OCR APIs
General Text OCR APIs
Vehicle Scene OCR APIs
Data Types
Error Codes
服务协议
Service Level Agreement
OCR Policy
隐私协议
数据处理和安全协议

RecognizeDetectCardCoords

PDF
聚焦模式
字号
最后更新时间: 2025-11-18 16:52:16

1. API Description

Domain name for API request: ocr.intl.tencentcloudapi.com.

This API is used to recognize the coordinates of four corners of cards.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: RecognizeDetectCardCoords.
Version Yes String Common Params. The value used for this API: 2018-11-19.
Region No String Common Params. This parameter is not required.
ImageUrl No String The Url of the image. supported image formats: PNG, JPG, JPEG. GIF format is not currently supported. supported image size: the downloaded image should be no more than 7M after Base64 encoding. image download time should be no more than 3 seconds. images stored in tencent cloud's urls guarantee higher download speed and stability. it is recommended to store images in tencent cloud. the speed and stability of non-tencent cloud storage urls may be impacted.
ImageBase64 No String The Base64 value of the image. supported image formats: PNG, JPG, JPEG. GIF format is not currently supported. supported image size: no more than 7M after the downloaded image is encoded in Base64. image download time is not more than 3 seconds. either ImageUrl or ImageBase64 must be provided. if both are provided, only use ImageUrl.

3. Output Parameters

Parameter Name Type Description
ItemList Array of CoordsItem Detected coordinate information.
RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Four Corner Coordinate Detection and Recognition

Input Example

POST / HTTP/1.1
Host: ocr.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: RecognizeDetectCardCoords
<Common request parameters>

{
    "ImageUrl": "https://ocr-demo-1254418846.cos.ap-guangzhou.myqcloud.com/card/IDCardOCR/IDCardOCR1.jpg"
}

Output Example

{
    "Response": {
        "ItemList": [
            {
                "Coords": {
                    "Height": 388,
                    "Width": 607,
                    "X": 93,
                    "Y": 204
                },
                "Polygon": {
                    "LeftBottom": {
                        "X": 93,
                        "Y": 592
                    },
                    "LeftTop": {
                        "X": 95,
                        "Y": 204
                    },
                    "RightBottom": {
                        "X": 700,
                        "Y": 592
                    },
                    "RightTop": {
                        "X": 700,
                        "Y": 204
                    }
                }
            }
        ],
        "RequestId": "27ca3357-3cfe-4cb2-9996-0120241211b1"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
FailedOperation.DownLoadError File download failed.
FailedOperation.ImageDecodeFailed Image decoding failed.
FailedOperation.OcrFailed OCR failed. This error may be caused by unstable network connections,service anomalies or other issues.
FailedOperation.UnKnowError Unknown error.
FailedOperation.UnOpenError The service is not activated.
InvalidParameterValue.InvalidParameterValueLimit Incorrect parameter value.
LimitExceeded.TooLargeFileError The file is too large.
ResourceUnavailable.InArrears The account is in arrears.
ResourceUnavailable.ResourcePackageRunOut The account resource package is exhausted.
ResourcesSoldOut.ChargeStatusException Exceptional billing status.

帮助和支持

本页内容是否解决了您的问题?

填写满意度调查问卷,共创更好文档体验。

文档反馈