diff --git a/.gitignore b/.gitignore index 5eff17020..f5d70543d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ build +.vs +CMakeSettings.json CMakeLists.txt.user* CMakeFiles -CMakeCache.txt +CMakeCache.txt \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 197cb04e2..5ffbaf0f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,10 +28,18 @@ elseif (MSVC) add_definitions(-D_USE_MATH_DEFINES -DNOMINMAX) endif() -set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/build) +if(${CMAKE_BUILD_TYPE} MATCHES Debug) +set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/build/Debug) +elseif(${CMAKE_BUILD_TYPE} MATCHES Release) +set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/build/Release) +elseif(${CMAKE_BUILD_TYPE} MATCHES RelWithDebInfo) +set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/build/RelWithDebInfo) +endif() + set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}) set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}) +set(OpenCV_DIR "C:/opencv-4.5.5_and_opencv_contrib-4.5.5/opencv_lib") FIND_PACKAGE(OpenCV REQUIRED) option(SILENT_WORK "Remove all imshow and waitKey functions?" OFF) diff --git a/README.md b/README.md index 7867c9ce4..2c7409b35 100644 --- a/README.md +++ b/README.md @@ -115,14 +115,15 @@ Also you can read [Wiki in Russian](https://github.com/Smorodov/Multitarget-trac #### Build 1. Download project sources 2. Install CMake -3. Install OpenCV (https://github.com/opencv/opencv) and OpenCV contrib (https://github.com/opencv/opencv_contrib) repositories -4. Configure project CmakeLists.txt, set OpenCV_DIR (-DOpenCV_DIR=/path/to/opencv/build). -5. If opencv_contrib don't installed then disable options USE_OCV_BGFG=OFF, USE_OCV_KCF=OFF and USE_OCV_UKF=OFF -6. If you want to use native darknet YOLO detector with CUDA + cuDNN then set BUILD_YOLO_LIB=ON (Install first CUDA and cuDNN libraries from Nvidia) -7. If you want to use YOLO detector with TensorRT then set BUILD_YOLO_TENSORRT=ON (Install first TensorRT library from Nvidia) -8. For building example with low fps detector (now native darknet YOLO detector) and Tracker worked on each frame: BUILD_ASYNC_DETECTOR=ON -9. For building example with line crossing detection (cars counting): BUILD_CARS_COUNTING=ON -10. Go to the build directory and run make +3. Install OpenCV (https://github.com/opencv/opencv) and OpenCV contrib (https://github.com/opencv/opencv_contrib) repositories. [Istallation CMake, OpenCV and OpenCV contrib together](https://www.youtube.com/watch?v=v_76zetw950) +4. Add in Multitarget-tracker\CMakeLists.txt set(OpenCV_DIR "path_to_opencv_build") and configure project CmakeLists.txt +5. It may be necessary to add ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib in missing places namely in the Multitarget-tracker\src\Detector\CMakeLists, Multitarget-tracker\src\Tracker\CMakeLists.txt, ultitarget-tracker\src\Detector\CMakeLists.txt +6. If opencv_contrib don't installed then disable options USE_OCV_BGFG=OFF, USE_OCV_KCF=OFF and USE_OCV_UKF=OFF +7. If you want to use native darknet YOLO detector with CUDA + cuDNN then set BUILD_YOLO_LIB=ON (Install first CUDA and cuDNN libraries from Nvidia) +8. If you want to use YOLO detector with TensorRT then set BUILD_YOLO_TENSORRT=ON (Install first TensorRT library from Nvidia) +9. For building example with low fps detector (now native darknet YOLO detector) and Tracker worked on each frame: BUILD_ASYNC_DETECTOR=ON +10. For building example with line crossing detection (cars counting): BUILD_CARS_COUNTING=ON +11. Go to the build directory and run make **Full build:** @@ -246,4 +247,4 @@ Apache 2.0: [LICENSE text](https://github.com/Smorodov/Multitarget-tracker/blob/ 8. RADEK VOPÁLENSKÝ "DETECTION,TRACKING AND CLASSIFICATION OF VEHICLES", 2018 ( https://www.vutbr.cz/www_base/zav_prace_soubor_verejne.php?file_id=181063 ) 9. Márk Rátosi, Gyula Simon "Real-Time Localization and Tracking using Visible Light Communication", 2018 ( https://ieeexplore.ieee.org/abstract/document/8533800 ) 10. Thi Nha Ngo, Kung-Chin Wu, En-Cheng Yang, Ta-Te Lin "Areal-time imaging system for multiple honey bee tracking and activity monitoring", 2019 ( https://www.sciencedirect.com/science/article/pii/S0168169919301498 ) -11. ROS, http://docs.ros.org/lunar/api/costmap_converter/html/Ctracker_8cpp_source.html +11. ROS, http://docs.ros.org/lunar/api/costmap_converter/html/Ctracker_8cpp_source.html \ No newline at end of file diff --git a/example/main.cpp b/example/main.cpp index 70c8638a9..29a40b16f 100644 --- a/example/main.cpp +++ b/example/main.cpp @@ -23,7 +23,7 @@ static void Help() const char* keys = { - "{ @1 |../data/atrium.avi | movie file | }" + "{ @1 |../../data/atrium.avi | movie file | }" "{ e example |1 | number of example 0 - MouseTracking, 1 - MotionDetector, 2 - FaceDetector, 3 - PedestrianDetector, 4 - OpenCV dnn objects detector, 5 - YOLO Darknet detector, 6 - YOLO TensorRT Detector, 7 - Cars counting | }" "{ sf start_frame |0 | Start a video from this position | }" "{ ef end_frame |0 | Play a video to this position (if 0 then played to the end of file) | }" diff --git a/src/Detector/CMakeLists.txt b/src/Detector/CMakeLists.txt index 230d96dc0..c4b4b17c0 100644 --- a/src/Detector/CMakeLists.txt +++ b/src/Detector/CMakeLists.txt @@ -109,5 +109,6 @@ set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${detector_heade install(TARGETS ${PROJECT_NAME} EXPORT MTTrackingExports LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib + ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME}) diff --git a/src/Tracker/CMakeLists.txt b/src/Tracker/CMakeLists.txt index 42ba83477..f7f1aa328 100644 --- a/src/Tracker/CMakeLists.txt +++ b/src/Tracker/CMakeLists.txt @@ -223,5 +223,6 @@ set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${tracker_header install(TARGETS ${PROJECT_NAME} EXPORT MTTrackingExports LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib + ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME}) diff --git a/thirdparty/inih/CMakeLists.txt b/thirdparty/inih/CMakeLists.txt index 422c8f577..ee6265f0b 100644 --- a/thirdparty/inih/CMakeLists.txt +++ b/thirdparty/inih/CMakeLists.txt @@ -13,5 +13,6 @@ set_target_properties(inih PROPERTIES FOLDER "libs") install(TARGETS ${PROJECT_NAME} EXPORT MTTrackingExports LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib + ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME})