人脸交互包括批量人脸、单人脸;多人脸包括查询、增加、更新和删除操作;
子图SubImageList中包含大图(底图)、人脸图;根据Type区分图像类型;FaceObject中SourceID应该与SubImageInfoObject中type为’14’,即底图中的ImageID一致;FaceObject的源ID应该是底图的ImageID。
Post 增加人脸对象信息
POST /VIID/Faces HTTP/1.1
Host: 192.168.1.240:10008
Accept: application/json,application/VIID+json
Content-Type: application/VIID+JSON;charset=UTF-8
Connection: keepalive
User-Identify:34020000001110000001
User-Agent: libghttp/1.0
Content-Length: 242332
{
"FaceListObject": {
"FaceObject": [{
"FaceID": "340200000011100000010220200510200408000010600001",
"InfoKind": 0,
"SourceID": "34020000001110000001022020051020040800001",
"DeviceID": "34020000001110000001",
"LeftTopX": 163,
"LeftTopY": 726,
"RightBtmX": 334,
"RightBtmY": 897,
"AgeUpLimit": 0,
"AgeLowerLimit": 0,
"AccompanyNumber": 0,
"IsDriver": 0,
"IsForeigner": 0,
"IsSuspectedTerrorist": 0,
"IsCriminalInvolved": 0,
"IsDetainees": 0,
"IsVictim": 0,
"IsSuspiciousPerson": 0,
"Attitude": 0,
"m_dSimilaritydegree": 0,
"SubImageList": {
"SubImageInfoObject": [{
"ImageID": "34020000001110000001022020051020040800001",
"EventSort": 2,
"DeviceID": "34020000001110000001",
"Type": "14",
"FileFormat": "Jpeg",
"ShotTime": "20200510200408",
"Width": 1920,
"Height": 1080,
"FileSize": 156500,
"Data": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wDFABMSEx0YFCYhISEwLSoyP3NLRT8/RZptc1p9tp/NycCrvLjX8v//5PP/9sTT////////////9P////////////8BFBkZJSAlTysrT7B1Y3Wwt7e3t7e3wMDAwMDAwoAKKKSgBaSiigAopKKQBRRSUALRSUUAf/9k="
}, {
"ImageID": "34020000001110000001022020051020040800008",
"EventSort": 2,
"DeviceID": "34020000001110000001",
"Type": "11",
"FileFormat": "Jpeg",
"ShotTime": "20200510200408",
"Width": 461,
"Height": 461,
"FileSize": 101984,
"Data": "/9j/4AAQSkZJRgABAQAAAQABAAD/7wCKVERNUwYAAAB8AAAAeAAAAAgQAAARAAAAfsoBABQFCgAUBAhMAQAAAFwAAAAAAAAAAAAAAAAAAAAAAAAAgAIQJ7gTECccBRAnXBgQJwAAAAA7f5dRl4YIYfqe3PsepP+cUuRxyB6duO1QxscvnHAOD6HkZ+tT4HoD9VB/pThrfysB//Z"
}]
}
}]
}
}
其中Data为base64加密,示例省略了部分Data数据;需要说明的是,SubImageList包含两组SubImageInfoObject,分别表示底图和目标图(人脸图);根据图片类型Type判断是底图或目标图;
{"ResponseStatusList":{"ResponseStatusObject":[{"Id":"340200000011100000010220200428155448000010600001","LocalTime":"20200515164535","RequestURL":"/VIID/Faces","StatusCode":0,"StatusString":"OK"}]}}
GET /VIID/Faces?FaceID=340200000011100000010220200507144613000010600001 HTTP/1.1
accept: */*
user-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)
content-Type: application/json
Host: 127.0.0.1:10008
Connection: keep-alive
其中FaceID表示Face的属性键/值对,Face的属性键/值对格式这部分还未验证是不是这种格式,有经验的可以指正下;
HTTP/1.1 200 OK
Content-Type: application/json
{"FaceListObject":{"FaceObject":[{"AccompanyNumber":0,"AgeLowerLimit":0,"AgeUpLimit":0,"Attitude":0,"DeviceID":"34020000001110000001 ","FaceID":"340200000011100000010220200507144613000010600001","InfoKind":0,"IsCriminalInvolved":0,"IsDetainees":0,"IsDriver":0,"IsForeigner":0,"IsSuspectedTerrorist":0,"IsSuspiciousPerson":0,"IsVictim":0,"LeftTopX":34,"LeftTopY":802,"RightBtmX":189,"RightBtmY":957,"Similaritydegree":0,"SourceID":"34020000001110000001022020050714461300001","SubImageList":{"SubImageInfoObject":[{"DeviceID":"34020000001110000001","EventSort":2,"FileFormat":"Jpeg","Height":418,"ImageID":"34020000001110000001022020050714461300023","ShotTime":"20200507144613","StoragePath":"http://127.0.0.1/1400_image/2020/05/9/34020000001110000001022020050714461300023.jpg","Type":"11","Width":419},{"DeviceID":"34020000001110000001","EventSort":2,"FileFormat":"Jpeg","Height":1080,"ImageID":"34020000001110000001022020050714461300001","ShotTime":"20200507144613","StoragePath":"http://127.0.0.1/1400_image/2020/05/9/34020000001110000001022020050714461300001.jpg","Type":"14","Width":1920}]}}]}}