diff --git a/.gitignore b/.gitignore index 1dc0ca2..dd63ac6 100644 --- a/.gitignore +++ b/.gitignore @@ -369,3 +369,8 @@ cmake-build-* tests/runs/* + +DPL/dataset/* + +tests/runs/* + diff --git a/CMakeLists.txt b/CMakeLists.txt index 78cd882..1c8d017 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,25 +18,25 @@ find_package(OpenCV REQUIRED) # 包含 OpenCV 头文件路径 include_directories(${OpenCV_INCLUDE_DIRS}) -# 设置 Qt 路径 -if(DEFINED ENV{Qt6_DIR}) - set(Qt6_DIR ENV{Qt6_DIR}) - message(STATUS "Qt6_DIR set from environment variable: ${Qt6_DIR}") -else() - message(FATAL_ERROR "Qt6_DIR is not set. Please set the Qt6_DIR environment variable.") -endif() -# 查找 Qt6 包 -find_package(Qt6 REQUIRED COMPONENTS Widgets) -# 自动处理 MOC、UIC、RCC -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTOUIC ON) -set(CMAKE_AUTORCC ON) +## 设置 Qt 路径 +#if(DEFINED ENV{Qt6_DIR}) +# set(Qt6_DIR ENV{Qt6_DIR}) +# message(STATUS "Qt6_DIR set from environment variable: ${Qt6_DIR}") +#else() +# message(FATAL_ERROR "Qt6_DIR is not set. Please set the Qt6_DIR environment variable.") +#endif() +## 查找 Qt6 包 +#find_package(Qt6 REQUIRED COMPONENTS Widgets) +## 自动处理 MOC、UIC、RCC +#set(CMAKE_AUTOMOC ON) +#set(CMAKE_AUTOUIC ON) +#set(CMAKE_AUTORCC ON) #配置mil库 -include_directories(E:/QTexamble/matrox/Include) +include_directories("C:/Program Files/Matrox Imaging/MIL/Include") # 添加 MIL 库的库文件路径 -link_directories(E:/QTexamble/matrox/LIB) -file(GLOB MIL_LIBS E:/QTexamble/matrox/LIB/*.lib) +link_directories("C:/Program Files/Matrox Imaging/MIL/LIB") +file(GLOB MIL_LIBS "C:/Program Files/Matrox Imaging/MIL/LIB/*.lib") # 添加子目录 @@ -46,5 +46,5 @@ add_subdirectory(tests) add_executable(opencv_onnx opencv_onnx.cpp) # 链接 OpenCV 和 Qt 库 -target_link_libraries(opencv_onnx Qt6::Widgets ${OpenCV_LIBS} comdlg32) +target_link_libraries(opencv_onnx ${OpenCV_LIBS} comdlg32) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 68c580a..18b08ea 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -8,7 +8,7 @@ add_library(Matrox # 头文件路径 target_include_directories(Matrox PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) # 链接依赖库 -target_link_libraries(Matrox PUBLIC Qt6::Widgets ${OpenCV_LIBS} ${MIL_LIBS}) +target_link_libraries(Matrox PUBLIC ${OpenCV_LIBS} ${MIL_LIBS}) #定义CVDL模块的库 @@ -18,4 +18,4 @@ add_library(CVDL # 头文件路径 target_include_directories(CVDL PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) # 链接依赖库 -target_link_libraries(CVDL PUBLIC Qt6::Widgets Matrox ${OpenCV_LIBS} ${MIL_LIBS}) \ No newline at end of file +target_link_libraries(CVDL PUBLIC Matrox ${OpenCV_LIBS} ${MIL_LIBS}) \ No newline at end of file diff --git a/tests/test_total.cpp b/tests/test_color_range_2threads.cpp similarity index 97% rename from tests/test_total.cpp rename to tests/test_color_range_2threads.cpp index 0ac0f84..52cc23e 100644 --- a/tests/test_total.cpp +++ b/tests/test_color_range_2threads.cpp @@ -67,7 +67,7 @@ int main() { Timer timer1, timer2; std::map params; read_params_from_file("C:\\Users\\ZLSDKJ\\Desktop\\color_range_config.txt", params); - // read_params_from_file("..\\config\\template_color_config.txt", params); + read_params_from_file("..\\config\\template_color_config.txt", params); MIL_ID MilImage = M_NULL, MilHighSatResult = M_NULL, MilTemplateMatchingResult = M_NULL; MbufRestore(IMAGE_DIR, MilSystem, &MilImage); const int iterations_per_thread = 500;