通过运动模型判断是否稳跟。

main
wangchongwu 3 months ago
parent ee96b4191c
commit af8d1a1b43

@ -1190,7 +1190,7 @@ SINT32 SA_Tracker::FindMatchTarget(PIPE* pPipe, TARGET_OBJECT* ptTargetArray, SI
//局部变量 //局部变量
FLOAT32 fSim = 0.0f; //目标相似度 FLOAT32 fSim = 0.0f; //目标相似度
FLOAT32 fSimMax = -1.0f;//目标相似度最大值 FLOAT32 fSimMax = -1.0f;//目标相似度最大值
FLOAT32 fSimThres = 0.5f; //相似度阈值 FLOAT32 fSimThres = 0.3f; //相似度阈值
SINT32 nFrmsStep = 1; //帧间隔 SINT32 nFrmsStep = 1; //帧间隔
TARGET_OBJECT* ptMainTarget = NULL; //主管道目标 TARGET_OBJECT* ptMainTarget = NULL; //主管道目标
TARGET_OBJECT* ptTarget = NULL; //候选目标 TARGET_OBJECT* ptTarget = NULL; //候选目标
@ -1223,12 +1223,12 @@ SINT32 SA_Tracker::FindMatchTarget(PIPE* pPipe, TARGET_OBJECT* ptTargetArray, SI
} }
// 小目标主要使用位置信息 // 小目标主要使用位置信息 //s3315运动不稳定不优先使用运动模型
if (SizeType::SmallTarget == m_SizeMode) if (SizeType::SmallTarget == m_SizeMode)
{ {
fMoveModelWeight = 0.7f; fMoveModelWeight = 0.5f;
fApparentModelWeight = 0.3f; fApparentModelWeight = 0.5f;
fMoveThres = 0.7f; fMoveThres = 0.5f;
} }
// +++++++++++++++++++++++++++++++++++++++++++++++++++++ // +++++++++++++++++++++++++++++++++++++++++++++++++++++
//若长短轨迹预测异常,则直接取距离搜索区域中心最近的目标 //若长短轨迹预测异常,则直接取距离搜索区域中心最近的目标
@ -1333,10 +1333,10 @@ SINT32 SA_Tracker::FindMatchTarget(PIPE* pPipe, TARGET_OBJECT* ptTargetArray, SI
fSScaleChangeHighThres = 3.f; fSScaleChangeHighThres = 3.f;
fAScaleChangeLowThres = 0.5; fAScaleChangeLowThres = 0.5;
fAScaleChangeHighThres = 2.0; fAScaleChangeHighThres = 2.0;
nLastDiffThresX = MAX(nMoveMin, 6); nLastDiffThresX = MAX(nMoveMin, 12);
nLastDiffThresY = MAX(nMoveMin, 6); nLastDiffThresY = MAX(nMoveMin, 12);
nPredictDiffThresX = MAX(nFThreMin, 6); nPredictDiffThresX = MAX(nFThreMin, 12);
nPredictDiffThresY = MAX(nFThreMin, 6); nPredictDiffThresY = MAX(nFThreMin, 12);
} }
else if (pPipe->unLostCnt < 20) else if (pPipe->unLostCnt < 20)
{ {
@ -1391,11 +1391,19 @@ SINT32 SA_Tracker::FindMatchTarget(PIPE* pPipe, TARGET_OBJECT* ptTargetArray, SI
fSScaleChangeHighThres = 3.f; fSScaleChangeHighThres = 3.f;
fAScaleChangeLowThres = 0.5; fAScaleChangeLowThres = 0.5;
fAScaleChangeHighThres = 2.0; fAScaleChangeHighThres = 2.0;
nLastDiffThresX = MAX(nMoveMin, 4); nLastDiffThresX = MAX(nMoveMin, 12);
nLastDiffThresY = MAX(nMoveMin, 4); nLastDiffThresY = MAX(nMoveMin, 12);
nPredictDiffThresX = MAX(nFThreMin, 6); nPredictDiffThresX = MAX(nFThreMin, 12);
nPredictDiffThresY = MAX(nFThreMin, 6); nPredictDiffThresY = MAX(nFThreMin, 12);
} }
//// 针对S3315大目标近距离伺服晃动阈值强制放大
//else if(pPipe->ObjectFilter.sfSize.w >= 6 || pPipe->ObjectFilter.sfSize.h >= 6 || pPipe->ObjectFilter.fPxlsCnt > 9)
//{
// nLastDiffThresX = MAX(nLastDiffThresX, 36);
// nLastDiffThresY = MAX(nLastDiffThresY, 36);
// nPredictDiffThresX = MAX(nPredictDiffThresX, 36);
// nPredictDiffThresY = MAX(nPredictDiffThresY, 36);
//}
SINT32 nEnd = pPipe->ubEnd; SINT32 nEnd = pPipe->ubEnd;
@ -1428,6 +1436,8 @@ SINT32 SA_Tracker::FindMatchTarget(PIPE* pPipe, TARGET_OBJECT* ptTargetArray, SI
} }
// 目标运动距离强逻辑:用预测位置和上一帧的位置,防止跟踪跳转到错误的目标 // 目标运动距离强逻辑:用预测位置和上一帧的位置,防止跟踪跳转到错误的目标
if (nSimTargetId != -1) if (nSimTargetId != -1)
{ {
@ -1465,6 +1475,19 @@ SINT32 SA_Tracker::FindMatchTarget(PIPE* pPipe, TARGET_OBJECT* ptTargetArray, SI
fSimMax = -1; fSimMax = -1;
} }
} }
//// 灰度类型不同,任何情况都不允许跳跃
//if (ptTarget->fSNR * ptMainTarget->fSNR < 0)
//{
// if ((ABS(ptTarget->pfCenPos.x - stMotionMod_mean.crnObjPrediRtLong.cx) > MAX(ABS(fAzSpeed) * 2, 6)
// || ABS(ptTarget->pfCenPos.y - stMotionMod_mean.crnObjPrediRtLong.cy) > MAX(ABS(fPtSpeed) * 2, 6))
// && (ABS(ptTarget->pfCenPos.x - m_ObjStatus.ptPos.x) > MAX(ABS(fAzSpeed) * 2, 6)
// || ABS(ptTarget->pfCenPos.y - m_ObjStatus.ptPos.y) > MAX(ABS(fPtSpeed) * 2, 6)))
// {
// fSimMax = -1;
// }
//}
} }
} }
////+++++++++++++++++++++++++++++++++++++++++++++++++++++++ ////+++++++++++++++++++++++++++++++++++++++++++++++++++++++
@ -1507,10 +1530,10 @@ SINT32 SA_Tracker::FindMatchTarget(PIPE* pPipe, TARGET_OBJECT* ptTargetArray, SI
} }
// 警戒周边干扰时,调整阈值 // 警戒周边干扰时,调整阈值
if (pPipe->blookout) if (pPipe->blookout && pPipe->stMotionMod_mean.bTrackStable)
{ {
fThres = 0.8 * ContiLostThres; fThres = fSimThres * ContiLostThres;
fMoveThres = 0.8 * 1.f - ContiLostThres; fMoveThres = fMoveThres * 1.f - ContiLostThres;
} }

@ -207,6 +207,16 @@ void Predict_ObjAglTrackPredict(FilterMeanNL* pFilter, SINT32 nWidth, SINT32 nHe
} }
pFilter->dnObjPredictDist = dnNLDist; pFilter->dnObjPredictDist = dnNLDist;
// 预测偏离,或者滤波器被重置时,均不能认为跟踪稳定
if (dnNLDist.dx > 8 || dnNLDist.dy > 8 || (pFilter->ObjAglListsLong.nCnt == 0))
{
pFilter->bTrackStable = false;
}
else
{
pFilter->bTrackStable = true;
}
////利用长短时轨迹判断是否开启惯性预测,采用多帧判断 by wcw04046 @ 2022/01/17 ////利用长短时轨迹判断是否开启惯性预测,采用多帧判断 by wcw04046 @ 2022/01/17
//if (g_GLB_stOutput.nObjPredictFarCnt == 0) //if (g_GLB_stOutput.nObjPredictFarCnt == 0)
//{ //{

@ -1825,7 +1825,7 @@ SINT32 DetectAreaObj::DAT_ObjsSegmentation(UINT16* pFrame, UBYTE8* pnGrayBinary,
//MSSu, 20150514: 弱目标检测时,灰度、梯度二值点取并集,否则取交集 //MSSu, 20150514: 弱目标检测时,灰度、梯度二值点取并集,否则取交集
BBOOL bSeedPt = FALSE; BBOOL bSeedPt = FALSE;
if ((DAT_FLAG_BINARY == pnGrayBinary[nIndex] if ((DAT_FLAG_BINARY == pnGrayBinary[nIndex]
|| DAT_FLAG_BINARY == pnGradBinary[nIndex]) && DAT_FLAG_BINARY == pnGradBinary[nIndex])
&& DAT_FLAG_CONNECTED != pnFlagHasSr[nIndex]) && DAT_FLAG_CONNECTED != pnFlagHasSr[nIndex])
{ {
bSeedPt = TRUE; bSeedPt = TRUE;

@ -76,7 +76,6 @@ typedef struct tagARIDLL_OBJINFO
float fBgEntropy; //目标背景信息熵 float fBgEntropy; //目标背景信息熵
float fSaliency; //目标显著性值 float fSaliency; //目标显著性值
// //
bool nJammingSucess; //目标成功干扰 bool nJammingSucess; //目标成功干扰

@ -3,4 +3,4 @@
#pragma once #pragma once
#include <string> #include <string>
std::string BUILD_TIME = "BUILD_TIME @build_time@"; std::string BUILD_TIME = "BUILD_TIME @build_time@";
std::string VERSION = "BUILD_VERSION 1.4.0"; std::string VERSION = "BUILD_VERSION 1.4.1";

@ -1924,10 +1924,21 @@ void QVideoPlayer::DrawPipeAglInfo()
auto TrackListInfo = ARIDLL_GetTrackerHistInfo(pEOTracker, P); auto TrackListInfo = ARIDLL_GetTrackerHistInfo(pEOTracker, P);
DrawAglList(m_ImageViewer, &TrackListInfo->ObjAglListsNear, QPen(QColor(255, 255, 255), 0.5, Qt::DotLine)); DrawAglList(m_ImageViewer, &TrackListInfo->ObjAglListsNear, QPen(QColor(255, 255, 255), 0.5, Qt::DotLine));
DrawAglList(m_ImageViewer, &TrackListInfo->ObjAglListsLong, QPen(QColor(255, 100, 100), 0.5, Qt::DotLine)); DrawAglList(m_ImageViewer, &TrackListInfo->ObjAglListsLong, QPen(QColor(255, 100, 100), 0.5, Qt::DotLine));
if (TrackListInfo->bTrackStable)
{
QPen pen1(QPen(QColor(255, 255, 255), 0.5, Qt::SolidLine)); QPen pen1(QPen(QColor(255, 255, 255), 0.5, Qt::SolidLine));
DrawCrossInImage(m_ImageViewer, QRect(pPipe->stMotionMod_mean.crnObjPrediRtLong.cx - 40, pPipe->stMotionMod_mean.crnObjPrediRtLong.cy - 40, 80, 80), pen1); DrawCrossInImage(m_ImageViewer, QRect(pPipe->stMotionMod_mean.crnObjPrediRtLong.cx - 80, pPipe->stMotionMod_mean.crnObjPrediRtLong.cy - 80, 160, 160), pen1);
}
else
{
QPen pen2(QPen(QColor(255, 255, 255), 0.5, Qt::DotLine));
DrawCrossInImage(m_ImageViewer, QRect(pPipe->stMotionMod_mean.crnObjPrediRtLong.cx - 40, pPipe->stMotionMod_mean.crnObjPrediRtLong.cy - 40, 80, 80), pen2);
}
QPen pen2(QPen(QColor(255, 20, 20), 0.5, Qt::SolidLine)); QPen pen2(QPen(QColor(255, 20, 20), 0.5, Qt::SolidLine));
DrawCrossInImage(m_ImageViewer, QRect(pPipe->stMotionMod_mean.crnObjPrediRtNear.cx - 25, pPipe->stMotionMod_mean.crnObjPrediRtNear.cy - 25, 50, 50), pen2); DrawCrossInImage(m_ImageViewer, QRect(pPipe->stMotionMod_mean.crnObjPrediRtNear.cx - 25, pPipe->stMotionMod_mean.crnObjPrediRtNear.cy - 25, 50, 50), pen2);
} }
else if(bEnableDrawFrameDetect) else if(bEnableDrawFrameDetect)
{ {

Loading…
Cancel
Save