1.重新处理天际线,不占用管道资源

2.将波门位置改为短时轨迹预测位置
main
wangchongwu 4 months ago
parent cfcdaca5c0
commit 3bfe9ffb6f

@ -1048,7 +1048,24 @@ void Arith_CalcTargetSysInfo(TARGET_OBJECT* pTargetObj, SINT32 nFrmNum, GLB_INP
} }
} }
void DeleteTargetSkyLine(TARGET_OBJECT* pTargetArr, int num, GLB_PARAMETERS& g_para)
{
// 不使用天地线
if (!g_para.bFiteredAlarm)
{
return;
}
for (int i = 0; i < num; i++)
{
TARGET_OBJECT* tTarget = &pTargetArr[i];
if (tTarget->afAngle.fPt < g_para.fFilterPt)
{
tTarget->bObject = false;
}
}
}
void Arith_EOController::GLB_Release_Trackers(SINT32 nPipeNum) void Arith_EOController::GLB_Release_Trackers(SINT32 nPipeNum)
{ {

@ -14,6 +14,8 @@
void Arith_CalcTargetSysInfo(TARGET_OBJECT* pTargetObj, SINT32 nFrmNum, GLB_INPUT g_Input); void Arith_CalcTargetSysInfo(TARGET_OBJECT* pTargetObj, SINT32 nFrmNum, GLB_INPUT g_Input);
void DeleteTargetSkyLine(TARGET_OBJECT* pTargetArr, int num, GLB_PARAMETERS& g_para);
class Arith_EOController class Arith_EOController
{ {
public: public:

@ -316,6 +316,9 @@ BBOOL Arith_EOController::Arith_Status_MOTRACK(GD_VIDEO_FRAME_S img, GLB_INPUT&
// 目标系统相关的其他信息计算 // 目标系统相关的其他信息计算
Arith_CalcTargetSysInfo(pFrameTargetArray, nFrmTargetNum, g_Input); Arith_CalcTargetSysInfo(pFrameTargetArray, nFrmTargetNum, g_Input);
// 拦截天地线以下的目标
DeleteTargetSkyLine(pFrameTargetArray, nFrmTargetNum, g_para);
// MOT管道处理 // MOT管道处理
g_GLB_PipeProc->Run(pFrameTargetArray, nFrmTargetNum, GLB_STATUS_TRACK, g_Input, m_SceneType); g_GLB_PipeProc->Run(pFrameTargetArray, nFrmTargetNum, GLB_STATUS_TRACK, g_Input, m_SceneType);

@ -174,24 +174,7 @@ SINT32 Arith_EOController::Proc_SearchLock(GD_VIDEO_FRAME_S img, GLB_INPUT & g_I
} }
void DeleteTargetSkyLine(TARGET_OBJECT* pTargetArr, int num, GLB_PARAMETERS& g_para)
{
// 不使用天地线
if (!g_para.bFiteredAlarm)
{
return;
}
for (int i = 0; i < num; i++)
{
TARGET_OBJECT* tTarget = &pTargetArr[i];
if (tTarget->afAngle.fPt < g_para.fFilterPt)
{
tTarget->bObject = false;
}
}
}
/************************************* /*************************************

@ -435,9 +435,11 @@ void SA_Tracker::SetAutoSearchZone(SINT32 nWidth, SINT32 nHeight, GLB_INPUT* p_G
SINT32 nPipeRadiusTrack = m_TSA_Param.nPipeRadiusTrack; SINT32 nPipeRadiusTrack = m_TSA_Param.nPipeRadiusTrack;
SINT32 nPipeRadiusLost = m_TSA_Param.nPipeRadiusLost; SINT32 nPipeRadiusLost = m_TSA_Param.nPipeRadiusLost;
//根据目标速度预测目标在当前帧的坐标位置 //根据目标速度预测目标在当前帧的坐标位置
// 伺服太晃,直接使用短时预测。
nEnd = m_LockingPipe->ubEnd; nEnd = m_LockingPipe->ubEnd;
pPipe->ptCurrentPnt.x = pPipe->stMotionMod_mean.crnObjPrediRtLong.cx; pPipe->ptCurrentPnt.x = pPipe->stMotionMod_mean.crnObjPrediRtNear.cx;
pPipe->ptCurrentPnt.y = pPipe->stMotionMod_mean.crnObjPrediRtLong.cy; pPipe->ptCurrentPnt.y = pPipe->stMotionMod_mean.crnObjPrediRtNear.cy;
// 取长时预测点作为管道当前位置预测 // 取长时预测点作为管道当前位置预测
if (PIPE_EVENT_JUST_LOCK == m_LockingPipe->ubEventStatus) if (PIPE_EVENT_JUST_LOCK == m_LockingPipe->ubEventStatus)
@ -452,6 +454,7 @@ void SA_Tracker::SetAutoSearchZone(SINT32 nWidth, SINT32 nHeight, GLB_INPUT* p_G
} }
//判断管道目标是否超出视场 //判断管道目标是否超出视场
//if (IMGO_IsPoint16SOutImg(nWidth, nHeight, pPipe->ptCurrentPnt)) //if (IMGO_IsPoint16SOutImg(nWidth, nHeight, pPipe->ptCurrentPnt))
if(IMGO_IsPoint32FOutImg(nWidth, nHeight, ptCurrentPnt)) if(IMGO_IsPoint32FOutImg(nWidth, nHeight, ptCurrentPnt))
@ -1175,7 +1178,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.7f; //相似度阈值 FLOAT32 fSimThres = 0.2f; //相似度阈值
SINT32 nFrmsStep = 1; //帧间隔 SINT32 nFrmsStep = 1; //帧间隔
TARGET_OBJECT* ptMainTarget = NULL; //主管道目标 TARGET_OBJECT* ptMainTarget = NULL; //主管道目标
TARGET_OBJECT* ptTarget = NULL; //候选目标 TARGET_OBJECT* ptTarget = NULL; //候选目标
@ -1377,8 +1380,8 @@ SINT32 SA_Tracker::FindMatchTarget(PIPE* pPipe, TARGET_OBJECT* ptTargetArray, SI
fAScaleChangeHighThres = 2.0; fAScaleChangeHighThres = 2.0;
nLastDiffThresX = MAX(nMoveMin, 6); nLastDiffThresX = MAX(nMoveMin, 6);
nLastDiffThresY = MAX(nMoveMin, 6); nLastDiffThresY = MAX(nMoveMin, 6);
nPredictDiffThresX = MAX(nFThreMin, 6); nPredictDiffThresX = MAX(nFThreMin, 12);
nPredictDiffThresY = MAX(nFThreMin, 6); nPredictDiffThresY = MAX(nFThreMin, 12);
} }

@ -150,9 +150,13 @@ bool Tracker::Track(GD_VIDEO_FRAME_S img, GLB_INPUT* p_GLB_Input, API_MOT_PIPE*
// 基于窗口平均计算管道长短时预测点 // 基于窗口平均计算管道长短时预测点
Predict_ObjAglTrackPredict(&m_LockingPipe->stMotionMod_mean, img.u32Width, img.u32Height, p_GLB_Input); Predict_ObjAglTrackPredict(&m_LockingPipe->stMotionMod_mean, img.u32Width, img.u32Height, p_GLB_Input);
m_LockingPipe->afCurrentAgl = m_LockingPipe->stMotionMod_mean.ObjAglListsLong.arfFilter.afAngle; //m_LockingPipe->afCurrentAgl = m_LockingPipe->stMotionMod_mean.ObjAglListsLong.arfFilter.afAngle;
m_LockingPipe->ptCurrentPnt.x = m_LockingPipe->stMotionMod_mean.crnObjPrediRtLong.cx; //m_LockingPipe->ptCurrentPnt.x = m_LockingPipe->stMotionMod_mean.crnObjPrediRtLong.cx;
m_LockingPipe->ptCurrentPnt.y = m_LockingPipe->stMotionMod_mean.crnObjPrediRtLong.cy; //m_LockingPipe->ptCurrentPnt.y = m_LockingPipe->stMotionMod_mean.crnObjPrediRtLong.cy;
m_LockingPipe->afCurrentAgl = m_LockingPipe->stMotionMod_mean.ObjAglListsNear.arfFilter.afAngle;
m_LockingPipe->ptCurrentPnt.x = m_LockingPipe->stMotionMod_mean.crnObjPrediRtNear.cx;
m_LockingPipe->ptCurrentPnt.y = m_LockingPipe->stMotionMod_mean.crnObjPrediRtNear.cy;
// 跟踪找到目标 // 跟踪找到目标
if (m_type == GLB_SCEN_MODE::GLB_SCEN_SKY) if (m_type == GLB_SCEN_MODE::GLB_SCEN_SKY)

@ -187,7 +187,7 @@ void Predict_ObjAglTrackPredict(FilterMeanNL* pFilter, SINT32 nWidth, SINT32 nHe
//SINT32 nNLDist2Thres = g_DST_stPara.nPipeRadiusTrack * g_DST_stPara.nPipeRadiusTrack; //SINT32 nNLDist2Thres = g_DST_stPara.nPipeRadiusTrack * g_DST_stPara.nPipeRadiusTrack;
// SINT32 nNLDist2Thres = 20*20; // SINT32 nNLDist2Thres = 20*20;
//SINT32 nNLDist2Thres = (g_GLB_stOutput.ObjectStatus.sfSize.h * g_GLB_stOutput.ObjectStatus.sfSize.w) * 25; //SINT32 nNLDist2Thres = (g_GLB_stOutput.ObjectStatus.sfSize.h * g_GLB_stOutput.ObjectStatus.sfSize.w) * 25;
SINT32 nNLDist2Thres = 10 * 25; SINT32 nNLDist2Thres = 10*10;
nNLDist2Thres = MAX(nNLDist2Thres,100); nNLDist2Thres = MAX(nNLDist2Thres,100);
if (fNLDist2 - fNLDist2Pre > 2 if (fNLDist2 - fNLDist2Pre > 2
@ -200,7 +200,7 @@ void Predict_ObjAglTrackPredict(FilterMeanNL* pFilter, SINT32 nWidth, SINT32 nHe
pFilter->nObjPredictFarCnt = 0; pFilter->nObjPredictFarCnt = 0;
pFilter->bObjPredictAbnormal = FALSE; pFilter->bObjPredictAbnormal = FALSE;
} }
if (pFilter->nObjPredictFarCnt > 10 if (pFilter->nObjPredictFarCnt > 5
&& fNLDist2 > nNLDist2Thres) && fNLDist2 > nNLDist2Thres)
{ {
pFilter->bObjPredictAbnormal = TRUE; pFilter->bObjPredictAbnormal = TRUE;

@ -97,7 +97,7 @@
#define GLB_GROUP_PIPENUM_MAX 3 //组包含的管道个数只支持3个合并 #define GLB_GROUP_PIPENUM_MAX 3 //组包含的管道个数只支持3个合并
//管道确认帧数 //管道确认帧数
#define GLB_PIPE_AWS_FRAME_STARE 5 //管道目标确认(报警)的最少帧数:凝视 #define GLB_PIPE_AWS_FRAME_STARE 3 //管道目标确认(报警)的最少帧数:凝视
#define GLB_PIPE_AWS_FRAME_SCAN 3 //管道目标确认(报警)的最少帧数:扫描 #define GLB_PIPE_AWS_FRAME_SCAN 3 //管道目标确认(报警)的最少帧数:扫描
#define GLB_PIPE_NUM_SECTOR 9 //目标运动方向分割 qw 20220112 #define GLB_PIPE_NUM_SECTOR 9 //目标运动方向分割 qw 20220112

@ -293,6 +293,26 @@ DAT_OUTPUT* ARIDLL_GetTrkDAT_stOutput(ArithHandle hArithSrc, int pipeID)
return pArith->g_GLB_Trackers[pipeID]->pSkyTracker->pSATracker->pDAT_Module->getDAT_stOutput(); return pArith->g_GLB_Trackers[pipeID]->pSkyTracker->pSATracker->pDAT_Module->getDAT_stOutput();
} }
DBG_TRACKER_API int ARIDLL_GetSkyLineY(ArithHandle hArithSrc)
{
Arith_EOController* pArith = (Arith_EOController*)hArithSrc;
auto input = &pArith->g_GLB_stInput;
if (pArith->g_GLB_stPara.bFiteredAlarm)
{
Pole skyPole = { 0 };
skyPole.alpha = pArith->g_GLB_stPara.fFilterPt;
skyPole.beta = input->servoInfo.fAz; //这个车基本是平的,不然需要找到当前视场方位角
POINT32F Skypos = getImagePosFromStablePole(skyPole, input->stCamera, input->servoInfo, input->afPlatformRPY, input->setupErr);
return Skypos.y;
}
return -1;
}
FilterMeanNL* ARIDLL_GetTrackerHistInfo(ArithHandle hArithSrc, int pipeID) FilterMeanNL* ARIDLL_GetTrackerHistInfo(ArithHandle hArithSrc, int pipeID)
{ {

@ -146,6 +146,9 @@ DBG_TRACKER_API DAT_PARAMETERS* ARIDLL_GetTrkDAT_stPara(ArithHandle hArithSrc, i
// 跟踪器局部检测面结果输出 // 跟踪器局部检测面结果输出
DBG_TRACKER_API DAT_OUTPUT* ARIDLL_GetTrkDAT_stOutput(ArithHandle hArithSrc, int pipeID); DBG_TRACKER_API DAT_OUTPUT* ARIDLL_GetTrkDAT_stOutput(ArithHandle hArithSrc, int pipeID);
// 输出天地线
DBG_TRACKER_API int ARIDLL_GetSkyLineY(ArithHandle hArithSrc);
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
////////////////////////////TLD检测结果导出/////////////////////////////// ////////////////////////////TLD检测结果导出///////////////////////////////

@ -650,6 +650,8 @@ void QVideoPlayer::DrawArithResult()
// 导引信息 // 导引信息
DrawGuideRect(); DrawGuideRect();
DrawSkyLine(m_ImageViewer);
// 绘制单帧检测(外部传入) // 绘制单帧检测(外部传入)
if (bEnableDrawFrameDetect) if (bEnableDrawFrameDetect)
{ {
@ -892,22 +894,27 @@ void QVideoPlayer::DrawTrackersInfo()
str = QString(_S("ID:%1 conf%2,Src:%3,mem:%4")).arg(obj->nOutputID).arg(QString::number(fconf, 'f', 3)).arg(src).arg(lostCnt); str = QString(_S("ID:%1 conf%2,Src:%3,mem:%4")).arg(obj->nOutputID).arg(QString::number(fconf, 'f', 3)).arg(src).arg(lostCnt);
str1 = QString(_S("type:%1")).arg(obj->unClsType); str1 = QString(_S("type:%1")).arg(obj->unClsType);
QString str2 = QString(_S("SNR:%1, dGray:%2")).arg(obj->fSNR).arg(obj->nObjGray - obj->fBkgGray);
if (obj->nOutputID >= 2) if (obj->nOutputID >= 2)
{ {
continue; continue;
} }
auto text = scene->addSimpleText(str); auto text = scene->addSimpleText(str);
auto text1 = scene->addSimpleText(str1); auto text1 = scene->addSimpleText(str1);
auto text2 = scene->addSimpleText(str2);
if (sabox.w == 0 || sabox.h == 0) if (sabox.w == 0 || sabox.h == 0)
{ {
text->setPos(QPoint(kcfBox.x - 10, kcfBox.y - 10)); text->setPos(QPoint(kcfBox.x - 10, kcfBox.y - 10));
text1->setPos(QPoint(kcfBox.x - 10, kcfBox.y + kcfBox.h + 10)); text1->setPos(QPoint(kcfBox.x - 10, kcfBox.y + kcfBox.h + 10));
} }
else else
{ {
text->setPos(QPoint(sabox.x - 10, sabox.y - 10)); text->setPos(QPoint(sabox.x - 10, sabox.y - 10));
text1->setPos(QPoint(sabox.x - 10, sabox.y + sabox.h + 10)); text1->setPos(QPoint(sabox.x - 10, sabox.y + sabox.h + 10));
text2->setPos(QPoint(sabox.x - 10, sabox.y + sabox.h + 20));
} }
QFont ft; ft.setPointSize(8); QFont ft; ft.setPointSize(8);
text->setBrush(QBrush(QColor(Qt::red))); text->setBrush(QBrush(QColor(Qt::red)));
@ -1599,10 +1606,16 @@ void QVideoPlayer::DrawCrossInImage(QImageViewer* view, QRect rect, QPen pen)
} }
void QVideoPlayer::DrawSkyLine(QImageViewer* view,int y) void QVideoPlayer::DrawSkyLine(QImageViewer* view)
{ {
int skyY = ARIDLL_GetSkyLineY(pEOTracker);
if (skyY > 0)
{
QGraphicsScene* scene = view->imgScene;
scene->addLine(QLine(0, skyY, 640, skyY), QPen(QBrush(QColor(Qt::red)),3,Qt::DashDotLine));
}
} }
void QVideoPlayer::DrawGuideRect() void QVideoPlayer::DrawGuideRect()

@ -243,7 +243,7 @@ private:
void PrintTableInfo(); void PrintTableInfo();
// 绘制天地线 // 绘制天地线
void DrawSkyLine(QImageViewer* view, int y); void DrawSkyLine(QImageViewer* view);
// 绘制导引区域 // 绘制导引区域
void DrawGuideRect(); void DrawGuideRect();

Loading…
Cancel
Save