AI Agent Hub
Back to skills
Tencent Cloud Advertise OCR icon

Tencent Cloud Advertise OCR

Design & Media Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Please refer to https://skillhub.cn/install/skillhub.md to install @tencent-adm/tencentcloud-ocr-general.

About this skill

The Specific Problem It Solves

In image processing, advertising analysis, or automated document workflows, extracting text information from images is often necessary. Traditional OCR tools frequently struggle with mixed Chinese and English text, multi-directional layouts (such as vertical or tilted text), or rotated images, leading to reduced accuracy or inability to provide precise text location coordinates for subsequent visual positioning or interactive design.

How the Skill Works

The Tencent Cloud Advertise OCR interface addresses these issues with its core capabilities:
- Mixed Language Recognition: Supports accurate detection and recognition of mixed Chinese and English text, suitable for multilingual scenarios.
- Multi-Directional Support: Handles horizontal, vertical, and tilted text scenes without pre-correction.
- Rotation Support: Recognizes text in images rotated by 90, 180, or 270 degrees, enhancing processing flexibility.
- Coordinate Return: Returns the four vertex coordinates (Polygon field) for each text line in a list format, facilitating visual operations.
- Confidence Scoring: Provides confidence scores (0~100) for each recognition result, aiding quality assessment.

The usage workflow involves key steps:
1. Image Input: Provide the image via ImageBase64 (Base64 encoded, under 10MB) or ImageUrl (recommended from Tencent Cloud COS), with at least one required.
2. API Call: Use the tencentcloud-sdk-python library to send requests to the API, which has a default rate limit of 20 requests per second.
3. Response Parsing: Returns a JSON result containing a TextDetections list, where each entry includes fields like DetectedText (recognized text), Confidence (confidence score), and Polygon (coordinates), along with metadata such as TextCount and ImageSize.

Applicable Boundaries and Considerations

While powerful, keep the following in mind:
- Request Limits: The API has a default frequency of 20 requests per second; high-frequency scenarios require careful call strategy design.
- Image Requirements: Supports PNG, JPG, JPEG, and BMP formats, with a recommended resolution of at least 600×800 pixels for optimal recognition, and encoded size under 10MB.
- Environment Setup: Requires Python 3.6+ and the tencentcloud-sdk-python library, with environment variables TENCENTCLOUD_SECRET_ID and TENCENTCLOUD_SECRET_KEY set for API key authentication.
- Error Handling: Handle errors based on codes like FailedOperation.ImageNoText (no text detected) or LimitExceeded.TooLargeFileError (file too large) to avoid service interruptions.
- Billing and Resources: The API charges per request; monitor resource usage to prevent arrears or resource package exhaustion (e.g., error code ResourceUnavailable.InArrears).
By understanding these points, developers can efficiently integrate this skill into projects for reliable image text recognition.

Use Cases

  • Extract Chinese and English promotional text from e-commerce ad banners to automatically generate product descriptions or analyze marketing trends.
  • Recognize multi-directional text (like vertical titles) in social media ad images, obtaining coordinates to optimize ad layout design.
  • Process scanned paper ad document images, identifying tilted or rotated text content for automated information entry into systems.
  • Extract text lines and confidence scores from design screenshots to help front-end teams verify UI element positions and perform interactive development.

Best For

  • Ad Data Analyst: Needs to periodically batch-extract text from multiple image ads for market competitor analysis and performance evaluation.
  • UI/UX Designer: Must obtain precise coordinates of text during design iterations to ensure visual element alignment and interaction accuracy.
  • Content Compliance Reviewer: Responsible for checking images for prohibited ad text, relying on OCR for quick identification and audit report generation.