From a9b6a0f95513352fd70afa5deea7db31133924dc Mon Sep 17 00:00:00 2001 From: wangchongwu <759291707@qq.com> Date: Wed, 13 Aug 2025 15:53:09 +0800 Subject: [PATCH] =?UTF-8?q?1.=E8=AF=BB=E5=8F=96=E5=BD=95=E5=83=8F=E7=83=AD?= =?UTF-8?q?=E5=83=8F=E4=BB=AA=E5=8F=82=E6=95=B0=E7=9A=84=E7=84=A6=E8=B7=9D?= =?UTF-8?q?=E5=80=BC=202.=E6=96=B0=E5=A2=9E=E6=9C=80=E5=B0=8F=E5=83=8F?= =?UTF-8?q?=E7=B4=A0=E6=95=B0=E6=8E=A5=E5=8F=A3=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NeoTracker/src/Arith_Detector.cpp | 2 ++ NeoTracker/src/Arith_EOController.cpp | 3 +++ NeoTracker/src/Detect/Arith_DetectSmallObj.cpp | 5 +++++ NeoTracker/src/Detect/Arith_DetectSmallObj.h | 2 +- NeoTracker/tests/TestAPI_SOT_Sky_Y16.cpp | 2 ++ QGuideArithStudio/src/Project/S3315.cpp | 6 +++--- QGuideArithStudio/src/RawFileStream.cpp | 4 ++-- 7 files changed, 18 insertions(+), 6 deletions(-) diff --git a/NeoTracker/src/Arith_Detector.cpp b/NeoTracker/src/Arith_Detector.cpp index 49cd8e1..e8f4e00 100644 --- a/NeoTracker/src/Arith_Detector.cpp +++ b/NeoTracker/src/Arith_Detector.cpp @@ -365,6 +365,8 @@ Param_SkyDetect Detectors::GetParam() para.fSmallDetectGDK = pDST_stPara->fgdk; para.fDimGdk = pDST_stPara->fDimGdk; para.nDetectGrayType = pDST_stPara->nDetectGrayType; + para.nObjSizeMin = pDST_stPara->nObjSizeMin; + para.nObjSizeMax = pDST_stPara->nObjSizeMax; // 面目标参数查询 para.bEnableDetcetAreaTarget = pDAT_Module->getDatDetState(); diff --git a/NeoTracker/src/Arith_EOController.cpp b/NeoTracker/src/Arith_EOController.cpp index c8d94ce..03ed0b2 100644 --- a/NeoTracker/src/Arith_EOController.cpp +++ b/NeoTracker/src/Arith_EOController.cpp @@ -656,6 +656,7 @@ void Arith_EOController::Arith_SetRunTimeParam(ARIDLL_PARMA config) para.nGrayThresMinDark = config.PrmSkyDetect.nGrayThresMinDark; para.nDetectGrayType = config.PrmSkyDetect.nDetectGrayType; para.nDSmpScale = config.PrmSkyDetect.nDSmpScale; + para.nObjSizeMin = config.PrmSkyDetect.nObjSizeMin; g_GLB_Detectors->SetParam(para);//设置参数 // 全局检测器参数共享给局部检测器参数 @@ -762,6 +763,7 @@ ARIDLL_PARMA Arith_EOController::getStructFromFS(cv::FileStorage fs) SAFE_CONFIG_GET(fs, "nDetectGrayType", config.PrmSkyDetect.nDetectGrayType); SAFE_CONFIG_GET(fs, "nDSmpScale", config.PrmSkyDetect.nDSmpScale); SAFE_CONFIG_GET(fs, "bEnLowSkylieSADet", config.PrmSkyDetect.bEnLowSkylieSADet); + SAFE_CONFIG_GET(fs, "nObjSizeMin", config.PrmSkyDetect.nObjSizeMin); // stSkyParam.prmTSkyDet parameters SAFE_CONFIG_GET(fs, "bEnableDetcetAreaTarget", config.stSkyParam.prmTSkyDet.bEnableDetcetAreaTarget); @@ -868,6 +870,7 @@ void Arith_EOController::Arith_ExportParaFile(const char* path) fs << "Sky_nTrackMemFrmNum" << 1000; // 最大记忆帧数 fs << "bEnLowSkylieSADet" << true; // 允许低于天地线小面检测输出,默认允许 fs << "nSmallObjSizeMax" << 36; // 小目标最大像素数 + fs << "nObjSizeMin" << 1; fs << "nPipeRadiusSearch" << 40; // 管道搜索范围直径 -- 搜索 diff --git a/NeoTracker/src/Detect/Arith_DetectSmallObj.cpp b/NeoTracker/src/Detect/Arith_DetectSmallObj.cpp index 09ddd30..d2759b4 100644 --- a/NeoTracker/src/Detect/Arith_DetectSmallObj.cpp +++ b/NeoTracker/src/Detect/Arith_DetectSmallObj.cpp @@ -138,7 +138,12 @@ DST_PARAMETERS* DetectSmallObj::GetDstParm() void DetectSmallObj::setDstParm(Param_SkyDetect* param) { m_DST_stPara.fgdk = param->fSmallDetectGDK; + m_DST_stPara.fDimGdk = param->fDimGdk; m_DST_stPara.nDetectGrayType = param->nDetectGrayType; + + m_DST_stPara.nObjSizeMin = param->nObjSizeMin; + m_DST_stPara.nObjSizeMax = param->nObjSizeMax; + } BBOOL DetectSmallObj::getDstDetState() diff --git a/NeoTracker/src/Detect/Arith_DetectSmallObj.h b/NeoTracker/src/Detect/Arith_DetectSmallObj.h index 1a5f5e1..6d18114 100644 --- a/NeoTracker/src/Detect/Arith_DetectSmallObj.h +++ b/NeoTracker/src/Detect/Arith_DetectSmallObj.h @@ -105,7 +105,7 @@ #define DST_OBJ_SNR_MIN 5.0f//目标SNR下限 //目标大小 -#define DST_OBJ_SIZE_MIN 3 //目标大小下限 +#define DST_OBJ_SIZE_MIN 1 //目标大小下限 //背景标准差限制 #define DST_Bm_STD_LIMIT_MIN 3 //极大值滤波窗口-背景标准差下限 diff --git a/NeoTracker/tests/TestAPI_SOT_Sky_Y16.cpp b/NeoTracker/tests/TestAPI_SOT_Sky_Y16.cpp index 799eb8e..a927e5c 100644 --- a/NeoTracker/tests/TestAPI_SOT_Sky_Y16.cpp +++ b/NeoTracker/tests/TestAPI_SOT_Sky_Y16.cpp @@ -31,6 +31,8 @@ int main() ARIDLL_EOArithInitWithMode(pTracker,nWidth,nHeight,GD_PIXEL_FORMAT_E::GD_PIXEL_FORMAT_GRAY_Y16, GLB_SYS_MODE::GLB_SYS_STARE,GLB_SCEN_MODE::GLB_SCEN_SKY); + ARIDLL_ReadSetParamFile(pTracker, "ArithPara.json"); + // 算法输入部分 ARIDLL_INPUTPARA stInputPara = { 0 }; stInputPara.unFrmId++; diff --git a/QGuideArithStudio/src/Project/S3315.cpp b/QGuideArithStudio/src/Project/S3315.cpp index 4128258..6836026 100644 --- a/QGuideArithStudio/src/Project/S3315.cpp +++ b/QGuideArithStudio/src/Project/S3315.cpp @@ -34,11 +34,11 @@ void S3315GetImagePara(unsigned char* pImageDataBuffer,unsigned char* pParamData 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 = 948; ImagePara->unFreq = 50; - //unsigned short* pIR = ((unsigned short*)pImageDataBuffer); - //ImagePara->stCameraInfo.nFocus = pIR[640 + 64] * 0.1; + // pImageDataBuffer 是热像仪640*513 最后一行是热像仪参数 + unsigned short* pIR = ((unsigned short*)pImageDataBuffer); + ImagePara->stCameraInfo.nFocus = pIR[640 * 512 + 64] * 0.1; diff --git a/QGuideArithStudio/src/RawFileStream.cpp b/QGuideArithStudio/src/RawFileStream.cpp index a357e25..ca48ed3 100644 --- a/QGuideArithStudio/src/RawFileStream.cpp +++ b/QGuideArithStudio/src/RawFileStream.cpp @@ -259,8 +259,8 @@ bool RawFileStream::ReadFrame(BYTE* pFrameData, BYTE* pImageData, BYTE* pParamDa * 640 * 1 0xF1180 No56 * (640 * 4 参数行) */ - memcpy(pParamData, pFrameData + m_lArithReslutDataSize + m_lImageDataSize + 640 * 513, m_lParamDataSize); - memcpy(pImageData, pFrameData + m_lArithReslutDataSize, m_lImageDataSize); + memcpy(pParamData, pFrameData + m_lImageDataSize + 640 * 513, m_lParamDataSize); + memcpy(pImageData, pFrameData, m_lImageDataSize); memcpy(pResultData, pFrameData + m_lImageDataSize , m_lArithReslutDataSize); } unsigned short* pSrc = (unsigned short*)pImageData;