mirror of
https://github.com/Karllzy/cotton_color.git
synced 2025-11-09 11:13:54 +00:00
两线程并修改Cmake去除了qt
This commit is contained in:
parent
80e6aca858
commit
abe7965813
5
.gitignore
vendored
5
.gitignore
vendored
@ -369,3 +369,8 @@ cmake-build-*
|
||||
|
||||
tests/runs/*
|
||||
|
||||
|
||||
DPL/dataset/*
|
||||
|
||||
tests/runs/*
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
|
||||
@ -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})
|
||||
@ -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;
|
||||
Loading…
Reference in New Issue
Block a user