|
|
|
|
@ -40,39 +40,7 @@ void ARIDLL_EOArithInitWithMode(ArithHandle hArith, int nWidth, int nHeight, GD_
|
|
|
|
|
//printf("HI_Inite:nPixelType:{%d}, nSysMode:{%d}, nScenMode:{%d}", (int)nPixelType, (int)nSysMode, (int)nScenMode);
|
|
|
|
|
return ((Arith_EOController*)hArith)->Arith_SystemInit(nWidth, nHeight, nSysMode, nScenMode);
|
|
|
|
|
}
|
|
|
|
|
//int save_Y16(ArithHandle h,GD_VIDEO_FRAME_S img, const int width, const int height, const int unFrmId)
|
|
|
|
|
//{
|
|
|
|
|
// const std::string path = "./Neolog/Ori_Y16_";
|
|
|
|
|
// // 将Y16数据保存为二进制文件
|
|
|
|
|
// const std::string filePath = path + std::to_string(unFrmId) + ".yuv";
|
|
|
|
|
//
|
|
|
|
|
// std::ofstream outFile(filePath, std::ios::binary);
|
|
|
|
|
// if (!outFile.is_open())
|
|
|
|
|
// {
|
|
|
|
|
// LOG_DEBUG("无法创建文件");
|
|
|
|
|
// std::cerr << "无法创建文件: " << filePath << std::endl;
|
|
|
|
|
// return -1;
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// outFile.write(reinterpret_cast<const char*>(img.u64VirAddr[0]), width * height * sizeof(uint16_t));
|
|
|
|
|
// outFile.close();
|
|
|
|
|
// LOG_DEBUG("Y16图像数据已保存到:{}", filePath);
|
|
|
|
|
// std::cout << "Y16图像数据已保存到: " << filePath << std::endl;
|
|
|
|
|
//
|
|
|
|
|
// return 0;
|
|
|
|
|
//}
|
|
|
|
|
//int read_y16(Arith_EOController* pArith, GD_VIDEO_FRAME_S img, const int width, const int height, const int unFrmId)
|
|
|
|
|
//{
|
|
|
|
|
// // 创建OpenCV Mat对象存储Y16数据
|
|
|
|
|
// cv::Mat y16Image(height, width, CV_16UC1, img.u64VirAddr[0]);
|
|
|
|
|
//
|
|
|
|
|
// // 将Y16数据归一化到0-255范围(转换为8位)
|
|
|
|
|
// cv::Mat y8Image;
|
|
|
|
|
// double minVal, maxVal;
|
|
|
|
|
// cv::minMaxLoc(y16Image, &minVal, &maxVal); // 找到最小值和最大值
|
|
|
|
|
// y16Image.convertTo(y8Image, CV_8UC1, 255.0 / maxVal); // 归一化并转换为8位
|
|
|
|
|
// return 0;
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
int ARIDLL_RunController(ArithHandle hArithSrc, GD_VIDEO_FRAME_S img, ARIDLL_INPUTPARA stInputPara, ARIDLL_OUTPUT* pstOutput)
|
|
|
|
|
{
|
|
|
|
|
//算法输入信息整理【调试】
|
|
|
|
|
@ -637,7 +605,7 @@ void ARIDLL_OutputPipeTarget(Arith_EOController* pArith, ARIDLL_OUTPUT* pstOutpu
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//对输出目标进行排序,防止ARM转发取差量时跳动
|
|
|
|
|
//对输出目标按ID序号进行排序,防止ARM转发取差量时跳动
|
|
|
|
|
for (int i = 0; i < pstOutput->nTrackObjCnts; i++)
|
|
|
|
|
{
|
|
|
|
|
ARIDLL_OBJINFO trackObj_temp_i = pstOutput->stTrackers[i];
|
|
|
|
|
@ -651,7 +619,7 @@ void ARIDLL_OutputPipeTarget(Arith_EOController* pArith, ARIDLL_OUTPUT* pstOutpu
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//仅用于对外送显状态显示
|
|
|
|
|
if(2 == pstOutput->nStatus)//搜索状态
|
|
|
|
|
{
|
|
|
|
|
if (pstOutput->nAlarmObjCnts > 0)
|
|
|
|
|
@ -791,7 +759,17 @@ bool CheckImageFormat(Arith_EOController* pArith, GD_VIDEO_FRAME_S img)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************
|
|
|
|
|
* 函数名称:ARIDLL_LockOrUnLock()
|
|
|
|
|
* 功能描述:3315新增需求,单点响应锁定/解锁 仅解锁辅跟目标
|
|
|
|
|
* 输入参数:GD_VIDEO_FRAME_S img
|
|
|
|
|
int nX, int nY---点选位置
|
|
|
|
|
int Radius---解锁响应范围
|
|
|
|
|
* 输出参数:无
|
|
|
|
|
* 返 回 值:无
|
|
|
|
|
* 调用关系:无
|
|
|
|
|
* 其它说明:
|
|
|
|
|
**********************************************************/
|
|
|
|
|
STD_TRACKER_API ARIDLL_OBJINFO ARIDLL_LockOrUnLock(ArithHandle hArithSrc, GD_VIDEO_FRAME_S img, int nX, int nY, int Radius)
|
|
|
|
|
{
|
|
|
|
|
Arith_EOController* pArith = (Arith_EOController*)hArithSrc;
|
|
|
|
|
@ -803,6 +781,7 @@ STD_TRACKER_API ARIDLL_OBJINFO ARIDLL_LockOrUnLock(ArithHandle hArithSrc, GD_VID
|
|
|
|
|
LOG_DEBUG("LOCK_X:{},LOCK_Y:{}", nX, nY);
|
|
|
|
|
if (0 != nX && 0 != nY)
|
|
|
|
|
{
|
|
|
|
|
//点选位置范围内查找是否有辅跟目标管道
|
|
|
|
|
for (int i = 0; i < MaxPipeNum; ++i)
|
|
|
|
|
{
|
|
|
|
|
PIPE* pPipeTemp = &pPipeArray[i];
|
|
|
|
|
@ -818,6 +797,7 @@ STD_TRACKER_API ARIDLL_OBJINFO ARIDLL_LockOrUnLock(ArithHandle hArithSrc, GD_VID
|
|
|
|
|
UnLockIndex = i;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/*找到辅跟踪目标管道进行解锁*/
|
|
|
|
|
if (-1 != UnLockIndex)
|
|
|
|
|
{
|
|
|
|
|
PIPE* pPipe = &pPipeArray[UnLockIndex];
|
|
|
|
|
@ -850,6 +830,7 @@ STD_TRACKER_API ARIDLL_OBJINFO ARIDLL_LockOrUnLock(ArithHandle hArithSrc, GD_VID
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//无辅跟踪目标管道执行锁定操作
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//obj = ARIDLL_LockTarget(pArith, img, nX, nY, 0, 0);
|
|
|
|
|
@ -857,13 +838,24 @@ STD_TRACKER_API ARIDLL_OBJINFO ARIDLL_LockOrUnLock(ArithHandle hArithSrc, GD_VID
|
|
|
|
|
}
|
|
|
|
|
return obj;
|
|
|
|
|
}
|
|
|
|
|
/**********************************************************
|
|
|
|
|
* 函数名称:ARIDLL_Sort_PipeByDistance()
|
|
|
|
|
* 功能描述:3315新增需求,按距离中心点距离对输出目标进行排序
|
|
|
|
|
* 输入参数:
|
|
|
|
|
* 输出参数:无
|
|
|
|
|
* 返 回 值:距离中心点最近目标索引
|
|
|
|
|
* 调用关系:无
|
|
|
|
|
* 其它说明:
|
|
|
|
|
**********************************************************/
|
|
|
|
|
STD_TRACKER_API int ARIDLL_Sort_PipeByDistance(ArithHandle hArithSrc, ARIDLL_OUTPUT* pstOutput)
|
|
|
|
|
{
|
|
|
|
|
Arith_EOController* pArith = (Arith_EOController*)hArithSrc;
|
|
|
|
|
//获取图像中心坐标
|
|
|
|
|
float centre_x = pArith->g_GLB_stInput.nImageWidth / 2.f;
|
|
|
|
|
float centre_y = pArith->g_GLB_stInput.nImageHeight / 2.f;
|
|
|
|
|
float min_distance = 99999999;
|
|
|
|
|
int Index = -1;
|
|
|
|
|
//按距离图像中心距离,对告警管道进行排序输出
|
|
|
|
|
for (int i = 0; i < pstOutput->nAlarmObjCnts; ++i)
|
|
|
|
|
{
|
|
|
|
|
float distance = (pstOutput->stAlarmObjs[i].nX - centre_x) * (pstOutput->stAlarmObjs[i].nX - centre_x) +
|
|
|
|
|
|