From fdf2a713a8b11850b37ab8c4917f3e5fd6b333fa Mon Sep 17 00:00:00 2001 From: Diogo Andrei Benvenutti Date: Tue, 16 Jan 2018 15:06:25 +0100 Subject: [PATCH 1/3] Add gitignore file --- .gitignore | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4a2eb44 --- /dev/null +++ b/.gitignore @@ -0,0 +1,35 @@ +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + +# Build folder +**/build + +# Temporary user files +**/CMakeLists.txt.user From 55fa85be9d4298a1c61e1a093c6adfe4b476d6ff Mon Sep 17 00:00:00 2001 From: Diogo Andrei Benvenutti Date: Tue, 16 Jan 2018 15:07:40 +0100 Subject: [PATCH 2/3] Refactor CMake script --- CMakeLists.txt | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 53005fe..664adda 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,17 +1,35 @@ -cmake_minimum_required(VERSION 2.8) -project(test) +cmake_minimum_required(VERSION 3.0 FATAL_ERROR) +project(KCF LANGUAGES CXX) -find_package(OpenCV REQUIRED) +## build settings: + +set(CMAKE_CXX_STANDARD 11) + +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the build type" FORCE) +endif() -if(NOT WIN32) -ADD_DEFINITIONS("-std=c++0x -O3") -endif(NOT WIN32) +set(CMAKE_CXX_FLAGS_RELEASE -O3) -include_directories(src) -FILE(GLOB_RECURSE sourcefiles "src/*.cpp") -add_executable( KCF ${sourcefiles} ) -target_link_libraries( KCF ${OpenCV_LIBS}) +## 3rd-party dependencies: + +find_package(OpenCV REQUIRED) +## executable: +set(sources + src/fhog.cpp + src/kcftracker.cpp + src/runtracker.cpp) +set(headers + src/ffttools.hpp + src/fhog.hpp + src/kcftracker.hpp + src/labdata.hpp + src/recttools.hpp + src/tracker.h) +add_executable(${PROJECT_NAME} ${sources} ${headers}) +target_include_directories(${PROJECT_NAME} PUBLIC src) +target_link_libraries(${PROJECT_NAME} PUBLIC ${OpenCV_LIBS}) From d7fdfdf35c460cee00050e73fc566441e5d211be Mon Sep 17 00:00:00 2001 From: Diogo Andrei Benvenutti Date: Tue, 16 Jan 2018 15:15:30 +0100 Subject: [PATCH 3/3] Update compilation instructions on README --- README.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 26e748a..169cdf6 100644 --- a/README.md +++ b/README.md @@ -24,10 +24,15 @@ Description: KCF on HOG and Lab features, ported to C++ OpenCV. The Lab features The CSK tracker [2] is also implemented as a bonus, simply by using raw grayscale as features (the filter becomes single-channel). ### Compilation instructions ### -There are no external dependencies other than OpenCV 3.0.0. Tested on a freshly installed Ubuntu 14.04. -1) cmake CMakeLists.txt -2) make +There are no external dependencies other than [OpenCV](https://opencv.org/) 3.0.0. Tested on a freshly installed Ubuntu 14.04. It is recommended to do an *out-of-source* build, as in: + +```shh +KCFcpp$ mkdir build +KCFcpp$ cd build +KCFcpp/build$ cmake .. +KCFcpp/build$ cmake --build . +``` ### Running instructions ### @@ -45,7 +50,7 @@ fixed_window - Keep the window size fixed when in single-scale mode (multi-scale show - Show the results in a window. To include it in your project, without the VOT toolkit you just need to: - + // Create the KCFTracker object with one of the available options KCFTracker tracker(HOG, FIXEDWINDOW, MULTISCALE, LAB);