两线程并修改Cmake去除了qt

This commit is contained in:
ZhenyeLi 2024-12-09 16:13:30 +08:00
parent 80e6aca858
commit abe7965813
4 changed files with 25 additions and 20 deletions

5
.gitignore vendored
View File

@ -369,3 +369,8 @@ cmake-build-*
tests/runs/*
DPL/dataset/*
tests/runs/*

View File

@ -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)
# MOCUICRCC
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)
## MOCUICRCC
#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)

View File

@ -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})
target_link_libraries(CVDL PUBLIC Matrox ${OpenCV_LIBS} ${MIL_LIBS})

View File

@ -67,7 +67,7 @@ int main() {
Timer timer1, timer2;
std::map<std::string, int> 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;