From a7c5f4fec511028b6d231534c91d5e87392725f1 Mon Sep 17 00:00:00 2001 From: zjc-zjc-123 <1714105370@qq.com> Date: Wed, 20 Nov 2024 19:54:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=8611=E6=9C=8821?= =?UTF-8?q?=E6=97=A5=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Matrox/template_matching.cpp | 11 ++++++++++- tests/test_template_matching.cpp | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Matrox/template_matching.cpp b/src/Matrox/template_matching.cpp index e959513..8d24a69 100644 --- a/src/Matrox/template_matching.cpp +++ b/src/Matrox/template_matching.cpp @@ -181,10 +181,19 @@ class TemplateMatcher { }; -void template_matching(const MIL_ID& inputImage, MIL_ID& outputImage, const map& params) { +void test_template_matching(const MIL_ID& inputImage, MIL_ID& outputImage, const map& params) { // Create a TemplateMatcher instance TemplateMatcher matcher(MilSystem, MilDisplay); + //TODO: 1加入加载多个模板的功能 + //TODO: 2加入配置文件解析功能,解析后的文件与当前的para map兼容 + // 配置文件当中加入是否显示参数,能调控加载模板的过程是否显示。 + //TODO: 3修改当前的代码使模板匹配不出错 + //TODO: 4成立模板文件夹,能够加载文件夹下的全部模板并实现检测 + //TODO: 5制作标准结构的函数,例如:matcher.findModels(MIL_ID inputImage, MIL_ID output_image, map); + //TODO: 6完善相应部分的手册 + + // Load template models vector template_paths = {"C:\\Users\\zjc\\Desktop\\template1.png", "C:\\Users\\zjc\\Desktop\\template1.png", diff --git a/tests/test_template_matching.cpp b/tests/test_template_matching.cpp index c8d6725..792c152 100644 --- a/tests/test_template_matching.cpp +++ b/tests/test_template_matching.cpp @@ -48,7 +48,7 @@ int main() { // Measure execution time measure_execution_time([&]() { pre_process(MilImage, detection_result, params); - template_matching(detection_result, detection_result, params); + test_template_matching(detection_result, detection_result, params); }); MbufSave(SAVE_PATH, detection_result); // Display result