tencent cloud

APIs

RecognizeDetectCardCoords

Download
Modo Foco
Tamanho da Fonte
Última atualização: 2026-07-02 16:21:50

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 URL of the image. Supported image formats: PNG, JPG, JPEG. GIF is not supported. The downloaded image must be no larger than 7 MB after Base64 encoding. Image download must complete within 3 seconds. Images stored in Tencent Cloud offer higher download speed and stability. We recommend storing images in Tencent Cloud. The speed and stability of URLs from non-Tencent Cloud storage may be affected.
ImageBase64 No String Base64-encoded image data. Supported image formats: PNG, JPG, JPEG. GIF is not supported. The image must be no larger than 7 MB after Base64 encoding. Image download must complete within 3 seconds. You must provide either ImageUrl or ImageBase64. If both are provided, ImageUrl will be used.

3. Output Parameters

Parameter Name Type Description
ItemList Array of CoordsItem Coordinate information of the detected four corners of the card.
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 Failed to download the file.
FailedOperation.ImageDecodeFailed Failed to decode the image.
FailedOperation.OcrFailed OCR recognition failed. This error may be caused by unstable network connections, service anomalies, or other issues.
FailedOperation.UnKnowError Unknown error.
FailedOperation.UnOpenError The service has not been activated.
InvalidParameterValue.InvalidParameterValueLimit Incorrect parameter value.
LimitExceeded.TooLargeFileError The file size exceeds the limit
ResourceUnavailable.InArrears The account has insufficient balance.
ResourceUnavailable.ResourcePackageRunOut The resource package has been exhausted.
ResourcesSoldOut.ChargeStatusException The billing status is abnormal.

Ajuda e Suporte

Esta página foi útil?

comentários