├── data └── tests │ ├── core │ ├── test_file.txt │ ├── folder_test │ │ ├── folder_test_file1.txt │ │ ├── folder_test_file2.txt │ │ ├── folder_test_file3.txt │ │ ├── sub_folder_test1 │ │ │ └── folder_test_file1.txt │ │ ├── sub_folder_test2 │ │ │ └── folder_test_file1.txt │ │ └── sub_folder_test3 │ │ │ └── folder_test_file1.txt │ ├── output.log │ ├── kmeans_.yml │ ├── firefly.yml │ └── parameters.yml │ ├── ml │ ├── diag2.png │ ├── Lena_bw.png │ ├── oaaData.yml │ └── firefly.yml │ └── descriptors │ ├── bic.png │ ├── hog.png │ ├── diag2.png │ ├── glcm.png │ ├── hog1.png │ ├── lena.jpg │ ├── Lena_bw.png │ ├── cooc_img.jpg │ ├── person23_running_d4_uncomp.avi │ └── hog1_expected.yml ├── Testing └── Temporary │ ├── CTestCostData.txt │ └── LastTest.log ├── doc ├── CMakeLists.txt └── doxygen │ ├── ssf_logo_bitmap.png │ ├── doxyfile.in │ └── CMakeLists.txt ├── scripts ├── README.md ├── data │ ├── ssiglib_template_test.tcpp │ ├── ssiglib_template_header.thpp │ ├── ssiglib_template_source.tcpp │ └── ssiglib_template_license.txt └── update_license.py ├── puppet ├── modules │ ├── clang │ │ └── manifests │ │ │ └── init.pp │ ├── cmake │ │ └── manifests │ │ │ └── init.pp │ └── opencv │ │ └── manifests │ │ └── init.pp └── manifests │ └── site.pp ├── 3rdparty ├── hayai-1.1.0 │ ├── include │ │ └── hayai │ │ │ ├── hayai_fixture.hpp │ │ │ ├── hayai_compatibility.hpp │ │ │ ├── hayai_test_factory.hpp │ │ │ ├── hayai_default_test_factory.hpp │ │ │ └── hayai_test.hpp │ ├── src │ │ └── hayai_posix_main.cpp │ └── CMakeLists.txt ├── flann-1.8.4 │ ├── CMakeLists.txt │ └── include │ │ └── flann │ │ ├── mpi │ │ ├── flann_mpi_server.cpp │ │ ├── flann_mpi_client.cpp │ │ ├── matrix.h │ │ ├── client.h │ │ └── queries.h │ │ ├── flann_cpp.cpp │ │ ├── config.h │ │ ├── config.h.in │ │ ├── util │ │ ├── timer.h │ │ ├── sampling.h │ │ └── object_factory.h │ │ └── nn │ │ └── ground_truth.h ├── libsvm-3.21 │ └── CMakeLists.txt ├── CMakeLists.txt └── gtest-1.7.0 │ ├── src │ ├── gtest_main.cc │ └── gtest-all.cc │ ├── include │ └── gtest │ │ └── gtest_prod.h │ └── CMakeLists.txt ├── cmake ├── SSIGUtil.cmake ├── SSIGOpenCVUtil.cmake └── SSIGCudaUtil.cmake ├── modules ├── CMakeLists.txt ├── ml │ ├── src │ │ ├── embedding.cpp │ │ ├── multiclass.cpp │ │ └── pca_embedding.cpp │ ├── test │ │ ├── test_main.cpp │ │ ├── test_stacked_pls.cpp │ │ ├── test_spectral_embedding.cpp │ │ └── test_pca_embedding.cpp │ └── include │ │ └── ssiglib │ │ └── ml │ │ ├── multiclass.hpp │ │ ├── ml_defs.hpp │ │ ├── spatial_pyramid.hpp │ │ ├── embedding.hpp │ │ └── pca_embedding.hpp ├── video │ ├── test │ │ └── test_main.cpp │ ├── include │ │ └── ssiglib │ │ │ └── video │ │ │ ├── video.hpp │ │ │ └── video_defs.hpp │ └── src │ │ └── video.cpp ├── core │ ├── test │ │ ├── test_main.cpp │ │ ├── test_cube.cpp │ │ └── test_sampling.cpp │ ├── src │ │ ├── resource.cpp │ │ ├── base_object.cpp │ │ └── exception.cpp │ └── include │ │ └── ssiglib │ │ └── core │ │ ├── core_defs.hpp │ │ ├── base_object.hpp │ │ ├── resource.hpp │ │ └── exception.hpp ├── hashing │ ├── test │ │ └── test_hashing.cpp │ └── include │ │ └── ssiglib │ │ └── hashing │ │ ├── hashing_defs.hpp │ │ ├── plsh.hpp │ │ └── eplsh.hpp └── descriptors │ ├── test │ ├── test_main.cpp │ ├── test_bic.cpp │ ├── test_lbp.cpp │ ├── test_dalal_mbh.cpp │ ├── test_hog_uoccti.cpp │ └── test_hsv.cpp │ ├── descriptor.cpp │ ├── descriptor.hpp │ ├── src │ └── descriptor.cpp │ ├── include │ └── ssiglib │ │ └── descriptors │ │ ├── descriptors_defs.hpp │ │ ├── descriptor.hpp │ │ ├── co_occurrence.hpp │ │ ├── bic_features.hpp │ │ ├── haralick.hpp │ │ └── lbp_features.hpp │ └── perf │ └── perf_haralick.cpp ├── codecov.yml ├── .travis.yml ├── .travis.sh ├── README.md ├── LICENSE └── appveyor.yml /data/tests/core/test_file.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Testing/Temporary/CTestCostData.txt: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /doc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(doxygen) -------------------------------------------------------------------------------- /data/tests/core/folder_test/folder_test_file1.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/tests/core/folder_test/folder_test_file2.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/tests/core/folder_test/folder_test_file3.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/tests/core/folder_test/sub_folder_test1/folder_test_file1.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/tests/core/folder_test/sub_folder_test2/folder_test_file1.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/tests/core/folder_test/sub_folder_test3/folder_test_file1.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/tests/core/output.log: -------------------------------------------------------------------------------- 1 | message info 2 | message error 3 | message debug 4 | message warning 5 | -------------------------------------------------------------------------------- /data/tests/ml/diag2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartsenselab/ssiglib/HEAD/data/tests/ml/diag2.png -------------------------------------------------------------------------------- /scripts/README.md: -------------------------------------------------------------------------------- 1 | usage: python ssf_class_generate.py -m module-name -n class-name -f file-name 2 | -------------------------------------------------------------------------------- /data/tests/ml/Lena_bw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartsenselab/ssiglib/HEAD/data/tests/ml/Lena_bw.png -------------------------------------------------------------------------------- /data/tests/descriptors/bic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartsenselab/ssiglib/HEAD/data/tests/descriptors/bic.png -------------------------------------------------------------------------------- /data/tests/descriptors/hog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartsenselab/ssiglib/HEAD/data/tests/descriptors/hog.png -------------------------------------------------------------------------------- /data/tests/descriptors/diag2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartsenselab/ssiglib/HEAD/data/tests/descriptors/diag2.png -------------------------------------------------------------------------------- /data/tests/descriptors/glcm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartsenselab/ssiglib/HEAD/data/tests/descriptors/glcm.png -------------------------------------------------------------------------------- /data/tests/descriptors/hog1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartsenselab/ssiglib/HEAD/data/tests/descriptors/hog1.png -------------------------------------------------------------------------------- /data/tests/descriptors/lena.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartsenselab/ssiglib/HEAD/data/tests/descriptors/lena.jpg -------------------------------------------------------------------------------- /doc/doxygen/ssf_logo_bitmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartsenselab/ssiglib/HEAD/doc/doxygen/ssf_logo_bitmap.png -------------------------------------------------------------------------------- /data/tests/descriptors/Lena_bw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartsenselab/ssiglib/HEAD/data/tests/descriptors/Lena_bw.png -------------------------------------------------------------------------------- /data/tests/descriptors/cooc_img.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartsenselab/ssiglib/HEAD/data/tests/descriptors/cooc_img.jpg -------------------------------------------------------------------------------- /data/tests/descriptors/person23_running_d4_uncomp.avi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartsenselab/ssiglib/HEAD/data/tests/descriptors/person23_running_d4_uncomp.avi -------------------------------------------------------------------------------- /data/tests/core/kmeans_.yml: -------------------------------------------------------------------------------- 1 | %YAML:1.0 2 | root: 3 | Centroids: !!opencv-matrix 4 | rows: 2 5 | cols: 2 6 | dt: f 7 | data: [ 2., 1., 102., 103. ] 8 | -------------------------------------------------------------------------------- /puppet/modules/clang/manifests/init.pp: -------------------------------------------------------------------------------- 1 | #Install clang 2 | class clang{ 3 | 4 | $packages = [ 5 | 'clang', 6 | ] 7 | 8 | package { $packages: ensure => latest } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /puppet/modules/cmake/manifests/init.pp: -------------------------------------------------------------------------------- 1 | #Install cmake 2 | class cmake{ 3 | 4 | $packages = [ 5 | 'cmake', 6 | ] 7 | 8 | package { $packages: ensure => latest } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /Testing/Temporary/LastTest.log: -------------------------------------------------------------------------------- 1 | Start testing: Jun 29 19:07 Hora oficial do Brasil 2 | ---------------------------------------------------------- 3 | End testing: Jun 29 19:07 Hora oficial do Brasil 4 | -------------------------------------------------------------------------------- /3rdparty/hayai-1.1.0/include/hayai/hayai_fixture.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __HAYAI_FIXTURE 2 | #define __HAYAI_FIXTURE 3 | #include "hayai_test.hpp" 4 | 5 | namespace hayai 6 | { 7 | typedef Test Fixture; 8 | } 9 | #endif 10 | -------------------------------------------------------------------------------- /scripts/data/ssiglib_template_test.tcpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "ssiglib/{module}/{file_name}.hpp" 3 | 4 | TEST({class_name}, Sample{class_name}) {{ 5 | // Automatically generated stub 6 | 7 | EXPECT_EQ(2, 2 + 2); 8 | }} 9 | -------------------------------------------------------------------------------- /3rdparty/hayai-1.1.0/include/hayai/hayai_compatibility.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __HAYAI_COMPATIBILITY 2 | #define __HAYAI_COMPATIBILITY 3 | 4 | # if __cplusplus > 201100L 5 | # define __hayai_noexcept noexcept 6 | # else 7 | # define __hayai_noexcept 8 | # endif 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /data/tests/ml/oaaData.yml: -------------------------------------------------------------------------------- 1 | %YAML:1.0 2 | inp: !!opencv-matrix 3 | rows: 9 4 | cols: 2 5 | dt: f 6 | data: [ .3, .4, 0., 0., .2, .1, -0.1, -0.2, -0.2, -0.3, -0.2, 7 | -0.1, .8, .9, .7, .9, .8, .8 ] 8 | labels: !!opencv-matrix 9 | rows: 9 10 | cols: 1 11 | dt: i 12 | data: [ 1, 1, 1, 2, 2, 2, 3, 3, 3 ] 13 | -------------------------------------------------------------------------------- /3rdparty/flann-1.8.4/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(libflann CXX C) 2 | cmake_minimum_required(VERSION 2.6.2) 3 | 4 | if(POLICY CMP0054) 5 | cmake_policy(SET CMP0054 OLD) 6 | endif() 7 | 8 | add_library(libflann STATIC "include/flann/flann_cpp.cpp") 9 | 10 | target_include_directories(libflann PUBLIC ${libflann_SOURCE_DIR}/include) 11 | 12 | set_target_properties(libflann PROPERTIES FOLDER 3RDPARTY) -------------------------------------------------------------------------------- /cmake/SSIGUtil.cmake: -------------------------------------------------------------------------------- 1 | macro(ssig_append_target_property target property str) 2 | get_target_property(current_property ${target} ${property}) 3 | if(NOT current_property) # property non-existent or empty 4 | set_target_properties(${target} PROPERTIES ${property} ${str}) 5 | else() 6 | set_target_properties(${target} PROPERTIES ${property} "${current_property} ${str}") 7 | endif() 8 | endmacro() 9 | -------------------------------------------------------------------------------- /3rdparty/hayai-1.1.0/src/hayai_posix_main.cpp: -------------------------------------------------------------------------------- 1 | #include "hayai/hayai_main.hpp" 2 | 3 | int main(int argc, char** argv) { 4 | // Set up the main runner. 5 | ::hayai::MainRunner runner; 6 | 7 | // Parse the arguments. 8 | int result = runner.ParseArgs(argc, argv); 9 | if (result) { 10 | return result; 11 | } 12 | 13 | // Execute based on the selected mode. 14 | return runner.Run(); 15 | } 16 | -------------------------------------------------------------------------------- /scripts/data/ssiglib_template_header.thpp: -------------------------------------------------------------------------------- 1 | #ifndef _SSIG_{module_upper}_{file_name_upper}_HPP_ 2 | #define _SSIG_{module_upper}_{file_name_upper}_HPP_ 3 | 4 | namespace ssig {{ 5 | class {class_name} {{ 6 | public: 7 | {class_name}(void); 8 | virtual ~{class_name}(void); 9 | {class_name}(const {class_name}& rhs); 10 | {class_name}& operator=(const {class_name}& rhs); 11 | 12 | private: 13 | // private members 14 | }}; 15 | }} // namespace ssig 16 | #endif // !_SSIG_{module_upper}_{file_name_upper}_HPP_ 17 | -------------------------------------------------------------------------------- /3rdparty/hayai-1.1.0/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(hayai CXX C) 2 | cmake_minimum_required(VERSION 2.6.2) 3 | 4 | if(POLICY CMP0054) 5 | cmake_policy(SET CMP0054 OLD) 6 | endif() 7 | 8 | add_library(hayai STATIC "src/hayai_posix_main.cpp") 9 | 10 | # if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") 11 | # set_target_properties(hayai PROPERTIES COMPILE_FLAGS "/WX- /W0") 12 | # endif() 13 | 14 | target_include_directories(hayai PUBLIC ${hayai_SOURCE_DIR}/include) 15 | 16 | set_target_properties(hayai PROPERTIES FOLDER 3RDPARTY) 17 | -------------------------------------------------------------------------------- /scripts/data/ssiglib_template_source.tcpp: -------------------------------------------------------------------------------- 1 | #include "ssiglib/{module}/{file_name}.hpp" 2 | 3 | namespace ssig {{ 4 | {class_name}::{class_name}() {{ 5 | // Constructor 6 | }} 7 | 8 | {class_name}::~{class_name}() {{ 9 | // Destructor 10 | }} 11 | 12 | {class_name}::{class_name}(const {class_name}& rhs) {{ 13 | // Constructor Copy 14 | }} 15 | 16 | {class_name}& {class_name}::operator=(const {class_name}& rhs) {{ 17 | if (this != &rhs) {{ 18 | // code here 19 | }} 20 | return *this; 21 | }} 22 | }} // namespace ssig 23 | -------------------------------------------------------------------------------- /3rdparty/libsvm-3.21/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(libsvm CXX C) 2 | cmake_minimum_required(VERSION 2.6.2) 3 | 4 | if(POLICY CMP0054) 5 | cmake_policy(SET CMP0054 OLD) 6 | endif() 7 | 8 | add_library(libsvm STATIC "src/libsvm.cpp") 9 | 10 | target_include_directories(libsvm PUBLIC ${libsvm_SOURCE_DIR}/include) 11 | 12 | if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") 13 | set_target_properties(libsvm PROPERTIES COMPILE_FLAGS "/openmp" FOLDER 3RDPARTY) 14 | else() 15 | set_target_properties(libsvm PROPERTIES COMPILE_FLAGS "-fopenmp -fPIC" FOLDER 3RDPARTY) 16 | endif() 17 | -------------------------------------------------------------------------------- /3rdparty/hayai-1.1.0/include/hayai/hayai_test_factory.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __HAYAI_TESTFACTORY 2 | #define __HAYAI_TESTFACTORY 3 | #include "hayai_test.hpp" 4 | 5 | namespace hayai 6 | { 7 | /// Base class for test factory implementations. 8 | class TestFactory 9 | { 10 | public: 11 | /// Virtual destructor 12 | 13 | /// Has no function in the base class. 14 | virtual ~TestFactory() 15 | { 16 | 17 | } 18 | 19 | 20 | /// Creates a test instance to run. 21 | 22 | /// @returns a pointer to an initialized test. 23 | virtual Test* CreateTest() = 0; 24 | }; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /3rdparty/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #root/3rdparty/CMakeLists.txt 2 | 3 | ############################################################################### 4 | # 3RDPARTY SUBDIRECTORIES 5 | ############################################################################### 6 | 7 | #Google Tests 8 | #Include Google Tests if only BUILD_TESTS was checked by user 9 | if(BUILD_TESTS) 10 | add_subdirectory (gtest-1.7.0) 11 | endif() 12 | 13 | #Hayai 14 | #Include Hayai Performance Tests if only BUILD_PERF_TESTS was checked by user 15 | if(BUILD_PERF_TESTS) 16 | add_subdirectory (hayai-1.1.0) 17 | endif() 18 | 19 | add_subdirectory (libsvm-3.21) 20 | 21 | add_subdirectory (flann-1.8.4) -------------------------------------------------------------------------------- /puppet/manifests/site.pp: -------------------------------------------------------------------------------- 1 | node default{ 2 | 3 | include apt 4 | exec { 'apt-upgrade': 5 | command => '/usr/bin/apt-get --quiet --yes --fix-broken upgrade', 6 | logoutput => 'on_failure', 7 | path => '/usr/bin:/usr/sbin:/bin:/usr/local/bin:/usr/local/sbin:/sbin', 8 | } 9 | 10 | include git 11 | include gcc 12 | include cmake 13 | include clang 14 | 15 | class { 'python' : 16 | version => 'system', 17 | pip => 'present', 18 | dev => 'present', 19 | virtualenv => 'present', 20 | } 21 | 22 | python::pip { 'cpplint': 23 | ensure => 'latest', 24 | } 25 | 26 | include opencv 27 | 28 | } 29 | -------------------------------------------------------------------------------- /doc/doxygen/doxyfile.in: -------------------------------------------------------------------------------- 1 | DOXYFILE_ENCODING = UTF-8 2 | PROJECT_NAME = "@PROJECT_ACRONYM_STR@" 3 | PROJECT_BRIEF = "@PROJECT_NAME_STR@" 4 | PROJECT_NUMBER = @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@ 5 | FULL_PATH_NAMES = YES 6 | STRIP_FROM_PATH = @CMAKE_SOURCE_DIR@/components 7 | INPUT = @doxy_main_page@ \ 8 | @PROJECT_SOURCE_DIR@ \ 9 | @PROJECT_BINARY_DIR@ 10 | FILE_PATTERNS = *.hpp 11 | RECURSIVE = YES 12 | USE_MDFILE_AS_MAINPAGE = @doxy_main_page@ 13 | EXCLUDE_SYMBOLS = cv::* \ 14 | moodycamel::* 15 | ENABLE_PREPROCESSING = YES 16 | MACRO_EXPANSION = YES 17 | EXPAND_ONLY_PREDEF = YES 18 | PREDEFINED = CORE_EXPORT= -------------------------------------------------------------------------------- /3rdparty/flann-1.8.4/include/flann/mpi/flann_mpi_server.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main(int argc, char* argv[]) 7 | { 8 | boost::mpi::environment env(argc, argv); 9 | 10 | try { 11 | if (argc != 4) { 12 | std::cout << "Usage: " << argv[0] << " \n"; 13 | return 1; 14 | } 15 | flann::mpi::Server > server(argv[1], argv[2], std::atoi(argv[3]), 16 | flann::KDTreeIndexParams(4)); 17 | 18 | server.run(); 19 | } 20 | catch (std::exception& e) { 21 | std::cerr << "Exception: " << e.what() << "\n"; 22 | } 23 | 24 | return 0; 25 | } 26 | 27 | -------------------------------------------------------------------------------- /modules/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #root/components/CMakeLists.txt 2 | 3 | ssig_add_module(core REQUIRED OPENCV opencv_world opencv_core opencv_imgproc opencv_imgcodecs opencv_highgui DEPENDENCIES libflann) 4 | ssig_add_module(ml OPENCV opencv_core opencv_ml opencv_imgproc opencv_objdetect opencv_highgui opencv_world DEPENDENCIES core libsvm libflann) 5 | ssig_add_module(video OPENCV opencv_world opencv_core opencv_videoio opencv_video DEPENDENCIES core libflann) 6 | ssig_add_module(descriptors CUDA OPENCV opencv_core opencv_ml opencv_imgproc opencv_objdetect opencv_highgui opencv_videoio opencv_video opencv_world DEPENDENCIES core video libflann) 7 | ssig_add_module(hashing OPENCV opencv_core DEPENDENCIES core ml libflann) 8 | #ssf_add_module(optimization OPENCV opencv_core DEPENDENCIES core) 9 | -------------------------------------------------------------------------------- /doc/doxygen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # add a target to generate API documentation with Doxygen 2 | if(BUILD_DOCS) 3 | 4 | find_package(Doxygen) 5 | 6 | if(NOT DOXYGEN_FOUND) 7 | message(FATAL_ERROR "Doxygen is needed to build the documentation.") 8 | endif() 9 | 10 | set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/doxyfile.in) 11 | set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/doxyfile) 12 | 13 | configure_file(${doxyfile_in} ${doxyfile} @ONLY) 14 | 15 | add_custom_target(documentation 16 | COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile} 17 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 18 | COMMENT "Generating API documentation with Doxygen" 19 | VERBATIM) 20 | 21 | install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/doc) 22 | endif() -------------------------------------------------------------------------------- /3rdparty/hayai-1.1.0/include/hayai/hayai_default_test_factory.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __HAYAI_DEFAULTTESTFACTORY 2 | #define __HAYAI_DEFAULTTESTFACTORY 3 | #include "hayai_test_factory.hpp" 4 | 5 | namespace hayai 6 | { 7 | /// Default test factory implementation. 8 | 9 | /// Simply constructs an instance of a the test of class @ref T with no 10 | /// constructor parameters. 11 | /// 12 | /// @tparam T Test class. 13 | template 14 | class TestFactoryDefault 15 | : public TestFactory 16 | { 17 | public: 18 | /// Create a test instance with no constructor parameters. 19 | 20 | /// @returns a pointer to an initialized test. 21 | virtual Test* CreateTest() 22 | { 23 | return new T(); 24 | } 25 | }; 26 | } 27 | #endif 28 | -------------------------------------------------------------------------------- /cmake/SSIGOpenCVUtil.cmake: -------------------------------------------------------------------------------- 1 | include(CMakeParseArguments) 2 | 3 | set(ssig_opencv_minimal_version 3.0) 4 | 5 | macro(ssig_find_opencv) 6 | set(ssig_multiValueArgs COMPONENTS) 7 | cmake_parse_arguments(SSIG_FIND_OPENCV "${ssig_multiValueArgs}" ${ARGN} ) 8 | 9 | find_package(OpenCV ${ssig_opencv_minimal_version} COMPONENTS ${SSIG_FIND_OPENCV_COMPONENTS} REQUIRED QUIET) 10 | mark_as_advanced(OPENCV_FOUND) 11 | endmacro() 12 | 13 | macro(ssig_link_opencv SSIGLIB_MODULE) 14 | ssig_find_opencv(COMPONENTS ${ARGN}) 15 | 16 | message(STATUS "Link to OpenCV Libraries:") 17 | find_path(OpenCV_INCLUDE_DIRS "opencv/cv.h" PATHS "${OpenCV_DIR}" PATH_SUFFIXES "include" DOC "") 18 | target_include_directories(${SSIGLIB_MODULE} PUBLIC ${OpenCV_INCLUDE_DIR}) 19 | 20 | target_link_libraries(${SSIGLIB_MODULE} ${OpenCV_LIBS}) 21 | 22 | endmacro() 23 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | codecov: 2 | token: 917e6854-0681-4e05-9c8e-50446045f887 3 | branch: develop 4 | bot: rbkloss 5 | ci: null 6 | strict_yaml_branch: null 7 | max_report_age: null 8 | notify: 9 | after_n_builds: null 10 | countdown: null 11 | require_ci_to_pass: no 12 | archive: 13 | uploads: yes 14 | coverage: 15 | ignore: 16 | - /usr/.* 17 | - 3rdparty/.* 18 | - usr/.* 19 | - .*/tests/.* 20 | status: 21 | patch: false 22 | project: 23 | default: 24 | target: auto 25 | threshold: 5 26 | branches: null 27 | base: auto 28 | set_pending: yes 29 | if_no_uploads: success 30 | if_not_found: success 31 | if_ci_failed: success 32 | only_pulls: null 33 | flags: null 34 | paths: null -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | dist: trusty 3 | 4 | language: cpp 5 | 6 | env: 7 | global: 8 | - secure: "H1ZVbraqi9LAmdGM9O9VhFHJP6Uk1Ux2iZSQqmSUi+Ph4muk8vsr7Grqu6yPJOI71aSs73ugTxW3S6nYVzgB+nCqEHZk5RnjyDHDfvDAg0h+OsBP4u0dQ6IZMfFRhw6R8B+VpUKD4j687MLs3eUFMsRJ8/t+24+/T097dKYWij4=" 9 | 10 | matrix: 11 | include: 12 | - compiler: gcc 13 | env: TASK="lint" 14 | - compiler: gcc 15 | env: TASK="test-gcc" 16 | 17 | before_install: 18 | - sudo apt-get update -qq 19 | 20 | install: 21 | - sudo apt-get install python 22 | - sudo pip install cpplint 23 | - sudo apt-get -y install build-essential cmake git libgtk2.0-dev pkg-config python-dev python-numpy 24 | - sudo apt-get -y install libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev libtbb2 25 | - sudo apt-get -y install libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev 26 | - sudo apt-get -y install unzip 27 | 28 | 29 | script: 30 | - bash .travis.sh 31 | 32 | after_success: 33 | - if [ "$TASK" == "test-gcc" ]; then bash <(curl -s https://codecov.io/bash); fi; 34 | -------------------------------------------------------------------------------- /cmake/SSIGCudaUtil.cmake: -------------------------------------------------------------------------------- 1 | include(CMakeParseArguments) 2 | 3 | set(ssig_cuda_minimal_version 5.0) 4 | 5 | macro(ssig_find_cuda) 6 | find_package(CUDA ${ssig_cuda_minimal_version}) 7 | mark_as_advanced(CUDA_FOUND) 8 | endmacro() 9 | 10 | macro(ssig_link_cuda SSIGLIB_MODULE) 11 | ssig_find_cuda() 12 | 13 | if(CUDA_FOUND) 14 | set(MODULE_PATH "${PROJECT_SOURCE_DIR}/modules/${SSIGLIB_MODULE}") 15 | file(GLOB CUDA_INCLUDE_FILES "${MODULE_PATH}/include/${SSIGLIB_MODULE}/*.cuh") 16 | file(GLOB CUDA_SOURCE_FILES "${MODULE_PATH}/cuda/*.cu") 17 | 18 | 19 | list(LENGTH CUDA_SOURCE_FILES source_files_size) 20 | if(NOT ${source_files_size} STREQUAL "0") 21 | message(STATUS "Link to CUDA Library:") 22 | include_directories("${MODULE_PATH}/include/") 23 | CUDA_ADD_LIBRARY(cuda_${SSIGLIB_MODULE} STATIC ${CUDA_SOURCE_FILES} ${CUDA_INCLUDE_FILES}) 24 | target_link_libraries(${SSIGLIB_MODULE} cuda_${SSIGLIB_MODULE}) 25 | else() 26 | message(WARNING "This module does not have cuda files!") 27 | endif() 28 | else() 29 | message(WARNING "Cuda not found!") 30 | endif() 31 | 32 | endmacro() 33 | -------------------------------------------------------------------------------- /.travis.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SSIG_DIR=`pwd` 4 | BUILD_DIR=$SSIG_DIR/build 5 | 6 | function lint() 7 | { 8 | FILES_LINT=`( find . -name *.hpp -or -name *.cpp | grep "^./modules/" )` 9 | cpplint --counting=detailed --filter=-runtime/references,-build/header_guard,-build/include_order $FILES_LINT 10 | } 11 | 12 | function test-gcc() 13 | { 14 | mkdir opencv 15 | cd opencv 16 | wget https://github.com/Itseez/opencv/archive/3.1.0.zip 17 | unzip -qq 3.1.0.zip 18 | cd opencv-3.1.0 19 | mkdir build 20 | cd build 21 | cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=OFF -D WITH_FFMPEG=ON -D WITH_V4L=OFF -D WITH_OPENMP=ON -D BUILD_opencv_apps=OFF -D BUILD_DOCS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_TESTS=OFF -D BUILD_WITH_DEBUG_INFO=OFF -D BUILD_ANDROID_SERVICE=OFF .. 22 | make -j2 23 | sudo make install 24 | sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf' 25 | sudo ldconfig 26 | cd ../../.. 27 | mkdir $BUILD_DIR && cd $BUILD_DIR 28 | cmake -DBUILD_TESTS=ON -DENABLE_COVERAGE=ON $SSIG_DIR 29 | make 30 | make test ARGS="--output-on-failure" 31 | } 32 | 33 | case $TASK in 34 | lint ) lint;; 35 | test-gcc ) test-gcc;; 36 | esac 37 | -------------------------------------------------------------------------------- /data/tests/ml/firefly.yml: -------------------------------------------------------------------------------- 1 | %YAML:1.0 2 | Pop: !!opencv-matrix 3 | rows: 30 4 | cols: 2 5 | dt: f 6 | data: [ 3.02827924e-001, -3.00740814e+000, -9.89405572e-001, 7 | 3.14385080e+000, -6.28670216e-001, -2.51210308e+000, 8 | 2.73105049e+000, 2.62093735e+000, -1.92205524e+000, 9 | 2.02431703e+000, -2.15527937e-001, 2.92190027e+000, 10 | -4.14156866e+000, -4.24939728e+000, -3.36576605e+000, 11 | -2.00220776e+000, 4.05653906e+000, 2.09685826e+000, 12 | -3.50287485e+000, 2.65439939e+000, -3.75718594e+000, 13 | -4.96271420e+000, 5.15135884e-001, 4.98199320e+000, 14 | -3.41007853e+000, -3.38821936e+000, -4.61810684e+000, 15 | -7.41386712e-001, 3.46127629e+000, 3.87604475e+000, 16 | -2.35287619e+000, -2.29216957e+000, 4.52666378e+000, 17 | 1.75131297e+000, 3.10216379e+000, -3.16039801e+000, 18 | -4.05543804e+000, 3.15903306e+000, 2.45176613e-001, 19 | -1.19161153e+000, -8.80052388e-001, -2.44464660e+000, 20 | 4.44895887e+000, 4.00123501e+000, -4.21084344e-001, 21 | 3.41306949e+000, -2.19699883e+000, -1.14564300e+000, 22 | -4.80985373e-001, 3.75433564e+000, -3.40584946e+000, 23 | 1.49286604e+000, -7.45431066e-001, 1.79950416e+000, 24 | -1.50470567e+000, 1.00716686e+000, -2.22135329e+000, 25 | 1.49820209e+000, -6.42413378e-001, 2.87622690e+000 ] 26 | -------------------------------------------------------------------------------- /data/tests/core/firefly.yml: -------------------------------------------------------------------------------- 1 | %YAML:1.0 2 | Pop: !!opencv-matrix 3 | rows: 30 4 | cols: 2 5 | dt: f 6 | data: [ 3.02827924e-001, -3.00740814e+000, -9.89405572e-001, 7 | 3.14385080e+000, -6.28670216e-001, -2.51210308e+000, 8 | 2.73105049e+000, 2.62093735e+000, -1.92205524e+000, 9 | 2.02431703e+000, -2.15527937e-001, 2.92190027e+000, 10 | -4.14156866e+000, -4.24939728e+000, -3.36576605e+000, 11 | -2.00220776e+000, 4.05653906e+000, 2.09685826e+000, 12 | -3.50287485e+000, 2.65439939e+000, -3.75718594e+000, 13 | -4.96271420e+000, 5.15135884e-001, 4.98199320e+000, 14 | -3.41007853e+000, -3.38821936e+000, -4.61810684e+000, 15 | -7.41386712e-001, 3.46127629e+000, 3.87604475e+000, 16 | -2.35287619e+000, -2.29216957e+000, 4.52666378e+000, 17 | 1.75131297e+000, 3.10216379e+000, -3.16039801e+000, 18 | -4.05543804e+000, 3.15903306e+000, 2.45176613e-001, 19 | -1.19161153e+000, -8.80052388e-001, -2.44464660e+000, 20 | 4.44895887e+000, 4.00123501e+000, -4.21084344e-001, 21 | 3.41306949e+000, -2.19699883e+000, -1.14564300e+000, 22 | -4.80985373e-001, 3.75433564e+000, -3.40584946e+000, 23 | 1.49286604e+000, -7.45431066e-001, 1.79950416e+000, 24 | -1.50470567e+000, 1.00716686e+000, -2.22135329e+000, 25 | 1.49820209e+000, -6.42413378e-001, 2.87622690e+000 ] 26 | -------------------------------------------------------------------------------- /data/tests/core/parameters.yml: -------------------------------------------------------------------------------- 1 | %YAML:1.0 2 | config1: 3 | paramInteger: 10 4 | paramDouble: 2.2 5 | paramString: "test_string" 6 | paramBool: "true" 7 | paramFileHandle: "test_file.txt" 8 | paramDirectoryHandle: "folder_test" 9 | paramIntVector: [10, 11, 12] 10 | paramDoubleVector: [1000, 1100.1, 1200.2] 11 | paramStringVector: ["a", "b", "c"] 12 | invalid1: 13 | paramInteger: {} 14 | paramDouble: 2.2 15 | paramString: "test_string" 16 | paramBool: true 17 | paramFileHandle: "test_file.txt" 18 | paramDirectoryHandle: "folder_test" 19 | paramIntVector: [10, 11, 12] 20 | paramDoubleVector: [1000, 1100.1, 1200.2] 21 | paramStringVector: ["a", "b", "c"] 22 | invalid2: 23 | config1: 24 | paramInteger: 10 25 | paramDouble: 2.2 26 | paramString: "test_string" 27 | paramBool: "true" 28 | paramFileHandle: "test_file.txt" 29 | paramDirectoryHandle: "folder_test" 30 | paramIntVector: [10, 11, 12] 31 | paramDoubleVector: [1000, 1100.1, 1200.2] 32 | paramStringVector: ["a", "b", "c"] 33 | invalid3: {} 34 | invalid4: 35 | paramInteger: [] 36 | paramDouble: 2.2 37 | paramString: "test_string" 38 | paramBool: true 39 | paramFileHandle: "test_file.txt" 40 | paramDirectoryHandle: "folder_test" 41 | paramIntVector: [10, 11, 12] 42 | paramDoubleVector: [1000, 1100.1, 1200.2] 43 | paramStringVector: ["a", "b", "c"] -------------------------------------------------------------------------------- /scripts/update_license.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | """ 3 | Update SSIGLib lincence 4 | """ 5 | 6 | import re 7 | import os 8 | 9 | if __name__ == "__main__": 10 | 11 | with open('data/ssiglib_template_license.txt', 'r') as f_template_license: 12 | TEMPLATE = f_template_license.read() 13 | 14 | ROOT_DIR = '../modules' 15 | for subdir, _, files in os.walk(ROOT_DIR, topdown=False): 16 | for filename in files: 17 | if filename.endswith('.h') or \ 18 | filename.endswith('.hpp') or \ 19 | filename.endswith('.cpp') or \ 20 | filename.endswith('.cu') or filename.endswith('.cuh'): 21 | fullpath = os.path.join(subdir, filename) 22 | print fullpath 23 | content = '' 24 | with open(fullpath, 'r') as file_reader: 25 | content = file_reader.read() 26 | with open(fullpath, 'w') as file_writer: 27 | match_pattern = re.search( 28 | r'/\*L(.+?)L\*/', content, re.DOTALL) 29 | if match_pattern: 30 | template_strip = TEMPLATE.rstrip('\r\n') 31 | content = content.replace( 32 | match_pattern.group(0), template_strip) 33 | file_writer.write(content) 34 | else: 35 | content = TEMPLATE.rstrip( 36 | '\r\n') + '\n\n' + content 37 | file_writer.write(content) 38 | -------------------------------------------------------------------------------- /data/tests/descriptors/hog1_expected.yml: -------------------------------------------------------------------------------- 1 | %YAML:1.0 2 | expected: !!opencv-matrix 3 | rows: 1 4 | cols: 36 5 | dt: f 6 | data: [ 3.43583494e-01, 0., 0., 0., 3.45149428e-01, 0., 0., 0., 7 | 3.43583494e-01, 3.45149428e-01, 0., 0., 0., 3.45149428e-01, 0., 8 | 0., 0., 3.45149428e-01, 5.42500280e-02, 0., 0., 0., 9 | 3.45149428e-01, 0., 0., 0., 5.42500280e-02, 2.71250129e-01, 0., 10 | 0., 0., 1.08500056e-01, 0., 0., 0., 2.71250129e-01 ] 11 | 12 | signed_expected: !!opencv-matrix 13 | rows: 1 14 | cols: 72 15 | dt: f 16 | data: [ 2.31036976e-01, 0., 0., 0., 2.93017536e-01, 0., 0., 0., 17 | 1.50676295e-01, 1.50676295e-01, 0., 0., 0., 2.93017536e-01, 0., 18 | 0., 0., 2.31036976e-01, 2.61172235e-01, 0., 0., 0., 19 | 2.93017536e-01, 0., 0., 0., 2.00901717e-01, 2.00901717e-01, 0., 20 | 0., 0., 2.93017536e-01, 0., 0., 0., 2.61172235e-01, 21 | 6.02705143e-02, 0., 0., 0., 2.93017536e-01, 0., 0., 0., 0., 0., 22 | 0., 0., 0., 2.93017536e-01, 0., 0., 0., 6.02705143e-02, 23 | 1.50676295e-01, 0., 0., 0., 1.20541029e-01, 0., 0., 0., 24 | 1.50676295e-01, 1.50676295e-01, 0., 0., 0., 0., 0., 0., 0., 25 | 1.50676295e-01 ] 26 | 27 | expected_uoccti: !!opencv-matrix 28 | rows: 1 29 | cols: 31 30 | dt: f 31 | data: [ 2.53558278e-01, 0., 0., 0., 2.85987079e-01, 0., 0., 0., 32 | 2.53558278e-01, 1.75788999e-01, 0., 0., 0., 2.49898419e-01, 0., 33 | 0., 0., 1.25563577e-01, 1.25563577e-01, 0., 0., 0., 34 | 2.19763160e-01, 0., 0., 0., 1.75788999e-01, 1.03231645e+00, 35 | 1.03544831e+00, 4.53649491e-01, 6.51000321e-01 ] 36 | -------------------------------------------------------------------------------- /3rdparty/flann-1.8.4/include/flann/flann_cpp.cpp: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | *************************************************************************/ 28 | 29 | 30 | #include "./flann.hpp" 31 | -------------------------------------------------------------------------------- /3rdparty/flann-1.8.4/include/flann/config.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2011 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2011 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | *************************************************************************/ 28 | 29 | 30 | #ifndef FLANN_CONFIG_H_ 31 | #define FLANN_CONFIG_H_ 32 | 33 | #ifdef FLANN_VERSION_ 34 | #undef FLANN_VERSION_ 35 | #endif 36 | #define FLANN_VERSION_ "" 37 | 38 | #endif /* FLANN_CONFIG_H_ */ 39 | -------------------------------------------------------------------------------- /3rdparty/gtest-1.7.0/src/gtest_main.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #include 31 | 32 | #include "gtest/gtest.h" 33 | 34 | GTEST_API_ int main(int argc, char **argv) { 35 | printf("Running main() from gtest_main.cc\n"); 36 | testing::InitGoogleTest(&argc, argv); 37 | return RUN_ALL_TESTS(); 38 | } 39 | -------------------------------------------------------------------------------- /3rdparty/flann-1.8.4/include/flann/config.h.in: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2011 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2011 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | *************************************************************************/ 28 | 29 | 30 | #ifndef FLANN_CONFIG_H_ 31 | #define FLANN_CONFIG_H_ 32 | 33 | #ifdef FLANN_VERSION_ 34 | #undef FLANN_VERSION_ 35 | #endif 36 | #define FLANN_VERSION_ "${FLANN_VERSION}" 37 | 38 | #endif /* FLANN_CONFIG_H_ */ 39 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SSIGLib - Smart Surveillance Interest Group Library 2 | 3 | 4 | 5 | | License|Linux|Win|Code Coverage| 6 | | ----|----|----- | ---------| 7 | |[![BSD License](https://img.shields.io/badge/license-BSD-blue.svg)](http://opensource.org/licenses/BSD-3-Clause)| [![Build Status](https://travis-ci.org/ssig/ssiglib.svg?branch=develop)](https://travis-ci.org/ssig/ssiglib) | [![Build status](https://ci.appveyor.com/api/projects/status/rmyr058kebpbg3v7/branch/develop?svg=true)](https://ci.appveyor.com/project/rbkloss/ssiglib) | [![codecov.io](https://codecov.io/github/ssig/ssiglib/coverage.svg?branch=develop)](https://codecov.io/github/ssig/ssiglib?branch=develop) | 8 | 9 | The Smart Surveillance Interest Group Library (SSIGLib) is a C/C++ library built to provide a set of functionalities that aid researchers not only on the development of surveillance systems but also on the creation of novel solutions for problems related to video surveillance. 10 | 11 | The SSIGLib was designed to provide features for a good scene understanding, scalability, real-time operation, multi-sensor environment, usage of low cost standard components, and communication control. 12 | 13 | ###Warning 14 | Be noted that there is no stable version yet, which means that some interfaces may change with each update and the library has most of its features in an experimental fashion. 15 | 16 | ## Contributing 17 | 18 | Simple way: 19 | 20 | 1. Fork it! 21 | 2. Create your feature branch: `git checkout -b feature-feat_name` 22 | 3. Commit your changes: `git commit -am 'Add some feature'` 23 | 4. Push to the branch: `git push origin feature-feat_name` 24 | 5. Submit a pull request :D 25 | 26 | Detailed way: 27 | 28 | As a side note new test cases, documentation and bug reports would be really helpful. 29 | 30 | Please visit our [Wiki Page](https://github.com/ssig/ssiglib/wiki). 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 2 | 3 | IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | 5 | By downloading, copying, installing or using the software you agree to this 6 | license. If you do not agree to this license, do not download, install, copy or 7 | use the software. 8 | 9 | Software License Agreement (BSD License) 10 | For Smart Surveillance Interest Group Library 11 | http://ssig.dcc.ufmg.br 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are met: 15 | 16 | 1. Redistributions of source code must retain the above copyright notice, this 17 | list of conditions and the following disclaimer. 18 | 19 | 2. Redistributions in binary form must reproduce the above copyright notice, 20 | this list of conditions and the following disclaimer in the documentation 21 | and/or other materials provided with the distribution. 22 | 23 | 3. Neither the name of the copyright holder nor the names of its contributors 24 | may be used to endorse or promote products derived from this software 25 | without specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 31 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 34 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | -------------------------------------------------------------------------------- /puppet/modules/opencv/manifests/init.pp: -------------------------------------------------------------------------------- 1 | #Install latest opencv 2 | class opencv{ 3 | 4 | # sudo apt-get install -qq libboost-filesystem1.54-dev libboost-log1.54-dev 5 | # libboost-date-time1.54-dev libboost-thread1.54-dev 6 | 7 | $packages = [ 8 | 'libgtk2.0-dev', 9 | 'pkg-config', 10 | 'libavcodec-dev', 11 | 'libavformat-dev', 12 | 'libswscale-dev', 13 | 'libtbb2', 14 | 'libtbb-dev', 15 | 'libjpeg-dev', 16 | 'libpng-dev', 17 | 'libtiff-dev', 18 | 'libjasper-dev', 19 | 'libdc1394-22-dev', 20 | 'python-numpy', 21 | ] 22 | 23 | package { $packages: ensure => latest } 24 | 25 | vcsrepo { '/tmp/opencv-git-clone': 26 | ensure => present, 27 | provider => git, 28 | source => 'git://github.com/Itseez/opencv.git', 29 | } 30 | 31 | file { '/tmp/opencv-git-clone/build': 32 | ensure => directory, 33 | require => Vcsrepo['/tmp/opencv-git-clone'], 34 | } 35 | 36 | exec {'opencv cmake pre': 37 | require => File['/tmp/opencv-git-clone/build'], 38 | command => 'cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=OFF -D WITH_FFMPEG=OFF -D WITH_OPENMP=OFF -D BUILD_opencv_apps=OFF -D BUILD_DOCS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_TESTS=OFF -D BUILD_WITH_DEBUG_INFO=OFF -D BUILD_ANDROID_SERVICE=OFF ..', 39 | cwd => '/tmp/opencv-git-clone/build', 40 | path => '/usr/bin:/usr/sbin/:/bin:/sbin' 41 | } 42 | 43 | exec {'opencv cmake build': 44 | require => Exec['opencv cmake pre'], 45 | command => 'cmake --build .', 46 | cwd => '/tmp/opencv-git-clone/build', 47 | path => '/usr/bin:/usr/sbin/:/bin:/sbin', 48 | timeout => 1800, 49 | } 50 | 51 | exec {'opencv cmake install': 52 | require => Exec['opencv cmake build'], 53 | command => 'cmake --build . --target install', 54 | cwd => '/tmp/opencv-git-clone/build', 55 | path => '/usr/bin:/usr/sbin/:/bin:/sbin' 56 | } 57 | 58 | exec {'opencv ldconfig': 59 | require => Exec['opencv cmake install'], 60 | command => 'sh -c \'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf && ldconfig\'', 61 | path => '/usr/bin:/usr/sbin/:/bin:/sbin' 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /3rdparty/flann-1.8.4/include/flann/mpi/flann_mpi_client.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | 11 | 12 | #define IF_RANK0 if (world.rank()==0) 13 | 14 | timeval start_time_; 15 | void start_timer(const std::string& message = "") 16 | { 17 | if (!message.empty()) { 18 | printf("%s", message.c_str()); 19 | fflush(stdout); 20 | } 21 | gettimeofday(&start_time_,NULL); 22 | } 23 | 24 | double stop_timer() 25 | { 26 | timeval end_time; 27 | gettimeofday(&end_time,NULL); 28 | 29 | return double(end_time.tv_sec-start_time_.tv_sec)+ double(end_time.tv_usec-start_time_.tv_usec)/1000000; 30 | } 31 | 32 | float compute_precision(const flann::Matrix& match, const flann::Matrix& indices) 33 | { 34 | int count = 0; 35 | 36 | assert(match.rows == indices.rows); 37 | size_t nn = std::min(match.cols, indices.cols); 38 | 39 | for(size_t i=0; i query; 58 | flann::Matrix match; 59 | 60 | flann::load_from_file(query, "sift100K.h5","query"); 61 | flann::load_from_file(match, "sift100K.h5","match"); 62 | // flann::load_from_file(gt_dists, "sift100K.h5","dists"); 63 | 64 | flann::mpi::Client index("localhost","9999"); 65 | 66 | int nn = 1; 67 | flann::Matrix indices(new int[query.rows*nn], query.rows, nn); 68 | flann::Matrix dists(new float[query.rows*nn], query.rows, nn); 69 | 70 | start_timer("Performing search...\n"); 71 | index.knnSearch(query, indices, dists, nn, flann::SearchParams(64)); 72 | printf("Search done (%g seconds)\n", stop_timer()); 73 | 74 | printf("Checking results\n"); 75 | float precision = compute_precision(match, indices); 76 | printf("Precision is: %g\n", precision); 77 | 78 | } 79 | catch (std::exception& e) { 80 | std::cerr << "Exception: " << e.what() << "\n"; 81 | } 82 | 83 | return 0; 84 | } 85 | 86 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 1.0.{build} 2 | 3 | clone_folder: c:\ssiglib\ 4 | 5 | branches: 6 | # whitelist 7 | only: 8 | - develop 9 | - master 10 | 11 | os: Windows Server 2012 12 | platform: x64 13 | configuration: Release 14 | 15 | environment: 16 | OpenCV_DIR: c:\opencv\build\ 17 | OPENCV_BIN: c:\opencv\build\bin\Release\ 18 | SSIGLib_DIR: c:\ssiglib\build\ 19 | SSIGLib_BIN: c:\ssiglib\build\bin\Release\ 20 | 21 | before_build: 22 | - echo =====Starting OpenCV==== 23 | - git clone https://github.com/Itseez/opencv.git c:\opencv\ 24 | - cd c:\opencv 25 | - mkdir build 26 | - cd build 27 | - cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=c:\opencv\build\ -D WITH_TBB=OFF -D WITH_FFMPEG=ON -D WITH_V4L=OFF -D WITH_OPENMP=OFF -D BUILD_opencv_apps=OFF -D BUILD_DOCS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_TESTS=OFF -D BUILD_WITH_DEBUG_INFO=OFF .. -G "Visual Studio 12 Win64" 28 | - '"c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64' 29 | - msbuild ALL_BUILD.vcxproj /p:configuration=release /p:platform=x64 /p:UseEnv=true /p:PreferredToolArchitecture=x64 /p:PlatformToolset=v120 30 | - echo =====Starting SSIGLib===== 31 | - cd c:\ssiglib 32 | - mkdir build 33 | - cd build 34 | - cmake -D BUILD_TESTS=ON -D ENABLE_COVERAGE=ON .. -G "Visual Studio 12 Win64" 35 | 36 | build_script: 37 | - cd c:\ssiglib\build\ 38 | - msbuild ALL_BUILD.vcxproj /p:configuration=release /p:platform=x64 /p:UseEnv=true /p:PreferredToolArchitecture=x64 /p:PlatformToolset=v120 39 | 40 | build: 41 | verbosity: minimal 42 | parallel: true 43 | # project: c:\ssiglib\build\ALL_BUILD.vcxproj 44 | 45 | before_test: 46 | - echo ==== Tests ==== 47 | - cd c:\ssiglib\build\ 48 | - '"c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64' 49 | - set PATH=%PATH%;%OPENCV_BIN%; 50 | 51 | #after_test: 52 | 53 | test_script: 54 | - echo === Hakuna Matata === 55 | - ctest -C Release --output-on-failure --test-timeout 270 56 | 57 | notifications: 58 | # Email 59 | - provider: Email 60 | to: 61 | - rbk@dcc.ufmg.br 62 | subject: 'Build {{status}}' 63 | # message: "{{message}}, {{commitId}}, ..." 64 | on_build_status_changed: true 65 | -------------------------------------------------------------------------------- /3rdparty/hayai-1.1.0/include/hayai/hayai_test.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __HAYAI_TEST 2 | #define __HAYAI_TEST 3 | #include 4 | 5 | #include "hayai_clock.hpp" 6 | #include "hayai_test_result.hpp" 7 | 8 | 9 | namespace hayai 10 | { 11 | /// Base test class. 12 | 13 | /// @ref SetUp is invoked before each run, and @ref TearDown is invoked 14 | /// once the run is finished. Iterations rely on the same fixture 15 | /// for every run. 16 | /// 17 | /// The default test class does not contain any actual code in the 18 | /// SetUp and TearDown methods, which means that tests can inherit 19 | /// this class directly for non-fixture based benchmarking tests. 20 | class Test 21 | { 22 | public: 23 | /// Set up the testing fixture for execution of a run. 24 | virtual void SetUp() 25 | { 26 | 27 | } 28 | 29 | 30 | /// Tear down the previously set up testing fixture after the 31 | /// execution run. 32 | virtual void TearDown() 33 | { 34 | 35 | } 36 | 37 | 38 | /// Run the test. 39 | 40 | /// @param iterations Number of iterations to gather data for. 41 | /// @returns the number of nanoseconds the run took. 42 | uint64_t Run(std::size_t iterations) 43 | { 44 | std::size_t iteration = iterations; 45 | 46 | // Set up the testing fixture. 47 | SetUp(); 48 | 49 | // Get the starting time. 50 | Clock::TimePoint startTime, endTime; 51 | 52 | startTime = Clock::Now(); 53 | 54 | // Run the test body for each iteration. 55 | while (iteration--) 56 | TestBody(); 57 | 58 | // Get the ending time. 59 | endTime = Clock::Now(); 60 | 61 | // Tear down the testing fixture. 62 | TearDown(); 63 | 64 | // Return the duration in nanoseconds. 65 | return Clock::Duration(startTime, endTime); 66 | } 67 | 68 | 69 | virtual ~Test() 70 | { 71 | 72 | } 73 | protected: 74 | /// Test body. 75 | 76 | /// Executed for each iteration the benchmarking test is run. 77 | virtual void TestBody() 78 | { 79 | 80 | } 81 | }; 82 | } 83 | #endif 84 | -------------------------------------------------------------------------------- /3rdparty/gtest-1.7.0/src/gtest-all.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: mheule@google.com (Markus Heule) 31 | // 32 | // Google C++ Testing Framework (Google Test) 33 | // 34 | // Sometimes it's desirable to build Google Test by compiling a single file. 35 | // This file serves this purpose. 36 | 37 | // This line ensures that gtest.h can be compiled on its own, even 38 | // when it's fused. 39 | #include "gtest/gtest.h" 40 | 41 | // The following lines pull in the real gtest *.cc files. 42 | #include "src/gtest.cc" 43 | #include "src/gtest-death-test.cc" 44 | #include "src/gtest-filepath.cc" 45 | #include "src/gtest-port.cc" 46 | #include "src/gtest-printers.cc" 47 | #include "src/gtest-test-part.cc" 48 | #include "src/gtest-typed-test.cc" 49 | -------------------------------------------------------------------------------- /scripts/data/ssiglib_template_license.txt: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | -------------------------------------------------------------------------------- /modules/ml/src/embedding.cpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | #include "ssiglib/ml/embedding.hpp" 43 | 44 | namespace ssig {} // namespace ssig 45 | -------------------------------------------------------------------------------- /3rdparty/flann-1.8.4/include/flann/mpi/matrix.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2011 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2011 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | *************************************************************************/ 28 | 29 | 30 | #ifndef MPI_MATRIX_H_ 31 | #define MPI_MATRIX_H_ 32 | 33 | #include 34 | #include 35 | 36 | 37 | namespace boost { 38 | namespace serialization { 39 | 40 | template 41 | void serialize(Archive & ar, flann::Matrix & matrix, const unsigned int version) 42 | { 43 | ar & matrix.rows & matrix.cols & matrix.stride; 44 | if (Archive::is_loading::value) { 45 | matrix = flann::Matrix(new T[matrix.rows*matrix.cols], matrix.rows, matrix.cols, matrix.stride); 46 | } 47 | ar & boost::serialization::make_array(matrix.ptr(), matrix.rows*matrix.cols); 48 | } 49 | 50 | } 51 | } 52 | 53 | 54 | #endif /* MPI_MATRIX_H_ */ 55 | -------------------------------------------------------------------------------- /modules/ml/test/test_main.cpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | #include "gtest/gtest.h" 43 | 44 | int main(int argc, char **argv) { 45 | ::testing::InitGoogleTest(&argc, argv); 46 | return RUN_ALL_TESTS(); 47 | } 48 | -------------------------------------------------------------------------------- /modules/video/test/test_main.cpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | #include "gtest/gtest.h" 43 | 44 | int main(int argc, char **argv) { 45 | ::testing::InitGoogleTest(&argc, argv); 46 | return RUN_ALL_TESTS(); 47 | } 48 | -------------------------------------------------------------------------------- /modules/core/test/test_main.cpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | 43 | #include "gtest/gtest.h" 44 | 45 | int main(int argc, char **argv) { 46 | ::testing::InitGoogleTest(&argc, argv); 47 | return RUN_ALL_TESTS(); 48 | } 49 | -------------------------------------------------------------------------------- /modules/hashing/test/test_hashing.cpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | #include "gtest/gtest.h" 43 | 44 | int main(int argc, char **argv) { 45 | ::testing::InitGoogleTest(&argc, argv); 46 | return RUN_ALL_TESTS(); 47 | } 48 | -------------------------------------------------------------------------------- /modules/ml/src/multiclass.cpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | #include "ssiglib/ml/multiclass.hpp" 43 | 44 | namespace ssig { 45 | 46 | bool Multiclass::isClassifier() const { 47 | return true; 48 | } 49 | } // namespace ssig 50 | -------------------------------------------------------------------------------- /3rdparty/gtest-1.7.0/include/gtest/gtest_prod.h: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | // 32 | // Google C++ Testing Framework definitions useful in production code. 33 | 34 | #ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_ 35 | #define GTEST_INCLUDE_GTEST_GTEST_PROD_H_ 36 | 37 | // When you need to test the private or protected members of a class, 38 | // use the FRIEND_TEST macro to declare your tests as friends of the 39 | // class. For example: 40 | // 41 | // class MyClass { 42 | // private: 43 | // void MyMethod(); 44 | // FRIEND_TEST(MyClassTest, MyMethod); 45 | // }; 46 | // 47 | // class MyClassTest : public testing::Test { 48 | // // ... 49 | // }; 50 | // 51 | // TEST_F(MyClassTest, MyMethod) { 52 | // // Can call MyClass::MyMethod() here. 53 | // } 54 | 55 | #define FRIEND_TEST(test_case_name, test_name)\ 56 | friend class test_case_name##_##test_name##_Test 57 | 58 | #endif // GTEST_INCLUDE_GTEST_GTEST_PROD_H_ 59 | -------------------------------------------------------------------------------- /modules/descriptors/test/test_main.cpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | 43 | #include "gtest/gtest.h" 44 | 45 | int main(int argc, char **argv) { 46 | // ::testing::GTEST_FLAG(filter) = "OFCM*"; 47 | ::testing::InitGoogleTest(&argc, argv); 48 | return RUN_ALL_TESTS(); 49 | } 50 | -------------------------------------------------------------------------------- /3rdparty/gtest-1.7.0/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ######################################################################## 2 | # CMake build script for Google Test. 3 | # 4 | # To run the tests for Google Test itself on Linux, use 'make test' or 5 | # ctest. You can select which tests to run using 'ctest -R regex'. 6 | # For more options, run 'ctest --help'. 7 | 8 | # When other libraries are using a shared version of runtime libraries, 9 | # Google Test also has to use one. 10 | set( 11 | gtest_force_shared_crt 12 | OFF) 13 | 14 | set(gtest_disable_pthreads ON) 15 | 16 | # Defines pre_project_set_up_hermetic_build() and set_up_hermetic_build(). 17 | include(cmake/hermetic_build.cmake OPTIONAL) 18 | 19 | if (COMMAND pre_project_set_up_hermetic_build) 20 | pre_project_set_up_hermetic_build() 21 | endif() 22 | 23 | MARK_AS_ADVANCED(gtest_force_shared_crt gtest_disable_pthreads) 24 | 25 | ######################################################################## 26 | # 27 | # Project-wide settings 28 | 29 | # Name of the project. 30 | # 31 | # CMake files in this project can refer to the root source directory 32 | # as ${gtest_SOURCE_DIR} and to the root binary directory as 33 | # ${gtest_BINARY_DIR}. 34 | # Language "C" is required for find_package(Threads). 35 | project(gtest CXX C) 36 | cmake_minimum_required(VERSION 2.6.2) 37 | 38 | if (COMMAND set_up_hermetic_build) 39 | set_up_hermetic_build() 40 | endif() 41 | 42 | # Define helper functions and macros used by Google Test. 43 | include(cmake/internal_utils.cmake) 44 | 45 | config_compiler_and_linker() # Defined in internal_utils.cmake. 46 | 47 | 48 | 49 | # Where Google Test's libraries can be found. 50 | #link_directories(${gtest_BINARY_DIR}/src) 51 | 52 | ######################################################################## 53 | # 54 | # Defines the gtest & gtest_main libraries. User tests should link 55 | # with one of them. 56 | 57 | # Google Test libraries. We build them using more strict warnings than what 58 | # are used for other targets, to ensure that gtest can be compiled by a user 59 | # aggressive about warnings. 60 | cxx_library(gtest "${cxx_strict}" src/gtest-all.cc) 61 | cxx_library(gtest_main "${cxx_strict}" src/gtest_main.cc) 62 | # Where Google Test's .h files can be found. 63 | target_include_directories(gtest PUBLIC 64 | ${gtest_SOURCE_DIR}/include 65 | ${gtest_SOURCE_DIR}) 66 | 67 | target_include_directories(gtest_main PUBLIC 68 | ${gtest_SOURCE_DIR}/include 69 | ${gtest_SOURCE_DIR}) 70 | 71 | target_link_libraries(gtest_main gtest) 72 | 73 | set_target_properties(gtest PROPERTIES FOLDER 3RDPARTY) 74 | set_target_properties(gtest_main PROPERTIES FOLDER 3RDPARTY) 75 | -------------------------------------------------------------------------------- /modules/core/src/resource.cpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | 43 | #include "ssiglib/core/resource.hpp" 44 | 45 | namespace ssig { 46 | 47 | Resource::Resource() {} 48 | 49 | Resource::~Resource() {} 50 | 51 | Resource::Resource(const Resource& rhs) {} 52 | 53 | Resource& Resource::operator=(const Resource& rhs) { return *this; } 54 | 55 | } // namespace ssig 56 | -------------------------------------------------------------------------------- /modules/core/src/base_object.cpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | 43 | #include "ssiglib/core/base_object.hpp" 44 | 45 | namespace ssig { 46 | 47 | BaseObject::BaseObject() {} 48 | 49 | BaseObject::~BaseObject() {} 50 | 51 | BaseObject::BaseObject(const BaseObject& rhs) {} 52 | 53 | BaseObject& BaseObject::operator=(const BaseObject& rhs) { return *this; } 54 | 55 | } // namespace ssig 56 | -------------------------------------------------------------------------------- /modules/descriptors/descriptor.cpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | #include "descriptors/descriptor.hpp" 43 | 44 | namespace ssig { 45 | Descriptor::Descriptor() { 46 | // Constructor 47 | } 48 | 49 | Descriptor::~Descriptor() { 50 | // Destructor 51 | } 52 | 53 | Descriptor::Descriptor(const Descriptor& rhs) { 54 | // Constructor Copy 55 | } 56 | 57 | Descriptor& Descriptor::operator=(const Descriptor& rhs) { 58 | if (this != &rhs) { 59 | // code here 60 | } 61 | return *this; 62 | } 63 | } // namespace ssig 64 | -------------------------------------------------------------------------------- /modules/descriptors/descriptor.hpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | #ifndef _SSIG_DESCRIPTORS_DESRIPTOR_HPP_ 43 | #define _SSIG_DESCRIPTORS_DESRIPTOR_HPP_ 44 | #include 45 | #include "descriptors_defs.hpp" 46 | 47 | namespace ssig { 48 | class Descriptor { 49 | public: 50 | Descriptor(void); 51 | ~Descriptor(void); 52 | Descriptor(const Descriptor& rhs); 53 | Descriptor& operator=(const Descriptor& rhs); 54 | }; 55 | } // namespace ssig 56 | #endif // !_SSF_DESCRIPTORS_DESRIPTOR_HPP_ 57 | 58 | 59 | -------------------------------------------------------------------------------- /modules/descriptors/src/descriptor.cpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | #include "ssiglib/descriptors/descriptor.hpp" 43 | 44 | namespace ssig { 45 | Descriptor::Descriptor() { 46 | // Constructor 47 | } 48 | 49 | Descriptor::~Descriptor() { 50 | // Destructor 51 | } 52 | 53 | Descriptor::Descriptor(const Descriptor& rhs) { 54 | // Constructor Copy 55 | } 56 | 57 | Descriptor& Descriptor::operator=(const Descriptor& rhs) { 58 | if (this != &rhs) { 59 | // code here 60 | } 61 | return *this; 62 | } 63 | } // namespace ssig 64 | -------------------------------------------------------------------------------- /modules/descriptors/test/test_bic.cpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | 43 | #include 44 | #include 45 | #include 46 | #include 47 | 48 | TEST(BIC, BIC_Simple) { 49 | cv::Mat img = cv::imread("bic.png"); 50 | ASSERT_FALSE(img.empty()); 51 | ssig::BIC bic(img); 52 | cv::Mat featVector; 53 | 54 | bic.extract(featVector); 55 | ASSERT_FLOAT_EQ(9, featVector.at(127)); 56 | ASSERT_FLOAT_EQ(8, featVector.at(63)); 57 | } 58 | 59 | -------------------------------------------------------------------------------- /modules/core/include/ssiglib/core/core_defs.hpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | 43 | #ifndef _SSIG_CORE_DEFS_HPP_ 44 | #define _SSIG_CORE_DEFS_HPP_ 45 | 46 | namespace ssig { 47 | 48 | #ifndef CORE_EXPORT 49 | #if (defined WIN32 || defined _WIN32 || defined __CYGWIN__) 50 | #if defined CORE_API_EXPORTS 51 | #define CORE_EXPORT __declspec(dllexport) 52 | #else 53 | #define CORE_EXPORT __declspec(dllimport) 54 | #endif 55 | #else 56 | #define CORE_EXPORT 57 | #endif 58 | #endif 59 | 60 | } // namespace ssig 61 | 62 | #endif // !_SSIG_CORE_DEFS_HPP_PP_ 63 | -------------------------------------------------------------------------------- /modules/ml/include/ssiglib/ml/multiclass.hpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | #ifndef _SSIG_ML_MULTICLASS_HPP_ 43 | #define _SSIG_ML_MULTICLASS_HPP_ 44 | 45 | // ssiglib 46 | #include "ssiglib/core/algorithm.hpp" 47 | #include "ssiglib/ml/ml_defs.hpp" 48 | #include "ssiglib/ml/classification.hpp" 49 | 50 | 51 | namespace ssig { 52 | class Multiclass : public Classifier { 53 | public: 54 | Multiclass() = default; 55 | virtual ~Multiclass() = default; 56 | 57 | bool isClassifier() const override; 58 | }; 59 | } // namespace ssig 60 | #endif // !_SSIG_ML_MULTICLASS_HPP_ 61 | -------------------------------------------------------------------------------- /modules/hashing/include/ssiglib/hashing/hashing_defs.hpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | 43 | #ifndef _SSIG_HASHING_DEFS_HPP_ 44 | #define _SSIG_HASHING_DEFS_HPP_ 45 | 46 | namespace ssig { 47 | 48 | #ifndef HASHING_EXPORT 49 | #if (defined WIN32 || defined _WIN32 || defined __CYGWIN__) 50 | #if defined HASHING_API_EXPORTS 51 | #define HASHING_EXPORT __declspec(dllexport) 52 | #else 53 | #define HASHING_EXPORT __declspec(dllimport) 54 | #endif 55 | #else 56 | #define HASHING_EXPORT 57 | #endif 58 | #endif 59 | 60 | } // namespace ssig 61 | 62 | #endif // !_SSIG_HASHING_DEFS_HPP_PP_ 63 | -------------------------------------------------------------------------------- /modules/ml/include/ssiglib/ml/ml_defs.hpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | 43 | #ifndef _SSIG_ML_DEFS_HPP_ 44 | #define _SSIG_ML_DEFS_HPP_ 45 | 46 | #include 47 | #include 48 | 49 | namespace ssig { 50 | 51 | #ifndef ML_EXPORT 52 | #if (defined WIN32 || defined _WIN32 || defined __CYGWIN__) 53 | #if defined ML_API_EXPORTS 54 | #define ML_EXPORT __declspec(dllexport) 55 | #else 56 | #define ML_EXPORT __declspec(dllimport) 57 | #endif 58 | #else 59 | #define ML_EXPORT 60 | #endif 61 | #endif 62 | 63 | } // namespace ssig 64 | 65 | #endif // !_SSIG_ML_DEFS_HPP_PP_ 66 | -------------------------------------------------------------------------------- /modules/core/include/ssiglib/core/base_object.hpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | 43 | #ifndef _SSIG_CORE_BASE_OBJECT_HPP_ 44 | #define _SSIG_CORE_BASE_OBJECT_HPP_ 45 | 46 | #include "ssiglib/core/core_defs.hpp" 47 | 48 | namespace ssig { 49 | 50 | class BaseObject { 51 | public: 52 | CORE_EXPORT BaseObject(void); 53 | 54 | CORE_EXPORT virtual ~BaseObject(void); 55 | 56 | CORE_EXPORT BaseObject(const BaseObject& rhs); 57 | 58 | CORE_EXPORT BaseObject& operator=(const BaseObject& rhs); 59 | }; 60 | 61 | } // namespace ssig 62 | 63 | #endif // !_SSIG_CORE_BASE_OBJECT_HPP_PP_ 64 | -------------------------------------------------------------------------------- /3rdparty/flann-1.8.4/include/flann/util/timer.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * THE BSD LICENSE 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | *************************************************************************/ 30 | 31 | #ifndef FLANN_TIMER_H 32 | #define FLANN_TIMER_H 33 | 34 | #include 35 | 36 | 37 | namespace flann 38 | { 39 | 40 | /** 41 | * A start-stop timer class. 42 | * 43 | * Can be used to time portions of code. 44 | */ 45 | class StartStopTimer 46 | { 47 | clock_t startTime; 48 | 49 | public: 50 | /** 51 | * Value of the timer. 52 | */ 53 | double value; 54 | 55 | 56 | /** 57 | * Constructor. 58 | */ 59 | StartStopTimer() 60 | { 61 | reset(); 62 | } 63 | 64 | /** 65 | * Starts the timer. 66 | */ 67 | void start() 68 | { 69 | startTime = clock(); 70 | } 71 | 72 | /** 73 | * Stops the timer and updates timer value. 74 | */ 75 | double stop() 76 | { 77 | clock_t stopTime = clock(); 78 | value += ( (double)stopTime - startTime) / CLOCKS_PER_SEC; 79 | 80 | return value; 81 | } 82 | 83 | /** 84 | * Resets the timer value to 0. 85 | */ 86 | void reset() 87 | { 88 | value = 0; 89 | } 90 | 91 | }; 92 | 93 | } 94 | 95 | #endif // FLANN_TIMER_H 96 | -------------------------------------------------------------------------------- /modules/video/include/ssiglib/video/video.hpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | #ifndef _SSIG_VIDEO_VIDEO_HPP_ 43 | #define _SSIG_VIDEO_VIDEO_HPP_ 44 | 45 | #include 46 | #include 47 | 48 | #include 49 | 50 | #include "ssiglib/video/video_defs.hpp" 51 | #include "ssiglib/video/optical_flow_farneback.hpp" 52 | 53 | namespace ssig { 54 | VIDEO_EXPORT void readVideo( 55 | const std::string& videoname, 56 | const bool convert2BW, 57 | std::vector& frames, 58 | int& fps); 59 | } // namespace ssig 60 | #endif // !_SSIG_VIDEO_VIDEO_HPP_ 61 | -------------------------------------------------------------------------------- /modules/video/include/ssiglib/video/video_defs.hpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | 43 | #ifndef _SSIG_VIDEO_DEFS_HPP_ 44 | #define _SSIG_VIDEO_DEFS_HPP_ 45 | 46 | #include 47 | #include 48 | 49 | namespace ssig { 50 | 51 | #ifndef VIDEO_EXPORT 52 | #if (defined WIN32 || defined _WIN32 || defined __CYGWIN__) 53 | #if defined VIDEO_API_EXPORTS 54 | #define VIDEO_EXPORT __declspec(dllexport) 55 | #else 56 | #define VIDEO_EXPORT __declspec(dllimport) 57 | #endif 58 | #else 59 | #define VIDEO_EXPORT 60 | #endif 61 | #endif 62 | 63 | } // namespace ssig 64 | 65 | #endif // !_SSIG_VIDEO_DEFS_HPP_PP_ 66 | -------------------------------------------------------------------------------- /modules/core/include/ssiglib/core/resource.hpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | 43 | #ifndef _SSIG_CORE_RESOURCE_HPP_ 44 | #define _SSIG_CORE_RESOURCE_HPP_ 45 | 46 | #include "ssiglib/core/core_defs.hpp" 47 | #include "ssiglib/core/base_object.hpp" 48 | 49 | namespace ssig { 50 | 51 | class Resource : public BaseObject { 52 | public: 53 | CORE_EXPORT Resource(void); 54 | 55 | CORE_EXPORT virtual ~Resource(void); 56 | 57 | CORE_EXPORT Resource(const Resource& rhs); 58 | 59 | CORE_EXPORT Resource& operator=(const Resource& rhs); 60 | }; 61 | 62 | } // namespace ssig 63 | 64 | #endif // !_SSIG_CORE_RESOURCE_HPP_ 65 | -------------------------------------------------------------------------------- /3rdparty/flann-1.8.4/include/flann/util/sampling.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | *************************************************************************/ 28 | 29 | 30 | #ifndef FLANN_SAMPLING_H_ 31 | #define FLANN_SAMPLING_H_ 32 | 33 | #include "flann/util/matrix.h" 34 | #include "flann/util/random.h" 35 | 36 | namespace flann 37 | { 38 | 39 | template 40 | Matrix random_sample(Matrix& srcMatrix, size_t size, bool remove = false) 41 | { 42 | UniqueRandom rand_unique(int(srcMatrix.rows)); 43 | Matrix newSet(new T[size * srcMatrix.cols], size,srcMatrix.cols); 44 | 45 | T* src,* dest; 46 | for (size_t i=0; i(rand_int(int(srcMatrix.rows - i))); 50 | } 51 | else { 52 | r = static_cast(rand_unique.next()); 53 | } 54 | dest = newSet[i]; 55 | src = srcMatrix[r]; 56 | std::copy(src, src+srcMatrix.cols, dest); 57 | if (remove) { 58 | src = srcMatrix[srcMatrix.rows-i-1]; 59 | dest = srcMatrix[r]; 60 | std::copy(src, src+srcMatrix.cols, dest); 61 | } 62 | } 63 | if (remove) { 64 | srcMatrix.rows -= size; 65 | } 66 | return newSet; 67 | } 68 | 69 | } // namespace 70 | 71 | 72 | #endif /* FLANN_SAMPLING_H_ */ 73 | -------------------------------------------------------------------------------- /modules/descriptors/include/ssiglib/descriptors/descriptors_defs.hpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | 43 | #ifndef _SSIG_DESCRIPTORS_DEFS_HPP_ 44 | #define _SSIG_DESCRIPTORS_DEFS_HPP_ 45 | 46 | #include 47 | 48 | namespace ssig { 49 | 50 | #ifndef DESCRIPTORS_EXPORT 51 | #if (defined WIN32 || defined _WIN32 || defined __CYGWIN__) 52 | #if defined DESCRIPTORS_API_EXPORTS 53 | #define DESCRIPTORS_EXPORT __declspec(dllexport) 54 | #else 55 | #define DESCRIPTORS_EXPORT __declspec(dllimport) 56 | #endif 57 | #else 58 | #define DESCRIPTORS_EXPORT 59 | #endif 60 | #endif 61 | 62 | } // namespace ssig 63 | 64 | #endif // !_SSIG_DESCRIPTORS_DEFS_HPP_PP_ 65 | -------------------------------------------------------------------------------- /modules/descriptors/include/ssiglib/descriptors/descriptor.hpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | #ifndef _SSIG_DESCRIPTORS_DESRIPTOR_HPP_ 43 | #define _SSIG_DESCRIPTORS_DESRIPTOR_HPP_ 44 | #include 45 | #include "descriptors_defs.hpp" 46 | 47 | namespace ssig { 48 | class Descriptor : public ssig::Algorithm { 49 | public: 50 | DESCRIPTORS_EXPORT Descriptor(void); 51 | DESCRIPTORS_EXPORT virtual ~Descriptor(void); 52 | DESCRIPTORS_EXPORT Descriptor(const Descriptor& rhs); 53 | DESCRIPTORS_EXPORT Descriptor& operator=(const Descriptor& rhs); 54 | }; 55 | } // namespace ssig 56 | #endif // !_SSF_DESCRIPTORS_DESRIPTOR_HPP_ 57 | 58 | 59 | -------------------------------------------------------------------------------- /modules/core/src/exception.cpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | 43 | #include "ssiglib/core/exception.hpp" 44 | 45 | #include 46 | 47 | namespace ssig { 48 | 49 | Exception::Exception(const char* message /*= "" */) : mMessage(message) {} 50 | 51 | Exception::Exception(const std::string& message) : mMessage(message) {} 52 | 53 | Exception::~Exception() throw() {} 54 | 55 | Exception::Exception(const Exception& rhs) : mMessage(rhs.mMessage) {} 56 | 57 | Exception& Exception::operator=(const Exception& rhs) { 58 | if (this != &rhs) { 59 | this->mMessage = rhs.mMessage; 60 | } 61 | return *this; 62 | } 63 | 64 | const char* Exception::what() const throw() { return this->mMessage.c_str(); } 65 | 66 | } // namespace ssig 67 | -------------------------------------------------------------------------------- /modules/descriptors/test/test_lbp.cpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | #include 43 | 44 | #include 45 | #include 46 | 47 | TEST(LBP, SimpleResult) { 48 | cv::Mat_ img = (cv::Mat_(3, 3) << 49 | 1, 1, 0, 50 | 1, 1, 0, 51 | 0, 0, 1); 52 | cv::Mat_ gt = (cv::Mat_(3, 3) << 53 | 208, 104, 104, 54 | 22, 139, 107, 55 | 22, 31, 1); 56 | 57 | cv::Mat diff, lbpImg; 58 | cv::Mat_ out; 59 | 60 | ssig::LBP lbp(img); 61 | lbp.extract(out); 62 | lbp.getLbpImage(lbpImg); 63 | 64 | cv::compare(gt, lbpImg, diff, cv::CMP_EQ); 65 | auto nonzeros = cv::countNonZero(diff); 66 | GTEST_ASSERT_EQ(9, nonzeros); 67 | } 68 | -------------------------------------------------------------------------------- /modules/core/test/test_cube.cpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | #include 43 | #include "ssiglib/core/cube.hpp" 44 | 45 | TEST(cube, CubeIntersection) { 46 | int temporalSize = 5; 47 | ssig::Cube cuboid(0, 0, 2, 8, 8, 3); 48 | 49 | auto cuboidRoi = ssig::Cube(0, 0, 0, 16, 16, 8); 50 | auto intersection = cuboidRoi & cuboid; 51 | 52 | EXPECT_EQ(intersection, cuboid); 53 | 54 | cuboid.x0 = 13; 55 | intersection = cuboidRoi & cuboid; 56 | EXPECT_FALSE(intersection == cuboid); 57 | 58 | cuboid.x0 = 0; 59 | cuboid.y0 = 13; 60 | intersection = cuboidRoi & cuboid; 61 | EXPECT_FALSE(intersection == cuboid); 62 | 63 | cuboid.x0 = 0; 64 | cuboid.y0 = 0; 65 | cuboid.t0 = 13; 66 | intersection = cuboidRoi & cuboid; 67 | EXPECT_FALSE(intersection == cuboid); 68 | } 69 | -------------------------------------------------------------------------------- /modules/core/include/ssiglib/core/exception.hpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | 43 | #ifndef _SSIG_CORE_EXCEPTION_HPP_ 44 | #define _SSIG_CORE_EXCEPTION_HPP_ 45 | 46 | #include 47 | #include 48 | 49 | #include "ssiglib/core/core_defs.hpp" 50 | 51 | namespace ssig { 52 | 53 | class Exception : public std::exception { 54 | public: 55 | CORE_EXPORT explicit Exception(const char* message = ""); 56 | 57 | CORE_EXPORT explicit Exception(const std::string& message); 58 | 59 | CORE_EXPORT virtual ~Exception() throw(); 60 | 61 | CORE_EXPORT Exception(const Exception& rhs); 62 | 63 | CORE_EXPORT Exception& operator=(const Exception& rhs); 64 | 65 | CORE_EXPORT const char* what() const throw() override; 66 | 67 | protected: 68 | std::string mMessage; 69 | }; 70 | 71 | } // namespace ssig 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /modules/core/test/test_sampling.cpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | 43 | #include 44 | #include 45 | #include 46 | 47 | #include 48 | 49 | TEST(ImageSampling, execution) { 50 | auto samples = ssig::Sampling::sampleImage(10, 10, 2, 2, 1.0f, 1.0f, 1, 51 | 1.0f, 1.0f); 52 | 53 | EXPECT_EQ(25, static_cast(samples.size())); 54 | EXPECT_EQ(cv::Rect(0, 0, 2, 2), samples[0]); 55 | EXPECT_EQ(cv::Rect(8, 8, 2, 2), samples.back()); 56 | } 57 | 58 | TEST(ImageSampling, FeatureDetection) { 59 | auto img = cv::imread("000036.jpg", cv::IMREAD_GRAYSCALE); 60 | int maxPatches = 20; 61 | cv::Size winSize{80, 80}; 62 | 63 | auto samples = ssig::Sampling::sampleImage(img, maxPatches, winSize); 64 | } 65 | -------------------------------------------------------------------------------- /modules/ml/test/test_stacked_pls.cpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | #include 43 | #include "ssiglib/ml/stacked_pls.hpp" 44 | 45 | TEST(StackedPLS, SampleStackedPLS) { 46 | /** 47 | * This Test is to complicated and costly to be included here you 48 | may take a look on this file link_to_code . it shows a sample usage of the method 49 | on the mnist digits dataset. 50 | * Using the first 100th training samples and a linear OvO svm 51 | for classification, the stacked pls was able to achieve 52 | 0.66 mean average precision. 53 | * Points of notice: 54 | ***The normalization method was not specified in the paper 55 | so we used the x - min / (max - min) scalling. 56 | ***The results were obtained disregarding their one versus one scheme 57 | for feature extraction. 58 | ***We did not discarded the borders as they did. 59 | **/ 60 | } 61 | -------------------------------------------------------------------------------- /modules/ml/include/ssiglib/ml/spatial_pyramid.hpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | #ifndef _SSIG_ML_SPATIAL_PYRAMID_HPP_ 43 | #define _SSIG_ML_SPATIAL_PYRAMID_HPP_ 44 | 45 | // c++ 46 | #include 47 | #include 48 | // ssiglib 49 | #include "ml_defs.hpp" 50 | #include "clustering.hpp" 51 | #include "ssiglib/core/algorithm.hpp" 52 | 53 | 54 | namespace ssig { 55 | 56 | namespace SpatialPyramid { 57 | ML_EXPORT void pool( 58 | const cv::Size& imageSize, 59 | const std::vector& clusteringMethods, 60 | const std::vector& pyramidConfigurations, 61 | const std::vector& poolingWeights, 62 | const std::vector>& partFeatures, 63 | const std::vector& partWindows, 64 | const std::vector& scaledHeights, 65 | cv::Mat_& output); 66 | } // namespace SpatialPyramid 67 | 68 | } // namespace ssig 69 | #endif // !_SSF_ML_SPATIAL_PYRAMID_HPP_ 70 | 71 | 72 | -------------------------------------------------------------------------------- /3rdparty/flann-1.8.4/include/flann/util/object_factory.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * THE BSD LICENSE 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | *************************************************************************/ 30 | 31 | #ifndef FLANN_OBJECT_FACTORY_H_ 32 | #define FLANN_OBJECT_FACTORY_H_ 33 | 34 | #include 35 | 36 | namespace flann 37 | { 38 | 39 | class CreatorNotFound 40 | { 41 | }; 42 | 43 | template 46 | class ObjectFactory 47 | { 48 | typedef ObjectFactory ThisClass; 49 | typedef std::map ObjectRegistry; 50 | 51 | // singleton class, private constructor 52 | ObjectFactory() {} 53 | 54 | public: 55 | 56 | bool subscribe(UniqueIdType id, ObjectCreator creator) 57 | { 58 | if (object_registry.find(id) != object_registry.end()) return false; 59 | 60 | object_registry[id] = creator; 61 | return true; 62 | } 63 | 64 | bool unregister(UniqueIdType id) 65 | { 66 | return object_registry.erase(id) == 1; 67 | } 68 | 69 | ObjectCreator create(UniqueIdType id) 70 | { 71 | typename ObjectRegistry::const_iterator iter = object_registry.find(id); 72 | 73 | if (iter == object_registry.end()) { 74 | throw CreatorNotFound(); 75 | } 76 | 77 | return iter->second; 78 | } 79 | 80 | static ThisClass& instance() 81 | { 82 | static ThisClass the_factory; 83 | return the_factory; 84 | } 85 | private: 86 | ObjectRegistry object_registry; 87 | }; 88 | 89 | } 90 | 91 | #endif /* FLANN_OBJECT_FACTORY_H_ */ 92 | -------------------------------------------------------------------------------- /3rdparty/flann-1.8.4/include/flann/mpi/client.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2011 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2011 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | *************************************************************************/ 28 | 29 | 30 | #ifndef MPI_CLIENT_H_ 31 | #define MPI_CLIENT_H_ 32 | 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include "queries.h" 38 | 39 | namespace flann { 40 | namespace mpi { 41 | 42 | 43 | class Client 44 | { 45 | public: 46 | Client(const std::string& host, const std::string& service) 47 | { 48 | tcp::resolver resolver(io_service_); 49 | tcp::resolver::query query(tcp::v4(), host, service); 50 | iterator_ = resolver.resolve(query); 51 | } 52 | 53 | 54 | template 55 | void knnSearch(const flann::Matrix& queries, flann::Matrix& indices, flann::Matrix& dists, int knn, const SearchParams& params) 56 | { 57 | tcp::socket sock(io_service_); 58 | sock.connect(*iterator_); 59 | 60 | Request req; 61 | req.nn = knn; 62 | req.queries = queries; 63 | req.checks = params.checks; 64 | // send request 65 | write_object(sock,req); 66 | 67 | Response resp; 68 | // read response 69 | read_object(sock, resp); 70 | 71 | for (size_t i=0;i 46 | #include 47 | #include 48 | 49 | #include "ssiglib/ml/pls.hpp" 50 | #include "hashing_defs.hpp" 51 | 52 | namespace ssig { 53 | class PLSH { 54 | public: 55 | typedef std::vector> CandListType; 56 | 57 | HASHING_EXPORT PLSH(const cv::Mat_ samples, const cv::Mat_ labels, 58 | const int models, const int factors = 10); 59 | 60 | HASHING_EXPORT CandListType& query(const cv::Mat_ sample, 61 | CandListType& candidates); 62 | 63 | private: 64 | struct HashModel { 65 | PLS mHashFunc; 66 | std::vector mSubjects; 67 | }; 68 | 69 | std::vector mHashModels; 70 | std::vector mSubjects; 71 | 72 | int mFactors; 73 | }; 74 | 75 | } // namespace ssig 76 | 77 | #endif // !_SSF_HASHING_PLSH_HPP_ 78 | -------------------------------------------------------------------------------- /modules/descriptors/test/test_dalal_mbh.cpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | #include 43 | #include 44 | #include "ssiglib/descriptors/dalal_mbh.hpp" 45 | #include "ssiglib/video/optical_flow_farneback.hpp" 46 | #include "ssiglib/video/video.hpp" 47 | 48 | /* 49 | TEST(HOF, SampleHOF) { 50 | // Automatically generated stub 51 | 52 | std::vector frames; 53 | ssig::readVideo("d:/Downloads/aw7z4Wx_460sv.mp4", 54 | frames, true); 55 | ssig::DalalMBH mbh(frames); 56 | mbh.setFrameCombination(ssig::FrameCombination::MAX_POOL); 57 | auto of = cv::createOptFlow_DualTVL1(); 58 | 59 | auto of = ssig::OpticalFlowFarneback::create(); 60 | mbh.setOpticalFlowMethod(of); 61 | cv::Mat out; 62 | mbh.extract(out); 63 | EXPECT_EQ(2, 2 + 2); 64 | } 65 | */ 66 | /* 67 | of->setGamma(0.5); 68 | of->setInnerIterations(10); 69 | of->setScalesNumber(4); 70 | of->setOuterIterations(10); 71 | of->setLambda(1); 72 | of->setMedianFiltering(3); 73 | */ 74 | -------------------------------------------------------------------------------- /modules/ml/test/test_spectral_embedding.cpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | #include 43 | #include "ssiglib/ml/spectral_embedding.hpp" 44 | 45 | TEST(SpectralEmbedding, SampleSpectralEmbedding) { 46 | // Automatically generated stub 47 | auto specEmbedding = ssig::SpectralEmbedding::create(); 48 | cv::Mat_ output, X; 49 | 50 | X = cv::Mat::zeros(30, 10, CV_32FC1); 51 | cv::randn(X.rowRange(0, 15), 52 | cv::Mat::zeros(1, 1, CV_32F), 53 | cv::Mat::ones(1, 1, CV_32F)); 54 | cv::randn(X.rowRange(15, 30), 55 | cv::Mat(1, 1, CV_32F, 10), 56 | cv::Mat::ones(1, 1, CV_32F)); 57 | 58 | specEmbedding->learn(X, output); 59 | auto eiValues = specEmbedding->getEigenValues(); 60 | /* 61 | *We have two Gaussians and therefore Two disconnected components, 62 | we expect that if the method is working, than the two first eigenValues 63 | will be really close to zero. 64 | */ 65 | EXPECT_LT(abs(eiValues.at(0)), 1e-4); 66 | EXPECT_LT(abs(eiValues.at(1)), 1e-4); 67 | } 68 | -------------------------------------------------------------------------------- /modules/ml/include/ssiglib/ml/embedding.hpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | #ifndef _SSIG_ML_EMBEDDING_HPP_ 43 | #define _SSIG_ML_EMBEDDING_HPP_ 44 | 45 | // ssiglib 46 | #include "ssiglib/core/algorithm.hpp" 47 | #include "ssiglib/ml/ml_defs.hpp" 48 | 49 | namespace ssig { 50 | class Embedding : public ssig::Algorithm { 51 | public: 52 | virtual ~Embedding(void) = default; 53 | /** 54 | * @brief: This method must be called before project, 55 | it is used to learn the embedding from the data contained in input. 56 | * @param input: Must be an cv::Mat with one channel 57 | */ 58 | virtual void learn( 59 | cv::InputArray input) = 0; 60 | /** 61 | * @brief: This method finds the embedding of sample on the learned space. 62 | 63 | * @param input: Must be an cv::Mat with one channel 64 | */ 65 | virtual void project( 66 | cv::InputArray sample, 67 | cv::OutputArray output) = 0; 68 | 69 | protected: 70 | Embedding(void) = default; 71 | 72 | private: 73 | // private members 74 | }; 75 | } // namespace ssig 76 | #endif // !_SSIG_ML_EMBEDDING_HPP_ 77 | -------------------------------------------------------------------------------- /modules/descriptors/perf/perf_haralick.cpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | // #include 43 | // #include 44 | // #include 45 | // #include 46 | // 47 | // #include "delivery_man.hpp" 48 | // 49 | // class FastDeliveryManFixture 50 | // : public ::hayai::Fixture 51 | // { 52 | // public: 53 | // virtual void SetUp() 54 | // { 55 | // this->FastDeliveryMan = new DeliveryMan(10); 56 | // } 57 | // 58 | // virtual void TearDown() 59 | // { 60 | // delete this->FastDeliveryMan; 61 | // } 62 | // 63 | // DeliveryMan* FastDeliveryMan; 64 | // }; 65 | // 66 | // /* 67 | // * Note _F suffix in macro name. 68 | // */ 69 | // BENCHMARK_P_F(FastDeliveryManFixture, DeliverPackage, 10, 100, 70 | // (std::size_t distance)) 71 | // { 72 | // FastDeliveryMan->DeliverPackage(distance); 73 | // } 74 | // 75 | // BENCHMARK_P_INSTANCE(FastDeliveryManFixture, DeliverPackage, (1)); 76 | // BENCHMARK_P_INSTANCE(FastDeliveryManFixture, DeliverPackage, (10)); 77 | // BENCHMARK_P_INSTANCE(FastDeliveryManFixture, DeliverPackage, (100)); 78 | -------------------------------------------------------------------------------- /modules/descriptors/test/test_hog_uoccti.cpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | #include 42 | 43 | // opencv 44 | #include 45 | #include 46 | #include 47 | // c++ 48 | #include 49 | // ssiglib 50 | #include "ssiglib/descriptors/hog_uoccti_features.hpp" 51 | 52 | TEST(HOGUOCCTI, Simple) { 53 | cv::Mat img; 54 | cv::Mat_ out; 55 | 56 | img = cv::imread("hog1.png"); 57 | 58 | ssig::HOGUOCCTI hog(img); 59 | hog.setBlockConfiguration({16, 16}); 60 | hog.setBlockStride({8, 8}); 61 | hog.setCellConfiguration({2, 2}); 62 | hog.setNumberOfBins(9); 63 | hog.extract(out); 64 | 65 | cv::FileStorage stg("hog1_expected.yml", cv::FileStorage::READ); 66 | cv::Mat_ expected; 67 | stg["expected_uoccti"] >> expected; 68 | 69 | cv::Mat diff = cv::abs(out - expected); 70 | cv::Mat epsilon(diff.rows, diff.cols, CV_32FC1); 71 | epsilon = 0.1f; 72 | cv::Mat cmpson; 73 | cv::compare(diff, epsilon, cmpson, cv::CMP_LT); 74 | int diffSum = cv::countNonZero(cmpson); 75 | 76 | EXPECT_EQ(31, diffSum); 77 | } 78 | 79 | -------------------------------------------------------------------------------- /modules/descriptors/test/test_hsv.cpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | #include 43 | 44 | #include 45 | #include 46 | #include 47 | 48 | TEST(HSV_Histogram, HSV_Simple) { 49 | cv::Mat img(1, 4, CV_8UC3); 50 | 51 | img.at(0, 0) = cv::Vec3b(255, 21, 0); 52 | img.at(0, 1) = cv::Vec3b(208, 255, 0); 53 | img.at(0, 2) = cv::Vec3b(0, 223, 255); 54 | img.at(0, 3) = cv::Vec3b(0, 0, 255); 55 | 56 | ssig::ColorHistogramHSV hsv(img); 57 | cv::Mat featVector; 58 | 59 | hsv.extract(featVector); 60 | int total = static_cast(cv::sum(featVector)[0]); 61 | ASSERT_EQ(1, total); 62 | 63 | cv::Mat_ expected(1, 256, 0.f); 64 | expected[0][240] = .25f; 65 | expected[0][242] = .25f; 66 | expected[0][247] = .25f; 67 | expected[0][250] = .25f; 68 | 69 | cv::Mat comparison; 70 | cv::compare(featVector, expected, comparison, CV_CMP_EQ); 71 | 72 | int diff = static_cast(cv::countNonZero(comparison)); 73 | ASSERT_EQ(featVector.rows * featVector.cols, diff); 74 | } 75 | 76 | -------------------------------------------------------------------------------- /modules/video/src/video.cpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | #include "ssiglib/video/video.hpp" 43 | 44 | #include 45 | #include 46 | #include 47 | 48 | #include 49 | #include 50 | 51 | namespace ssig { 52 | 53 | void readVideo(const std::string& videoname, 54 | const bool convert2BW, 55 | std::vector& frames, 56 | int& fps) { 57 | cv::VideoCapture capture; 58 | 59 | capture.open(videoname); 60 | if (!capture.isOpened()) { 61 | std::cout << "Error opening video!" << std::endl; 62 | exit(1); 63 | } 64 | 65 | int totalFrames = static_cast(capture.get(cv::CAP_PROP_FRAME_COUNT)); 66 | fps = static_cast(capture.get(cv::CAP_PROP_FPS)); 67 | capture.set(cv::CAP_PROP_CONVERT_RGB, 1); 68 | 69 | frames.resize(totalFrames); 70 | cv::Mat frame; 71 | for (int i = 0; i < totalFrames; ++i) { 72 | int errorCode = capture.read(frame); 73 | if (convert2BW) { 74 | cv::cvtColor(frame, frame, cv::COLOR_RGB2GRAY); 75 | } 76 | frame.copyTo(frames[i]); 77 | } 78 | } 79 | 80 | } // namespace ssig 81 | 82 | 83 | -------------------------------------------------------------------------------- /modules/ml/include/ssiglib/ml/pca_embedding.hpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | #ifndef _SSIG_ML_PCA_EMBEDDING_HPP_ 43 | #define _SSIG_ML_PCA_EMBEDDING_HPP_ 44 | // c++ 45 | #include 46 | // opencv 47 | #include 48 | // ssiglib 49 | #include "embedding.hpp" 50 | 51 | namespace ssig { 52 | class PCAEmbedding : Embedding { 53 | public: 54 | ML_EXPORT virtual ~PCAEmbedding(void) = default; 55 | ML_EXPORT static cv::Ptr create(const int dimensions); 56 | ML_EXPORT PCAEmbedding(const PCAEmbedding& rhs); 57 | ML_EXPORT PCAEmbedding& operator=(const PCAEmbedding& rhs); 58 | 59 | ML_EXPORT void learn(cv::InputArray input) override; 60 | 61 | ML_EXPORT void project( 62 | cv::InputArray sample, 63 | cv::OutputArray output) override; 64 | 65 | protected: 66 | ML_EXPORT PCAEmbedding(void) = default; 67 | 68 | ML_EXPORT void read(const cv::FileNode& fn) override; 69 | ML_EXPORT void write(cv::FileStorage& fs) const override; 70 | 71 | private: 72 | // private members 73 | int mDimensions; 74 | std::unique_ptr mPCA; 75 | }; 76 | } // namespace ssig 77 | #endif // !_SSIG_ML_PCA_EMBEDDING_HPP_ 78 | -------------------------------------------------------------------------------- /modules/hashing/include/ssiglib/hashing/eplsh.hpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | #ifndef _SSF_HASHING_PLSH_HPP_ 43 | #define _SSF_HASHING_PLSH_HPP_ 44 | 45 | #include 46 | #include 47 | #include 48 | 49 | #include "ssiglib/ml/pls.hpp" 50 | #include "hashing_defs.hpp" 51 | 52 | namespace ssig { 53 | class EPLSH { 54 | public: 55 | typedef std::vector> CandListType; 56 | 57 | HASHING_EXPORT EPLSH(const cv::Mat_ samples, 58 | const cv::Mat_ labels, 59 | const int models, 60 | const int factors = 10, 61 | const int ndim = 5000); 62 | 63 | HASHING_EXPORT CandListType& query(const cv::Mat_ sample, 64 | CandListType& candidates); 65 | 66 | private: 67 | struct HashModel { 68 | PLS mHashFunc; 69 | std::vector mSubjects; 70 | std::vector mIndexes; 71 | }; 72 | 73 | std::vector mHashModels; 74 | std::vector mSubjects; 75 | 76 | int mFactors; 77 | }; 78 | 79 | } // namespace ssig 80 | 81 | #endif // !_SSF_HASHING_PLSH_HPP_ 82 | 83 | 84 | -------------------------------------------------------------------------------- /modules/descriptors/include/ssiglib/descriptors/co_occurrence.hpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | #ifndef _SSIG_DESCRIPTORS_CO_OCCURRENCE_HPP_ 43 | #define _SSIG_DESCRIPTORS_CO_OCCURRENCE_HPP_ 44 | 45 | #include 46 | #include "descriptors_defs.hpp" 47 | 48 | namespace ssig { 49 | class CoOccurrence { 50 | public: 51 | DESCRIPTORS_EXPORT CoOccurrence(void) = default; 52 | DESCRIPTORS_EXPORT virtual ~CoOccurrence(void) = default; 53 | 54 | DESCRIPTORS_EXPORT static void extractCoOccurrence( 55 | const cv::Mat& mat, 56 | const cv::Rect& patch, 57 | const int dx, const int dy, 58 | const int nbins, 59 | const int levels, 60 | cv::Mat& out); 61 | 62 | DESCRIPTORS_EXPORT static void extractPairCoOccurrence( 63 | const cv::Mat& m1, 64 | const cv::Mat& m2, 65 | const cv::Rect window, 66 | const int dx, const int dy, 67 | const int levels1, 68 | const int bins1, 69 | const int levels2, 70 | const int bins2, 71 | cv::Mat& out); 72 | 73 | DESCRIPTORS_EXPORT static int isValidPixel(int i, int j, int rows, int cols); 74 | 75 | private: 76 | // private members 77 | }; 78 | } // namespace ssig 79 | #endif // !_SSIG_DESCRIPTORS_CO_OCCURRENCE_HPP_ 80 | -------------------------------------------------------------------------------- /3rdparty/flann-1.8.4/include/flann/mpi/queries.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2011 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2011 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | *************************************************************************/ 28 | 29 | 30 | #ifndef MPI_QUERIES_H_ 31 | #define MPI_QUERIES_H_ 32 | 33 | #include 34 | #include 35 | #include 36 | #include 37 | 38 | namespace flann 39 | { 40 | 41 | template 42 | struct Request 43 | { 44 | flann::Matrix queries; 45 | int nn; 46 | int checks; 47 | 48 | template 49 | void serialize(Archive& ar, const unsigned int version) 50 | { 51 | ar & queries & nn & checks; 52 | } 53 | }; 54 | 55 | template 56 | struct Response 57 | { 58 | flann::Matrix indices; 59 | flann::Matrix dists; 60 | 61 | template 62 | void serialize(Archive& ar, const unsigned int version) 63 | { 64 | ar & indices & dists; 65 | } 66 | }; 67 | 68 | 69 | using boost::asio::ip::tcp; 70 | 71 | template 72 | void read_object(tcp::socket& sock, T& val) 73 | { 74 | uint32_t size; 75 | boost::asio::read(sock, boost::asio::buffer(&size, sizeof(size))); 76 | size = ntohl(size); 77 | 78 | boost::asio::streambuf archive_stream; 79 | boost::asio::read(sock, archive_stream, boost::asio::transfer_at_least(size)); 80 | 81 | boost::archive::binary_iarchive archive(archive_stream); 82 | archive >> val; 83 | } 84 | 85 | template 86 | void write_object(tcp::socket& sock, const T& val) 87 | { 88 | boost::asio::streambuf archive_stream; 89 | boost::archive::binary_oarchive archive(archive_stream); 90 | archive << val; 91 | 92 | uint32_t size = archive_stream.size(); 93 | size = htonl(size); 94 | boost::asio::write(sock, boost::asio::buffer(&size, sizeof(size))); 95 | boost::asio::write(sock, archive_stream); 96 | 97 | } 98 | 99 | } 100 | 101 | 102 | 103 | #endif /* MPI_QUERIES_H_ */ 104 | -------------------------------------------------------------------------------- /modules/descriptors/include/ssiglib/descriptors/bic_features.hpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | #ifndef _SSIG_DESCRIPTORS_BIC_FEATURES_HPP_ 43 | #define _SSIG_DESCRIPTORS_BIC_FEATURES_HPP_ 44 | 45 | #include "descriptors_defs.hpp" 46 | #include "descriptor_2d.hpp" 47 | 48 | namespace ssig { 49 | class BIC : public Descriptor2D { 50 | public: 51 | DESCRIPTORS_EXPORT BIC(const cv::Mat& input); 52 | DESCRIPTORS_EXPORT BIC(const cv::Mat& input, const BIC& descriptor); 53 | DESCRIPTORS_EXPORT virtual ~BIC(void) = default; 54 | DESCRIPTORS_EXPORT BIC(const BIC& rhs); 55 | 56 | protected: 57 | DESCRIPTORS_EXPORT void read(const cv::FileNode& fn) override; 58 | DESCRIPTORS_EXPORT void write(cv::FileStorage& fs) const override; 59 | 60 | DESCRIPTORS_EXPORT void beforeProcess() override; 61 | DESCRIPTORS_EXPORT void extractFeatures(const cv::Rect& patch, 62 | cv::Mat& output) override; 63 | 64 | private: 65 | static 66 | DESCRIPTORS_EXPORT void compressHistogram(const cv::Mat_& hist, 67 | cv::Mat_& ch); 68 | static 69 | DESCRIPTORS_EXPORT float computeLog(float value); 70 | int nbins = 64; 71 | cv::Mat mInteriorMask; 72 | // private members 73 | }; 74 | } // namespace ssig 75 | #endif // !_SSF_DESCRIPTORS_BIC_FEATURES_HPP_ 76 | 77 | 78 | -------------------------------------------------------------------------------- /modules/descriptors/include/ssiglib/descriptors/haralick.hpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | #ifndef _SSIG_DESCRIPTORS_HARALICK_HPP_ 43 | #define _SSIG_DESCRIPTORS_HARALICK_HPP_ 44 | 45 | #include 46 | #include "ssiglib/descriptors/descriptors_defs.hpp" 47 | 48 | #define HARALICK_EPSILON 0.00001 49 | 50 | namespace ssig { 51 | class Haralick { 52 | public: 53 | DESCRIPTORS_EXPORT static cv::Mat compute(const cv::Mat& mat); 54 | DESCRIPTORS_EXPORT static cv::Mat computeOld(const cv::Mat& mat); 55 | private: 56 | static float f1ASM(const cv::Mat& mat); 57 | static float f2Contrast(const cv::Mat& mat); 58 | static float f3Correlation(const cv::Mat& mat); 59 | static float f4Variance(const cv::Mat& mat); 60 | static float f5IDM(const cv::Mat& mat); 61 | static float f6SumAverage(const cv::Mat& mat); 62 | static float f7SumVariance(const cv::Mat& mat); 63 | static float f8SumEntropy(const cv::Mat& mat); 64 | static float f9Entropy(const cv::Mat& mat); 65 | static float f10DifferenceVariance(const cv::Mat& mat); 66 | static float f11DifferenceEntropy(const cv::Mat& mat); 67 | static float f12InformationCorrelation01(const cv::Mat& mat); 68 | static float f13InformationCorrelation02(const cv::Mat& mat); 69 | static float f15_Directionality(const cv::Mat& mat); 70 | }; 71 | } // namespace ssig 72 | #endif // !_SSIG_DESCRIPTORS_HARALICK_HPP_ 73 | -------------------------------------------------------------------------------- /modules/ml/test/test_pca_embedding.cpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | #include 43 | // ssiglib 44 | #include "ssiglib/ml/pca_embedding.hpp" 45 | #include "ssiglib/core/math.hpp" 46 | 47 | TEST(PCAEmbedding, CovarianceTest) { 48 | /* The goal of PCA is to minimize the covariance 49 | so, here we test if the projection has a quasi-diagonal covar matrix 50 | */ 51 | cv::Mat_ X; 52 | cv::Mat_ mean, std; 53 | 54 | X = cv::Mat::zeros(30, 10, CV_32FC1); 55 | cv::randn(X, cv::Mat::zeros(1, 1, CV_32F), cv::Mat::ones(1, 1, CV_32F)); 56 | 57 | cv::Mat_ centeredX = X.clone(); 58 | ssig::computeMeanStd(X, cv::ml::COL_SAMPLE, mean, std); 59 | ssig::computeZScore(centeredX, mean, std); 60 | 61 | cv::Mat covar = centeredX.t()*centeredX; 62 | float covarValue = static_cast( 63 | (cv::sum(covar) - cv::trace(covar))[0]); 64 | auto embedder = ssig::PCAEmbedding::create(10); 65 | 66 | embedder->learn(X); 67 | cv::Mat projection; 68 | embedder->project(X, projection); 69 | 70 | centeredX = projection.clone(); 71 | ssig::computeMeanStd(centeredX, cv::ml::COL_SAMPLE, mean, std); 72 | ssig::computeZScore(centeredX, mean, std); 73 | cv::Mat newCovar = centeredX.t()*centeredX; 74 | float newCovarValue = static_cast( 75 | (cv::sum(newCovar) - cv::trace(newCovar))[0]); 76 | 77 | EXPECT_LT(abs(newCovarValue), abs(covarValue)); 78 | } 79 | -------------------------------------------------------------------------------- /modules/ml/src/pca_embedding.cpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | #include "ssiglib/ml/pca_embedding.hpp" 43 | 44 | namespace ssig { 45 | cv::Ptr PCAEmbedding::create(const int dimensions) { 46 | auto ans = cv::Ptr(new PCAEmbedding()); 47 | ans->mDimensions = dimensions; 48 | return ans; 49 | } 50 | 51 | PCAEmbedding::PCAEmbedding(const PCAEmbedding& rhs) { 52 | // Constructor Copy 53 | this->mDimensions = rhs.mDimensions; 54 | } 55 | 56 | PCAEmbedding& PCAEmbedding::operator=(const PCAEmbedding& rhs) { 57 | if (this != &rhs) { 58 | this->mDimensions = rhs.mDimensions; 59 | } 60 | return *this; 61 | } 62 | 63 | void PCAEmbedding::learn(cv::InputArray input) { 64 | #ifdef _WIN32 65 | mPCA = std::make_unique(); 66 | #else 67 | mPCA = std::unique_ptr(new cv::PCA()); 68 | #endif 69 | cv::Mat X = input.getMat(); 70 | mPCA->operator()(X, cv::noArray(), cv::PCA::DATA_AS_ROW); 71 | } 72 | 73 | void PCAEmbedding::project( 74 | cv::InputArray sample, 75 | cv::OutputArray output) { 76 | cv::Mat X = sample.getMat(); 77 | 78 | output.create(X.rows, X.cols, CV_32F); 79 | mPCA->project(sample, output); 80 | cv::Mat dst = output.getMat(); 81 | 82 | dst = dst.colRange(0, mDimensions); 83 | dst.copyTo(output); 84 | } 85 | 86 | void PCAEmbedding::read(const cv::FileNode& fn) {} 87 | 88 | void PCAEmbedding::write(cv::FileStorage& fs) const {} 89 | } // namespace ssig 90 | -------------------------------------------------------------------------------- /modules/descriptors/include/ssiglib/descriptors/lbp_features.hpp: -------------------------------------------------------------------------------- 1 | /*L***************************************************************************** 2 | * 3 | * Copyright (c) 2015, Smart Surveillance Interest Group, all rights reserved. 4 | * 5 | * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 6 | * 7 | * By downloading, copying, installing or using the software you agree to this 8 | * license. If you do not agree to this license, do not download, install, copy 9 | * or use the software. 10 | * 11 | * Software License Agreement (BSD License) 12 | * For Smart Surveillance Interest Group Library 13 | * http://ssig.dcc.ufmg.br 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 21 | * 2. Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * 3. Neither the name of the copyright holder nor the names of its 26 | * contributors may be used to endorse or promote products derived from 27 | * this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 33 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | *****************************************************************************L*/ 41 | 42 | #ifndef _SSIG_DESCRIPTORS_LBP_FEATURES_HPP_ 43 | #define _SSIG_DESCRIPTORS_LBP_FEATURES_HPP_ 44 | 45 | #include "descriptors_defs.hpp" 46 | #include "descriptor_2d.hpp" 47 | 48 | namespace ssig { 49 | 50 | class LBP : public Descriptor2D { 51 | public: 52 | DESCRIPTORS_EXPORT LBP(const cv::Mat& input); 53 | DESCRIPTORS_EXPORT LBP(const cv::Mat& input, const LBP& descriptor); 54 | DESCRIPTORS_EXPORT LBP(const LBP& descriptor); 55 | DESCRIPTORS_EXPORT virtual ~LBP(void) = default; 56 | 57 | DESCRIPTORS_EXPORT cv::Mat_ getKernel() const; 58 | 59 | DESCRIPTORS_EXPORT void setKernel(const cv::Mat_& kernel); 60 | 61 | DESCRIPTORS_EXPORT void getLbpImage(cv::Mat& output) const; 62 | 63 | protected: 64 | DESCRIPTORS_EXPORT void read(const cv::FileNode& fn) override; 65 | DESCRIPTORS_EXPORT void write(cv::FileStorage& fs) const override; 66 | DESCRIPTORS_EXPORT void beforeProcess() override; 67 | DESCRIPTORS_EXPORT void extractFeatures(const cv::Rect& patch, 68 | cv::Mat& output) override; 69 | 70 | DESCRIPTORS_EXPORT bool inValidRange(const int i, const int j) const; 71 | 72 | private: 73 | DESCRIPTORS_EXPORT void setDefaultKernel(); 74 | // private members 75 | cv::Mat_ mBinaryPattern; 76 | cv::Mat_ mKernel; 77 | }; 78 | 79 | } // namespace ssig 80 | 81 | #endif // !_SSIG_DESCRIPTORS_LBP_FEATURES_HPP_ 82 | -------------------------------------------------------------------------------- /3rdparty/flann-1.8.4/include/flann/nn/ground_truth.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * THE BSD LICENSE 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | *************************************************************************/ 30 | 31 | #ifndef FLANN_GROUND_TRUTH_H_ 32 | #define FLANN_GROUND_TRUTH_H_ 33 | 34 | #include "flann/algorithms/dist.h" 35 | #include "flann/util/matrix.h" 36 | 37 | 38 | namespace flann 39 | { 40 | 41 | template 42 | void find_nearest(const Matrix& dataset, typename Distance::ElementType* query, size_t* matches, size_t nn, 43 | size_t skip = 0, Distance distance = Distance()) 44 | { 45 | typedef typename Distance::ElementType ElementType; 46 | typedef typename Distance::ResultType DistanceType; 47 | int n = int(nn + skip); 48 | 49 | int* match = new int[n]; 50 | DistanceType* dists = new DistanceType[n]; 51 | 52 | dists[0] = distance(dataset[0], query, dataset.cols); 53 | match[0] = 0; 54 | int dcnt = 1; 55 | 56 | for (size_t i=1; i=1 && dists[j] 87 | void compute_ground_truth(const Matrix& dataset, const Matrix& testset, Matrix& matches, 88 | int skip=0, Distance d = Distance()) 89 | { 90 | for (size_t i=0; i(dataset, testset[i], matches[i], matches.cols, skip, d); 92 | } 93 | } 94 | 95 | 96 | } 97 | 98 | #endif //FLANN_GROUND_TRUTH_H_ 99 | --------------------------------------------------------------------------------