You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
353 lines
12 KiB
353 lines
12 KiB
|
11 months ago
|
#include "debugExport.h"
|
||
|
|
#include "Arith_EOController.h"
|
||
|
|
#include "Arith_CoordModule.h"
|
||
|
|
|
||
|
|
|
||
|
|
void ARIDLL_GetDeBugOutput(ArithHandle hArithSrc, ARIDLL_INPUTPARA* stInputPara, ARIDLL_DEBUG_OUTPUT* pstOutput)
|
||
|
|
{
|
||
|
|
Arith_EOController* pArith = (Arith_EOController*)hArithSrc;
|
||
|
|
|
||
|
|
// 输出单帧检测结果
|
||
|
|
ARIDLL_DEBUG_OUTPUT* info = pstOutput;
|
||
|
|
|
||
|
|
// 管道资源占用
|
||
|
|
info->nMaxPipeNum = pArith->g_GLB_PipeProc->PIPE_GetMaxPipeNum();
|
||
|
|
info->nUsePipeNum = pArith->g_GLB_PipeProc->PIPE_GetOccupyNum();
|
||
|
|
|
||
|
|
if (pArith->g_GLB_stPara.nLockPipeInd < 0)
|
||
|
|
{
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
Tracker* pTracker = pArith->g_GLB_Trackers[pArith->g_GLB_stPara.nLockPipeInd];
|
||
|
|
|
||
|
|
if (pTracker != NULL && pTracker->pGroundTracker)
|
||
|
|
{
|
||
|
|
if (pTracker->pGroundTracker->m_pAITracker)
|
||
|
|
{
|
||
|
|
AIT_OUTPUT pAITOut = pTracker->pGroundTracker->m_pAITracker->m_Ai_TkOut;
|
||
|
|
info->fAITRes = pAITOut.fProb;
|
||
|
|
info->nAITNum = pAITOut.nDetectNum;
|
||
|
|
}
|
||
|
|
OBJECTSTATUS pDeciOutput = pTracker->pGroundTracker->ObjStatus;
|
||
|
|
OBJECTSTATUS pKCFOutput = pTracker->pGroundTracker->ObjStatusKCF;
|
||
|
|
OBJECTSTATUS pAIOutput = pTracker->pGroundTracker->ObjStatusAI;
|
||
|
|
OccJudge* pOccJudgeKCF = pTracker->pGroundTracker->m_pOccJudgeKCF;
|
||
|
|
OccJudgeAI* pOccJudgeAI = pTracker->pGroundTracker->m_pOccJudgeAI;
|
||
|
|
TargetArrest* pArrestOut = pTracker->pGroundTracker->m_pTargetArrest;
|
||
|
|
|
||
|
|
TLD_Para* pTLDPara = pTracker->pGroundTracker->m_pTLDTracker->TLD_GetPara();
|
||
|
|
//对地调试参数传值
|
||
|
|
info->fKCFRes = pKCFOutput.fConfidence;
|
||
|
|
info->nLearnCnt = pTLDPara->nLearnedNum;
|
||
|
|
info->nTLDNum = pTLDPara->nClusterNum;
|
||
|
|
info->fMaxNNConf = pTLDPara->fNNConfMax;
|
||
|
|
info->nAIJamCnt = pOccJudgeAI->m_AIT_stOcclude.nJamExistCnt;
|
||
|
|
info->nAIChangCnt = pOccJudgeAI->m_AIT_stOcclude.nDetectChangeCnt;
|
||
|
|
info->fLargeResTH = pOccJudgeKCF->g_GLB_Large_Scale_Response_Thresh;
|
||
|
|
info->fArrKCFRes = pArrestOut->fArrestKCFRes;
|
||
|
|
info->nObjNumArrestTH = pOccJudgeAI->m_AIT_stOcclude.nObjNumArrestTH;
|
||
|
|
info->nOccKCFStatus = pOccJudgeKCF->nOccKCFStatus;
|
||
|
|
info->nArrestKCFStatus = pArrestOut->nArrestKCFStatus;
|
||
|
|
info->nOccAIStatus = pOccJudgeAI->nOccAIStatus;
|
||
|
|
info->nArrestAIStatus = pArrestOut->nArrestAIStatus;
|
||
|
|
info->nDecisionStatus = pDeciOutput.nDeciStatus;
|
||
|
|
info->nKcfStatus = pKCFOutput.nOcclude_flag;
|
||
|
|
info->nAIStatus = pAIOutput.nOcclude_flag;
|
||
|
|
info->nX = (int)pDeciOutput.ptPos.x;
|
||
|
|
info->nY = (int)pDeciOutput.ptPos.y;
|
||
|
|
info->nW = (int)pDeciOutput.sfSize.w;
|
||
|
|
info->nH = (int)pDeciOutput.sfSize.h;
|
||
|
|
}
|
||
|
|
else if (pTracker != NULL && pTracker->pSkyTracker)
|
||
|
|
{
|
||
|
|
UBYTE8 ubBkgIndex = 0;
|
||
|
|
BBOOL bComplexEnv = FALSE;
|
||
|
|
BBOOL bInterferenceMem = FALSE;
|
||
|
|
UBYTE8 bInfrnDirection = 0;
|
||
|
|
|
||
|
|
getBKMInform(hArithSrc, pArith->g_GLB_stPara.nLockPipeInd, NULL, NULL, &ubBkgIndex,
|
||
|
|
&bComplexEnv, &bInterferenceMem, &bInfrnDirection, NULL);
|
||
|
|
info->sky_bComplexEnv = bComplexEnv;
|
||
|
|
info->sky_bInterferenceMem = bInterferenceMem;
|
||
|
|
|
||
|
|
TSky_Output* pSky_Output = GetSkyTrackerObjectStatus(hArithSrc, pArith->g_GLB_stPara.nLockPipeInd);
|
||
|
|
info->sky_TrkDownRatio = pSky_Output->mTrakingPara_Output.prmTSkyDet.nDSmpScale;
|
||
|
|
info->sky_TrkMemFrm = pSky_Output->ObjectStatusDesc.unContiLostCnt;
|
||
|
|
info->sky_nTrkCX = pSky_Output->ObjectStatusDesc.ptPos.x;
|
||
|
|
info->sky_nTrkCY = pSky_Output->ObjectStatusDesc.ptPos.y;
|
||
|
|
info->sky_nTrkW = pSky_Output->ObjectStatusDesc.sfSize.w;
|
||
|
|
info->sky_nTrkH = pSky_Output->ObjectStatusDesc.sfSize.h;
|
||
|
|
info->sky_fTrkPxlsCnt = pSky_Output->ObjectStatusDesc.fObjPxlsCnt;
|
||
|
|
info->sky_fTrkConf = pSky_Output->ObjectStatusDesc.fConfidence;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
GLB_OUTPUT ARIDLL_Export_GLB_OUTPUT(ArithHandle hArithSrc)
|
||
|
|
{
|
||
|
|
Arith_EOController* pArith = (Arith_EOController*)hArithSrc;
|
||
|
|
return pArith->g_GLB_stOutput;
|
||
|
|
}
|
||
|
|
|
||
|
|
PIPE* ARIDLL_ExportPipeArrayPtr(ArithHandle hArithSrc)
|
||
|
|
{
|
||
|
|
// 获取算法指针
|
||
|
|
Arith_EOController* pArith = (Arith_EOController*)hArithSrc;
|
||
|
|
|
||
|
|
return pArith->g_GLB_PipeProc->getPipeArray();
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
RECT32S TLD_GetBestNNRect(ArithHandle hArithSrc, int pipeID)
|
||
|
|
{
|
||
|
|
RECT32S res = {0};
|
||
|
|
Arith_EOController* pArith = (Arith_EOController*)hArithSrc;
|
||
|
|
if (NULL == pArith->g_GLB_Trackers[pipeID] || NULL == pArith->g_GLB_Trackers[pipeID]->pGroundTracker)
|
||
|
|
{
|
||
|
|
return res;
|
||
|
|
}
|
||
|
|
return pArith->g_GLB_Trackers[pipeID]->pGroundTracker->m_pTLDTracker->TLD_GetBestNNRect();
|
||
|
|
}
|
||
|
|
|
||
|
|
RECT16S* ARIDLL_AID_GetObservInfo(ArithHandle hArithSrc, int pipeID, int& num)
|
||
|
|
{
|
||
|
|
Arith_EOController* pArith = (Arith_EOController*)hArithSrc;
|
||
|
|
if (NULL == pArith->g_GLB_Trackers[pipeID] || NULL == pArith->g_GLB_Trackers[pipeID]->pGroundTracker)
|
||
|
|
{
|
||
|
|
return NULL;
|
||
|
|
}
|
||
|
|
num = pArith->g_GLB_Trackers[pipeID]->pGroundTracker->Ai_DMonitor->masterPipeMonitor.nNeighborCnt;
|
||
|
|
return &pArith->g_GLB_Trackers[pipeID]->pGroundTracker->Ai_DMonitor->ObservRect;
|
||
|
|
}
|
||
|
|
|
||
|
|
RECT16S* ARIDLL_AID_GetRecapRect(ArithHandle hArithSrc, int pipeID)
|
||
|
|
{
|
||
|
|
Arith_EOController* pArith = (Arith_EOController*)hArithSrc;
|
||
|
|
if (NULL == pArith->g_GLB_Trackers[pipeID] || NULL == pArith->g_GLB_Trackers[pipeID]->pGroundTracker)
|
||
|
|
{
|
||
|
|
return NULL;
|
||
|
|
}
|
||
|
|
return &pArith->g_GLB_Trackers[pipeID]->pGroundTracker->Ai_DMonitor->RecapRect;
|
||
|
|
}
|
||
|
|
|
||
|
|
POINT32F ARIDLL_GetImagePosFromStablePole(ArithHandle hArithSrc,ANGLE32F agl)
|
||
|
|
{
|
||
|
|
POINT32S pOut = { 0 };
|
||
|
|
// 获取算法指针
|
||
|
|
Arith_EOController* pArith = (Arith_EOController*)hArithSrc;
|
||
|
|
|
||
|
|
Pole p = { 0};
|
||
|
|
p.alpha = agl.fPt;
|
||
|
|
p.beta = agl.fAz;
|
||
|
|
POINT32F imgPos = getImagePosFromStablePole(p, pArith->g_GLB_stInput.stCamera, pArith->g_GLB_stInput.servoInfo, pArith->g_GLB_stInput.afPlatformRPY, pArith->g_GLB_stInput.setupErr);
|
||
|
|
|
||
|
|
return imgPos;
|
||
|
|
}
|
||
|
|
|
||
|
|
ANGLE32F ARIDLL_GetStablePoleFromImagePos(ArithHandle hArithSrc, POINT32F fImagePos)
|
||
|
|
{
|
||
|
|
// 获取算法指针
|
||
|
|
Arith_EOController* pArith = (Arith_EOController*)hArithSrc;
|
||
|
|
|
||
|
|
Pole pole = getStablePoleFromImagePos(fImagePos, pArith->g_GLB_stInput.stCamera, pArith->g_GLB_stInput.servoInfo, pArith->g_GLB_stInput.afPlatformRPY, pArith->g_GLB_stInput.setupErr);
|
||
|
|
|
||
|
|
ANGLE32F stablePole = { 0 };
|
||
|
|
stablePole.fAz = (FLOAT32)pole.beta;
|
||
|
|
stablePole.fPt = (FLOAT32)pole.alpha;
|
||
|
|
return stablePole;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
POINT16S* ARIDLL_GetSATracker_DSTPoint(ArithHandle hArithSrc, int pipeID)
|
||
|
|
{
|
||
|
|
Arith_EOController* pArith = (Arith_EOController*)hArithSrc;
|
||
|
|
|
||
|
|
if (pArith->g_GLB_Trackers[pipeID] == NULL)
|
||
|
|
{
|
||
|
|
return NULL;
|
||
|
|
}
|
||
|
|
return pArith->g_GLB_Trackers[pipeID]->pSkyTracker->GetDST_MaxPoint_Sky();
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
TARGET_OBJECT* ARIDLL_GetTrackerTarget(ArithHandle hArithSrc,int pipeID, int& num)
|
||
|
|
{
|
||
|
|
Arith_EOController* pArith = (Arith_EOController*)hArithSrc;
|
||
|
|
|
||
|
|
if (pArith->g_GLB_Trackers[pipeID] == NULL || pArith->g_GLB_Trackers[pipeID]->m_type == GLB_SCEN_GROUND)
|
||
|
|
{
|
||
|
|
num = 0;
|
||
|
|
return NULL;
|
||
|
|
}
|
||
|
|
|
||
|
|
return pArith->g_GLB_Trackers[pipeID]->pSkyTracker->getTrackerSATargetList(num);
|
||
|
|
}
|
||
|
|
|
||
|
|
DAT_PARAMETERS* ARIDLL_GetTrkDAT_stPara(ArithHandle hArithSrc, int pipeID)
|
||
|
|
{
|
||
|
|
Arith_EOController* pArith = (Arith_EOController*)hArithSrc;
|
||
|
|
|
||
|
|
if (pArith->g_GLB_Trackers[pipeID] == NULL || pArith->g_GLB_Trackers[pipeID]->m_type == GLB_SCEN_GROUND)
|
||
|
|
{
|
||
|
|
return NULL;
|
||
|
|
}
|
||
|
|
return pArith->g_GLB_Trackers[pipeID]->pSkyTracker->pSATracker->pDAT_Module->GetDatParm();
|
||
|
|
}
|
||
|
|
|
||
|
|
DAT_PARAMETERS* ARIDLL_GetDAT_stPara(ArithHandle hArithSrc)
|
||
|
|
{
|
||
|
|
Arith_EOController* pArith = (Arith_EOController*)hArithSrc;
|
||
|
|
if (NULL == pArith->g_GLB_Detectors || NULL == pArith->g_GLB_Detectors->pDAT_Module)
|
||
|
|
{
|
||
|
|
return NULL;
|
||
|
|
}
|
||
|
|
return pArith->g_GLB_Detectors->pDAT_Module->GetDatParm();
|
||
|
|
}
|
||
|
|
|
||
|
|
DAT_OUTPUT* ARIDLL_GetDAT_stOutput(ArithHandle hArithSrc)
|
||
|
|
{
|
||
|
|
Arith_EOController* pArith = (Arith_EOController*)hArithSrc;
|
||
|
|
if (NULL == pArith->g_GLB_Detectors || NULL == pArith->g_GLB_Detectors->pDAT_Module)
|
||
|
|
{
|
||
|
|
return NULL;
|
||
|
|
}
|
||
|
|
return pArith->g_GLB_Detectors->pDAT_Module->getDAT_stOutput();
|
||
|
|
}
|
||
|
|
|
||
|
|
TARGET_OBJECT* ARIDLL_GetFullSATarget(ArithHandle hArithSrc, int& SANum)
|
||
|
|
{
|
||
|
|
Arith_EOController* pArith = (Arith_EOController*)hArithSrc;
|
||
|
|
|
||
|
|
SANum = pArith->g_GLB_Detectors->m_FrmObjsCnt;
|
||
|
|
TARGET_OBJECT* pFrameTargetArray = pArith->g_GLB_Detectors->GetTargetArray();
|
||
|
|
return pFrameTargetArray;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
DAT_OUTPUT* ARIDLL_GetTrkDAT_stOutput(ArithHandle hArithSrc, int pipeID)
|
||
|
|
{
|
||
|
|
Arith_EOController* pArith = (Arith_EOController*)hArithSrc;
|
||
|
|
|
||
|
|
if (pArith->g_GLB_Trackers[pipeID] == NULL || pArith->g_GLB_Trackers[pipeID]->m_type == GLB_SCEN_GROUND)
|
||
|
|
{
|
||
|
|
return NULL;
|
||
|
|
}
|
||
|
|
return pArith->g_GLB_Trackers[pipeID]->pSkyTracker->pSATracker->pDAT_Module->getDAT_stOutput();
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
FilterMeanNL* ARIDLL_GetTrackerHistInfo(ArithHandle hArithSrc, int pipeID)
|
||
|
|
{
|
||
|
|
Arith_EOController* pArith = (Arith_EOController*)hArithSrc;
|
||
|
|
PIPE* pPipe = &pArith->g_GLB_PipeProc->getPipeArray()[pipeID];
|
||
|
|
if (pPipe->bOccupy)
|
||
|
|
{
|
||
|
|
return &pPipe->stMotionMod_mean;
|
||
|
|
}
|
||
|
|
|
||
|
|
return nullptr;
|
||
|
|
}
|
||
|
|
|
||
|
|
POINT16S * ARIDLL_GetMaxPoint(ArithHandle hArithSrc)
|
||
|
|
{
|
||
|
|
Arith_EOController* pArith = (Arith_EOController*)hArithSrc;
|
||
|
|
return pArith->g_GLB_Detectors->GetDST_MaxPoint();
|
||
|
|
}
|
||
|
|
|
||
|
|
TargetGuide* ARIDLL_GetTargetGuide(ArithHandle hArithSrc)
|
||
|
|
{
|
||
|
|
Arith_EOController* pArith = (Arith_EOController*)hArithSrc;
|
||
|
|
return pArith->g_GLB_stPara.targetGuide;
|
||
|
|
}
|
||
|
|
|
||
|
|
GLB_SCEN_MODE ARIDLL_ExportSceneMode(ArithHandle hArithSrc)
|
||
|
|
{
|
||
|
|
Arith_EOController* pArith = (Arith_EOController*)hArithSrc;
|
||
|
|
return pArith->m_SceneType;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
GLB_SCEN_MODE ARIDLL_ExportTrkSceneMode(ArithHandle hArithSrc, int pipeID)
|
||
|
|
{
|
||
|
|
Arith_EOController* pArith = (Arith_EOController*)hArithSrc;
|
||
|
|
if (NULL == pArith->g_GLB_Trackers[pipeID])
|
||
|
|
{
|
||
|
|
return GLB_SCEN_NONE;
|
||
|
|
}
|
||
|
|
return pArith->g_GLB_Trackers[pipeID]->m_type;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
ALARM_TARGET* ARIDLL_GetAlarmArray(ArithHandle hArithSrc)
|
||
|
|
{
|
||
|
|
Arith_EOController* pArith = (Arith_EOController*)hArithSrc;
|
||
|
|
|
||
|
|
return pArith->g_GLB_PipeProc->PIPE_GetAlarmTarget();
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
BBOOL* ARIDLL_GetIDArray(ArithHandle hArithSrc)
|
||
|
|
{
|
||
|
|
Arith_EOController* pArith = (Arith_EOController*)hArithSrc;
|
||
|
|
|
||
|
|
return pArith->g_GLB_PipeProc->PIPE_GetAlarmIDArray();
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
//获取背景监控信息
|
||
|
|
void getBKMInform(ArithHandle hArithSrc, int pipeID, FLOAT32* pdObj8BkgStdArray, BBOOL* pbObj8BkgStatus, UBYTE8* ubBkgIndex,
|
||
|
|
BBOOL* bComplexEnv, BBOOL* bInterferenceMem, UBYTE8* bInfrnDirection, MINMAXRECT32S *mrnBkgBlks)
|
||
|
|
{
|
||
|
|
Arith_EOController* pArith = (Arith_EOController*)hArithSrc;
|
||
|
|
|
||
|
|
if (pArith->g_GLB_Trackers[pipeID] == NULL || pArith->g_GLB_Trackers[pipeID]->m_type == GLB_SCEN_GROUND)
|
||
|
|
{
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
BkgMonitor* pBkgMonitor = pArith->g_GLB_Trackers[pipeID]->pSkyTracker->pBkgMonitor;
|
||
|
|
if (NULL != mrnBkgBlks)
|
||
|
|
{
|
||
|
|
memcpy(mrnBkgBlks, pBkgMonitor->mrnBkgBlks, sizeof(MINMAXRECT32S) * 8);
|
||
|
|
}
|
||
|
|
if (NULL != pdObj8BkgStdArray)
|
||
|
|
{
|
||
|
|
memcpy(pdObj8BkgStdArray, pBkgMonitor->DSP_GLB_Obj8BkgStdArray, sizeof(FLOAT32) * GLB_OBJ_BKG_FRM_NUM * GLB_OBJ_BKG_NUM);
|
||
|
|
}
|
||
|
|
if (NULL != pbObj8BkgStatus)
|
||
|
|
{
|
||
|
|
memcpy(pbObj8BkgStatus, pBkgMonitor->g_GLB_bObj8BkgStatus, sizeof(BBOOL) * GLB_OBJ_BKG_NUM);
|
||
|
|
}
|
||
|
|
|
||
|
|
*ubBkgIndex = pBkgMonitor->g_GLB_nObj8BkgArrayIndex;
|
||
|
|
*bComplexEnv = pBkgMonitor->g_GLB_bComplexEnv;
|
||
|
|
*bInterferenceMem = pBkgMonitor->g_GLB_bInterferenceMem;
|
||
|
|
*bInfrnDirection = pBkgMonitor->g_GLB_bInfrnDirection;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
TSky_Output * GetSkyTrackerObjectStatus(ArithHandle hArithSrc, int pipeID)
|
||
|
|
{
|
||
|
|
|
||
|
|
Arith_EOController* pArith = (Arith_EOController*)hArithSrc;
|
||
|
|
|
||
|
|
if (pArith->g_GLB_Trackers[pipeID] == NULL || pArith->g_GLB_Trackers[pipeID]->m_type == GLB_SCEN_GROUND)
|
||
|
|
{
|
||
|
|
return NULL;
|
||
|
|
}
|
||
|
|
Tracker_Ptr pTracker = pArith->g_GLB_Trackers[pipeID];
|
||
|
|
return &pTracker->pSkyTracker->m_TSky_Output;
|
||
|
|
}
|
||
|
|
|
||
|
|
Param_SkyTracker* GetSkyTrackerParam(ArithHandle hArithSrc, int pipeID)
|
||
|
|
{
|
||
|
|
Arith_EOController* pArith = (Arith_EOController*)hArithSrc;
|
||
|
|
|
||
|
|
if (pArith->g_GLB_Trackers[pipeID] == NULL || pArith->g_GLB_Trackers[pipeID]->m_type == GLB_SCEN_GROUND)
|
||
|
|
{
|
||
|
|
return NULL;
|
||
|
|
}
|
||
|
|
Tracker_Ptr pTracker = pArith->g_GLB_Trackers[pipeID];
|
||
|
|
|
||
|
|
return &pTracker->pSkyTracker->m_TSky_Output.mTrakingPara_Output;
|
||
|
|
}
|