From a943686f67773bffd3d969accd7262c74188ef66 Mon Sep 17 00:00:00 2001 From: 11566hyc <123456789> Date: Tue, 1 Jul 2025 09:01:15 +0800 Subject: [PATCH] =?UTF-8?q?S3315=E5=A4=96=E5=9C=BA=E8=81=94=E8=B0=83?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NeoTracker/src/Arith_GetCommand.cpp | 4 ++-- NeoTracker/src/NeoArithStandardDll.cpp | 23 +++++++++++----------- NeoTracker/src/PIPE/Arith_MOT_PipeProc.cpp | 11 +++++++---- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/NeoTracker/src/Arith_GetCommand.cpp b/NeoTracker/src/Arith_GetCommand.cpp index 5f52995..581082d 100644 --- a/NeoTracker/src/Arith_GetCommand.cpp +++ b/NeoTracker/src/Arith_GetCommand.cpp @@ -360,7 +360,7 @@ void Arith_EOController::CMD_OnCancelTrack(void) // 释放所有跟踪器 //GLB_Release_Trackers(g_GLB_stPara.nPipeMaxNum); - + LOG_DEBUG("CMD_OnCancelTrack:nStatus:{},unSetCancleMode:{}", g_GLB_stPara.nStatus, g_GLB_stCommand.unSetCancleMode); if (0 == g_GLB_stCommand.unSetCancleMode) {// 解锁对应点跟踪器 POINT32S ptCanclePos = { g_GLB_stCommand.unSetCanclePosX ,g_GLB_stCommand.unSetCanclePosY }; @@ -372,7 +372,7 @@ void Arith_EOController::CMD_OnCancelTrack(void) // 释放所有跟踪器 GLB_Release_Trackers(g_GLB_stPara.nPipeMaxNum); //清空算法输出结果 - memset(&g_GLB_stOutput, 0, sizeof(GLB_OUTPUT)); + //memset(&g_GLB_stOutput, 0, sizeof(GLB_OUTPUT)); } //跟踪状态下,当接收到解锁指令后,下一帧跟踪器返回待命状态 if (GLB_STATUS_TRACK == g_GLB_stPara.nStatus || GLB_STATUS_LOST == g_GLB_stPara.nStatus || (GLB_STATUS_MOTRACK == g_GLB_stPara.nStatus && 1 == g_GLB_stCommand.unSetCancleMode)) diff --git a/NeoTracker/src/NeoArithStandardDll.cpp b/NeoTracker/src/NeoArithStandardDll.cpp index 15adcce..3b94a09 100644 --- a/NeoTracker/src/NeoArithStandardDll.cpp +++ b/NeoTracker/src/NeoArithStandardDll.cpp @@ -412,10 +412,10 @@ void ARIDLL_Output(Arith_EOController* pArith, ARIDLL_OUTPUT* pstOutput) // 返回跟踪器状态 pstOutput->nStatus = pArith->g_GLB_stPara.nStatus; - LOG_DEBUG("pstOutput:pstOutput->nFrmNum:{},pstOutput->nSysMode:{}, pstOutput->nStatus:{}", - pstOutput->nFrmNum,pstOutput->nSysMode,pstOutput->nStatus); // 目标输出,统一由管道牵头输出 ARIDLL_OutputPipeTarget(pArith, pstOutput); + LOG_DEBUG("pstOutput:pstOutput->nFrmNum:{},pstOutput->nSysMode:{}, pstOutput->nStatus:{}", + pstOutput->nFrmNum, pstOutput->nSysMode, pstOutput->nStatus); } @@ -647,17 +647,18 @@ void ARIDLL_OutputPipeTarget(Arith_EOController* pArith, ARIDLL_OUTPUT* pstOutpu pstOutput->nStatus = 12; //半自动截获状态 } } - if (3 == pstOutput->nStatus || 5 == pstOutput->nStatus || 9 == pstOutput->nStatus)//跟踪状态 + //if (3 == pstOutput->nStatus || 5 == pstOutput->nStatus || 9 == pstOutput->nStatus)//跟踪状态 + //{ + if (pstOutput->nTrackObjCnts > 0) { - if (pstOutput->nTrackObjCnts > 1) - { - pstOutput->nStatus = 9; //多目标跟踪 - } - else - { - pstOutput->nStatus = 3; //单目标跟踪 - } + pstOutput->nStatus = 3; //单目标跟踪 } + if (pstOutput->nTrackObjCnts > 1) + { + pstOutput->nStatus = 9; //多目标跟踪 + } + + //} int Index = ARIDLL_Sort_PipeByDistance(pArith, pstOutput); if (0 < Index) { diff --git a/NeoTracker/src/PIPE/Arith_MOT_PipeProc.cpp b/NeoTracker/src/PIPE/Arith_MOT_PipeProc.cpp index 945f2f0..af3a894 100644 --- a/NeoTracker/src/PIPE/Arith_MOT_PipeProc.cpp +++ b/NeoTracker/src/PIPE/Arith_MOT_PipeProc.cpp @@ -1103,7 +1103,7 @@ SINT32 MOT_Pipe::PIPE_GetAlarmMaxNum() SINT32 MOT_Pipe::SO_PointLock(GD_VIDEO_FRAME_S img, PIPE* pPipeArray, POINT32F ptLockPos) { SINT32 nSelecID = -1; - SINT32 nNearstDis = 99999; + SINT32 nNearstDis = 99999999; // 大分辨率因为没有全屏显示,在实际图像上很小的距离占据较大像素,导致无法轻松锁定管道 SINT32 smallSize = g_PIPE_stPara.nPipeRadiusLock; // 默认设置为40 @@ -1136,10 +1136,13 @@ SINT32 MOT_Pipe::SO_PointLock(GD_VIDEO_FRAME_S img, PIPE* pPipeArray, POINT32F p FLOAT32 disDiagonalHalf = (FLOAT32)(sqrt(POW2(pPipe->ObjectFilter.sfSize.w) + POW2(pPipe->ObjectFilter.sfSize.h)) / 2); FLOAT32 disXY = (FLOAT32)sqrt(POW2(disX) + POW2(disY)); - - if (disXY > MAX(2.5 * disDiagonalHalf, smallSize)) + //响应自动跟踪时,下发图像中心位置,算法自动寻找最近目标 + if ((320 != (UINT16)ptLockPos.x) || (256 != (UINT16)ptLockPos.y)) { - continue; + if (disXY > MAX(2.5 * disDiagonalHalf, smallSize)) + { + continue; + } } //if (disX > MAX(pPipe->ObjectFilter.sfSize.w * 1.5, smallSize) || disY > MAX(pPipe->ObjectFilter.sfSize.h * 1.5, smallSize)) //{