diff --git a/CMakeLists.txt b/CMakeLists.txt index c364979..12f1380 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,7 +61,7 @@ ENABLE_TESTING() # opencv + TensorRT IF(WIN32) - set(OpenCV_DIR "D:/Opencv_v/4.8.1/build/install/x64/vc17/lib") + set(OpenCV_DIR "C:/opencv/build/x64/vc15/lib") set(TRT_DIR "D:/TensorRT/TensorRT7") ELSE(WIN32) set(OpenCV_DIR "/home/wcw/opencv-3.4.16/install/share/OpenCV") diff --git a/NeoTracker/src/Arith_Status_SEARCH.cpp b/NeoTracker/src/Arith_Status_SEARCH.cpp index 2e6d8ba..d69bc20 100644 --- a/NeoTracker/src/Arith_Status_SEARCH.cpp +++ b/NeoTracker/src/Arith_Status_SEARCH.cpp @@ -156,7 +156,7 @@ SINT32 Arith_EOController::Proc_SearchLock(GD_VIDEO_FRAME_S img, GLB_INPUT & g_I pDAT_stPara->nDetectGrayType = GLB_OBJ_GRAY_BRIGHT; } else - {//未设置时亮暗目标都检测 + { //未设置时亮暗目标都检测 // 局部小目标检测器 pDST_stPara->nDetectGrayType = GLB_OBJ_GRAY_ALL; // 局部面目标检测器 diff --git a/NeoTracker/src/Arith_TrackSAObj.cpp b/NeoTracker/src/Arith_TrackSAObj.cpp index c1ec787..acaa7ae 100644 --- a/NeoTracker/src/Arith_TrackSAObj.cpp +++ b/NeoTracker/src/Arith_TrackSAObj.cpp @@ -667,7 +667,7 @@ void SA_Tracker::SARegionDet(GD_VIDEO_FRAME_S img, GLB_INPUT* p_GLB_Input, SINT3 pDST_Module->SetCombinDist(nCombinDist); - pDST_Module->Detect(img, m_TSA_Input.crCenterRect, GLB_STATUS_TRACK); + SINT32 nSmallTargetNum = pDST_Module->Detect(img, m_TSA_Input.crCenterRect, GLB_STATUS_TRACK); // 小目标可以开面目标检测 if (bEnableAreaObjDetect) { @@ -679,7 +679,7 @@ void SA_Tracker::SARegionDet(GD_VIDEO_FRAME_S img, GLB_INPUT* p_GLB_Input, SINT3 // 面目标跟踪模式 if (m_SizeMode == SizeType::AreaTarget) { - pDAT_Module->Detect(img, m_TSA_Input.crCenterRect, nObjCombineDist, GLB_STATUS_TRACK); + SINT32 nAreaTargetNum = pDAT_Module->Detect(img, m_TSA_Input.crCenterRect, nObjCombineDist, GLB_STATUS_TRACK); m_TSA_output.crCenterRect = pDAT_Module->getDAT_stOutput()->crCenterRect; m_TSky_Output->mTrakingPara_Output.nAreaCombineDist = nObjCombineDist; // 面目标合并距离调试输出 } @@ -1262,7 +1262,7 @@ SINT32 SA_Tracker::FindMatchTarget(PIPE* pPipe, TARGET_OBJECT* ptTargetArray, SI ABS(ptTarget->snSize.h - pPipe->ObjectFilter.sfSize.h) > 3 * nDSmpScale || ABS(ptTarget->snSize.w - pPipe->ObjectFilter.sfSize.w) > 3 * nDSmpScale) && m_LockingPipe->unLostCnt < GLB_FRM_FREQ) { - continue; + //continue; } } @@ -1311,7 +1311,18 @@ SINT32 SA_Tracker::FindMatchTarget(PIPE* pPipe, TARGET_OBJECT* ptTargetArray, SI // 阈值调整 - if (pPipe->unLostCnt < 20) + if (pPipe->unLostCnt < 3) + { + fSScaleChangeLowThres = 0.3; + fSScaleChangeHighThres = 3.f; + fAScaleChangeLowThres = 0.5; + fAScaleChangeHighThres = 2.0; + nLastDiffThresX = MAX(nMoveMin, 6); + nLastDiffThresY = MAX(nMoveMin, 6); + nPredictDiffThresX = MAX(nFThreMin, 6); + nPredictDiffThresY = MAX(nFThreMin, 6); + } + else if (pPipe->unLostCnt < 20) { fSScaleChangeLowThres = 0.3; fSScaleChangeHighThres = 3.f; @@ -1369,11 +1380,12 @@ SINT32 SA_Tracker::FindMatchTarget(PIPE* pPipe, TARGET_OBJECT* ptTargetArray, SI fPixChange = (FLOAT32)(ptTarget->unObjPxlsCnt) / MAX(ptMainTarget->unObjPxlsCnt, 0.001f); // 大于DAT_TARGET_MIN的目标可能是临界目标 - if (ptTarget->unObjPxlsCnt < 6 || ptMainTarget->unObjPxlsCnt < 6) + if (ptTarget->unObjPxlsCnt < 9 || ptMainTarget->unObjPxlsCnt < 9) { - if (fSScaleChangeHighThres < fPixChange || fSScaleChangeLowThres > fPixChange) + if ((ptTarget->unObjPxlsCnt == 1) + && (fSScaleChangeHighThres < fPixChange || fSScaleChangeLowThres > fPixChange)) { - fSimMax = -1; + //fSimMax = -1; } } else if (fSScaleChangeHighThres < fSizeChange || fSScaleChangeLowThres > fSizeChange)//均为面目标的情形 diff --git a/NeoTracker/src/Detect/Arith_DetectAreaObj.cpp b/NeoTracker/src/Detect/Arith_DetectAreaObj.cpp index 63aa935..c26c609 100644 --- a/NeoTracker/src/Detect/Arith_DetectAreaObj.cpp +++ b/NeoTracker/src/Detect/Arith_DetectAreaObj.cpp @@ -1072,8 +1072,8 @@ void DetectAreaObj::DAT_Initialization(SINT32 nWidth, SINT32 nHeight, CENTERRECT m_DAT_stPara.nObjSizeMax = DAT_TARGET_PXLS_MAX; m_DAT_stPara.nObjWidthMax = DAT_TARGET_WIDTH_MAX; m_DAT_stPara.nObjHeightMax = DAT_TARGET_HEIGHT_MAX; - m_DAT_stPara.fObjWHRatioMin = 0.4f; - m_DAT_stPara.fObjWHRatioMax = 4.0f; + m_DAT_stPara.fObjWHRatioMin = 0.2f; + m_DAT_stPara.fObjWHRatioMax = 5.0f; m_DAT_stPara.fObjRectRatioMin = 0.3f; m_DAT_stPara.nObjBkgGrayDiffMin = 10; m_DAT_stPara.fBkgGrayDiffCoeff = 0.35f; diff --git a/NeoTracker/src/Detect/Arith_DetectSmallObj.cpp b/NeoTracker/src/Detect/Arith_DetectSmallObj.cpp index 56f4e10..7ae4ccd 100644 --- a/NeoTracker/src/Detect/Arith_DetectSmallObj.cpp +++ b/NeoTracker/src/Detect/Arith_DetectSmallObj.cpp @@ -142,7 +142,9 @@ void DetectSmallObj::setDstParm(Param_SkyDetect* param) m_DST_stPara.nDetectGrayType = param->nDetectGrayType; m_DST_stPara.nObjSizeMin = param->nObjSizeMin; - m_DST_stPara.nObjSizeMax = param->nObjSizeMax; + + + m_DST_stPara.bEnableDimDetect = param->bEnableDetcetDimTarget; } @@ -322,7 +324,7 @@ void DetectSmallObj::DST_Initialization(SINT32 nWidth, SINT32 nHeight, CENTERREC m_DST_stPara.fObjWHRatioMax = 5.0f; m_DST_stPara.fObjRectRatioMin = 0.2f; m_DST_stPara.nBGObjNumThres = 2; - m_DST_stPara.nBTGrayMinThres = 10; + m_DST_stPara.nBTGrayMinThres = 5; m_DST_stPara.bDimDetecting = false; m_DST_stPara.bEnableDimDetect = false; @@ -1183,7 +1185,6 @@ SINT32 DetectSmallObj::DST_DetectFrameTarget(GD_VIDEO_FRAME_S img, SINT32 nWidth continue; } - //查看此极值点,前面(上面和左边)4个极值点是否已被判断为目标, //若当前点落在该目标的上下左右边界之内,或者与该目标距离小于阈值,则将当前点删除不处理 //UINT16 pxPntGray = pFrame[pPnt.y * nWidth + pPnt.x];//from S332 @@ -3359,7 +3360,7 @@ BBOOL DetectSmallObj::DST_BlkMaxTargetDetect(GD_VIDEO_FRAME_S img, SINT32 nWidth && !m_DST_stPara.bDimDetecting && !m_DST_stPara.bSecDetecting && (ptTarget->unObjPxlsCnt < (UINT32)m_DST_stPara.nObjSizeMin - || ptTarget->unObjPxlsCnt >(UINT32)m_DST_stPara.nObjSizeMax)) + /*|| ptTarget->unObjPxlsCnt >(UINT32)m_DST_stPara.nObjSizeMax*/)) { bIsTarget = false; } diff --git a/NeoTracker/src/Detect/Arith_DetectSmallObj.h b/NeoTracker/src/Detect/Arith_DetectSmallObj.h index 6d18114..6a02408 100644 --- a/NeoTracker/src/Detect/Arith_DetectSmallObj.h +++ b/NeoTracker/src/Detect/Arith_DetectSmallObj.h @@ -102,13 +102,13 @@ //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //小目标检测参数 //gdk阈值 -#define DST_OBJ_SNR_MIN 5.0f//目标SNR下限 +#define DST_OBJ_SNR_MIN 4.0f//目标SNR下限 //目标大小 #define DST_OBJ_SIZE_MIN 1 //目标大小下限 //背景标准差限制 -#define DST_Bm_STD_LIMIT_MIN 3 //极大值滤波窗口-背景标准差下限 +#define DST_Bm_STD_LIMIT_MIN 2 //极大值滤波窗口-背景标准差下限 #define DST_Bm_STD_LIMIT_MAX 50 //极大值滤波窗口-背景标准差上限 //目标宽高比计算方式 diff --git a/NeoTracker/src/NeoArithStandardDll.cpp b/NeoTracker/src/NeoArithStandardDll.cpp index b2481c6..c161349 100644 --- a/NeoTracker/src/NeoArithStandardDll.cpp +++ b/NeoTracker/src/NeoArithStandardDll.cpp @@ -106,7 +106,19 @@ STD_TRACKER_API int ARIDLL_SearchFrameTargets(ArithHandle hArithSrc, GD_VIDEO_FR pArith->g_GLB_Detectors->m_FrmObjsCnt = nFrmTargetNum; return nFrmTargetNum; } + + nFrmTargetNum = pArith->g_GLB_Detectors->Detect(img); + + //if (pArith->g_GLB_stPara.nStatus != GLB_STATUS_MOTRACK) + //{ + // nFrmTargetNum = pArith->g_GLB_Detectors->Detect(img); + //} + //else + //{ + // pArith->g_GLB_Detectors->m_FrmObjsCnt = 0; + //} + //// 检测队列 //TARGET_OBJECT* pFrameTargetArray = pArith->g_GLB_Detectors->GetTargetArray(); @@ -623,6 +635,12 @@ void ARIDLL_OutputPipeTarget(Arith_EOController* pArith, ARIDLL_OUTPUT* pstOutpu } } } + + + + + + //仅用于对外送显状态显示 if(2 == pstOutput->nStatus)//搜索状态 { @@ -654,6 +672,15 @@ void ARIDLL_OutputPipeTarget(Arith_EOController* pArith, ARIDLL_OUTPUT* pstOutpu pstOutput->stAlarmObjs[0] = pstOutput->stAlarmObjs[Index]; pstOutput->stAlarmObjs[Index] = TempObj; } + + // 跟踪状态不送显示 + if (pstOutput->nTrackObjCnts > 0) + { + memset(pstOutput->stAlarmObjs, 0, ST_OBJ_NUM * sizeof(ARIDLL_OBJINFO)); + pstOutput->nAlarmObjCnts = 0; + } + + LOG_DEBUG_OUTPUT("stAlarmObjs[0]:nX:{},nY:{}; stTrackers[0]:nX:{},nY:{}", pstOutput->stAlarmObjs[0].nX, pstOutput->stAlarmObjs[0].nY, pstOutput->stTrackers[0].nX, pstOutput->stTrackers[0].nY); } diff --git a/NeoTracker/src/Version.h.in b/NeoTracker/src/Version.h.in index a84b30b..784a52a 100644 --- a/NeoTracker/src/Version.h.in +++ b/NeoTracker/src/Version.h.in @@ -3,4 +3,4 @@ #pragma once #include std::string BUILD_TIME = "BUILD_TIME @build_time@"; -std::string VERSION = "BUILD_VERSION 1.3.1"; +std::string VERSION = "BUILD_VERSION 1.3.2";