检索RGB掌纹
上传 RGB 掌图,在你的应用下所有已注册掌纹中进行 1:N 检索,返回最相似的用户。适用于无感知刷掌登录、刷掌考勤等场景。
| 项目 | 值 |
|---|---|
| 请求方式 | POST |
| 请求地址 | https://open.intl.palm.tencent.com/palm/openai/search_rgb_palm |
| Content-Type | application/json; charset=utf-8 |
| 鉴权方式 | Bearer <api_key> |
| 默认频率限制 | 20 次/秒 |
与 CompareRgbPalm(1:1)不同,本接口请求中无需传 UserId。若掌纹库为空或未命中任何用户,将返回业务错误码 2080010,且 data.UserId 为空。
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
RgbImage | 是 | Image | RGB 掌图;Data 与 ImageType 必填 |
输出参数(data)
| 参数名称 | 类型 | 描述 |
|---|---|---|
UserId | String | 命中掌纹所属的用户 ID(即注册时传入的 UserId) |
Score | Integer | 相似度得分,0–100 |
AlgorithmVersion | String | 本次检索使用的算法版本 |
PalmDirection | Integer | 命中掌纹的手掌方向,见 PalmDirectionType |
SessionId | String | 本次检索结果的临时查询凭据(UUID,有效期 2 小时) |
示例
输入示例
POST /palm/openai/search_rgb_palm HTTP/1.1
Host: open.intl.palm.tencent.com
Content-Type: application/json; charset=utf-8
Authorization: Bearer ak_xxxxxxxxxxxxxxxxxxxxxxxxxxxx
{
"RgbImage": {
"Data": "base64encodedRgbImageData...",
"ImageType": 1
}
}
输出示例
{
"code": 0,
"message": "ok",
"requestId": "4d5912a82af144f8a982c2da031c1035",
"data": {
"UserId": "user001",
"Score": 93,
"AlgorithmVersion": "v2.0",
"PalmDirection": 1,
"SessionId": "3f2b1a6d-8c4e-4b7a-9d5f-1e2c3a4b5c6d"
}
}
cURL 示例
curl -X POST "https://open.intl.palm.tencent.com/palm/openai/search_rgb_palm" \
-H "Content-Type: application/json; charset=utf-8" \
-H "Authorization: Bearer ak_xxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-d '{
"RgbImage": {
"Data": "'"$(base64 -w0 palm.jpg)"'",
"ImageType": 1
}
}'
说明
- 检索的准确率与耗时取决于掌纹库规模。
- 未命中用户返回
2080010(user not found in search)——这是正常业务结果,不是系统错误。