本文档介绍手势关键点检测HandPosture的语法及示例。

功能描述

HandPosture可以获取手势的二十一个关键点信息。

前提条件

请确保您已开通人脸人体服务,详情请参见服务开通

输入限制

  • 图片格式:JPEG、JPG、BMP、PNG。
  • URL地址中不能包含中文字符。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String HandPosture

要执行的操作。取值:HandPosture。

ImageURL String https://viapi-test.oss-cn-shanghai.aliyuncs.com/test-team/handp.jpg

图片URL地址。当前仅支持上海地域的OSS链接,如何生成URL请参见生成URL

返回数据

名称 类型 示例值 描述
Data Struct

返回的结果数据内容。

MetaObject Struct

图片基本信息。

Height Integer 600

图片高度。

Width Integer 500

图片宽度。

Outputs Array

手势检测结果。

HandCount Integer 1

手掌的个数。

Results Array

手势类别。

Box Struct

手势的检测框信息。

Confident Float 0.555

手势检测框的置信度。

Positions Array

手的检测框信息。格式为 [左上, 右上, 右下, 左下]

Points List [0.5656, 0.4567]

手体检测框的坐标,x和y的取值范围为0~1。相对于图像宽度width和图像高度height的相对坐标,实际坐标为x*widthy*height

Hands Struct

手势关键点信息。

Confident Float 0.555

置信度。

KeyPoints Array

关键点坐标,是相对坐标,即相对于图像尺寸的坐标。

Label String thumb

关键点的标签。

Positions Array

相对于图像尺寸的关键点坐标。

Points List [0.5656, 0.4567]

关键点的坐标,x和y的取值范围为0~1。相对于图像宽度width和图像高度height的相对坐标,实际坐标为x*widthy*height

RequestId String 99CE0601-FA61-4A41-BBF0-72D3E1FF5139

请求ID。

示例

请求示例

http(s)://facebody.cn-shanghai.aliyuncs.com/?Action=HandPosture
&ImageURL=http://alipay-rmsdeploy-image.cn-hangzhou.alipay.aliyun-inc.com/xnn-cloud/ff2000c1db8ba00b24cc8da3cdc1281c.jpg
&<公共请求参数>

正常返回示例

XML 格式

<RequestId>99CE0601-FA61-4A41-BBF0-72D3E1FF5139</RequestId>
<Data>
    <MetaObject>
        <Height>360</Height>
        <Width>640</Width>
    </MetaObject>
    <Outputs>
        <Results>
            <Hands>
                <Confident>0.99994850158691406</Confident>
                <KeyPoints>
                    <Label>0</Label>
                    <Positions>
                        <Points>0.60814106464385986</Points>
                        <Points>0.57843714952468872</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>1</Label>
                    <Positions>
                        <Points>0.5954553484916687</Points>
                        <Points>0.53584885597229</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>2</Label>
                    <Positions>
                        <Points>0.58072149753570557</Points>
                        <Points>0.52881228923797607</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>3</Label>
                    <Positions>
                        <Points>0.55731791257858276</Points>
                        <Points>0.53051036596298218</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>4</Label>
                    <Positions>
                        <Points>0.556272029876709</Points>
                        <Points>0.54263561964035034</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>5</Label>
                    <Positions>
                        <Points>0.58563053607940674</Points>
                        <Points>0.5606304407119751</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>6</Label>
                    <Positions>
                        <Points>0.55570542812347412</Points>
                        <Points>0.56016099452972412</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>7</Label>
                    <Positions>
                        <Points>0.527125895023346</Points>
                        <Points>0.53607034683227539</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>8</Label>
                    <Positions>
                        <Points>0.50249892473220825</Points>
                        <Points>0.52858757972717285</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>9</Label>
                    <Positions>
                        <Points>0.58144932985305786</Points>
                        <Points>0.600288450717926</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>10</Label>
                    <Positions>
                        <Points>0.548987090587616</Points>
                        <Points>0.57786983251571655</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>11</Label>
                    <Positions>
                        <Points>0.51771032810211182</Points>
                        <Points>0.56192481517791748</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>12</Label>
                    <Positions>
                        <Points>0.48404961824417114</Points>
                        <Points>0.55325514078140259</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>13</Label>
                    <Positions>
                        <Points>0.57908332347869873</Points>
                        <Points>0.62439030408859253</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>14</Label>
                    <Positions>
                        <Points>0.5494731068611145</Points>
                        <Points>0.615152895450592</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>15</Label>
                    <Positions>
                        <Points>0.52025854587554932</Points>
                        <Points>0.58855414390563965</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>16</Label>
                    <Positions>
                        <Points>0.48847651481628418</Points>
                        <Points>0.55619245767593384</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>17</Label>
                    <Positions>
                        <Points>0.57136648893356323</Points>
                        <Points>0.65912783145904541</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>18</Label>
                    <Positions>
                        <Points>0.54293251037597656</Points>
                        <Points>0.617222249507904</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>19</Label>
                    <Positions>
                        <Points>0.53020155429840088</Points>
                        <Points>0.606507420539856</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>20</Label>
                    <Positions>
                        <Points>0.50880300998687744</Points>
                        <Points>0.58464843034744263</Points>
                    </Positions>
                </KeyPoints>
            </Hands>
            <Box>
                <Confident>0.71226352453231812</Confident>
                <Positions>
                    <Points>0.4974265992641449</Points>
                    <Points>0.50328123569488525</Points>
                </Positions>
                <Positions>
                    <Points>0.62906938791275024</Points>
                    <Points>0.50328123569488525</Points>
                </Positions>
                <Positions>
                    <Points>0.62906938791275024</Points>
                    <Points>0.65238773822784424</Points>
                </Positions>
                <Positions>
                    <Points>0.4974265992641449</Points>
                    <Points>0.65238773822784424</Points>
                </Positions>
            </Box>
        </Results>
        <Results>
            <Hands>
                <Confident>0.9999852180480957</Confident>
                <KeyPoints>
                    <Label>0</Label>
                    <Positions>
                        <Points>0.393640398979187</Points>
                        <Points>0.59868341684341431</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>1</Label>
                    <Positions>
                        <Points>0.42132681608200073</Points>
                        <Points>0.62495428323745728</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>2</Label>
                    <Positions>
                        <Points>0.43745431303977966</Points>
                        <Points>0.689828097820282</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>3</Label>
                    <Positions>
                        <Points>0.4462774395942688</Points>
                        <Points>0.77660030126571655</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>4</Label>
                    <Positions>
                        <Points>0.45127806067466736</Points>
                        <Points>0.83825963735580444</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>5</Label>
                    <Positions>
                        <Points>0.44249773025512695</Points>
                        <Points>0.71941894292831421</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>6</Label>
                    <Positions>
                        <Points>0.44476762413978577</Points>
                        <Points>0.81073153018951416</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>7</Label>
                    <Positions>
                        <Points>0.45668521523475647</Points>
                        <Points>0.86831820011138916</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>8</Label>
                    <Positions>
                        <Points>0.45888024568557739</Points>
                        <Points>0.93340605497360229</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>9</Label>
                    <Positions>
                        <Points>0.41096386313438416</Points>
                        <Points>0.7522350549697876</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>10</Label>
                    <Positions>
                        <Points>0.41827210783958435</Points>
                        <Points>0.83636075258255</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>11</Label>
                    <Positions>
                        <Points>0.43387466669082642</Points>
                        <Points>0.87332594394683838</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>12</Label>
                    <Positions>
                        <Points>0.44423216581344604</Points>
                        <Points>0.9019133448600769</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>13</Label>
                    <Positions>
                        <Points>0.38739094138145447</Points>
                        <Points>0.76350539922714233</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>14</Label>
                    <Positions>
                        <Points>0.39671486616134644</Points>
                        <Points>0.82768404483795166</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>15</Label>
                    <Positions>
                        <Points>0.41303998231887817</Points>
                        <Points>0.84740370512008667</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>16</Label>
                    <Positions>
                        <Points>0.43770962953567505</Points>
                        <Points>0.86880898475646973</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>17</Label>
                    <Positions>
                        <Points>0.3712017834186554</Points>
                        <Points>0.760955810546875</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>18</Label>
                    <Positions>
                        <Points>0.387716680765152</Points>
                        <Points>0.83686923980712891</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>19</Label>
                    <Positions>
                        <Points>0.39462429285049438</Points>
                        <Points>0.84625548124313354</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>20</Label>
                    <Positions>
                        <Points>0.41109806299209595</Points>
                        <Points>0.83971405029296875</Points>
                    </Positions>
                </KeyPoints>
            </Hands>
            <Box>
                <Confident>0.59800052642822266</Confident>
                <Positions>
                    <Points>0.35801595449447632</Points>
                    <Points>0.54407310485839844</Points>
                </Positions>
                <Positions>
                    <Points>0.47501063346862793</Points>
                    <Points>0.54407310485839844</Points>
                </Positions>
                <Positions>
                    <Points>0.47501063346862793</Points>
                    <Points>0.93112361431121826</Points>
                </Positions>
                <Positions>
                    <Points>0.35801595449447632</Points>
                    <Points>0.93112361431121826</Points>
                </Positions>
            </Box>
        </Results>
        <HandCount>2</HandCount>
    </Outputs>
</Data>

JSON 格式

{
	"RequestId": "99CE0601-FA61-4A41-BBF0-72D3E1FF5139",
	"Data": {
		"MetaObject": {
			"Height": 360,
			"Width": 640
		},
		"Outputs": [
			{
				"Results": [
					{
						"Hands": {
							"Confident": "0.99994850158691406",
							"KeyPoints": [
								{
									"Label": "0",
									"Positions": [
										{
											"Points": [
												"0.60814106464385986",
												"0.57843714952468872"
											]
										}
									]
								},
								{
									"Label": "1",
									"Positions": [
										{
											"Points": [
												"0.5954553484916687",
												"0.53584885597229"
											]
										}
									]
								},
								{
									"Label": "2",
									"Positions": [
										{
											"Points": [
												"0.58072149753570557",
												"0.52881228923797607"
											]
										}
									]
								},
								{
									"Label": "3",
									"Positions": [
										{
											"Points": [
												"0.55731791257858276",
												"0.53051036596298218"
											]
										}
									]
								},
								{
									"Label": "4",
									"Positions": [
										{
											"Points": [
												"0.556272029876709",
												"0.54263561964035034"
											]
										}
									]
								},
								{
									"Label": "5",
									"Positions": [
										{
											"Points": [
												"0.58563053607940674",
												"0.5606304407119751"
											]
										}
									]
								},
								{
									"Label": "6",
									"Positions": [
										{
											"Points": [
												"0.55570542812347412",
												"0.56016099452972412"
											]
										}
									]
								},
								{
									"Label": "7",
									"Positions": [
										{
											"Points": [
												"0.527125895023346",
												"0.53607034683227539"
											]
										}
									]
								},
								{
									"Label": "8",
									"Positions": [
										{
											"Points": [
												"0.50249892473220825",
												"0.52858757972717285"
											]
										}
									]
								},
								{
									"Label": "9",
									"Positions": [
										{
											"Points": [
												"0.58144932985305786",
												"0.600288450717926"
											]
										}
									]
								},
								{
									"Label": "10",
									"Positions": [
										{
											"Points": [
												"0.548987090587616",
												"0.57786983251571655"
											]
										}
									]
								},
								{
									"Label": "11",
									"Positions": [
										{
											"Points": [
												"0.51771032810211182",
												"0.56192481517791748"
											]
										}
									]
								},
								{
									"Label": "12",
									"Positions": [
										{
											"Points": [
												"0.48404961824417114",
												"0.55325514078140259"
											]
										}
									]
								},
								{
									"Label": "13",
									"Positions": [
										{
											"Points": [
												"0.57908332347869873",
												"0.62439030408859253"
											]
										}
									]
								},
								{
									"Label": "14",
									"Positions": [
										{
											"Points": [
												"0.5494731068611145",
												"0.615152895450592"
											]
										}
									]
								},
								{
									"Label": "15",
									"Positions": [
										{
											"Points": [
												"0.52025854587554932",
												"0.58855414390563965"
											]
										}
									]
								},
								{
									"Label": "16",
									"Positions": [
										{
											"Points": [
												"0.48847651481628418",
												"0.55619245767593384"
											]
										}
									]
								},
								{
									"Label": "17",
									"Positions": [
										{
											"Points": [
												"0.57136648893356323",
												"0.65912783145904541"
											]
										}
									]
								},
								{
									"Label": "18",
									"Positions": [
										{
											"Points": [
												"0.54293251037597656",
												"0.617222249507904"
											]
										}
									]
								},
								{
									"Label": "19",
									"Positions": [
										{
											"Points": [
												"0.53020155429840088",
												"0.606507420539856"
											]
										}
									]
								},
								{
									"Label": "20",
									"Positions": [
										{
											"Points": [
												"0.50880300998687744",
												"0.58464843034744263"
											]
										}
									]
								}
							]
						},
						"Box": {
							"Confident": "0.71226352453231812",
							"Positions": [
								{
									"Points": [
										"0.4974265992641449",
										"0.50328123569488525"
									]
								},
								{
									"Points": [
										"0.62906938791275024",
										"0.50328123569488525"
									]
								},
								{
									"Points": [
										"0.62906938791275024",
										"0.65238773822784424"
									]
								},
								{
									"Points": [
										"0.4974265992641449",
										"0.65238773822784424"
									]
								}
							]
						}
					},
					{
						"Hands": {
							"Confident": "0.9999852180480957",
							"KeyPoints": [
								{
									"Label": "0",
									"Positions": [
										{
											"Points": [
												"0.393640398979187",
												"0.59868341684341431"
											]
										}
									]
								},
								{
									"Label": "1",
									"Positions": [
										{
											"Points": [
												"0.42132681608200073",
												"0.62495428323745728"
											]
										}
									]
								},
								{
									"Label": "2",
									"Positions": [
										{
											"Points": [
												"0.43745431303977966",
												"0.689828097820282"
											]
										}
									]
								},
								{
									"Label": "3",
									"Positions": [
										{
											"Points": [
												"0.4462774395942688",
												"0.77660030126571655"
											]
										}
									]
								},
								{
									"Label": "4",
									"Positions": [
										{
											"Points": [
												"0.45127806067466736",
												"0.83825963735580444"
											]
										}
									]
								},
								{
									"Label": "5",
									"Positions": [
										{
											"Points": [
												"0.44249773025512695",
												"0.71941894292831421"
											]
										}
									]
								},
								{
									"Label": "6",
									"Positions": [
										{
											"Points": [
												"0.44476762413978577",
												"0.81073153018951416"
											]
										}
									]
								},
								{
									"Label": "7",
									"Positions": [
										{
											"Points": [
												"0.45668521523475647",
												"0.86831820011138916"
											]
										}
									]
								},
								{
									"Label": "8",
									"Positions": [
										{
											"Points": [
												"0.45888024568557739",
												"0.93340605497360229"
											]
										}
									]
								},
								{
									"Label": "9",
									"Positions": [
										{
											"Points": [
												"0.41096386313438416",
												"0.7522350549697876"
											]
										}
									]
								},
								{
									"Label": "10",
									"Positions": [
										{
											"Points": [
												"0.41827210783958435",
												"0.83636075258255"
											]
										}
									]
								},
								{
									"Label": "11",
									"Positions": [
										{
											"Points": [
												"0.43387466669082642",
												"0.87332594394683838"
											]
										}
									]
								},
								{
									"Label": "12",
									"Positions": [
										{
											"Points": [
												"0.44423216581344604",
												"0.9019133448600769"
											]
										}
									]
								},
								{
									"Label": "13",
									"Positions": [
										{
											"Points": [
												"0.38739094138145447",
												"0.76350539922714233"
											]
										}
									]
								},
								{
									"Label": "14",
									"Positions": [
										{
											"Points": [
												"0.39671486616134644",
												"0.82768404483795166"
											]
										}
									]
								},
								{
									"Label": "15",
									"Positions": [
										{
											"Points": [
												"0.41303998231887817",
												"0.84740370512008667"
											]
										}
									]
								},
								{
									"Label": "16",
									"Positions": [
										{
											"Points": [
												"0.43770962953567505",
												"0.86880898475646973"
											]
										}
									]
								},
								{
									"Label": "17",
									"Positions": [
										{
											"Points": [
												"0.3712017834186554",
												"0.760955810546875"
											]
										}
									]
								},
								{
									"Label": "18",
									"Positions": [
										{
											"Points": [
												"0.387716680765152",
												"0.83686923980712891"
											]
										}
									]
								},
								{
									"Label": "19",
									"Positions": [
										{
											"Points": [
												"0.39462429285049438",
												"0.84625548124313354"
											]
										}
									]
								},
								{
									"Label": "20",
									"Positions": [
										{
											"Points": [
												"0.41109806299209595",
												"0.83971405029296875"
											]
										}
									]
								}
							]
						},
						"Box": {
							"Confident": "0.59800052642822266",
							"Positions": [
								{
									"Points": [
										"0.35801595449447632",
										"0.54407310485839844"
									]
								},
								{
									"Points": [
										"0.47501063346862793",
										"0.54407310485839844"
									]
								},
								{
									"Points": [
										"0.47501063346862793",
										"0.93112361431121826"
									]
								},
								{
									"Points": [
										"0.35801595449447632",
										"0.93112361431121826"
									]
								}
							]
						}
					}
				],
				"HandCount": 2
			}
		]
	}
}

错误码

关于手势关键点检测的错误码,详情请参见常见错误码

SDK参考

单击SDK简介查看SDK信息。