diff --git a/NeoTracker/src/Arith_EOController.cpp b/NeoTracker/src/Arith_EOController.cpp index 0711b88..c8d94ce 100644 --- a/NeoTracker/src/Arith_EOController.cpp +++ b/NeoTracker/src/Arith_EOController.cpp @@ -345,6 +345,9 @@ void Arith_EOController::GLB_InitArithParameters() g_GLB_stArithPara.stSkyParam.Sky_bSelectObjManual = 1; g_GLB_stArithPara.stSkyParam.Sky_bUseAIDet = true; g_GLB_stArithPara.stSkyParam.Sky_nUseAIDetFeq = 1; + g_GLB_stArithPara.stSkyParam.Sky_fLastMoveR = 4.0; + g_GLB_stArithPara.stSkyParam.Sky_fPredMoveR = 2.0; + g_GLB_stArithPara.stSkyParam.prmTSkyDet.bEnableDetcetAreaTarget = true; g_GLB_stArithPara.stSkyParam.prmTSkyDet.bEnableDetcetDimTarget = false; g_GLB_stArithPara.stSkyParam.prmTSkyDet.fSmallDetectGDK = 5; @@ -355,6 +358,7 @@ void Arith_EOController::GLB_InitArithParameters() g_GLB_stArithPara.stSkyParam.prmTSkyDet.nDSmpScale = 4; + // 对地默认参数 g_GLB_stArithPara.stGrdParam.bEnableAccuracyTrack = true; g_GLB_stArithPara.stGrdParam.bUseServePredict = false; diff --git a/NeoTracker/src/Arith_TrackSAObj.cpp b/NeoTracker/src/Arith_TrackSAObj.cpp index 655e4b6..de53f39 100644 --- a/NeoTracker/src/Arith_TrackSAObj.cpp +++ b/NeoTracker/src/Arith_TrackSAObj.cpp @@ -1007,10 +1007,10 @@ FLOAT32 SA_Tracker::Similarity_Move(PIPE* pPipe, TARGET_OBJECT* ptTarget, FLOAT3 SIZE16S padSize = { 0 }; - padSize.w = MAX(ABS(fSpeedLong.vx * 3) + pPipe->objHistoryList[pPipe->ubEnd].snSize.w, 8); - padSize.h = MAX(ABS(fSpeedLong.vy * 3) + pPipe->objHistoryList[pPipe->ubEnd].snSize.h, 8); + padSize.w = MAX(ABS(fSpeedLong.vx * 3) + pPipe->objHistoryList[pPipe->ubEnd].snSize.w, 20); + padSize.h = MAX(ABS(fSpeedLong.vy * 3) + pPipe->objHistoryList[pPipe->ubEnd].snSize.h, 20); - SINT32 nPipeRadiusTrack = 10 + MAX(pPipe->ObjectFilter.sfSize.w, pPipe->ObjectFilter.sfSize.h); + SINT32 nPipeRadiusTrack = 50 + MAX(pPipe->ObjectFilter.sfSize.w, pPipe->ObjectFilter.sfSize.h); if (pPipe->bLost) { @@ -1234,7 +1234,6 @@ SINT32 SA_Tracker::FindMatchTarget(PIPE* pPipe, TARGET_OBJECT* ptTargetArray, SI continue; } - // 计算表观相似度 FLOAT32 fAppSim = Similarity_Apparent(pPipe, ptTarget); @@ -1243,7 +1242,6 @@ SINT32 SA_Tracker::FindMatchTarget(PIPE* pPipe, TARGET_OBJECT* ptTargetArray, SI fSim = fAppSim * fApparentModelWeight + fMoveSim * fMoveModelWeight; - ptTarget->fMatchConf = fSim; SINT32 nDSmpScale = pDAT_Module->GetDatParm()->nDSmpScale; @@ -1297,6 +1295,11 @@ SINT32 SA_Tracker::FindMatchTarget(PIPE* pPipe, TARGET_OBJECT* ptTargetArray, SI } } + // 焦距关联阈值(按照0.01度器件精度) + SINT32 nFThreMin = 0.01 / fAglReso * 2; + SINT32 nMoveMin = 0.01 / fAglReso * 4; + + // 阈值调整 if (pPipe->unLostCnt < 20) { @@ -1304,10 +1307,10 @@ SINT32 SA_Tracker::FindMatchTarget(PIPE* pPipe, TARGET_OBJECT* ptTargetArray, SI fSScaleChangeHighThres = 3.f; fAScaleChangeLowThres = 0.5; fAScaleChangeHighThres = 2.0; - nLastDiffThresX = 6; - nLastDiffThresY = 6; - nPredictDiffThresX = 8; - nPredictDiffThresY = 8; + nLastDiffThresX = MAX(nMoveMin,12); + nLastDiffThresY = MAX(nMoveMin, 12); + nPredictDiffThresX = MAX(nFThreMin, 12); + nPredictDiffThresY = MAX(nFThreMin, 12); } else if (pPipe->unLostCnt < 50) { @@ -1315,10 +1318,10 @@ SINT32 SA_Tracker::FindMatchTarget(PIPE* pPipe, TARGET_OBJECT* ptTargetArray, SI fSScaleChangeHighThres = 5.f; fAScaleChangeLowThres = 0.33; fAScaleChangeHighThres = 3.0; - nLastDiffThresX = 10; - nLastDiffThresY = 10; - nPredictDiffThresX = 12; - nPredictDiffThresY = 12; + nLastDiffThresX = MAX(nMoveMin, 24); + nLastDiffThresY = MAX(nMoveMin, 24); + nPredictDiffThresX = MAX(nFThreMin, 36); + nPredictDiffThresY = MAX(nFThreMin, 36); } else if (pPipe->unLostCnt < 100) { @@ -1326,10 +1329,10 @@ SINT32 SA_Tracker::FindMatchTarget(PIPE* pPipe, TARGET_OBJECT* ptTargetArray, SI fSScaleChangeHighThres = 8.f; fAScaleChangeLowThres = 0.33; fAScaleChangeHighThres = 3.0; - nLastDiffThresX = 15; - nLastDiffThresY = 15; - nPredictDiffThresX = 18; - nPredictDiffThresY = 18; + nLastDiffThresX = MAX(nMoveMin, 36); + nLastDiffThresY = MAX(nMoveMin, 36); + nPredictDiffThresX = MAX(nFThreMin, 48); + nPredictDiffThresY = MAX(nFThreMin, 48); } else { @@ -1337,10 +1340,10 @@ SINT32 SA_Tracker::FindMatchTarget(PIPE* pPipe, TARGET_OBJECT* ptTargetArray, SI fSScaleChangeHighThres = 12.f; fAScaleChangeLowThres = 0.25; fAScaleChangeHighThres = 4.0; - nLastDiffThresX = 15; - nLastDiffThresY = 15; - nPredictDiffThresX = 18; - nPredictDiffThresY = 18; + nLastDiffThresX = MAX(nMoveMin, 48); + nLastDiffThresY = MAX(nMoveMin, 48); + nPredictDiffThresX = MAX(nFThreMin, 60); + nPredictDiffThresY = MAX(nFThreMin, 60); } SINT32 nEnd = pPipe->ubEnd; @@ -1466,10 +1469,11 @@ SINT32 SA_Tracker::FindMatchTarget(PIPE* pPipe, TARGET_OBJECT* ptTargetArray, SI fMoveThres = 0.8 * 1.f - ContiLostThres; } //若最大相似度不满足阈值,则认为未查找到管道目标,返回-1 - if (fSimMax < fThres ||(SmallTarget == m_SizeMode && fMoveSim_Target < fMoveThres)) + if (fSimMax < fThres /*||(SmallTarget == m_SizeMode && fMoveSim_Target < fMoveThres)*/) { nSimTargetId = -1; } + if (-1 != nSimTargetId) { //记录管道目标跟踪相似度 diff --git a/NeoTracker/src/Common/Arith_SysStruct.h b/NeoTracker/src/Common/Arith_SysStruct.h index 1d8aa2a..fac0bbb 100644 --- a/NeoTracker/src/Common/Arith_SysStruct.h +++ b/NeoTracker/src/Common/Arith_SysStruct.h @@ -971,6 +971,10 @@ typedef struct tagParam_SkyTracker SINT32 nSmallObjSizeMax; //小面目标的像素数切换阈值 SINT32 nAreaCombineDist; //面目标合并距离 + // 运动模型容忍度 + FLOAT32 Sky_fLastMoveR; // 相对上一帧位置容忍阈值(最小分辨力的倍率) + FLOAT32 Sky_fPredMoveR; // 相对预测位置容忍阈值(最小分辨力的倍率) + //用于控制跟踪局部的检测器 Param_SkyDetect prmTSkyDet; //对空跟踪局部检测器参数 diff --git a/NeoTracker/src/Version.h.in b/NeoTracker/src/Version.h.in index a1fe2aa..e31f5d0 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.0.1"; +std::string VERSION = "BUILD_VERSION 1.3.0"; diff --git a/QGuideArithStudio/src/ArithInterface.cpp b/QGuideArithStudio/src/ArithInterface.cpp index 291704f..75f4f9a 100644 --- a/QGuideArithStudio/src/ArithInterface.cpp +++ b/QGuideArithStudio/src/ArithInterface.cpp @@ -434,9 +434,10 @@ void RunNeoTracker(std::vector streamVec) ARIDLL_INPUTPARA stInputPara = { 0 }; BYTE* m_pParamData = m_stream->GetParamDataBuffer(); BYTE* m_pResultData = m_stream->GetResultDataBuffer(); //复用结果行解析红外参数 + memset(&m_stInputPara, 0, sizeof(ARIDLL_INPUTPARA)); memset(&m_stOutput, 0, sizeof(ARIDLL_OUTPUT)); - S3315GetImagePara(m_pParamData, m_pResultData, &stInputPara); + S3315GetImagePara(pSrc,m_pParamData, m_pResultData, &stInputPara); memcpy(&m_stInputPara, &stInputPara, sizeof(ARIDLL_INPUTPARA)); m_stInputPara.unFrmId = frameID; //memcpy(&m_stInputPara, m_pParamData, sizeof(ARIDLL_INPUTPARA));//读取可见光录像中算法输入 diff --git a/QGuideArithStudio/src/Project/S3315.cpp b/QGuideArithStudio/src/Project/S3315.cpp index dd99b97..4128258 100644 --- a/QGuideArithStudio/src/Project/S3315.cpp +++ b/QGuideArithStudio/src/Project/S3315.cpp @@ -19,24 +19,29 @@ float calc_fov_by_mil(float mil, int mil_type) return (mil * 360.0f / mil_type); } -void S3315GetImagePara(unsigned char* pParamDataBuffer, unsigned char* pResultDataBuffer, ARIDLL_INPUTPARA* ImagePara) +void S3315GetImagePara(unsigned char* pImageDataBuffer,unsigned char* pParamDataBuffer, unsigned char* pResultDataBuffer, ARIDLL_INPUTPARA* ImagePara) { ST_3315_152_NO110* pParamNO110DataBuffer = (ST_3315_152_NO110*)calloc(640, sizeof(int)); ST_3315_152_NO149* pParamNO149DataBuffer = (ST_3315_152_NO149*)calloc(640, sizeof(int)); ST_3315_152_NO65* pParamNO65DataBuffer = (ST_3315_152_NO65*)calloc(640, sizeof(int)); - unsigned char* IR_para = { 0 }; - //memcpy(IR_para, pParamDataBuffer, 1280); + memcpy(pParamNO110DataBuffer, pParamDataBuffer, 640); - memcpy(pParamNO149DataBuffer, pParamDataBuffer+ 640, 640); - memcpy(pParamNO65DataBuffer, pParamDataBuffer + 1280, 640); + memcpy(pParamNO149DataBuffer, pParamDataBuffer+ 640, 640); + memcpy(pParamNO65DataBuffer, pParamDataBuffer + 1280, 640); ImagePara->stServoInfo.fServoAz = calc_fov_by_mil(pParamNO65DataBuffer->B1B0 , 6000) * 6000.0f / 65536.0f; ImagePara->stServoInfo.fServoPt = calc_fov_by_mil(pParamNO65DataBuffer->B3B2, 6000) * 6000.0f / 65536.0f; ImagePara->stAirCraftInfo.stAtt.fYaw = calc_fov_by_mil(pParamNO65DataBuffer->B1B0, 6000) * 6000.0f / 65536.0f; ImagePara->stAirCraftInfo.stAtt.fPitch = calc_fov_by_mil(pParamNO65DataBuffer->B3B2, 6000) * 6000.0f / 65536.0f; ImagePara->stAirCraftInfo.stAtt.fRoll = calc_fov_by_mil(pParamNO65DataBuffer->B5B4, 6000) * 6000.0f / 65536.0f; ImagePara->stCameraInfo.fPixelSize = 25; - ImagePara->stCameraInfo.nFocus = 302; + ImagePara->stCameraInfo.nFocus = 948; ImagePara->unFreq = 50; + + //unsigned short* pIR = ((unsigned short*)pImageDataBuffer); + //ImagePara->stCameraInfo.nFocus = pIR[640 + 64] * 0.1; + + + /*std::cout << std::hex << std::setw(8) << "pParamDataBuffer" << std::setfill('0') << reinterpret_cast(pParamDataBuffer) << ": "; for (int i = 0; i < 640; ++i) { diff --git a/QGuideArithStudio/src/Project/S3315.h b/QGuideArithStudio/src/Project/S3315.h index e39356d..0b52ea7 100644 --- a/QGuideArithStudio/src/Project/S3315.h +++ b/QGuideArithStudio/src/Project/S3315.h @@ -54,4 +54,4 @@ typedef struct _3315_152_NO65 { unsigned short B5B4; /* 方位角(稳定系) */ unsigned short B7B6; /* 纵摇角 (稳定系)*/ }ST_3315_152_NO65; -extern void S3315GetImagePara(unsigned char* pParamDataBuffer, unsigned char* pResultDataBuffer, ARIDLL_INPUTPARA* ImagePara); \ No newline at end of file +extern void S3315GetImagePara(unsigned char* pImageDataBuffer,unsigned char* pParamDataBuffer, unsigned char* pResultDataBuffer, ARIDLL_INPUTPARA* ImagePara); \ No newline at end of file