forked from yuchenqiaqia/uavgp_vision
-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
159 lines (137 loc) · 4.69 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
cmake_minimum_required(VERSION 2.8)
project( uavgp_vision )
##set build mode;
set(CMAKE_BUILD_TYPE RELEASE)
## Find catkin macros and libraries,添加catkin的包
find_package(catkin REQUIRED COMPONENTS
#message_generation
#rospy
#roscpp
std_msgs
sensor_msgs
geometry_msgs
cv_bridge
image_transport
)
# include_directories(include),添加catkin的包含目录
include_directories(
${catkin_INCLUDE_DIRS}
)
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
)
##OpenCV
find_package( OpenCV REQUIRED )
include_directories(${OpenCV_INCLUDE_DIRS})
#PCL
find_package(PCL REQUIRED)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
#set include files;
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/include
${PROJECT_BINARY_DIR}
)
#set include files: *.h, *.hpp, *.hh;
#FILE(GLOB_RECURSE PROJECT_HEADERS )
# set OCR and output txt directory path
set(OCR_DIR_PATH ${PROJECT_SOURCE_DIR})
set(TXT_FILE_PATH ${PROJECT_SOURCE_DIR})
configure_file(
${PROJECT_SOURCE_DIR}/cmake_config/project_path_config.h.in
${PROJECT_BINARY_DIR}/project_path_config.h
)
#--------------------------------------------------------------------
# 标识物识别
add_executable( vision_result_publisher
./src/MarkDetection/main.cpp
./src/MarkDetection/Publish.cpp
./src/MarkDetection/Functions.cpp
./src/MarkDetection/KNN_OCR.cpp
./src/MarkDetection/preprocessing.cpp
./src/MarkDetection/ReadOfflineData.cpp
./src/MarkDetection/JudgeRectKind.cpp
./src/MarkDetection/RectDectByStatisticsError.cpp
./src/MarkDetection/SubscribeAndSave.cpp
./src/MarkDetection/CameraCoordinate2NegCoordinate.cpp
./src/PointGrayCameraCapture/OpenCamera.cpp
./include/declare.h
./include/define.h
./include/KNN_OCR.h
./include/preprocessing.h
./include/DisplayScreenProcess.h
./src/MarkDetection/DisplayScreenProcess.cpp
)
#OpenCV库
target_link_libraries(vision_result_publisher ${OpenCV_LIBRARIES} )
#添加多线程第三方库
target_link_libraries(vision_result_publisher -lpthread)
#catkin需要的库
target_link_libraries(vision_result_publisher ${catkin_LIBRARIES})
#-------------------------------------------------------------------
# 相机采集
add_executable( camera_publisher
./src/PointGrayCameraCapture/AutoSetExposureTime.cpp
./src/PointGrayCameraCapture/FlyCapture2.cpp
./include/FlyCapture2.h
./src/PointGrayCameraCapture/DetectRectToGetImageLightness.cpp
./src/PointGrayCameraCapture/DetectRectToGetImageLightness.h
)
#添加point gray相机动态链接库
target_link_libraries(camera_publisher flycapture)
#OpenCV库
target_link_libraries( camera_publisher ${OpenCV_LIBRARIES} )
#添加多线程第三方库
target_link_libraries(camera_publisher -lpthread)
#catkin需要的库
target_link_libraries(camera_publisher ${catkin_LIBRARIES})
#--------------------------------------------------------------------
# raw data save
add_executable( save_raw_data
./src/RawDataSave/RawDataSave.cpp
)
#OpenCV库
target_link_libraries( save_raw_data ${OpenCV_LIBRARIES} )
#catkin需要的库
target_link_libraries(save_raw_data ${catkin_LIBRARIES})
#--------------------------------------------------------------------
# read offline data and publish
add_executable( read_offline_data
./src/ReadOfflineData/ReadOfflineData.cpp
)
#OpenCV库
target_link_libraries( read_offline_data ${OpenCV_LIBRARIES} )
#catkin需要的库
target_link_libraries(read_offline_data ${catkin_LIBRARIES})
#--------------------------------------------------------------------
# DJI guidance capture
link_directories(${PROJECT_SOURCE_DIR}/lib/x64)
link_directories(${PROJECT_SOURCE_DIR}/lib/XU3)
include_directories(${PROJECT_SOURCE_DIR}/include)
add_executable(guidance_capture
${PROJECT_SOURCE_DIR}/src/GuidanceCapture/GuidanceNode.cpp
${PROJECT_SOURCE_DIR}/src/GuidanceCapture/DJI_utility.cpp
)
target_link_libraries(guidance_capture DJI_guidance usb-1.0 ${catkin_LIBRARIES} ${OpenCV_LIBS})
#-------------------------------------------------------------------
# guidance 数据处理
add_executable( guidance_data_process
./src/StereoProcess/StereoApperceive.cpp
./src/StereoProcess/PointCloudProcessing.cpp
./src/StereoProcess/StereoMatching.cpp
./src/StereoProcess/GetROI_AverageVal.cpp
./src/StereoProcess/ImageSegmentation.cpp
./src/StereoProcess/main.cpp
./include/declare.h
./include/StereoMatching.h
)
#OpenCV库
target_link_libraries( guidance_data_process ${OpenCV_LIBS} )
#添加多线程第三方库
target_link_libraries(guidance_data_process -lpthread)
#catkin需要的库
target_link_libraries(guidance_data_process ${catkin_LIBRARIES})
#PCL库
target_link_libraries(guidance_data_process ${PCL_LIBRARIES})
#----------------------------------------------------------------------