目标识别
Service
开启目标识别
先执行target_detect_open -》 再执行select_tracking_target 目标锁定
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: target_detect_open
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| ai_lens_type | 检测镜头 | int | 0:可见光,1:红外,2:夜视(暂不支持) | |
| scene_type | 当前识别场景 | int | 0:通用 | 默认传0 |
| target_type_list | 当前用户选择的检测类型列表,列表传空,表示当前识别场景下的所有支持检测类型进识别 | list<int> | 见下文“目标识别类型”定义 | 可以传NULL |
Example**:**
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: target_detect_open
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| result | 是否打开AI识别 | int | 0成功 非0失败 |
关闭目标识别
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: target_detect_close
Data:
Example**:**
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: target_detect_close
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| result | 关闭AI识别操作结果 | int | 0成功 非0失败 |
选择锁定目标的信息
锁定目标功能指飞行器将原地调整机身正对着该目标,该目标点将成为镜头视野的中心。
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: select_tracking_target
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| locked | 机头和云台的相对关系是否锁定 | bool | false:仅云台转,机身不转, true:锁定机头,云台和机身一起转 | |
| start_x | 起始点x坐标 | double | ||
| start_y | 起始点y坐标 | double | ||
| width | 目标点宽度 | double | ||
| height | 目标点高度 | double | ||
| tracker_id | 检测目标ID | int |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"start_x": 0.5,
"start_y": 0.5,
"locked": true,
"width": 0.8,
"height": 0.3,
"tracker_id": 123456
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "select_tracking_target"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: select_tracking_target
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| result | 返回码 | int | 非 0 代表错误 |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"result": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "select_tracking_target"
}
退出目标锁定
退出目标锁定,还会继续目标检测,关闭目标识别才会不再检测目标。
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: target_tracking_close
Data:
Example:
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: target_tracking_close
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| result | 关闭AI识别操作结果 | int | 0成功 非0失败 |
Status
目标识别结果上报
Topic: topic: thing/product/{gateway_sn}/state
**Direction:**up
Method: target_detect_result_report
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| time | 时间戳 | long | ||
| uav_id | 无人机ID | String | ||
| camera_id | 相机ID | int | 0,可见光,1,红外 | |
| global_pos | 无人机经纬度 | GlobalPos | ||
| camera | 相机参数 | CameraBean | ||
| obj_cnt | 检测到得目标数量 | int | ||
| objs | 检测内容 | List<ObjCnts> |
ObjCnts
| Column | Name | Type | constraint | Description | |
|---|---|---|---|---|---|
| tracker_id | 检测目标ID | String | |||
| cls_id | 检测目标类型 | int | |||
| cls_status | 跟踪目标类型 | int | |||
| bbox | 目标检测框 | BBox | |||
| pos | 目标经纬度 | GlobalPos | |||
| pic | 第一帧得图片路径 | String | (可能会更改,基槽以及无人机目前拿不到截图) | ||
| timestamp |
BBox
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| x | 目标在屏幕中的X坐标 | float | 占屏幕的比例 | |
| y | 目标在屏幕中的X坐标 | float | 占屏幕的比例 | |
| w | 目标在屏幕中的宽 | float | 占屏幕的比例 | |
| h | 目标在屏幕中的高 | float | 占屏幕的比例 |
CameraBean
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| roll | 云台翻滚角 | float | ||
| pitch | 云台俯仰角 | float | ||
| yaw | 云台旋转角度(水平) | float | ||
| longitude | 无人机经度 | double | ||
| latitude | 无人机纬度 | double | ||
| height | 无人机相对高度 | float | ||
| fov | 视场角度 | flaot[] | ||
| resolution | 原图片分辨率 | int[] | ||
| focal_type | 焦距类型 | String |
GlobalPos
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| latitude | 纬度 | double | max 90,min -90 | 角度值。南纬是负,北纬是正,精度到小数点后6位。 |
| longitude | 经度 | double | max 180,min:-180} | 角度值。东经是正,西经是负,精度到小数点后6位。 |
| altitude | 海拔高度 | float | 目标点高度(椭球高) |
目标**类型:**
| 目标类型ID | 目标名称 |
|---|---|
| 0 | 背景(暂不支持) |
| 1 | 动物(暂不支持) |
| 2 | 船 |
| 3 | 小车 |
| 4 | 行人 |
| 5 | 骑行者 |
| 6 | 大车 |
| 30 | 平民 |
| 34 | 无人机 |
| 35 | 烟雾 |
| 36 | 火 |
| 99 | 未检测到目标 |
Event
AI识别拍摄结果上报
Topic: thing/product/{gateway_sn}/events
Direction: up
Method: AI_detect_shoot_notify
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| File | 文件 | text | ||
| path | 文件的业务路径 | text | ||
| ext | 文件扩展内容 | struct | ||
| »flight_id | 任务 ID | text | ||
| »waypoint_id | 航点 ID | text | ||
| »drone_model_key | 飞行器产品枚举值 | text | ||
| »payload_model_key | 负载产品枚举值 | textt | ||
| »is_original | 是否为原图 | bool | 0:"否","1":"是" | |
| metadata | 媒体元数据 | struct | ||
| »gimbal_yaw_degree | 云台偏航角 | float | ||
| »absolute_altitude | 拍摄绝对高度 | float | ||
| »relative_altitude | 拍摄相对高度 | float | ||
| »create_time | 媒体拍摄时间 | date | "format":"iso8601" | |
| »shoot_position | 拍摄位置 | struct | ||
| »»lat | 拍摄位置纬度 | float | ||
| »»lng | 拍摄位置经度 | float | ||
| obj_num | 一帧中检测目标个数 | int | ||
| ObjInfo | 检测目标数组 | struct | ||
| »tracker_id | 检测目标ID | String | ||
| »cls_id | 检测目标类型 | int | ||
| »timestamp | ||||
| »object_position | 目标经纬度 | |||
| »»object_lat | 纬度 | |||
| »»object_lng | 经度 | |||
| »»object_altitude | 海拔高度 | float | ||
| »bbox | 目标检测框 | |||
| »»x | 目标在屏幕中的X坐标 | float | ||
| »»y | 目标在屏幕中的Y坐标 | float | ||
| »»w | 目标在屏幕中的宽 | float | ||
| »»h | 目标在屏幕中的高 | float |
证据采集状态上报
Topic: thing/product/{gateway_sn}/events
Direction: up
Method: evidence_collection_status
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| timestamp | 时间戳 | int | 单位:毫秒 | |
| index | 目标索引 | int | ||
| car_sum | 车辆总数 | int | ||
| flight_id | 任务名称 | string | 暂时存放mission_id | |
| status | 任务状态 | int | 1:暂停 2:正在执行 3:任务执行完成 4:任务执行异常停止 5:单车采集完毕 | |
| stop_reason | 异常停止原因 | int | ||
| pos | 目标经纬度 | GlobalPos | ||
| car_color | 车辆颜色 | string | ||
| plate_color | 车牌颜色 | string | 代表车牌种类,需要映射 | |
| car_num | 车牌号码 | string | ||
| car_brand | 车辆品牌 | string | ||
| car_id | 车辆ID | int | ||
| is_driver_seat_occupied | 驾驶位是否有人 | bool | ||
| photo_path_top | 顶部照片路径 | string | ||
| photo_path_front | 前向照片路径 | string | ||
| photo_path_num | 号码照片路径 | string |
GlobalPos
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| latitude | 纬度 | double | max 90,min -90 | 角度值。南纬是负,北纬是正,精度到小数点后6位。 |
| longitude | 经度 | double | max 180,min:-180} | 角度值。东经是正,西经是负,精度到小数点后6位。 |
| altitude | 海拔高度 | float | 目标点高度(椭球高) |
违停检测信息上报
Topic: thing/product/{gateway_sn}/events
Direction: up
Method: aiservice_illegal_parking_info
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| timestamp | 时间戳 | long | 获取帧时间戳 | |
| frame_id | 帧ID | int | ||
| flight_id | 任务id | string | ||
| resolution_width | 图像宽度 | int | 图像分辨率宽度 | |
| resolution_height | 图像高度 | int | 图像分辨率高度 | |
| lens_id | 镜头ID | int | 发布结果对应的镜头ID | |
| index | 车辆索引 | int | ||
| car_color | 车辆颜色 | string | ||
| score | 置信度 | int | [0,100] | |
| car_lat | 纬度 | double | ||
| car_lon | 经度 | double | ||
| car_alt | 高度 | double | ||
| car_center_w | 目标中心点宽度占比 | int | [0,10000] | 目标中心点在宽度方向的占比 |
| car_center_h | 目标中心点高度占比 | int | [0,10000] | 目标中心点在高度方向的占比 |
| car_grid_w | 目标框宽度占比 | int | [0,10000] | 目标框的宽度百分比 |
| car_grid_h | 目标框高度占比 | int | [0,10000] | 目标框的高度百分比 |