Skip to main content

Compare RGB Palmprint

Upload an RGB palm image and compare it 1:1 against a specific user's registered palmprint. Used for identity verification (e.g. secondary confirmation, pre-payment palm confirmation). Single-factor authentication.

ItemValue
MethodPOST
URLhttps://open.intl.palm.tencent.com/palm/openai/compare_rgb_palm
Content-Typeapplication/json; charset=utf-8
AuthorizationBearer <api_key>
Default rate limit20 requests/sec

Request Parameters

ParameterRequiredTypeDescription
RgbImageYesImageRGB palm image; Data and ImageType are required
CompareUserIdYesStringTarget user ID. The user must already be registered via RegisterRgbPalm under your application

Response Parameters (data)

ParameterTypeDescription
IsMatchBooleanWhether the palm matches the user. true = match, false = no match
ScoreIntegerSimilarity score, 0–100. Higher means more similar
AlgorithmVersionStringAlgorithm version used for this comparison
PalmDirectionIntegerDetected palm side, see PalmDirectionType
SessionIdStringTemporary query credential for this verification (UUID, valid 2 hours)

Example

Request

POST /palm/openai/compare_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
},
"CompareUserId": "user001"
}

Response

{
"code": 0,
"message": "ok",
"requestId": "4d5912a82af144f8a982c2da031c1035",
"data": {
"IsMatch": true,
"Score": 95,
"AlgorithmVersion": "v2.0",
"PalmDirection": 1,
"SessionId": "3f2b1a6d-8c4e-4b7a-9d5f-1e2c3a4b5c6d"
}
}

cURL

curl -X POST "https://open.intl.palm.tencent.com/palm/openai/compare_rgb_palm" \
-H "Content-Type: application/json; charset=utf-8" \
-H "Authorization: Bearer ak_xxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-d '{
"RgbImage": {
"Data": "'"$(base64 -w0 palm.jpg)"'",
"ImageType": 1
},
"CompareUserId": "user001"
}'

Notes

  • Trust IsMatch, not your own threshold on Score. Treat false as rejection and rate-limit repeated failures (e.g. freeze after 5 failures within 15 minutes) to prevent brute-force attempts.
  • Comparing against an unregistered user returns 2080016 (user does not exist in DB) or 2080017 (palm direction not registered).