|
|
|
|
|
#ifndef ARITH_AITRACKER_INTERFACE_H
|
|
|
|
|
|
#define ARITH_AITRACKER_INTERFACE_H
|
|
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
#include <fstream>
|
|
|
|
|
|
#include "json.hpp"
|
|
|
|
|
|
#include "gd_alg_type.h"
|
|
|
|
|
|
#include "Arith_Common.hpp"
|
|
|
|
|
|
|
|
|
|
|
|
// ai跟踪器在传统算法框架的接口,与其他跟踪器一样提供统一的控制接口。
|
|
|
|
|
|
// AIT_OUTPUT m_Ai_TkOut 是AI跟踪推理的结果,作为本模块的输入
|
|
|
|
|
|
// AIT_Command m_Ai_TkCmd 是本模块决策后对AI跟踪器的控制指令。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class AIT_Interface
|
|
|
|
|
|
{
|
|
|
|
|
|
public:
|
|
|
|
|
|
explicit AIT_Interface(const char* jsonConf);
|
|
|
|
|
|
~AIT_Interface();
|
|
|
|
|
|
// 建议使用如下接口,反序列化形式接口尽量在上层调用
|
|
|
|
|
|
AIT_Interface(Param_AITracker para);
|
|
|
|
|
|
// ai跟踪器初始化
|
|
|
|
|
|
BBOOL AIT_Init(GD_VIDEO_FRAME_S img, PIPE* pLockPipe, GLB_INPUT* g_GLB_Input);
|
|
|
|
|
|
|
|
|
|
|
|
// ai跟踪处理流程
|
|
|
|
|
|
int AIT_Run_Nano(GD_VIDEO_FRAME_S img, CENTERRECT32F srBbox, GLB_INPUT* g_GLB_Input);
|
|
|
|
|
|
|
|
|
|
|
|
// 输出标准跟踪结果
|
|
|
|
|
|
void AIT_UpdateTracker(SINT16 nWidth, SINT16 nHeight, OBJECTSTATUS *pObjStatus, GLB_INPUT* g_GLB_Input);
|
|
|
|
|
|
|
|
|
|
|
|
// 记忆跟踪
|
|
|
|
|
|
UBYTE8 AIT_MemTracker(OBJECTSTATUS *pObjStatus, SINT32 nWidth, SINT32 nHeight, GLB_INPUT* g_GLB_Input);
|
|
|
|
|
|
|
|
|
|
|
|
// 外部导入AI跟踪结果,并同步到当前时刻(推理设备->cpu)
|
|
|
|
|
|
void AIT_SyncInfo(AIT_OUTPUT* out);
|
|
|
|
|
|
|
|
|
|
|
|
void parse_json_to_struct(const std::string& json_file_path, gud_nano_config_t& config);
|
|
|
|
|
|
|
|
|
|
|
|
//获取跟踪结果
|
|
|
|
|
|
OBJECTSTATUS* GetTrackeStatus();
|
|
|
|
|
|
|
|
|
|
|
|
// 获取跟踪参数
|
|
|
|
|
|
AIT_OUTPUT* GetAIPara();
|
|
|
|
|
|
|
|
|
|
|
|
// 解锁
|
|
|
|
|
|
void AIT_Cancle();
|
|
|
|
|
|
|
|
|
|
|
|
// 封装Ait运行与管道填充
|
|
|
|
|
|
BBOOL AIT_Run(GD_VIDEO_FRAME_S img, GLB_INPUT* p_GLB_Input, PIPE* m_LockingPipe);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool bAssignflag; // 已被分配标记
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
AIT_OUTPUT m_Ai_TkOut;//ai跟踪器的通用输出,也是本模块的输入
|
|
|
|
|
|
|
|
|
|
|
|
AIT_Command m_Ai_TkCmd;//本模块的输出,也是外部AI跟踪器的输入、
|
|
|
|
|
|
|
|
|
|
|
|
PIPE* m_LockingPipe;//锁定管道指针,指向PIPE队列锁定目标,初始化赋值
|
|
|
|
|
|
|
|
|
|
|
|
OBJECTSTATUS m_ObjStatus;//跟踪结果输出,保持与其他跟踪器一致性
|
|
|
|
|
|
|
|
|
|
|
|
UBYTE8 m_OccCnt; //连续遮挡计数
|
|
|
|
|
|
|
|
|
|
|
|
UBYTE8 m_ArrestCnt; //连续捕获计数
|
|
|
|
|
|
|
|
|
|
|
|
unsigned char responeMap[127 * 127] = {0};
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
ArithHandle nTracker;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|