1- cmake_minimum_required (VERSION 3.5 )
2-
3- project (mtracking)
4-
5- set (main_sources nms.h defines.h)
6-
7- set (detector_sources
8- Detector/BaseDetector.cpp
9- Detector/MotionDetector.cpp
10- Detector/BackgroundSubtract.cpp
11- Detector/vibe_src/vibe.cpp
12- Detector/Subsense/BackgroundSubtractorLBSP.cpp
13- Detector/Subsense/BackgroundSubtractorLOBSTER.cpp
14- Detector/Subsense/BackgroundSubtractorSuBSENSE.cpp
15- Detector/Subsense/LBSP.cpp
16- Detector/FaceDetector.cpp
17- Detector/PedestrianDetector.cpp
18- Detector/pedestrians/c4-pedestrian-detector.cpp
19- Detector/SSDMobileNetDetector.cpp
20- Detector/YoloDetector.cpp
21-
22- Detector/BaseDetector.h
23- Detector/MotionDetector.h
24- Detector/BackgroundSubtract.h
25- Detector/vibe_src/vibe.hpp
26- Detector/Subsense/BackgroundSubtractorLBSP.h
27- Detector/Subsense/BackgroundSubtractorLOBSTER.h
28- Detector/Subsense/BackgroundSubtractorSuBSENSE.h
29- Detector/Subsense/DistanceUtils.h
30- Detector/Subsense/LBSP.h
31- Detector/Subsense/RandUtils.h
32- Detector/FaceDetector.h
33- Detector/PedestrianDetector.h
34- Detector/pedestrians/c4-pedestrian-detector.h
35- Detector/SSDMobileNetDetector.h
36- Detector/YoloDetector.h
37- )
38-
39- if (BUILD_YOLO_LIB)
40- set (detector_sources ${detector_sources} Detector/YoloDarknetDetector.cpp Detector/YoloDarknetDetector.h)
41- endif ()
42-
43- if (BUILD_YOLO_TENSORRT)
44- set (detector_sources ${detector_sources} Detector/YoloTensorRTDetector.cpp Detector/YoloTensorRTDetector.h)
45- endif ()
46-
47- set (tracker_sources
48- Tracker/Ctracker.cpp
49- Tracker/Ctracker.h
50- Tracker/ShortPathCalculator.cpp
51- Tracker/ShortPathCalculator.h
52- Tracker/track.cpp
53- Tracker/track.h
54- Tracker/Kalman.cpp
55- Tracker/Kalman.h
56-
57- Tracker/HungarianAlg/HungarianAlg.cpp
58- Tracker/HungarianAlg/HungarianAlg.h
59-
60- Tracker/muSSP/Graph.cpp
61- Tracker/muSSP/Node.cpp
62- Tracker/muSSP/Sink.cpp
63- Tracker/muSSP/Sink.h
64- Tracker/muSSP/Node.h
65- Tracker/muSSP/Graph.h
66-
67- Tracker/VOTTracker.hpp
68- Tracker/dat/dat_tracker.cpp
69- Tracker/dat/dat_tracker.hpp
70- )
71-
72- if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm|ARM|aarch64|AARCH64" )
73-
74- else ()
75- set (tracker_sources ${tracker_sources}
76- Tracker/staple/fhog.cpp
77- Tracker/staple/fhog.h
78- Tracker/staple/sse.hpp
79- Tracker/staple/staple_tracker.cpp
80- Tracker/staple/staple_tracker.hpp
81-
82- Tracker/ldes/correlation.cpp
83- Tracker/ldes/correlation.h
84- Tracker/ldes/fft_functions.cpp
85- Tracker/ldes/fft_functions.h
86- Tracker/ldes/fhog.cpp
87- Tracker/ldes/fhog.hpp
88- Tracker/ldes/hann.cpp
89- Tracker/ldes/hann.h
90- Tracker/ldes/ldes_tracker.cpp
91- Tracker/ldes/ldes_tracker.h
92- )
93- add_definitions (-DUSE_STAPLE_TRACKER )
94- endif ()
95-
96- set (graph_source
97- Tracker/graph/tokenise.cpp
98- # Tracker/graph/script.cpp
99- # Tracker/graph/rings.cpp
100- Tracker/graph/mytree.cpp
101- Tracker/graph/mygraph.cpp
102- Tracker/graph/mwbmatching.cpp
103- Tracker/graph/mincut.cpp
104- Tracker/graph/gport.cpp
105- # Tracker/graph/gml2nestedsql.cpp
106- # Tracker/graph/gml2dot.cpp
107- # Tracker/graph/components.cpp
108- Tracker/graph/fheap.c
109- )
110-
111- set (graph_header
112- Tracker/graph/tokenise.h
113- Tracker/graph/mytree.h
114- Tracker/graph/mygraph.h
115- Tracker/graph/mwbmatching.h
116- Tracker/graph/mincut.h
117- Tracker/graph/gport.h
118- Tracker/graph/gdefs.h
119- Tracker/graph/fheap.h
120- )
121-
122- set (gtl_source
123- Tracker/graph/GTL/src/bellman_ford.cpp
124- Tracker/graph/GTL/src/bfs.cpp
125- Tracker/graph/GTL/src/biconnectivity.cpp
126- Tracker/graph/GTL/src/bid_dijkstra.cpp
127- Tracker/graph/GTL/src/components.cpp
128- Tracker/graph/GTL/src/debug.cpp
129- Tracker/graph/GTL/src/dfs.cpp
130- Tracker/graph/GTL/src/dijkstra.cpp
131- Tracker/graph/GTL/src/edge.cpp
132- Tracker/graph/GTL/src/embedding.cpp
133- Tracker/graph/GTL/src/fm_partition.cpp
134- Tracker/graph/GTL/src/gml_parser.cpp
135- Tracker/graph/GTL/src/gml_scanner.cpp
136- Tracker/graph/GTL/src/graph.cpp
137- Tracker/graph/GTL/src/maxflow_ff.cpp
138- Tracker/graph/GTL/src/maxflow_pp.cpp
139- Tracker/graph/GTL/src/maxflow_sap.cpp
140- Tracker/graph/GTL/src/min_tree.cpp
141- Tracker/graph/GTL/src/node.cpp
142- Tracker/graph/GTL/src/planarity.cpp
143- Tracker/graph/GTL/src/pq_node.cpp
144- Tracker/graph/GTL/src/pq_tree.cpp
145- Tracker/graph/GTL/src/ratio_cut_partition.cpp
146- Tracker/graph/GTL/src/st_number.cpp
147- Tracker/graph/GTL/src/topsort.cpp
148- )
149-
150- set (gtl_header
151- Tracker/graph/GTL/include/GTL/algorithm.h
152- Tracker/graph/GTL/include/GTL/bellman_ford.h
153- Tracker/graph/GTL/include/GTL/bfs.h
154- Tracker/graph/GTL/include/GTL/biconnectivity.h
155- Tracker/graph/GTL/include/GTL/bid_dijkstra.h
156- Tracker/graph/GTL/include/GTL/bin_heap.h
157- Tracker/graph/GTL/include/GTL/components.h
158- Tracker/graph/GTL/include/GTL/debug.h
159- Tracker/graph/GTL/include/GTL/dfs.h
160- Tracker/graph/GTL/include/GTL/dijkstra.h
161- Tracker/graph/GTL/include/GTL/edge.h
162- Tracker/graph/GTL/include/GTL/edge_data.h
163- Tracker/graph/GTL/include/GTL/edge_map.h
164- Tracker/graph/GTL/include/GTL/embedding.h
165- Tracker/graph/GTL/include/GTL/fm_partition.h
166- Tracker/graph/GTL/include/GTL/gml_parser.h
167- Tracker/graph/GTL/include/GTL/gml_scanner.h
168- Tracker/graph/GTL/include/GTL/graph.h
169- Tracker/graph/GTL/include/GTL/maxflow_ff.h
170- Tracker/graph/GTL/include/GTL/maxflow_pp.h
171- Tracker/graph/GTL/include/GTL/maxflow_sap.h
172- Tracker/graph/GTL/include/GTL/min_tree.h
173- Tracker/graph/GTL/include/GTL/ne_map.h
174- Tracker/graph/GTL/include/GTL/node.h
175- Tracker/graph/GTL/include/GTL/node_data.h
176- Tracker/graph/GTL/include/GTL/node_map.h
177- Tracker/graph/GTL/include/GTL/planarity.h
178- Tracker/graph/GTL/include/GTL/pq_node.h
179- Tracker/graph/GTL/include/GTL/pq_tree.h
180- Tracker/graph/GTL/include/GTL/ratio_cut_partition.h
181- Tracker/graph/GTL/include/GTL/st_number.h
182- Tracker/graph/GTL/include/GTL/symlist.h
183- Tracker/graph/GTL/include/GTL/topsort.h
184- Tracker/graph/GTL/include/GTL/version.h
185- Tracker/graph/GTL/include/GTL/GTL.h
186- )
187-
188- SOURCE_GROUP ("Src" FILES ${main_sources} )
189- SOURCE_GROUP ("Detector" FILES ${detector_sources} )
190- SOURCE_GROUP ("Tracker" FILES ${tracker_sources} )
191-
192- SOURCE_GROUP ("Tracker/graph" FILES ${graph_source} ${graph_header} )
193- SOURCE_GROUP ("Tracker/GTL" FILES ${gtl_source} ${gtl_header} )
194-
195- include (CheckIncludeFileCXX )
196- check_include_file_cxx (opencv2/bgsegm.hpp HAVE_OPENCV_CONTRIB )
197- if (HAVE_OPENCV_CONTRIB)
198- add_definitions (-DHAVE_OPENCV_CONTRIB )
199-
200- option (USE_OCV_BGFG "Should use the bgfg algorithms from opencv_contrib?" ON )
201- option (USE_OCV_KCF "Should use the KCF tracker from opencv_contrib for collisions resolving?" ON )
202-
203- else (HAVE_OPENCV_CONTRIB )
204-
205- option (USE_OCV_BGFG "Should use the bgfg algorithms from opencv_contrib?" OFF )
206- option (USE_OCV_KCF "Should use the KCF tracker from opencv_contrib for collisions resolving?" OFF )
207-
208- endif (HAVE_OPENCV_CONTRIB )
209-
210- option (USE_OCV_UKF "Should use the Unscented Kalman Filterr from opencv_contrib?" OFF )
211-
212- if (USE_OCV_UKF)
213- add_definitions (-DUSE_OCV_UKF )
214- else ()
215- remove_definitions (-DUSE_OCV_UKF )
216- endif (USE_OCV_UKF )
217-
218- if (USE_OCV_KCF)
219- add_definitions (-DUSE_OCV_KCF )
220- else ()
221- remove_definitions (-DUSE_OCV_KCF )
222- endif (USE_OCV_KCF )
223-
224- if (USE_OCV_BGFG)
225- add_definitions (-DUSE_OCV_BGFG )
226- else ()
227- remove_definitions (-DUSE_OCV_BGFG )
228- endif (USE_OCV_BGFG )
229-
230-
231- include_directories (${PROJECT_SOURCE_DIR} )
232- include_directories (${PROJECT_SOURCE_DIR} /../src )
233- include_directories (${PROJECT_SOURCE_DIR} /Tracker )
234- include_directories (${PROJECT_SOURCE_DIR} /Tracker/graph )
235- include_directories (${PROJECT_SOURCE_DIR} /Tracker/graph/GTL/include )
236-
237-
238- if (CMAKE_COMPILER_IS_GNUCXX)
239- add_library (${PROJECT_NAME} SHARED
240- ${main_sources}
241- ${detector_sources}
242- ${tracker_sources}
243- ${graph_source} ${graph_header}
244- ${gtl_source} ${gtl_header} )
245- else (CMAKE_COMPILER_IS_GNUCXX )
246- add_library (${PROJECT_NAME}
247- ${main_sources}
248- ${detector_sources}
249- ${tracker_sources}
250- ${graph_source} ${graph_header}
251- ${gtl_source} ${gtl_header} )
252- endif ()
253-
254- if (CMAKE_COMPILER_IS_GNUCXX)
255- set (LIBS
256- ${OpenCV_LIBS}
257- # iconv
258- )
259- else (CMAKE_COMPILER_IS_GNUCXX )
260- set (LIBS
261- ${OpenCV_LIBS}
262- )
263- endif ()
264-
265- if (BUILD_YOLO_LIB)
266- set (LIBS ${LIBS} yolo_lib)
267- endif (BUILD_YOLO_LIB )
268-
269- if (BUILD_YOLO_TENSORRT)
270- set (LIBS ${LIBS} yolo_rt_lib)
271- endif (BUILD_YOLO_TENSORRT )
272-
273-
274- target_link_libraries (${PROJECT_NAME} ${LIBS} )
275-
1+ add_subdirectory (Detector )
2+ add_subdirectory (Tracker )
0 commit comments