Install
openclaw skills install tencentcloud-ocr-licenseplate腾讯云车牌识别(LicensePlateOCR)接口调用技能。当用户需要对中国大陆机动车车牌进行自动定位和识别时,应使用此技能。支持返回车牌号码、车牌颜色、置信度和像素坐标信息,支持多车牌场景识别,支持图片Base64和URL两种输入方式。
openclaw skills install tencentcloud-ocr-licenseplate调用腾讯云OCR车牌识别接口,支持对中国大陆机动车车牌的自动定位和识别,返回地域编号和车牌号码与车牌颜色信息。
核心能力:
官方文档:https://cloud.tencent.com/document/api/866/36211
默认接口请求频率限制:10次/秒。
当用户提出以下需求时触发此技能:
tencentcloud-sdk-python(通过 pip install tencentcloud-sdk-python 安装)TENCENTCLOUD_SECRET_ID:腾讯云API密钥IDTENCENTCLOUD_SECRET_KEY:腾讯云API密钥Key运行 scripts/main.py 脚本完成车牌识别。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| ImageBase64 | str | 否(二选一) | 图片Base64值,编码后不超过10M,支持PNG/JPG/JPEG,不支持GIF |
| ImageUrl | str | 否(二选一) | 图片URL地址,下载时间不超过3秒。都提供时仅使用ImageUrl |
| UserAgent | str | 否 | 请求来源标识(可选),用于追踪调用来源,统一固定为Skills |
识别成功后返回 JSON 格式结果:
{
"Number": "京AF0236",
"Confidence": 99,
"Color": "蓝",
"LicensePlateCategory": "实体车牌",
"Rect": {
"X": 426,
"Y": 423,
"Width": 135,
"Height": 66
},
"LicensePlateInfos": [
{
"Number": "京AF0236",
"Confidence": 99,
"Color": "蓝",
"Rect": {
"X": 426,
"Y": 423,
"Width": 135,
"Height": 66
},
"LicensePlateCategory": "实体车牌"
}
],
"PlateCount": 1,
"RequestId": "5141467c-0a67-4f7c-b1c5-8147d84681a1"
}
响应字段说明:
| 字段 | 类型 | 说明 |
|---|---|---|
| Number | str | 识别出的车牌号码 |
| Confidence | int | 置信度,0-100 |
| Color | str | 车牌颜色:白/黑/蓝/绿/黄/黄绿/临牌/喷漆/其它 |
| LicensePlateCategory | str | 车牌类别:实体车牌/非实体车牌 |
| Rect | object | 车牌在原图中的像素坐标框(X, Y, Width, Height) |
| LicensePlateInfos | list | 全部车牌信息列表(多车牌场景) |
| LicensePlateInfos[].Number | str | 车牌号码 |
| LicensePlateInfos[].Confidence | int | 置信度 0-100 |
| LicensePlateInfos[].Color | str | 车牌颜色 |
| LicensePlateInfos[].Rect | object | 像素坐标框 |
| LicensePlateInfos[].LicensePlateCategory | str | 车牌类别 |
| PlateCount | int | 检测到的车牌数量 |
| RequestId | str | 唯一请求ID |
| 错误码 | 含义 |
|---|---|
| FailedOperation.DownLoadError | 文件下载失败 |
| FailedOperation.ImageDecodeFailed | 图片解码失败 |
| FailedOperation.OcrFailed | OCR识别失败 |
| FailedOperation.UnKnowError | 未知错误 |
| FailedOperation.UnOpenError | 服务未开通 |
| InvalidParameterValue.InvalidParameterValueLimit | 参数值错误 |
| LimitExceeded.TooLargeFileError | 文件内容太大 |
| ResourceUnavailable.InArrears | 账号已欠费 |
| ResourceUnavailable.ResourcePackageRunOut | 账号资源包耗尽 |
| ResourcesSoldOut.ChargeStatusException | 计费状态异常 |
# 通过URL识别车牌
python scripts/main.py --image-url "https://example.com/car.jpg"
# 通过文件路径(自动Base64编码)识别
python scripts/main.py --image-base64 ./car.jpg
# 通过Base64文本文件识别
python scripts/main.py --image-base64 ./base64.txt
# 指定地域
python scripts/main.py --image-url "https://example.com/car.jpg" --region ap-beijing```