From fd368e169ba986445c7eb3f8e6b2ab42c7dd66e6 Mon Sep 17 00:00:00 2001 From: zjc-zjc-123 <1714105370@qq.com> Date: Thu, 28 Nov 2024 14:10:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A8=A1=E6=9D=BF=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=E4=BD=8D=E6=B7=B1=E7=9A=84=E5=B0=8Fbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Matrox/template_matching.cpp | 6 +++--- tests/test_template_matching.cpp | 2 +- tests/test_total.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Matrox/template_matching.cpp b/src/Matrox/template_matching.cpp index 377acbc..457353d 100644 --- a/src/Matrox/template_matching.cpp +++ b/src/Matrox/template_matching.cpp @@ -147,7 +147,7 @@ void TemplateMatcher::findModels(const MIL_ID& inputImage,MIL_ID& outputImage) // Create a binary image buffer MbufAlloc2d(MilSystem, MbufInquire(inputImage, M_SIZE_X, M_NULL), - MbufInquire(inputImage, M_SIZE_Y, M_NULL), 8 + M_UNSIGNED, + MbufInquire(inputImage, M_SIZE_Y, M_NULL), 1 + M_UNSIGNED, M_IMAGE + M_PROC, &outputImage); // Initialize the binary image to black MbufClear(outputImage, 0); @@ -252,12 +252,12 @@ void TemplateMatcher::predict(const MIL_ID &inputImage, MIL_ID &outputImage, con if (do_resize) { MIL_ID detection_resize, output_image_unresize; MbufAlloc2d(MilSystem, MbufInquire(detection_result, M_SIZE_X, M_NULL)/2, - MbufInquire(detection_result, M_SIZE_Y, M_NULL)/2, 1 + M_UNSIGNED, + MbufInquire(detection_result, M_SIZE_Y, M_NULL)/2, 8 + M_UNSIGNED, M_IMAGE + M_PROC, &detection_resize); MimResize(detection_result,detection_resize,0.5,0.5,M_DEFAULT); this->FindTemplates(detection_resize,output_image_unresize, params); MbufAlloc2d(MilSystem, MbufInquire(detection_result, M_SIZE_X, M_NULL), - MbufInquire(detection_result, M_SIZE_Y, M_NULL), 1 + M_UNSIGNED, + MbufInquire(detection_result, M_SIZE_Y, M_NULL), 8 + M_UNSIGNED, M_IMAGE + M_PROC, &outputImage); MimResize(output_image_unresize,outputImage,2,2,M_DEFAULT); MbufFree(detection_result); diff --git a/tests/test_template_matching.cpp b/tests/test_template_matching.cpp index 14053cd..dd2010e 100644 --- a/tests/test_template_matching.cpp +++ b/tests/test_template_matching.cpp @@ -54,7 +54,7 @@ void LoadImagesFromFolder(const std::string& folderPath) { pre_process(MilImage, detection_result, params); MbufAlloc2d(MilSystem, MbufInquire(detection_result, M_SIZE_X, M_NULL)/2, - MbufInquire(detection_result, M_SIZE_Y, M_NULL)/2, 1 + M_UNSIGNED, + MbufInquire(detection_result, M_SIZE_Y, M_NULL)/2, 8 + M_UNSIGNED, M_IMAGE + M_PROC, &detection_resize); MimResize(detection_result,detection_resize,0.5,0.5,M_DEFAULT); matcher.FindTemplates(detection_resize,output_Image,params); diff --git a/tests/test_total.cpp b/tests/test_total.cpp index f36e7d5..6a26688 100644 --- a/tests/test_total.cpp +++ b/tests/test_total.cpp @@ -18,7 +18,7 @@ #define IMAGE_DIR MIL_TEXT(".\\test_imgs\\cotton_image_new") // 文件夹路径 #define run_high_sat true; -#define run_templating false; +#define run_templating true; #define run_deep_learning true; MIL_ID MilApplication, MilSystem, MilDisplay;