Techt3o commited on
Commit
47cf931
·
verified ·
1 Parent(s): f7aa949

00b811cec297dfe1030807f4742fcf4a1ea098b1589c3d53dd182eae6de00a75

Browse files
Files changed (50) hide show
  1. third-party/DPVO/Pangolin/scripts/vcpkg/ports/date/portfile.cmake +44 -0
  2. third-party/DPVO/Pangolin/scripts/vcpkg/ports/date/vcpkg.json +25 -0
  3. third-party/DPVO/Pangolin/scripts/vcpkg/ports/dav1d/patch_underscore_prefix.patch +13 -0
  4. third-party/DPVO/Pangolin/scripts/vcpkg/ports/dav1d/portfile.cmake +32 -0
  5. third-party/DPVO/Pangolin/scripts/vcpkg/ports/dav1d/vcpkg.json +14 -0
  6. third-party/DPVO/Pangolin/scripts/vcpkg/ports/daw-header-libraries/portfile.cmake +18 -0
  7. third-party/DPVO/Pangolin/scripts/vcpkg/ports/daw-header-libraries/vcpkg.json +16 -0
  8. third-party/DPVO/Pangolin/scripts/vcpkg/ports/daw-json-link/portfile.cmake +40 -0
  9. third-party/DPVO/Pangolin/scripts/vcpkg/ports/daw-json-link/vcpkg.json +17 -0
  10. third-party/DPVO/Pangolin/scripts/vcpkg/ports/daw-utf-range/portfile.cmake +22 -0
  11. third-party/DPVO/Pangolin/scripts/vcpkg/ports/daw-utf-range/vcpkg.json +17 -0
  12. third-party/DPVO/Pangolin/scripts/vcpkg/ports/dbg-macro/portfile.cmake +14 -0
  13. third-party/DPVO/Pangolin/scripts/vcpkg/ports/dbg-macro/vcpkg.json +6 -0
  14. third-party/DPVO/Pangolin/scripts/vcpkg/ports/dbghelp/portfile.cmake +26 -0
  15. third-party/DPVO/Pangolin/scripts/vcpkg/ports/dbghelp/vcpkg.json +7 -0
  16. third-party/DPVO/Pangolin/scripts/vcpkg/ports/dbow2/portfile.cmake +28 -0
  17. third-party/DPVO/Pangolin/scripts/vcpkg/ports/dbow2/vcpkg.json +10 -0
  18. third-party/DPVO/Pangolin/scripts/vcpkg/ports/dbow3/fix_cmake.patch +2496 -0
  19. third-party/DPVO/Pangolin/scripts/vcpkg/ports/dbow3/portfile.cmake +32 -0
  20. third-party/DPVO/Pangolin/scripts/vcpkg/ports/dbow3/vcpkg.json +14 -0
  21. third-party/DPVO/Pangolin/scripts/vcpkg/ports/dcmtk/dcmtk.patch +16 -0
  22. third-party/DPVO/Pangolin/scripts/vcpkg/ports/dcmtk/portfile.cmake +50 -0
  23. third-party/DPVO/Pangolin/scripts/vcpkg/ports/dcmtk/usage +18 -0
  24. third-party/DPVO/Pangolin/scripts/vcpkg/ports/dcmtk/vcpkg.json +17 -0
  25. third-party/DPVO/Pangolin/scripts/vcpkg/ports/debug-assert/portfile.cmake +24 -0
  26. third-party/DPVO/Pangolin/scripts/vcpkg/ports/debug-assert/vcpkg.json +6 -0
  27. third-party/DPVO/Pangolin/scripts/vcpkg/ports/decimal-for-cpp/portfile.cmake +11 -0
  28. third-party/DPVO/Pangolin/scripts/vcpkg/ports/decimal-for-cpp/vcpkg.json +5 -0
  29. third-party/DPVO/Pangolin/scripts/vcpkg/ports/detours/find-jmp-bounds-arm64.patch +24 -0
  30. third-party/DPVO/Pangolin/scripts/vcpkg/ports/detours/portfile.cmake +35 -0
  31. third-party/DPVO/Pangolin/scripts/vcpkg/ports/detours/vcpkg.json +8 -0
  32. third-party/DPVO/Pangolin/scripts/vcpkg/ports/devicenameresolver/CMakeLists.txt +23 -0
  33. third-party/DPVO/Pangolin/scripts/vcpkg/ports/devicenameresolver/add-string-headfile.patch +12 -0
  34. third-party/DPVO/Pangolin/scripts/vcpkg/ports/devicenameresolver/portfile.cmake +25 -0
  35. third-party/DPVO/Pangolin/scripts/vcpkg/ports/devicenameresolver/vcpkg.json +13 -0
  36. third-party/DPVO/Pangolin/scripts/vcpkg/ports/devil/0001_fix-encoding.patch +173 -0
  37. third-party/DPVO/Pangolin/scripts/vcpkg/ports/devil/0002_fix-missing-mfc-includes.patch +102 -0
  38. third-party/DPVO/Pangolin/scripts/vcpkg/ports/devil/0003_fix-openexr.patch +55 -0
  39. third-party/DPVO/Pangolin/scripts/vcpkg/ports/devil/0004_compatible-jasper-2-0-20.patch +52 -0
  40. third-party/DPVO/Pangolin/scripts/vcpkg/ports/devil/0005-fix-pkgconfig.patch +52 -0
  41. third-party/DPVO/Pangolin/scripts/vcpkg/ports/devil/0006-fix-ilut-header.patch +12 -0
  42. third-party/DPVO/Pangolin/scripts/vcpkg/ports/devil/enable-static.patch +26 -0
  43. third-party/DPVO/Pangolin/scripts/vcpkg/ports/devil/portfile.cmake +49 -0
  44. third-party/DPVO/Pangolin/scripts/vcpkg/ports/devil/vcpkg.json +53 -0
  45. third-party/DPVO/Pangolin/scripts/vcpkg/ports/dimcli/fix-build.patch +39 -0
  46. third-party/DPVO/Pangolin/scripts/vcpkg/ports/dimcli/portfile.cmake +31 -0
  47. third-party/DPVO/Pangolin/scripts/vcpkg/ports/dimcli/vcpkg.json +14 -0
  48. third-party/DPVO/Pangolin/scripts/vcpkg/ports/directx-headers/portfile.cmake +20 -0
  49. third-party/DPVO/Pangolin/scripts/vcpkg/ports/directx-headers/vcpkg.json +8 -0
  50. third-party/DPVO/Pangolin/scripts/vcpkg/ports/directxmath/portfile.cmake +31 -0
third-party/DPVO/Pangolin/scripts/vcpkg/ports/date/portfile.cmake ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if(VCPKG_TARGET_IS_WINDOWS)
2
+ message(WARNING
3
+ "You will need to also install https://raw.githubusercontent.com/unicode-org/cldr/master/common/supplemental/windowsZones.xml into your install location.\n"
4
+ "See https://howardhinnant.github.io/date/tz.html"
5
+ )
6
+ endif()
7
+
8
+ vcpkg_from_github(
9
+ OUT_SOURCE_PATH SOURCE_PATH
10
+ REPO HowardHinnant/date
11
+ REF v3.0.1
12
+ SHA512 6bdc7cba821d66e17a559250cc0ce0095808e9db81cec9e16eaa4c31abdfa705299c67b72016d9b06b302bc306d063e83a374eb00728071b83a5ad650d59034f
13
+ HEAD_REF master
14
+ PATCHES
15
+ 0001-fix-uwp.patch
16
+ 0002-fix-cmake-3.14.patch
17
+ fix-uninitialized-values.patch #Update the new version please remove this patch
18
+ )
19
+
20
+ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
21
+ INVERTED_FEATURES
22
+ remote-api USE_SYSTEM_TZ_DB
23
+ )
24
+
25
+ vcpkg_cmake_configure(
26
+ SOURCE_PATH "${SOURCE_PATH}"
27
+ OPTIONS
28
+ ${FEATURE_OPTIONS}
29
+ -DBUILD_TZ_LIB=ON
30
+ )
31
+
32
+ vcpkg_cmake_install()
33
+
34
+ if(VCPKG_TARGET_IS_WINDOWS)
35
+ vcpkg_cmake_config_fixup(CONFIG_PATH CMake)
36
+ else()
37
+ vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/date)
38
+ endif()
39
+
40
+ vcpkg_copy_pdbs()
41
+
42
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
43
+
44
+ file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
third-party/DPVO/Pangolin/scripts/vcpkg/ports/date/vcpkg.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "date",
3
+ "version": "3.0.1",
4
+ "port-version": 2,
5
+ "description": "A date and time library based on the C++17 <chrono> header",
6
+ "homepage": "https://github.com/HowardHinnant/date",
7
+ "dependencies": [
8
+ {
9
+ "name": "vcpkg-cmake",
10
+ "host": true
11
+ },
12
+ {
13
+ "name": "vcpkg-cmake-config",
14
+ "host": true
15
+ }
16
+ ],
17
+ "features": {
18
+ "remote-api": {
19
+ "description": "support automatic download of tz data",
20
+ "dependencies": [
21
+ "curl"
22
+ ]
23
+ }
24
+ }
25
+ }
third-party/DPVO/Pangolin/scripts/vcpkg/ports/dav1d/patch_underscore_prefix.patch ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/meson.build b/meson.build
2
+ index 07b2586..02acd91 100644
3
+ --- a/meson.build
4
+ +++ b/meson.build
5
+ @@ -370,7 +370,7 @@ endif
6
+
7
+ cdata.set10('ARCH_PPC64LE', host_machine.cpu() == 'ppc64le')
8
+
9
+ -if cc.symbols_have_underscore_prefix()
10
+ +if cc.symbols_have_underscore_prefix() or (host_machine.cpu_family() == 'x86' and host_machine.system() == 'windows')
11
+ cdata.set10('PREFIX', true)
12
+ cdata_asm.set10('PREFIX', true)
13
+ endif
third-party/DPVO/Pangolin/scripts/vcpkg/ports/dav1d/portfile.cmake ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ vcpkg_from_gitlab(
2
+ GITLAB_URL https://code.videolan.org
3
+ OUT_SOURCE_PATH SOURCE_PATH
4
+ REPO videolan/dav1d
5
+ REF 0.8.2
6
+ SHA512 2f48c88fdbe627f089eb378f43b8f18e1c5cff4645148ee7e14b8f3f8e9d690b28e58fc9cb466e7a9a4c147f06b0d34c47c132070acefbd01abe23cd3c6047d8
7
+ PATCHES
8
+ "patch_underscore_prefix.patch"
9
+ )
10
+
11
+ vcpkg_find_acquire_program(NASM)
12
+ get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY)
13
+ vcpkg_add_to_path(${NASM_EXE_PATH})
14
+
15
+ set(LIBRARY_TYPE ${VCPKG_LIBRARY_LINKAGE})
16
+ if (LIBRARY_TYPE STREQUAL "dynamic")
17
+ set(LIBRARY_TYPE "shared")
18
+ endif(LIBRARY_TYPE STREQUAL "dynamic")
19
+
20
+ vcpkg_configure_meson(
21
+ SOURCE_PATH ${SOURCE_PATH}
22
+ OPTIONS
23
+ --default-library=${LIBRARY_TYPE}
24
+ -Denable_tests=false
25
+ -Denable_tools=false
26
+ )
27
+
28
+ vcpkg_install_meson()
29
+ vcpkg_copy_pdbs()
30
+ vcpkg_fixup_pkgconfig()
31
+
32
+ configure_file("${SOURCE_PATH}/COPYING" "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" COPYONLY)
third-party/DPVO/Pangolin/scripts/vcpkg/ports/dav1d/vcpkg.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "dav1d",
3
+ "version-semver": "0.8.2",
4
+ "port-version": 3,
5
+ "description": "dav1d is a new open-source AV1 decoder developed by the VideoLAN and FFmpeg communities and sponsored by the Alliance for Open Media.",
6
+ "homepage": "https://code.videolan.org/videolan/dav1d",
7
+ "supports": "!(uwp | arm | x86)",
8
+ "dependencies": [
9
+ {
10
+ "name": "vcpkg-tool-meson",
11
+ "host": true
12
+ }
13
+ ]
14
+ }
third-party/DPVO/Pangolin/scripts/vcpkg/ports/daw-header-libraries/portfile.cmake ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Header-only library
2
+ vcpkg_from_github(
3
+ OUT_SOURCE_PATH SOURCE_PATH
4
+ REPO beached/header_libraries
5
+ REF bd372e81e04e256a6ba88217c4b99a3601fb5ef7 #v1.29.7
6
+ SHA512 7aad017e70e79c3244011cbcb719afb385a639e1e4d37955be074bd1d2f501052dcae9347d094a8ef970f3762ebdfe33c90318b2e6891f4b354e823acfee7188
7
+ HEAD_REF master
8
+ )
9
+
10
+ vcpkg_cmake_configure(SOURCE_PATH "${SOURCE_PATH}")
11
+
12
+ vcpkg_cmake_install()
13
+ vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT})
14
+
15
+ # remove empty lib and debug/lib directories (and duplicate files from debug/include)
16
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug" "${CURRENT_PACKAGES_DIR}/lib")
17
+
18
+ file(INSTALL "${SOURCE_PATH}/LICENSE.md" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
third-party/DPVO/Pangolin/scripts/vcpkg/ports/daw-header-libraries/vcpkg.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "daw-header-libraries",
3
+ "version-semver": "1.29.7",
4
+ "description": "Set of header-only algorithms used in daw-utf8-range and daw-json-link.",
5
+ "homepage": "https://github.com/beached/header_libraries",
6
+ "dependencies": [
7
+ {
8
+ "name": "vcpkg-cmake",
9
+ "host": true
10
+ },
11
+ {
12
+ "name": "vcpkg-cmake-config",
13
+ "host": true
14
+ }
15
+ ]
16
+ }
third-party/DPVO/Pangolin/scripts/vcpkg/ports/daw-json-link/portfile.cmake ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Header-only library
2
+ vcpkg_from_github(
3
+ OUT_SOURCE_PATH SOURCE_PATH
4
+ REPO beached/daw_json_link
5
+ REF 828565f48bd077e776fcef322457186d8f01e7eb #v2.10.2
6
+ SHA512 8c870d778c9abb295d323ae913d9e2bb0255f176c7e4f1d8cdf424af9bbe4c5eb650436065bb47e3e8745ff1c12234959526c8dcdf2c169ab55af4b150e6b477
7
+ HEAD_REF master
8
+ )
9
+
10
+ vcpkg_cmake_configure(
11
+ SOURCE_PATH "${SOURCE_PATH}"
12
+ OPTIONS
13
+ -DDAW_USE_PACKAGE_MANAGEMENT=ON
14
+ )
15
+
16
+ vcpkg_cmake_install()
17
+ vcpkg_cmake_config_fixup(CONFIG_PATH share/${PORT}/cmake)
18
+
19
+ # remove empty lib and debug/lib directories (and duplicate files from debug/include)
20
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug" "${CURRENT_PACKAGES_DIR}/lib")
21
+
22
+ # Append the json-link and dragonbox license information into a single
23
+ # copyright file (they are both Boost v1.0 but it is good to be clear).
24
+ file(APPEND "${SOURCE_PATH}/copyright" [=[+----------------------------------------------------------------------------+
25
+ | json-link copywrite |
26
+ +----------------------------------------------------------------------------+
27
+ ]=])
28
+ file(READ "${SOURCE_PATH}/LICENSE" json_link_copywrite)
29
+ file(APPEND "${SOURCE_PATH}/copyright" ${json_link_copywrite})
30
+ file(APPEND "${SOURCE_PATH}/copyright" [=[
31
+
32
+
33
+ +----------------------------------------------------------------------------+
34
+ | dragonbox copywrite |
35
+ +----------------------------------------------------------------------------+
36
+ ]=])
37
+
38
+ file(READ "${SOURCE_PATH}/LICENSE_Dragonbox" dragonbox_copywrite)
39
+ file(APPEND "${SOURCE_PATH}/copyright" ${dragonbox_copywrite})
40
+ file(INSTALL "${SOURCE_PATH}/copyright" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
third-party/DPVO/Pangolin/scripts/vcpkg/ports/daw-json-link/vcpkg.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "daw-json-link",
3
+ "version-semver": "2.10.2",
4
+ "description": "Perhaps the fastest JSON deserializer/serializer posssible or at least close to it.",
5
+ "homepage": "https://github.com/beached/daw_json_link",
6
+ "dependencies": [
7
+ "daw-utf-range",
8
+ {
9
+ "name": "vcpkg-cmake",
10
+ "host": true
11
+ },
12
+ {
13
+ "name": "vcpkg-cmake-config",
14
+ "host": true
15
+ }
16
+ ]
17
+ }
third-party/DPVO/Pangolin/scripts/vcpkg/ports/daw-utf-range/portfile.cmake ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Header-only library
2
+ vcpkg_from_github(
3
+ OUT_SOURCE_PATH SOURCE_PATH
4
+ REPO beached/utf_range
5
+ REF cd45b91a1530a68ce019b876a32b1694b4031613 #v2.2.0
6
+ SHA512 21943b488b4efb8696bfe95f80c8043beed8f5f3cc9a34cfb95d34186d6a0ac2354943ebfd767bd6df42837c29e3c467a107d2f8556a7f719833d43f566afa40
7
+ HEAD_REF master
8
+ )
9
+
10
+ vcpkg_cmake_configure(
11
+ SOURCE_PATH "${SOURCE_PATH}"
12
+ OPTIONS
13
+ -DDAW_USE_PACKAGE_MANAGEMENT=ON
14
+ )
15
+
16
+ vcpkg_cmake_install()
17
+ vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT})
18
+
19
+ # remove empty lib and debug/lib directories (and duplicate files from debug/include)
20
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug" "${CURRENT_PACKAGES_DIR}/lib")
21
+
22
+ file(INSTALL "${SOURCE_PATH}/LICENSE.md" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
third-party/DPVO/Pangolin/scripts/vcpkg/ports/daw-utf-range/vcpkg.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "daw-utf-range",
3
+ "version-semver": "2.2.0",
4
+ "description": "Header-only utf8 string range used by daw-json-link. Includes a constexpr/noexcept modified version of utfcpp.",
5
+ "homepage": "https://github.com/beached/header_libraries",
6
+ "dependencies": [
7
+ "daw-header-libraries",
8
+ {
9
+ "name": "vcpkg-cmake",
10
+ "host": true
11
+ },
12
+ {
13
+ "name": "vcpkg-cmake-config",
14
+ "host": true
15
+ }
16
+ ]
17
+ }
third-party/DPVO/Pangolin/scripts/vcpkg/ports/dbg-macro/portfile.cmake ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # single header file library
2
+
3
+ vcpkg_from_github(
4
+ OUT_SOURCE_PATH SOURCE_PATH
5
+ REPO sharkdp/dbg-macro
6
+ REF 4db61805d90cb66d91bcc56c2703591a0127ed11
7
+ SHA512 68afaedce857f6007edbb65527745aa07ab3dd736e65602b4c6da04646730ef4c09d9a239a9bcae1806c5a0bc0f70b5766edf245b2fd5f84d64cc03a5cadc5c8
8
+ HEAD_REF master
9
+ )
10
+
11
+ file(COPY ${SOURCE_PATH}/dbg.h DESTINATION ${CURRENT_PACKAGES_DIR}/include)
12
+
13
+ # Handle copyright
14
+ configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY)
third-party/DPVO/Pangolin/scripts/vcpkg/ports/dbg-macro/vcpkg.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "name": "dbg-macro",
3
+ "version-date": "2021-11-02",
4
+ "description": "A dbg(...) macro for C++",
5
+ "homepage": "https://github.com/sharkdp/dbg-macro"
6
+ }
third-party/DPVO/Pangolin/scripts/vcpkg/ports/dbghelp/portfile.cmake ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
2
+
3
+ vcpkg_get_windows_sdk(WINDOWS_SDK)
4
+
5
+ if (WINDOWS_SDK VERSION_GREATER "10")
6
+ set(LIBFILEPATH "$ENV{WindowsSdkDir}Debuggers\\lib\\${TRIPLET_SYSTEM_ARCH}\\dbghelp.lib")
7
+ message("LIBFILEPATH: ${LIBFILEPATH}")
8
+ set(DLLFILEPATH "$ENV{WindowsSdkDir}Debuggers\\${TRIPLET_SYSTEM_ARCH}\\dbghelp.dll")
9
+ message("DLLFILEPATH: ${DLLFILEPATH}")
10
+ set(HEADERPATH "$ENV{WindowsSdkDir}Debuggers\\inc\\dbghelp.h")
11
+ message("HEADERPATH: ${HEADERPATH}")
12
+ else()
13
+ message(FATAL_ERROR "Portfile not yet configured for Windows SDK with version: ${WINDOWS_SDK}")
14
+ endif()
15
+
16
+ if (NOT EXISTS "${LIBFILEPATH}" OR NOT EXISTS "${DLLFILEPATH}" OR NOT EXISTS "${HEADERPATH}")
17
+ message(FATAL_ERROR "Cannot find debugging tools in Windows SDK ${WINDOWS_SDK}. Please reinstall the Windows SDK and select \"Debugging Tools\".")
18
+ endif()
19
+
20
+ file(INSTALL ${LIBFILEPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
21
+ file(INSTALL ${LIBFILEPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
22
+ file(INSTALL ${DLLFILEPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
23
+ file(INSTALL ${DLLFILEPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)
24
+ file(INSTALL ${HEADERPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/include)
25
+
26
+ file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright "See https://developer.microsoft.com/windows/downloads/windows-10-sdk for the Windows 10 SDK license")
third-party/DPVO/Pangolin/scripts/vcpkg/ports/dbghelp/vcpkg.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "dbghelp",
3
+ "version": "0",
4
+ "port-version": 2,
5
+ "description": "Windows Debug Help Library",
6
+ "supports": "windows"
7
+ }
third-party/DPVO/Pangolin/scripts/vcpkg/ports/dbow2/portfile.cmake ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
2
+
3
+ vcpkg_from_github(
4
+ OUT_SOURCE_PATH SOURCE_PATH
5
+ REPO dorian3d/DBoW2
6
+ REF 4d08e9fc751fac9063874d85a43c1ccdcda8b401
7
+ SHA512 0a4ad8506c731395cb23d96d0e8afe4131576af88468723b9496cdbc95a031089ecdeb61dbb7205cb3a7599acb60a39887fa9852e7d7a690b8152a1bd26d9bd0
8
+ HEAD_REF master
9
+ )
10
+
11
+ vcpkg_configure_cmake(
12
+ SOURCE_PATH ${SOURCE_PATH}
13
+ PREFER_NINJA
14
+ OPTIONS -DBUILD_Demo=OFF
15
+ )
16
+
17
+ vcpkg_install_cmake()
18
+
19
+ # Move CMake files to the right place
20
+ vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/DBoW2)
21
+
22
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
23
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/DBoW2/DBoW2Config.cmake)
24
+
25
+ # Handle copyright
26
+ file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
27
+ file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright)
28
+
third-party/DPVO/Pangolin/scripts/vcpkg/ports/dbow2/vcpkg.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "dbow2",
3
+ "version-string": "2019-08-05",
4
+ "port-version": 1,
5
+ "description": "DBoW2 is an improved version of the DBow library, an open source C++ library for indexing and converting images into a bag-of-word representation.",
6
+ "homepage": "https://github.com/dorian3d/DBoW2",
7
+ "dependencies": [
8
+ "opencv"
9
+ ]
10
+ }
third-party/DPVO/Pangolin/scripts/vcpkg/ports/dbow3/fix_cmake.patch ADDED
@@ -0,0 +1,2496 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ From d72cb42f5147f7648c462ee1b211070c1691a887 Mon Sep 17 00:00:00 2001
2
+ From: Ramadan <[email protected]>
3
+ Date: Thu, 15 Aug 2019 12:27:19 +0200
4
+ Subject: [PATCH 1/2] Fix CMakeLists.txt and installation
5
+
6
+ ---
7
+ .gitignore | 249 ++++++++++
8
+ CMakeLists.txt | 275 +----------
9
+ Lib/CMakeLists.txt | 99 ++++
10
+ Lib/DBow3Config.cmake | 4 +
11
+ {src => Lib/include/DBow3}/BowVector.h | 1 +
12
+ {src => Lib/include/DBow3}/DBoW3.h | 0
13
+ {src => Lib/include/DBow3}/Database.h | 0
14
+ {src => Lib/include/DBow3}/DescManip.h | 0
15
+ {src => Lib/include/DBow3}/FeatureVector.h | 0
16
+ {src => Lib/include/DBow3}/QueryResults.h | 0
17
+ {src => Lib/include/DBow3}/ScoringObject.h | 0
18
+ {src => Lib/include/DBow3}/Vocabulary.h | 0
19
+ {src => Lib/include/DBow3}/exports.h | 16 +-
20
+ {src => Lib/include/DBow3}/quicklz.h | 0
21
+ {src => Lib/include/DBow3}/timers.h | 0
22
+ {src => Lib/src}/BowVector.cpp | 2 +-
23
+ {src => Lib/src}/Database.cpp | 2 +-
24
+ {src => Lib/src}/DescManip.cpp | 546 ++++++++++-----------
25
+ {src => Lib/src}/FeatureVector.cpp | 2 +-
26
+ {src => Lib/src}/QueryResults.cpp | 2 +-
27
+ {src => Lib/src}/ScoringObject.cpp | 4 +-
28
+ {src => Lib/src}/Vocabulary.cpp | 8 +-
29
+ {src => Lib/src}/quicklz.c | 2 +-
30
+ cmake/instructionSet.cmake | 13 +
31
+ cmake_uninstall.cmake.in | 28 --
32
+ config.cmake.in | 36 --
33
+ {utils => examples}/CMakeLists.txt | 0
34
+ {utils => examples}/create_voc_step0.cpp | 252 +++++-----
35
+ {utils => examples}/create_voc_step1.cpp | 142 +++---
36
+ {utils => examples}/demo_general.cpp | 404 +++++++--------
37
+ {utils => examples}/images/image0.png | Bin
38
+ {utils => examples}/images/image1.png | Bin
39
+ {utils => examples}/images/image2.png | Bin
40
+ {utils => examples}/images/image3.png | Bin
41
+ src/CMakeLists.txt | 35 --
42
+ orbvoc.dbow3 => voc/orbvoc.dbow3 | Bin
43
+ 36 files changed, 1072 insertions(+), 1050 deletions(-)
44
+ create mode 100644 .gitignore
45
+ create mode 100644 Lib/CMakeLists.txt
46
+ create mode 100644 Lib/DBow3Config.cmake
47
+ rename {src => Lib/include/DBow3}/BowVector.h (99%)
48
+ rename {src => Lib/include/DBow3}/DBoW3.h (100%)
49
+ rename {src => Lib/include/DBow3}/Database.h (100%)
50
+ rename {src => Lib/include/DBow3}/DescManip.h (100%)
51
+ rename {src => Lib/include/DBow3}/FeatureVector.h (100%)
52
+ rename {src => Lib/include/DBow3}/QueryResults.h (100%)
53
+ rename {src => Lib/include/DBow3}/ScoringObject.h (100%)
54
+ rename {src => Lib/include/DBow3}/Vocabulary.h (100%)
55
+ rename {src => Lib/include/DBow3}/exports.h (78%)
56
+ rename {src => Lib/include/DBow3}/quicklz.h (100%)
57
+ rename {src => Lib/include/DBow3}/timers.h (100%)
58
+ rename {src => Lib/src}/BowVector.cpp (99%)
59
+ rename {src => Lib/src}/Database.cpp (99%)
60
+ rename {src => Lib/src}/DescManip.cpp (96%)
61
+ rename {src => Lib/src}/FeatureVector.cpp (98%)
62
+ rename {src => Lib/src}/QueryResults.cpp (97%)
63
+ rename {src => Lib/src}/ScoringObject.cpp (99%)
64
+ rename {src => Lib/src}/Vocabulary.cpp (99%)
65
+ rename {src => Lib/src}/quicklz.c (99%)
66
+ create mode 100644 cmake/instructionSet.cmake
67
+ delete mode 100644 cmake_uninstall.cmake.in
68
+ delete mode 100644 config.cmake.in
69
+ rename {utils => examples}/CMakeLists.txt (100%)
70
+ rename {utils => examples}/create_voc_step0.cpp (97%)
71
+ rename {utils => examples}/create_voc_step1.cpp (97%)
72
+ rename {utils => examples}/demo_general.cpp (96%)
73
+ rename {utils => examples}/images/image0.png (100%)
74
+ rename {utils => examples}/images/image1.png (100%)
75
+ rename {utils => examples}/images/image2.png (100%)
76
+ rename {utils => examples}/images/image3.png (100%)
77
+ delete mode 100644 src/CMakeLists.txt
78
+ rename orbvoc.dbow3 => voc/orbvoc.dbow3 (100%)
79
+
80
+ diff --git a/.gitignore b/.gitignore
81
+ new file mode 100644
82
+ index 0000000..8c4285e
83
+ --- /dev/null
84
+ +++ b/.gitignore
85
+ @@ -0,0 +1,249 @@
86
+ +## Ignore Visual Studio temporary files, build results, and
87
+ +## files generated by popular Visual Studio add-ons.
88
+ +
89
+ +# User-specific files
90
+ +*.suo
91
+ +*.user
92
+ +*.userosscache
93
+ +*.sln.docstates
94
+ +
95
+ +# User-specific files (MonoDevelop/Xamarin Studio)
96
+ +*.userprefs
97
+ +
98
+ +# Build results
99
+ +[Dd]ebug/
100
+ +[Dd]ebugPublic/
101
+ +[Rr]elease/
102
+ +[Rr]eleases/
103
+ +[Xx]64/
104
+ +[Xx]86/
105
+ +[Bb]uild/
106
+ +bld/
107
+ +[Bb]in/
108
+ +[Oo]bj/
109
+ +
110
+ +# Visual Studio 2015 cache/options directory
111
+ +.vs/
112
+ +out/
113
+ +# Uncomment if you have tasks that create the project's static files in wwwroot
114
+ +#wwwroot/
115
+ +
116
+ +# MSTest test Results
117
+ +[Tt]est[Rr]esult*/
118
+ +[Bb]uild[Ll]og.*
119
+ +
120
+ +# NUNIT
121
+ +*.VisualState.xml
122
+ +TestResult.xml
123
+ +
124
+ +# Build Results of an ATL Project
125
+ +[Dd]ebugPS/
126
+ +[Rr]eleasePS/
127
+ +dlldata.c
128
+ +
129
+ +# DNX
130
+ +project.lock.json
131
+ +artifacts/
132
+ +
133
+ +*_i.c
134
+ +*_p.c
135
+ +*_i.h
136
+ +*.ilk
137
+ +*.meta
138
+ +*.obj
139
+ +*.pch
140
+ +*.pdb
141
+ +*.pgc
142
+ +*.pgd
143
+ +*.rsp
144
+ +*.sbr
145
+ +*.tlb
146
+ +*.tli
147
+ +*.tlh
148
+ +*.tmp
149
+ +*.tmp_proj
150
+ +*.log
151
+ +*.vspscc
152
+ +*.vssscc
153
+ +.builds
154
+ +*.pidb
155
+ +*.svclog
156
+ +*.scc
157
+ +*.tlog
158
+ +*.idb
159
+ +# Chutzpah Test files
160
+ +_Chutzpah*
161
+ +
162
+ +# Visual C++ cache files
163
+ +ipch/
164
+ +*.aps
165
+ +*.ncb
166
+ +*.opendb
167
+ +*.opensdf
168
+ +*.sdf
169
+ +*.cachefile
170
+ +*.VC.db
171
+ +
172
+ +# Visual Studio profiler
173
+ +*.psess
174
+ +*.vsp
175
+ +*.vspx
176
+ +*.sap
177
+ +
178
+ +# TFS 2012 Local Workspace
179
+ +$tf/
180
+ +
181
+ +# Guidance Automation Toolkit
182
+ +*.gpState
183
+ +
184
+ +# ReSharper is a .NET coding add-in
185
+ +_ReSharper*/
186
+ +*.[Rr]e[Ss]harper
187
+ +*.DotSettings.user
188
+ +
189
+ +# JustCode is a .NET coding add-in
190
+ +.JustCode
191
+ +
192
+ +# TeamCity is a build add-in
193
+ +_TeamCity*
194
+ +
195
+ +# DotCover is a Code Coverage Tool
196
+ +*.dotCover
197
+ +
198
+ +# NCrunch
199
+ +_NCrunch_*
200
+ +.*crunch*.local.xml
201
+ +nCrunchTemp_*
202
+ +
203
+ +# MightyMoose
204
+ +*.mm.*
205
+ +AutoTest.Net/
206
+ +
207
+ +# Web workbench (sass)
208
+ +.sass-cache/
209
+ +
210
+ +# Installshield output folder
211
+ +[Ee]xpress/
212
+ +
213
+ +# DocProject is a documentation generator add-in
214
+ +DocProject/buildhelp/
215
+ +DocProject/Help/*.HxT
216
+ +DocProject/Help/*.HxC
217
+ +DocProject/Help/*.hhc
218
+ +DocProject/Help/*.hhk
219
+ +DocProject/Help/*.hhp
220
+ +DocProject/Help/Html2
221
+ +DocProject/Help/html
222
+ +
223
+ +# Click-Once directory
224
+ +publish/
225
+ +
226
+ +# Publish Web Output
227
+ +*.[Pp]ublish.xml
228
+ +*.azurePubxml
229
+ +
230
+ +# TODO: Un-comment the next line if you do not want to checkin
231
+ +# your web deploy settings because they may include unencrypted
232
+ +# passwords
233
+ +#*.pubxml
234
+ +*.publishproj
235
+ +
236
+ +# NuGet Packages
237
+ +*.nupkg
238
+ +# The packages folder can be ignored because of Package Restore
239
+ +**/packages/*
240
+ +# except build/, which is used as an MSBuild target.
241
+ +!**/packages/build/
242
+ +# Uncomment if necessary however generally it will be regenerated when needed
243
+ +#!**/packages/repositories.config
244
+ +# NuGet v3's project.json files produces more ignoreable files
245
+ +*.nuget.props
246
+ +*.nuget.targets
247
+ +
248
+ +# Microsoft Azure Build Output
249
+ +csx/
250
+ +*.build.csdef
251
+ +
252
+ +# Microsoft Azure Emulator
253
+ +ecf/
254
+ +rcf/
255
+ +
256
+ +# Microsoft Azure ApplicationInsights config file
257
+ +ApplicationInsights.config
258
+ +
259
+ +# Windows Store app package directory
260
+ +AppPackages/
261
+ +BundleArtifacts/
262
+ +
263
+ +# Visual Studio cache files
264
+ +# files ending in .cache can be ignored
265
+ +*.[Cc]ache
266
+ +# but keep track of directories ending in .cache
267
+ +!*.[Cc]ache/
268
+ +
269
+ +# Others
270
+ +ClientBin/
271
+ +[Ss]tyle[Cc]op.*
272
+ +~$*
273
+ +*~
274
+ +*.dbmdl
275
+ +*.dbproj.schemaview
276
+ +*.pfx
277
+ +*.publishsettings
278
+ +node_modules/
279
+ +orleans.codegen.cs
280
+ +
281
+ +# RIA/Silverlight projects
282
+ +Generated_Code/
283
+ +
284
+ +# Backup & report files from converting an old project file
285
+ +# to a newer Visual Studio version. Backup files are not needed,
286
+ +# because we have git ;-)
287
+ +_UpgradeReport_Files/
288
+ +Backup*/
289
+ +UpgradeLog*.XML
290
+ +UpgradeLog*.htm
291
+ +
292
+ +# SQL Server files
293
+ +*.mdf
294
+ +*.ldf
295
+ +
296
+ +# Business Intelligence projects
297
+ +*.rdl.data
298
+ +*.bim.layout
299
+ +*.bim_*.settings
300
+ +
301
+ +# Microsoft Fakes
302
+ +FakesAssemblies/
303
+ +
304
+ +# GhostDoc plugin setting file
305
+ +*.GhostDoc.xml
306
+ +
307
+ +# Node.js Tools for Visual Studio
308
+ +.ntvs_analysis.dat
309
+ +
310
+ +# Visual Studio 6 build log
311
+ +*.plg
312
+ +
313
+ +# Visual Studio 6 workspace options file
314
+ +*.opt
315
+ +
316
+ +# Visual Studio LightSwitch build output
317
+ +**/*.HTMLClient/GeneratedArtifacts
318
+ +**/*.DesktopClient/GeneratedArtifacts
319
+ +**/*.DesktopClient/ModelManifest.xml
320
+ +**/*.Server/GeneratedArtifacts
321
+ +**/*.Server/ModelManifest.xml
322
+ +_Pvt_Extensions
323
+ +
324
+ +# LightSwitch generated files
325
+ +GeneratedArtifacts/
326
+ +ModelManifest.xml
327
+ +
328
+ +# Paket dependency manager
329
+ +.paket/paket.exe
330
+ +
331
+ +# FAKE - F# Make
332
+ +.fake/
333
+ +html
334
+ +xml
335
+ diff --git a/CMakeLists.txt b/CMakeLists.txt
336
+ index 9541cd7..a2a563a 100644
337
+ --- a/CMakeLists.txt
338
+ +++ b/CMakeLists.txt
339
+ @@ -1,268 +1,25 @@
340
+ -# ----------------------------------------------------------------------------
341
+ -# Basic Configuration
342
+ -# ----------------------------------------------------------------------------
343
+ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
344
+ +cmake_minimum_required(VERSION 3.10)
345
+
346
+ -set(CMAKE_CXX_STANDARD 11)
347
+ +project(DBow3 VERSION 1.0.0)
348
+
349
+ -PROJECT(DBoW3)
350
+ -set(PROJECT_VERSION "0.0.1")
351
+ -string(REGEX MATCHALL "[0-9]" PROJECT_VERSION_PARTS "${PROJECT_VERSION}")
352
+ -list(GET PROJECT_VERSION_PARTS 0 PROJECT_VERSION_MAJOR)
353
+ -list(GET PROJECT_VERSION_PARTS 1 PROJECT_VERSION_MINOR)
354
+ -list(GET PROJECT_VERSION_PARTS 2 PROJECT_VERSION_PATCH)
355
+ -set(PROJECT_SOVERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
356
+ +option(BUILD_EXAMPLES "Set to ON to build examples" OFF)
357
+ +option(BUILD_TESTS "Set to ON to build tests" OFF)
358
+ +option(BUILD_SHARED_LIBS "Set to OFF to build static libraries" ON)
359
+
360
+ -message("LIB_INSTALL_DIR: ${LIB_INSTALL_DIR}")
361
+ +# OpenCV
362
+ +option(USE_OPENCV_CONTRIB "Set on to use opencv-contrib" ON)
363
+
364
+ -#------------------------------------------------------
365
+ -# Build type
366
+ -#------------------------------------------------------
367
+ +# Optimization
368
+ +option(USE_SIMD "Set on to enabel avx optimization" ON)
369
+
370
+ -IF(NOT CMAKE_BUILD_TYPE )
371
+ - SET( CMAKE_BUILD_TYPE "Release" )
372
+ -ENDIF()
373
+
374
+ -#------------------------------------------------------
375
+ -# Lib Names and Dirs
376
+ -#------------------------------------------------------
377
+ +add_subdirectory(Lib)
378
+
379
+ -if(WIN32)
380
+ - # Postfix of DLLs:
381
+ - SET(PROJECT_DLLVERSION "${PROJECT_VERSION_MAJOR}${PROJECT_VERSION_MINOR}${PROJECT_VERSION_PATCH}")
382
+ - SET(RUNTIME_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE PATH "Directory for dlls and binaries")
383
+ - SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE PATH "Directory for binaries")
384
+ - SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE PATH "Directory for dlls")
385
+ -else()
386
+ - # Postfix of so's:
387
+ - set(PROJECT_DLLVERSION)
388
+ - set(LIB_INSTALL_DIR lib CACHE STRING "Install location of libraries (e.g. lib32 or lib64 for multilib installations)")
389
+ - SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/cmake/ /usr/${LIB_INSTALL_DIR}/cmake )
390
+ -endif()
391
+ +if(BUILD_EXAMPLES)
392
+ + add_subdirectory(examples)
393
+ +endif(BUILD_EXAMPLES)
394
+
395
+ +if(BUILD_TESTS)
396
+ + add_subdirectory(tests)
397
+ +endif(BUILD_TESTS)
398
+
399
+ -
400
+ -#
401
+ -OPTION(BUILD_UTILS "Set to OFF to not build utils" ON)
402
+ -OPTION(USE_CONTRIB "Set to ON if contrib are installed" OFF)
403
+ -OPTION(BUILD_SHARED_LIBS "Set to OFF to build static libraries" ON)
404
+ -
405
+ -# ----------------------------------------------------------------------------
406
+ -# Find Dependencies
407
+ -# ----------------------------------------------------------------------------
408
+ -find_package(OpenCV REQUIRED)
409
+ -IF(USE_CONTRIB)
410
+ -add_definitions(-DUSE_CONTRIB)
411
+ -ENDIF()
412
+ -if(NOT OpenCV_VERSION VERSION_LESS "3.0")
413
+ - ADD_DEFINITIONS(-DOPENCV_VERSION_3)
414
+ - SET(OPENCV_VERSION_3 ON)
415
+ -ELSE()
416
+ - SET(OPENCV_VERSION_3 OFF)
417
+ -ENDIF()
418
+ -
419
+ -include_directories(${OpenCV_INCLUDE_DIRS})
420
+ -
421
+ -SET(REQUIRED_LIBRARIES ${REQUIRED_LIBRARIES} ${OpenCV_LIBS})
422
+ -
423
+ -# ----------------------------------------------------------------------------
424
+ -# PROJECT CONFIGURATION
425
+ -# force some variables that could be defined in the command line to be written to cache
426
+ -# ----------------------------------------------------------------------------
427
+ -OPTION(INSTALL_DOC "Set to ON to build/install Documentation" OFF)
428
+ -IF (INSTALL_DOC)
429
+ - FIND_PACKAGE(Doxygen REQUIRED)
430
+ - MESSAGE( STATUS "INSTALL_DOC: ${INSTALL_DOC} ")
431
+ - INCLUDE("${PROJECT_SOURCE_DIR}/generateDoc.cmake")
432
+ - GENERATE_DOCUMENTATION(${PROJECT_SOURCE_DIR}/dox.in)
433
+ -ENDIF()
434
+ -
435
+ -# ----------------------------------------------------------------------------
436
+ -# Uninstall target, for "make uninstall"
437
+ -# ----------------------------------------------------------------------------
438
+ -CONFIGURE_FILE( "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY)
439
+ -ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
440
+ -
441
+ -# ----------------------------------------------------------------------------
442
+ -# create configuration file from .in file (If you use windows take care with paths)
443
+ -# ----------------------------------------------------------------------------
444
+ -
445
+ -CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/config.cmake.in" "${PROJECT_BINARY_DIR}/Find${PROJECT_NAME}.cmake")
446
+ -CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/config.cmake.in" "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake")
447
+ -INSTALL(FILES "${PROJECT_BINARY_DIR}/Find${PROJECT_NAME}.cmake" DESTINATION ${LIB_INSTALL_DIR}/cmake/ )
448
+ -INSTALL(FILES "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" DESTINATION ${LIB_INSTALL_DIR}/cmake/${PROJECT_NAME} )
449
+ -
450
+ -
451
+ -
452
+ -
453
+ -# ----------------------------------------------------------------------------
454
+ -# Program Optimization and debug (Extracted from OpenCV)
455
+ -# ----------------------------------------------------------------------------
456
+ -set(WARNINGS_ARE_ERRORS OFF CACHE BOOL "Treat warnings as errors")
457
+ -set(WHOLE_PROGRAM_OPTIMIZATION OFF CACHE BOOL "Flags for whole program optimization.")
458
+ -
459
+ -set(EXTRA_C_FLAGS "")
460
+ -set(EXTRA_C_FLAGS_RELEASE "")
461
+ -set(EXTRA_C_FLAGS_DEBUG "")
462
+ -set(EXTRA_EXE_LINKER_FLAGS "")
463
+ -set(EXTRA_EXE_LINKER_FLAGS_RELEASE "")
464
+ -set(EXTRA_EXE_LINKER_FLAGS_DEBUG "")
465
+ -
466
+ -IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
467
+ - set(ENABLE_PROFILING OFF CACHE BOOL "Enable profiling in the GCC compiler (Add flags: -g -pg)")
468
+ - set(USE_OMIT_FRAME_POINTER ON CACHE BOOL "Enable -fomit-frame-pointer for GCC")
469
+ - if(${CMAKE_SYSTEM_PROCESSOR} MATCHES arm*) # We can use only -O2 because the -O3 causes gcc crash
470
+ - set(USE_O2 ON CACHE BOOL "Enable -O2 for GCC")
471
+ - set(USE_FAST_MATH OFF CACHE BOOL "Enable -ffast-math for GCC")
472
+ - endif()
473
+ - if(${CMAKE_SYSTEM_PROCESSOR} MATCHES powerpc*)
474
+ - set(USE_O3 ON CACHE BOOL "Enable -O3 for GCC")
475
+ - set(USE_POWERPC ON CACHE BOOL "Enable PowerPC for GCC")
476
+ - endif ()
477
+ - if(${CMAKE_SYSTEM_PROCESSOR} MATCHES amd64* OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES x86_64*)
478
+ - set(USE_O3 ON CACHE BOOL "Enable -O3 for GCC")
479
+ - set(USE_FAST_MATH OFF CACHE BOOL "Enable -ffast-math for GCC")
480
+ - set(USE_MMX ON CACHE BOOL "Enable MMX for GCC")
481
+ - set(USE_SSE ON CACHE BOOL "Enable SSE for GCC")
482
+ - set(USE_SSE2 ON CACHE BOOL "Enable SSE2 for GCC")
483
+ - set(USE_SSE3 ON CACHE BOOL "Enable SSE3 for GCC")
484
+ - endif()
485
+ - if(${CMAKE_SYSTEM_PROCESSOR} MATCHES i686* OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES x86)
486
+ - set(USE_O3 ON CACHE BOOL "Enable -O3 for GCC")
487
+ - set(USE_FAST_MATH OFF CACHE BOOL "Enable -ffast-math for GCC")
488
+ - set(USE_MMX ON CACHE BOOL "Enable MMX for GCC")
489
+ - set(USE_SSE OFF CACHE BOOL "Enable SSE for GCC")
490
+ - set(USE_SSE2 OFF CACHE BOOL "Enable SSE2 for GCC")
491
+ - set(USE_SSE3 OFF CACHE BOOL "Enable SSE3 for GCC")
492
+ - endif ()
493
+ -
494
+ - set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} -Wall")
495
+ -
496
+ - if(WARNINGS_ARE_ERRORS)
497
+ - set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} -Werror")
498
+ - endif()
499
+ -
500
+ - # The -Wno-long-long is required in 64bit systems when including sytem headers.
501
+ - if(${CMAKE_SYSTEM_PROCESSOR} MATCHES x86_64* OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES amd64*)
502
+ - set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} -Wno-long-long")
503
+ - endif()
504
+ -
505
+ - # Whole program optimization
506
+ - if(WHOLE_PROGRAM_OPTIMIZATION)
507
+ - set(EXTRA_C_FLAGS_RELEASE "${EXTRA_C_FLAGS_RELEASE} -fwhole-program --combine")
508
+ - endif()
509
+ -
510
+ - # Other optimizations
511
+ - if(USE_OMIT_FRAME_POINTER)
512
+ - set(EXTRA_C_FLAGS_RELEASE "${EXTRA_C_FLAGS_RELEASE} -fomit-frame-pointer")
513
+ - endif()
514
+ - if(USE_O2)
515
+ - set(EXTRA_C_FLAGS_RELEASE "${EXTRA_C_FLAGS_RELEASE} -O2")
516
+ - endif()
517
+ - if(USE_O3)
518
+ - set(EXTRA_C_FLAGS_RELEASE "${EXTRA_C_FLAGS_RELEASE} -O3")
519
+ - endif()
520
+ - if(USE_FAST_MATH)
521
+ - set(EXTRA_C_FLAGS_RELEASE "${EXTRA_C_FLAGS_RELEASE} -ffast-math")
522
+ - endif()
523
+ - if(USE_POWERPC)
524
+ - set(EXTRA_C_FLAGS_RELEASE "${EXTRA_C_FLAGS_RELEASE} -mcpu=G3 -mtune=G5")
525
+ - endif()
526
+ - if(USE_MMX)
527
+ - set(EXTRA_C_FLAGS_RELEASE "${EXTRA_C_FLAGS_RELEASE} -mmmx")
528
+ - endif()
529
+ - if(USE_SSE)
530
+ - set(EXTRA_C_FLAGS_RELEASE "${EXTRA_C_FLAGS_RELEASE} -msse")
531
+ - endif()
532
+ - if(USE_SSE2)
533
+ - set(EXTRA_C_FLAGS_RELEASE "${EXTRA_C_FLAGS_RELEASE} -msse2")
534
+ - endif()
535
+ - if(USE_SSE3 AND NOT MINGW) # SSE3 should be disabled under MingW because it generates compiler errors
536
+ - set(EXTRA_C_FLAGS_RELEASE "${EXTRA_C_FLAGS_RELEASE} -msse3")
537
+ - endif()
538
+ -
539
+ - if(ENABLE_PROFILING)
540
+ - set(EXTRA_C_FLAGS_RELEASE "${EXTRA_C_FLAGS_RELEASE} -pg -g")
541
+ - else()
542
+ - if(NOT APPLE)
543
+ - set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} -ffunction-sections")
544
+ - endif()
545
+ - endif()
546
+ -
547
+ -
548
+ - set(EXTRA_C_FLAGS_RELEASE "${EXTRA_C_FLAGS_RELEASE} -DNDEBUG ")
549
+ - set(EXTRA_C_FLAGS_DEBUG "-g3 -O0 -DDEBUG -D_DEBUG -W -Wextra -Wno-return-type ")
550
+ -
551
+ - MESSAGE( STATUS "-------------------------------------------------------------------------------" )
552
+ - message( STATUS "GNU COMPILER")
553
+ - MESSAGE( STATUS "-------------------------------------------------------------------------------" )
554
+ -
555
+ -
556
+ -
557
+ -
558
+ -ELSE() # MSVC
559
+ -
560
+ -
561
+ -ENDIF()#END OF COMPILER SPECIFIC OPTIONS
562
+ -SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} ${EXTRA_C_FLAGS_RELEASE}")
563
+ -SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} ${EXTRA_C_FLAGS_DEBUG}")
564
+ -SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -std=c++11")
565
+ -SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -std=c++11")
566
+ -set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELEASE} ${CMAKE_C_FLAGS_DEBUG}")
567
+ -set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_DEBUG}")
568
+ -SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${EXTRA_EXE_LINKER_FLAGS}")
569
+ -SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${EXTRA_EXE_LINKER_FLAGS_RELEASE}")
570
+ -SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${EXTRA_EXE_LINKER_FLAGS_DEBUG}")
571
+ -
572
+ -
573
+ -
574
+ -#------------------------------------------------
575
+ -# DIRS
576
+ -#------------------------------------------------
577
+ -ADD_SUBDIRECTORY(src)
578
+ -IF (BUILD_UTILS)
579
+ -ADD_SUBDIRECTORY(utils)
580
+ -ENDIF()
581
+ -
582
+ -IF (BUILD_TESTS)
583
+ -ADD_SUBDIRECTORY(tests)
584
+ -ENDIF()
585
+ -
586
+ -
587
+ -# ----------------------------------------------------------------------------
588
+ -# display status message for important variables
589
+ -# ----------------------------------------------------------------------------
590
+ -message( STATUS )
591
+ -MESSAGE( STATUS "-------------------------------------------------------------------------------" )
592
+ -message( STATUS "General configuration for ${PROJECT_NAME} ${PROJECT_VERSION}")
593
+ -MESSAGE( STATUS "-------------------------------------------------------------------------------" )
594
+ -message(" Built as dynamic libs?:" ${BUILD_SHARED_LIBS})
595
+ -message(" Compiler:" "${CMAKE_COMPILER}" "${CMAKE_CXX_COMPILER}")
596
+ -
597
+ -message( STATUS "Build Type: ${CMAKE_BUILD_TYPE}")
598
+ -message( STATUS "C++ flags (Release): ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}")
599
+ -message( STATUS "C++ flags (Debug): ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}")
600
+ -message( STATUS "C++ flags (Relase+Debug): ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
601
+ -
602
+ -message( STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
603
+ -message( STATUS "CMAKE_BINARY_DIR: ${CMAKE_BINARY_DIR}")
604
+ -
605
+ -MESSAGE( STATUS )
606
+ -MESSAGE( STATUS "CMAKE_SYSTEM_PROCESSOR = ${CMAKE_SYSTEM_PROCESSOR}" )
607
+ -MESSAGE( STATUS "CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}" )
608
+ -MESSAGE( STATUS "CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}" )
609
+ -MESSAGE( STATUS "CMAKE_MODULE_PATH = ${CMAKE_MODULE_PATH}" )
610
+ -MESSAGE( STATUS "BUILD_UTILS= ${BUILD_UTILS}" )
611
+ -MESSAGE( STATUS "BUILD_TESTS= ${BUILD_TESTS}" )
612
+ -MESSAGE( STATUS "OPENCV_DIR= ${OpenCV_DIR} VERSION=${OpenCV_VERSION}" )
613
+ -
614
+ -MESSAGE( STATUS "USE_CONTRIB= ${USE_CONTRIB}" )
615
+ -
616
+ -MESSAGE( STATUS )
617
+ -MESSAGE( STATUS "OpenCV_LIB_DIR=${OpenCV_LIB_DIR}")
618
+ -MESSAGE( STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}")
619
+ -
620
+ -MESSAGE( STATUS )
621
+ -MESSAGE( STATUS )
622
+ -MESSAGE( STATUS "Change a value with: cmake -D<Variable>=<Value>" )
623
+ -MESSAGE( STATUS )
624
+ diff --git a/Lib/CMakeLists.txt b/Lib/CMakeLists.txt
625
+ new file mode 100644
626
+ index 0000000..e56077b
627
+ --- /dev/null
628
+ +++ b/Lib/CMakeLists.txt
629
+ @@ -0,0 +1,99 @@
630
+ +cmake_minimum_required(VERSION 3.10)
631
+ +
632
+ +find_package(OpenCV REQUIRED)
633
+ +
634
+ +find_package(OpenMP REQUIRED)
635
+ +
636
+ +include(${CMAKE_SOURCE_DIR}/cmake/instructionSet.cmake)
637
+ +
638
+ +if(BUILD_SHARED_LIBS)
639
+ + add_library(DBow3 SHARED)
640
+ +
641
+ + target_compile_definitions(DBow3
642
+ + PUBLIC
643
+ + DBOW_API
644
+ + )
645
+ +
646
+ +else()
647
+ + add_library(DBow3 STATIC)
648
+ +endif()
649
+ +
650
+ +add_library(DBow3::DBow3 ALIAS DBow3)
651
+ +
652
+ +target_sources(DBow3
653
+ + PRIVATE
654
+ + src/BowVector.cpp
655
+ + src/Database.cpp
656
+ + src/DescManip.cpp
657
+ + src/FeatureVector.cpp
658
+ + src/QueryResults.cpp
659
+ + src/ScoringObject.cpp
660
+ + src/Vocabulary.cpp
661
+ + src/quicklz.c
662
+ +)
663
+ +
664
+ +target_include_directories(DBow3
665
+ + PUBLIC
666
+ + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
667
+ + $<INSTALL_INTERFACE:include>
668
+ +)
669
+ +
670
+ +target_link_libraries(DBow3
671
+ + PUBLIC
672
+ + OpenMP::OpenMP_CXX
673
+ +)
674
+ +
675
+ +if(USE_OPENCV_CONTRIB)
676
+ +target_link_libraries(DBow3
677
+ + PUBLIC
678
+ + ${OpenCV_LIBS}
679
+ +)
680
+ +
681
+ +target_include_directories(DBow3
682
+ + PUBLIC
683
+ + ${OpenCV_INCLUDE_DIR}
684
+ +)
685
+ +endif()
686
+ +
687
+ +if(USE_SIMD)
688
+ + target_link_libraries(DBow3
689
+ + PRIVATE
690
+ + SIMD::SSE4.1
691
+ + )
692
+ +endif()
693
+ +
694
+ +target_compile_definitions(DBow3
695
+ + PUBLIC
696
+ + NOMINMAX
697
+ + _USE_MATH_DEFINES
698
+ +)
699
+ +
700
+ +target_compile_features(DBow3
701
+ + PRIVATE
702
+ + cxx_std_14
703
+ +)
704
+ +
705
+ +
706
+ +install(TARGETS DBow3 EXPORT DBow3Targets
707
+ + LIBRARY DESTINATION lib
708
+ + ARCHIVE DESTINATION lib
709
+ + RUNTIME DESTINATION bin
710
+ + INCLUDES DESTINATION include
711
+ +)
712
+ +
713
+ +install (DIRECTORY include/ DESTINATION include)
714
+ +
715
+ +install(EXPORT DBow3Targets
716
+ + FILE DBow3Targets.cmake
717
+ + NAMESPACE DBow3::
718
+ + DESTINATION cmake/DBow3
719
+ +)
720
+ +
721
+ +include(CMakePackageConfigHelpers)
722
+ +
723
+ +write_basic_package_version_file(DBow3ConfigVersion.cmake
724
+ + COMPATIBILITY SameMajorVersion
725
+ +)
726
+ +
727
+ +install(FILES DBow3Config.cmake ${CMAKE_CURRENT_BINARY_DIR}/DBow3ConfigVersion.cmake
728
+ + DESTINATION cmake/DBow3)
729
+
730
+ diff --git a/Lib/DBow3Config.cmake b/Lib/DBow3Config.cmake
731
+ new file mode 100644
732
+ index 0000000..9720a14
733
+ --- /dev/null
734
+ +++ b/Lib/DBow3Config.cmake
735
+ @@ -0,0 +1,4 @@
736
+ +include(CMakeFindDependencyMacro)
737
+ +find_dependency(OpenCV)
738
+ +find_dependency(OpenMP)
739
+ +include("${CMAKE_CURRENT_LIST_DIR}/FbowTargets.cmake")
740
+
741
+ diff --git a/src/BowVector.h b/Lib/include/DBow3/BowVector.h
742
+ similarity index 99%
743
+ rename from src/BowVector.h
744
+ rename to Lib/include/DBow3/BowVector.h
745
+ index d8c17e0..cdbf517 100644
746
+ --- a/src/BowVector.h
747
+ +++ b/Lib/include/DBow3/BowVector.h
748
+ @@ -12,6 +12,7 @@
749
+
750
+ #include <map>
751
+ #include <vector>
752
+ +#include <ostream>
753
+ #include "exports.h"
754
+ #if _WIN32
755
+ #include <cstdint>
756
+ diff --git a/src/DBoW3.h b/Lib/include/DBow3/DBoW3.h
757
+ similarity index 100%
758
+ rename from src/DBoW3.h
759
+ rename to Lib/include/DBow3/DBoW3.h
760
+ diff --git a/src/Database.h b/Lib/include/DBow3/Database.h
761
+ similarity index 100%
762
+ rename from src/Database.h
763
+ rename to Lib/include/DBow3/Database.h
764
+ diff --git a/src/DescManip.h b/Lib/include/DBow3/DescManip.h
765
+ similarity index 100%
766
+ rename from src/DescManip.h
767
+ rename to Lib/include/DBow3/DescManip.h
768
+ diff --git a/src/FeatureVector.h b/Lib/include/DBow3/FeatureVector.h
769
+ similarity index 100%
770
+ rename from src/FeatureVector.h
771
+ rename to Lib/include/DBow3/FeatureVector.h
772
+ diff --git a/src/QueryResults.h b/Lib/include/DBow3/QueryResults.h
773
+ similarity index 100%
774
+ rename from src/QueryResults.h
775
+ rename to Lib/include/DBow3/QueryResults.h
776
+ diff --git a/src/ScoringObject.h b/Lib/include/DBow3/ScoringObject.h
777
+ similarity index 100%
778
+ rename from src/ScoringObject.h
779
+ rename to Lib/include/DBow3/ScoringObject.h
780
+ diff --git a/src/Vocabulary.h b/Lib/include/DBow3/Vocabulary.h
781
+ similarity index 100%
782
+ rename from src/Vocabulary.h
783
+ rename to Lib/include/DBow3/Vocabulary.h
784
+ diff --git a/src/exports.h b/Lib/include/DBow3/exports.h
785
+ similarity index 78%
786
+ rename from src/exports.h
787
+ rename to Lib/include/DBow3/exports.h
788
+ index c324953..a31b317 100644
789
+ --- a/src/exports.h
790
+ +++ b/Lib/include/DBow3/exports.h
791
+ @@ -35,17 +35,15 @@ or implied, of Rafael Muñoz Salinas.
792
+ #define _CRT_SECURE_NO_DEPRECATE /* to avoid multiple Visual Studio 2005 warnings */
793
+ #endif
794
+
795
+ -#if (defined WIN32 || defined _WIN32 || defined WINCE) && defined DBOW_DSO_EXPORTS
796
+ - #define DBOW_API __declspec(dllexport)
797
+ - #pragma warning ( disable : 4251 ) //disable warning to templates with dll linkage.
798
+ - #pragma warning ( disable : 4290 ) //disable warning due to exception specifications.
799
+ - #pragma warning ( disable : 4996 ) //disable warning regarding unsafe vsprintf.
800
+ - #pragma warning ( disable : 4244 ) //disable warning convesions with lost of data.
801
+ -
802
+ +#ifdef _WIN32
803
+ +# ifdef DBOW_API
804
+ +# define DBOW_API __declspec(dllexport)
805
+ +# else
806
+ +# define DBOW_API __declspec(dllimport)
807
+ +# endif
808
+ #else
809
+ - #define DBOW_API
810
+ +# define DBOW_API
811
+ #endif
812
+
813
+ -
814
+ #define DBOW_VERSION "3.0.0"
815
+ #endif
816
+ diff --git a/src/quicklz.h b/Lib/include/DBow3/quicklz.h
817
+ similarity index 100%
818
+ rename from src/quicklz.h
819
+ rename to Lib/include/DBow3/quicklz.h
820
+ diff --git a/src/timers.h b/Lib/include/DBow3/timers.h
821
+ similarity index 100%
822
+ rename from src/timers.h
823
+ rename to Lib/include/DBow3/timers.h
824
+ diff --git a/src/BowVector.cpp b/Lib/src/BowVector.cpp
825
+ similarity index 99%
826
+ rename from src/BowVector.cpp
827
+ rename to Lib/src/BowVector.cpp
828
+ index d132213..f61d421 100644
829
+ --- a/src/BowVector.cpp
830
+ +++ b/Lib/src/BowVector.cpp
831
+ @@ -13,7 +13,7 @@
832
+ #include <algorithm>
833
+ #include <cmath>
834
+
835
+ -#include "BowVector.h"
836
+ +#include "DBow3/BowVector.h"
837
+
838
+ namespace DBoW3 {
839
+
840
+ diff --git a/src/Database.cpp b/Lib/src/Database.cpp
841
+ similarity index 99%
842
+ rename from src/Database.cpp
843
+ rename to Lib/src/Database.cpp
844
+ index d8a1b81..25610a0 100644
845
+ --- a/src/Database.cpp
846
+ +++ b/Lib/src/Database.cpp
847
+ @@ -1,4 +1,4 @@
848
+ -#include "Database.h"
849
+ +#include "DBow3/Database.h"
850
+
851
+ namespace DBoW3{
852
+
853
+ diff --git a/src/DescManip.cpp b/Lib/src/DescManip.cpp
854
+ similarity index 96%
855
+ rename from src/DescManip.cpp
856
+ rename to Lib/src/DescManip.cpp
857
+ index d6331af..430ce2b 100644
858
+ --- a/src/DescManip.cpp
859
+ +++ b/Lib/src/DescManip.cpp
860
+ @@ -1,273 +1,273 @@
861
+ -/**
862
+ - * File: DescManip.cpp
863
+ - * Date: June 2012
864
+ - * Author: Dorian Galvez-Lopez
865
+ - * Description: functions for ORB descriptors
866
+ - * License: see the LICENSE.txt file
867
+ - *
868
+ - */
869
+ -
870
+ -#include <vector>
871
+ -#include <string>
872
+ -#include <sstream>
873
+ -#include <iostream>
874
+ -#include <stdint.h>
875
+ -#include <limits.h>
876
+ -
877
+ -#include "DescManip.h"
878
+ -
879
+ -using namespace std;
880
+ -
881
+ -namespace DBoW3 {
882
+ -
883
+ -// --------------------------------------------------------------------------
884
+ -
885
+ -void DescManip::meanValue(const std::vector<cv::Mat> &descriptors,
886
+ - cv::Mat &mean)
887
+ -{
888
+ -
889
+ - if(descriptors.empty()) return;
890
+ -
891
+ - if(descriptors.size() == 1)
892
+ - {
893
+ - mean = descriptors[0].clone();
894
+ - return;
895
+ - }
896
+ - //binary descriptor
897
+ - if (descriptors[0].type()==CV_8U ){
898
+ - //determine number of bytes of the binary descriptor
899
+ - int L= getDescSizeBytes( descriptors[0]);
900
+ - vector<int> sum( L * 8, 0);
901
+ -
902
+ - for(size_t i = 0; i < descriptors.size(); ++i)
903
+ - {
904
+ - const cv::Mat &d = descriptors[i];
905
+ - const unsigned char *p = d.ptr<unsigned char>();
906
+ -
907
+ - for(int j = 0; j < d.cols; ++j, ++p)
908
+ - {
909
+ - if(*p & (1 << 7)) ++sum[ j*8 ];
910
+ - if(*p & (1 << 6)) ++sum[ j*8 + 1 ];
911
+ - if(*p & (1 << 5)) ++sum[ j*8 + 2 ];
912
+ - if(*p & (1 << 4)) ++sum[ j*8 + 3 ];
913
+ - if(*p & (1 << 3)) ++sum[ j*8 + 4 ];
914
+ - if(*p & (1 << 2)) ++sum[ j*8 + 5 ];
915
+ - if(*p & (1 << 1)) ++sum[ j*8 + 6 ];
916
+ - if(*p & (1)) ++sum[ j*8 + 7 ];
917
+ - }
918
+ - }
919
+ -
920
+ - mean = cv::Mat::zeros(1, L, CV_8U);
921
+ - unsigned char *p = mean.ptr<unsigned char>();
922
+ -
923
+ - const int N2 = (int)descriptors.size() / 2 + descriptors.size() % 2;
924
+ - for(size_t i = 0; i < sum.size(); ++i)
925
+ - {
926
+ - if(sum[i] >= N2)
927
+ - {
928
+ - // set bit
929
+ - *p |= 1 << (7 - (i % 8));
930
+ - }
931
+ -
932
+ - if(i % 8 == 7) ++p;
933
+ - }
934
+ - }
935
+ - //non binary descriptor
936
+ - else{
937
+ - assert(descriptors[0].type()==CV_32F );//ensure it is float
938
+ -
939
+ - mean.create(1, descriptors[0].cols,descriptors[0].type());
940
+ - mean.setTo(cv::Scalar::all(0));
941
+ - float inv_s =1./double( descriptors.size());
942
+ - for(size_t i=0;i<descriptors.size();i++)
943
+ - mean += descriptors[i] * inv_s;
944
+ -
945
+ - }
946
+ -
947
+ -}
948
+ -
949
+ -// --------------------------------------------------------------------------
950
+ -static inline uint32_t distance_8uc1(const cv::Mat &a, const cv::Mat &b);
951
+ -
952
+ -double DescManip::distance(const cv::Mat &a, const cv::Mat &b)
953
+ -{
954
+ -
955
+ - //binary descriptor
956
+ - if (a.type()==CV_8U){
957
+ -
958
+ - // Bit count function got from:
959
+ - // http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetKernighan
960
+ - // This implementation assumes that a.cols (CV_8U) % sizeof(uint64_t) == 0
961
+ -
962
+ - const uint64_t *pa, *pb;
963
+ - pa = a.ptr<uint64_t>(); // a & b are actually CV_8U
964
+ - pb = b.ptr<uint64_t>();
965
+ -
966
+ - uint64_t v, ret = 0;
967
+ - for(size_t i = 0; i < a.cols / sizeof(uint64_t); ++i, ++pa, ++pb)
968
+ - {
969
+ - v = *pa ^ *pb;
970
+ - v = v - ((v >> 1) & (uint64_t)~(uint64_t)0/3);
971
+ - v = (v & (uint64_t)~(uint64_t)0/15*3) + ((v >> 2) &
972
+ - (uint64_t)~(uint64_t)0/15*3);
973
+ - v = (v + (v >> 4)) & (uint64_t)~(uint64_t)0/255*15;
974
+ - ret += (uint64_t)(v * ((uint64_t)~(uint64_t)0/255)) >>
975
+ - (sizeof(uint64_t) - 1) * CHAR_BIT;
976
+ - }
977
+ -
978
+ - return ret;
979
+ - }
980
+ - else{
981
+ - double sqd = 0.;
982
+ - assert(a.type()==CV_32F);
983
+ - assert(a.rows==1);
984
+ - const float *a_ptr=a.ptr<float>(0);
985
+ - const float *b_ptr=b.ptr<float>(0);
986
+ - for(int i = 0; i < a.cols; i ++)
987
+ - sqd += (a_ptr[i ] - b_ptr[i ])*(a_ptr[i ] - b_ptr[i ]);
988
+ - return sqd;
989
+ - }
990
+ -}
991
+ -
992
+ -
993
+ -
994
+ -
995
+ -// --------------------------------------------------------------------------
996
+ -
997
+ -std::string DescManip::toString(const cv::Mat &a)
998
+ -{
999
+ - stringstream ss;
1000
+ - //introduce a magic value to distinguish from DBOw2
1001
+ - ss<<"dbw3 ";
1002
+ - //save size and type
1003
+ -
1004
+ -
1005
+ - ss <<a.type()<<" "<<a.cols<<" ";
1006
+ -
1007
+ - if (a.type()==CV_8U){
1008
+ - const unsigned char *p = a.ptr<unsigned char>();
1009
+ - for(int i = 0; i < a.cols; ++i, ++p)
1010
+ - ss << (int)*p << " ";
1011
+ - }else{
1012
+ -
1013
+ - const float *p = a.ptr<float>();
1014
+ - for(int i = 0; i < a.cols; ++i, ++p)
1015
+ - ss << *p << " ";
1016
+ -
1017
+ - }
1018
+ -
1019
+ - return ss.str();
1020
+ -}
1021
+ -
1022
+ -// --------------------------------------------------------------------------
1023
+ -
1024
+ -void DescManip::fromString(cv::Mat &a, const std::string &s)
1025
+ -{
1026
+ -
1027
+ - //check if the dbow3 is present
1028
+ - string ss_aux;ss_aux.reserve(10);
1029
+ - for(size_t i=0;i<10 && i<s.size();i++)
1030
+ - ss_aux.push_back(s[i]);
1031
+ - if(ss_aux.find("dbw3")==std::string::npos){//is dbow2
1032
+ - //READ UNTIL END
1033
+ - stringstream ss(s);
1034
+ - int val;
1035
+ - vector<uchar> data;data.reserve(100);
1036
+ - while( ss>>val) data.push_back(val);
1037
+ - //copy to a
1038
+ - a.create(1,data.size(),CV_8UC1);
1039
+ - memcpy(a.ptr<char>(0),&data[0],data.size());
1040
+ - }
1041
+ - else {
1042
+ - char szSign[10];
1043
+ - int type,cols;
1044
+ - stringstream ss(s);
1045
+ - ss >> szSign >> type >> cols;
1046
+ - a.create(1, cols, type);
1047
+ - if(type==CV_8UC1){
1048
+ - unsigned char *p = a.ptr<unsigned char>();
1049
+ - int n;
1050
+ - for(int i = 0; i < a.cols; ++i, ++p)
1051
+ - if ( ss >> n) *p = (unsigned char)n;
1052
+ - }
1053
+ - else{
1054
+ - float *p = a.ptr<float>();
1055
+ - for(int i = 0; i < a.cols; ++i, ++p)
1056
+ - if ( !(ss >> *p))cerr<<"Error reading. Unexpected EOF. DescManip::fromString"<<endl;
1057
+ - }
1058
+ -
1059
+ - }
1060
+ -
1061
+ -}
1062
+ -
1063
+ -// --------------------------------------------------------------------------
1064
+ -
1065
+ -void DescManip::toMat32F(const std::vector<cv::Mat> &descriptors,
1066
+ - cv::Mat &mat)
1067
+ -{
1068
+ - if(descriptors.empty())
1069
+ - {
1070
+ - mat.release();
1071
+ - return;
1072
+ - }
1073
+ -
1074
+ - if(descriptors[0].type()==CV_8UC1){
1075
+ -
1076
+ - const size_t N = descriptors.size();
1077
+ - int L=getDescSizeBytes(descriptors[0]);
1078
+ - mat.create(N, L*8, CV_32F);
1079
+ - float *p = mat.ptr<float>();
1080
+ -
1081
+ - for(size_t i = 0; i < N; ++i)
1082
+ - {
1083
+ - const int C = descriptors[i].cols;
1084
+ - const unsigned char *desc = descriptors[i].ptr<unsigned char>();
1085
+ -
1086
+ - for(int j = 0; j < C; ++j, p += 8)
1087
+ - {
1088
+ - p[0] = (desc[j] & (1 << 7) ? 1 : 0);
1089
+ - p[1] = (desc[j] & (1 << 6) ? 1 : 0);
1090
+ - p[2] = (desc[j] & (1 << 5) ? 1 : 0);
1091
+ - p[3] = (desc[j] & (1 << 4) ? 1 : 0);
1092
+ - p[4] = (desc[j] & (1 << 3) ? 1 : 0);
1093
+ - p[5] = (desc[j] & (1 << 2) ? 1 : 0);
1094
+ - p[6] = (desc[j] & (1 << 1) ? 1 : 0);
1095
+ - p[7] = desc[j] & (1);
1096
+ - }
1097
+ - }
1098
+ - }
1099
+ - else{
1100
+ - assert(descriptors[0].type()==CV_32F);
1101
+ - const int N = descriptors.size();
1102
+ - int L=descriptors[0].cols;
1103
+ - mat.create(N, L, CV_32F);
1104
+ - for(int i = 0; i < N; ++i)
1105
+ - memcpy(mat.ptr<float>(i),descriptors[i].ptr<float>(0),sizeof(float)*L);
1106
+ - }
1107
+ -}
1108
+ -
1109
+ -void DescManip::toStream(const cv::Mat &m,std::ostream &str){
1110
+ - assert(m.rows==1 || m.isContinuous());
1111
+ - int type=m.type();
1112
+ - int cols=m.cols;
1113
+ - int rows=m.rows;
1114
+ - str.write((char*)&cols,sizeof(cols));
1115
+ - str.write((char*)&rows,sizeof(rows));
1116
+ - str.write((char*)&type,sizeof(type));
1117
+ - str.write((char*)m.ptr<char>(0),m.elemSize()*m.cols);
1118
+ -}
1119
+ -
1120
+ -void DescManip::fromStream(cv::Mat &m,std::istream &str){
1121
+ - int type,cols,rows;
1122
+ - str.read((char*)&cols,sizeof(cols));
1123
+ - str.read((char*)&rows,sizeof(rows));
1124
+ - str.read((char*)&type,sizeof(type));
1125
+ - m.create(rows,cols,type);
1126
+ - str.read((char*)m.ptr<char>(0),m.elemSize()*m.cols);
1127
+ -}
1128
+ -
1129
+ -
1130
+ -// --------------------------------------------------------------------------
1131
+ -
1132
+ -} // namespace DBoW3
1133
+ -
1134
+ +/**
1135
+ + * File: DescManip.cpp
1136
+ + * Date: June 2012
1137
+ + * Author: Dorian Galvez-Lopez
1138
+ + * Description: functions for ORB descriptors
1139
+ + * License: see the LICENSE.txt file
1140
+ + *
1141
+ + */
1142
+ +
1143
+ +#include <vector>
1144
+ +#include <string>
1145
+ +#include <sstream>
1146
+ +#include <iostream>
1147
+ +#include <stdint.h>
1148
+ +#include <limits.h>
1149
+ +
1150
+ +#include "DBow3/DescManip.h"
1151
+ +
1152
+ +using namespace std;
1153
+ +
1154
+ +namespace DBoW3 {
1155
+ +
1156
+ +// --------------------------------------------------------------------------
1157
+ +
1158
+ +void DescManip::meanValue(const std::vector<cv::Mat> &descriptors,
1159
+ + cv::Mat &mean)
1160
+ +{
1161
+ +
1162
+ + if(descriptors.empty()) return;
1163
+ +
1164
+ + if(descriptors.size() == 1)
1165
+ + {
1166
+ + mean = descriptors[0].clone();
1167
+ + return;
1168
+ + }
1169
+ + //binary descriptor
1170
+ + if (descriptors[0].type()==CV_8U ){
1171
+ + //determine number of bytes of the binary descriptor
1172
+ + int L= getDescSizeBytes( descriptors[0]);
1173
+ + vector<int> sum( L * 8, 0);
1174
+ +
1175
+ + for(size_t i = 0; i < descriptors.size(); ++i)
1176
+ + {
1177
+ + const cv::Mat &d = descriptors[i];
1178
+ + const unsigned char *p = d.ptr<unsigned char>();
1179
+ +
1180
+ + for(int j = 0; j < d.cols; ++j, ++p)
1181
+ + {
1182
+ + if(*p & (1 << 7)) ++sum[ j*8 ];
1183
+ + if(*p & (1 << 6)) ++sum[ j*8 + 1 ];
1184
+ + if(*p & (1 << 5)) ++sum[ j*8 + 2 ];
1185
+ + if(*p & (1 << 4)) ++sum[ j*8 + 3 ];
1186
+ + if(*p & (1 << 3)) ++sum[ j*8 + 4 ];
1187
+ + if(*p & (1 << 2)) ++sum[ j*8 + 5 ];
1188
+ + if(*p & (1 << 1)) ++sum[ j*8 + 6 ];
1189
+ + if(*p & (1)) ++sum[ j*8 + 7 ];
1190
+ + }
1191
+ + }
1192
+ +
1193
+ + mean = cv::Mat::zeros(1, L, CV_8U);
1194
+ + unsigned char *p = mean.ptr<unsigned char>();
1195
+ +
1196
+ + const int N2 = (int)descriptors.size() / 2 + descriptors.size() % 2;
1197
+ + for(size_t i = 0; i < sum.size(); ++i)
1198
+ + {
1199
+ + if(sum[i] >= N2)
1200
+ + {
1201
+ + // set bit
1202
+ + *p |= 1 << (7 - (i % 8));
1203
+ + }
1204
+ +
1205
+ + if(i % 8 == 7) ++p;
1206
+ + }
1207
+ + }
1208
+ + //non binary descriptor
1209
+ + else{
1210
+ + assert(descriptors[0].type()==CV_32F );//ensure it is float
1211
+ +
1212
+ + mean.create(1, descriptors[0].cols,descriptors[0].type());
1213
+ + mean.setTo(cv::Scalar::all(0));
1214
+ + float inv_s =1./double( descriptors.size());
1215
+ + for(size_t i=0;i<descriptors.size();i++)
1216
+ + mean += descriptors[i] * inv_s;
1217
+ +
1218
+ + }
1219
+ +
1220
+ +}
1221
+ +
1222
+ +// --------------------------------------------------------------------------
1223
+ +static inline uint32_t distance_8uc1(const cv::Mat &a, const cv::Mat &b);
1224
+ +
1225
+ +double DescManip::distance(const cv::Mat &a, const cv::Mat &b)
1226
+ +{
1227
+ +
1228
+ + //binary descriptor
1229
+ + if (a.type()==CV_8U){
1230
+ +
1231
+ + // Bit count function got from:
1232
+ + // http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetKernighan
1233
+ + // This implementation assumes that a.cols (CV_8U) % sizeof(uint64_t) == 0
1234
+ +
1235
+ + const uint64_t *pa, *pb;
1236
+ + pa = a.ptr<uint64_t>(); // a & b are actually CV_8U
1237
+ + pb = b.ptr<uint64_t>();
1238
+ +
1239
+ + uint64_t v, ret = 0;
1240
+ + for(size_t i = 0; i < a.cols / sizeof(uint64_t); ++i, ++pa, ++pb)
1241
+ + {
1242
+ + v = *pa ^ *pb;
1243
+ + v = v - ((v >> 1) & (uint64_t)~(uint64_t)0/3);
1244
+ + v = (v & (uint64_t)~(uint64_t)0/15*3) + ((v >> 2) &
1245
+ + (uint64_t)~(uint64_t)0/15*3);
1246
+ + v = (v + (v >> 4)) & (uint64_t)~(uint64_t)0/255*15;
1247
+ + ret += (uint64_t)(v * ((uint64_t)~(uint64_t)0/255)) >>
1248
+ + (sizeof(uint64_t) - 1) * CHAR_BIT;
1249
+ + }
1250
+ +
1251
+ + return ret;
1252
+ + }
1253
+ + else{
1254
+ + double sqd = 0.;
1255
+ + assert(a.type()==CV_32F);
1256
+ + assert(a.rows==1);
1257
+ + const float *a_ptr=a.ptr<float>(0);
1258
+ + const float *b_ptr=b.ptr<float>(0);
1259
+ + for(int i = 0; i < a.cols; i ++)
1260
+ + sqd += (a_ptr[i ] - b_ptr[i ])*(a_ptr[i ] - b_ptr[i ]);
1261
+ + return sqd;
1262
+ + }
1263
+ +}
1264
+ +
1265
+ +
1266
+ +
1267
+ +
1268
+ +// --------------------------------------------------------------------------
1269
+ +
1270
+ +std::string DescManip::toString(const cv::Mat &a)
1271
+ +{
1272
+ + stringstream ss;
1273
+ + //introduce a magic value to distinguish from DBOw2
1274
+ + ss<<"dbw3 ";
1275
+ + //save size and type
1276
+ +
1277
+ +
1278
+ + ss <<a.type()<<" "<<a.cols<<" ";
1279
+ +
1280
+ + if (a.type()==CV_8U){
1281
+ + const unsigned char *p = a.ptr<unsigned char>();
1282
+ + for(int i = 0; i < a.cols; ++i, ++p)
1283
+ + ss << (int)*p << " ";
1284
+ + }else{
1285
+ +
1286
+ + const float *p = a.ptr<float>();
1287
+ + for(int i = 0; i < a.cols; ++i, ++p)
1288
+ + ss << *p << " ";
1289
+ +
1290
+ + }
1291
+ +
1292
+ + return ss.str();
1293
+ +}
1294
+ +
1295
+ +// --------------------------------------------------------------------------
1296
+ +
1297
+ +void DescManip::fromString(cv::Mat &a, const std::string &s)
1298
+ +{
1299
+ +
1300
+ + //check if the dbow3 is present
1301
+ + string ss_aux;ss_aux.reserve(10);
1302
+ + for(size_t i=0;i<10 && i<s.size();i++)
1303
+ + ss_aux.push_back(s[i]);
1304
+ + if(ss_aux.find("dbw3")==std::string::npos){//is dbow2
1305
+ + //READ UNTIL END
1306
+ + stringstream ss(s);
1307
+ + int val;
1308
+ + vector<uchar> data;data.reserve(100);
1309
+ + while( ss>>val) data.push_back(val);
1310
+ + //copy to a
1311
+ + a.create(1,data.size(),CV_8UC1);
1312
+ + memcpy(a.ptr<char>(0),&data[0],data.size());
1313
+ + }
1314
+ + else {
1315
+ + char szSign[10];
1316
+ + int type,cols;
1317
+ + stringstream ss(s);
1318
+ + ss >> szSign >> type >> cols;
1319
+ + a.create(1, cols, type);
1320
+ + if(type==CV_8UC1){
1321
+ + unsigned char *p = a.ptr<unsigned char>();
1322
+ + int n;
1323
+ + for(int i = 0; i < a.cols; ++i, ++p)
1324
+ + if ( ss >> n) *p = (unsigned char)n;
1325
+ + }
1326
+ + else{
1327
+ + float *p = a.ptr<float>();
1328
+ + for(int i = 0; i < a.cols; ++i, ++p)
1329
+ + if ( !(ss >> *p))cerr<<"Error reading. Unexpected EOF. DescManip::fromString"<<endl;
1330
+ + }
1331
+ +
1332
+ + }
1333
+ +
1334
+ +}
1335
+ +
1336
+ +// --------------------------------------------------------------------------
1337
+ +
1338
+ +void DescManip::toMat32F(const std::vector<cv::Mat> &descriptors,
1339
+ + cv::Mat &mat)
1340
+ +{
1341
+ + if(descriptors.empty())
1342
+ + {
1343
+ + mat.release();
1344
+ + return;
1345
+ + }
1346
+ +
1347
+ + if(descriptors[0].type()==CV_8UC1){
1348
+ +
1349
+ + const size_t N = descriptors.size();
1350
+ + int L=getDescSizeBytes(descriptors[0]);
1351
+ + mat.create(N, L*8, CV_32F);
1352
+ + float *p = mat.ptr<float>();
1353
+ +
1354
+ + for(size_t i = 0; i < N; ++i)
1355
+ + {
1356
+ + const int C = descriptors[i].cols;
1357
+ + const unsigned char *desc = descriptors[i].ptr<unsigned char>();
1358
+ +
1359
+ + for(int j = 0; j < C; ++j, p += 8)
1360
+ + {
1361
+ + p[0] = (desc[j] & (1 << 7) ? 1 : 0);
1362
+ + p[1] = (desc[j] & (1 << 6) ? 1 : 0);
1363
+ + p[2] = (desc[j] & (1 << 5) ? 1 : 0);
1364
+ + p[3] = (desc[j] & (1 << 4) ? 1 : 0);
1365
+ + p[4] = (desc[j] & (1 << 3) ? 1 : 0);
1366
+ + p[5] = (desc[j] & (1 << 2) ? 1 : 0);
1367
+ + p[6] = (desc[j] & (1 << 1) ? 1 : 0);
1368
+ + p[7] = desc[j] & (1);
1369
+ + }
1370
+ + }
1371
+ + }
1372
+ + else{
1373
+ + assert(descriptors[0].type()==CV_32F);
1374
+ + const int N = descriptors.size();
1375
+ + int L=descriptors[0].cols;
1376
+ + mat.create(N, L, CV_32F);
1377
+ + for(int i = 0; i < N; ++i)
1378
+ + memcpy(mat.ptr<float>(i),descriptors[i].ptr<float>(0),sizeof(float)*L);
1379
+ + }
1380
+ +}
1381
+ +
1382
+ +void DescManip::toStream(const cv::Mat &m,std::ostream &str){
1383
+ + assert(m.rows==1 || m.isContinuous());
1384
+ + int type=m.type();
1385
+ + int cols=m.cols;
1386
+ + int rows=m.rows;
1387
+ + str.write((char*)&cols,sizeof(cols));
1388
+ + str.write((char*)&rows,sizeof(rows));
1389
+ + str.write((char*)&type,sizeof(type));
1390
+ + str.write((char*)m.ptr<char>(0),m.elemSize()*m.cols);
1391
+ +}
1392
+ +
1393
+ +void DescManip::fromStream(cv::Mat &m,std::istream &str){
1394
+ + int type,cols,rows;
1395
+ + str.read((char*)&cols,sizeof(cols));
1396
+ + str.read((char*)&rows,sizeof(rows));
1397
+ + str.read((char*)&type,sizeof(type));
1398
+ + m.create(rows,cols,type);
1399
+ + str.read((char*)m.ptr<char>(0),m.elemSize()*m.cols);
1400
+ +}
1401
+ +
1402
+ +
1403
+ +// --------------------------------------------------------------------------
1404
+ +
1405
+ +} // namespace DBoW3
1406
+ +
1407
+ diff --git a/src/FeatureVector.cpp b/Lib/src/FeatureVector.cpp
1408
+ similarity index 98%
1409
+ rename from src/FeatureVector.cpp
1410
+ rename to Lib/src/FeatureVector.cpp
1411
+ index 880eab1..a9cd792 100644
1412
+ --- a/src/FeatureVector.cpp
1413
+ +++ b/Lib/src/FeatureVector.cpp
1414
+ @@ -7,7 +7,7 @@
1415
+ *
1416
+ */
1417
+
1418
+ -#include "FeatureVector.h"
1419
+ +#include "DBow3/FeatureVector.h"
1420
+ #include <map>
1421
+ #include <vector>
1422
+ #include <iostream>
1423
+ diff --git a/src/QueryResults.cpp b/Lib/src/QueryResults.cpp
1424
+ similarity index 97%
1425
+ rename from src/QueryResults.cpp
1426
+ rename to Lib/src/QueryResults.cpp
1427
+ index 7062400..b852979 100644
1428
+ --- a/src/QueryResults.cpp
1429
+ +++ b/Lib/src/QueryResults.cpp
1430
+ @@ -9,7 +9,7 @@
1431
+
1432
+ #include <iostream>
1433
+ #include <fstream>
1434
+ -#include "QueryResults.h"
1435
+ +#include "DBow3/QueryResults.h"
1436
+
1437
+ using namespace std;
1438
+
1439
+ diff --git a/src/ScoringObject.cpp b/Lib/src/ScoringObject.cpp
1440
+ similarity index 99%
1441
+ rename from src/ScoringObject.cpp
1442
+ rename to Lib/src/ScoringObject.cpp
1443
+ index 7cf0812..adde8e9 100644
1444
+ --- a/src/ScoringObject.cpp
1445
+ +++ b/Lib/src/ScoringObject.cpp
1446
+ @@ -8,8 +8,8 @@
1447
+ */
1448
+
1449
+ #include <cfloat>
1450
+ -#include "Vocabulary.h"
1451
+ -#include "BowVector.h"
1452
+ +#include "DBow3/Vocabulary.h"
1453
+ +#include "DBow3/BowVector.h"
1454
+
1455
+ using namespace DBoW3;
1456
+
1457
+ diff --git a/src/Vocabulary.cpp b/Lib/src/Vocabulary.cpp
1458
+ similarity index 99%
1459
+ rename from src/Vocabulary.cpp
1460
+ rename to Lib/src/Vocabulary.cpp
1461
+ index 9f0eff3..6ccbbea 100644
1462
+ --- a/src/Vocabulary.cpp
1463
+ +++ b/Lib/src/Vocabulary.cpp
1464
+ @@ -1,8 +1,8 @@
1465
+ -#include "Vocabulary.h"
1466
+ -#include "DescManip.h"
1467
+ -#include "quicklz.h"
1468
+ +#include "DBow3/Vocabulary.h"
1469
+ +#include "DBow3/DescManip.h"
1470
+ +#include "DBow3/quicklz.h"
1471
+ #include <sstream>
1472
+ -#include "timers.h"
1473
+ +#include "DBow3/timers.h"
1474
+ namespace DBoW3{
1475
+ // --------------------------------------------------------------------------
1476
+
1477
+ diff --git a/src/quicklz.c b/Lib/src/quicklz.c
1478
+ similarity index 99%
1479
+ rename from src/quicklz.c
1480
+ rename to Lib/src/quicklz.c
1481
+ index 3742129..bd3cb11 100644
1482
+ --- a/src/quicklz.c
1483
+ +++ b/Lib/src/quicklz.c
1484
+ @@ -9,7 +9,7 @@
1485
+
1486
+ // 1.5.0 final
1487
+
1488
+ -#include "quicklz.h"
1489
+ +#include "DBow3/quicklz.h"
1490
+
1491
+ #if QLZ_VERSION_MAJOR != 1 || QLZ_VERSION_MINOR != 5 || QLZ_VERSION_REVISION != 0
1492
+ #error quicklz.c and quicklz.h have different versions
1493
+ diff --git a/cmake/instructionSet.cmake b/cmake/instructionSet.cmake
1494
+ new file mode 100644
1495
+ index 0000000..d0febeb
1496
+ --- /dev/null
1497
+ +++ b/cmake/instructionSet.cmake
1498
+ @@ -0,0 +1,13 @@
1499
+ +add_library(
1500
+ + SSE4.1
1501
+ + INTERFACE
1502
+ +)
1503
+ +
1504
+ +add_library(SIMD::SSE4.1 ALIAS SSE4.1)
1505
+ +
1506
+ +target_compile_options(
1507
+ + SSE4.1
1508
+ + INTERFACE
1509
+ + $<$<PLATFORM_ID:Linux>:-msse4.1;-march=native>
1510
+ + $<$<PLATFORM_ID:Windows>:/arch:AVX2>
1511
+ +)
1512
+ diff --git a/cmake_uninstall.cmake.in b/cmake_uninstall.cmake.in
1513
+ deleted file mode 100644
1514
+ index 81482da..0000000
1515
+ --- a/cmake_uninstall.cmake.in
1516
+ +++ /dev/null
1517
+ @@ -1,28 +0,0 @@
1518
+ -# -----------------------------------------------
1519
+ -# File that provides "make uninstall" target
1520
+ -# We use the file 'install_manifest.txt'
1521
+ -# -----------------------------------------------
1522
+ -IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
1523
+ - MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
1524
+ -ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
1525
+ -
1526
+ -FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
1527
+ -STRING(REGEX REPLACE "\n" ";" files "${files}")
1528
+ -FOREACH(file ${files})
1529
+ - MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
1530
+ -# IF(EXISTS "$ENV{DESTDIR}${file}")
1531
+ -# EXEC_PROGRAM(
1532
+ -# "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
1533
+ -# OUTPUT_VARIABLE rm_out
1534
+ -# RETURN_VALUE rm_retval
1535
+ -# )
1536
+ - EXECUTE_PROCESS(COMMAND rm $ENV{DESTDIR}${file})
1537
+ -# IF(NOT "${rm_retval}" STREQUAL 0)
1538
+ -# MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
1539
+ -# ENDIF(NOT "${rm_retval}" STREQUAL 0)
1540
+ -# ELSE(EXISTS "$ENV{DESTDIR}${file}")
1541
+ -# MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
1542
+ -# ENDIF(EXISTS "$ENV{DESTDIR}${file}")
1543
+ -ENDFOREACH(file)
1544
+ -
1545
+ -
1546
+ diff --git a/config.cmake.in b/config.cmake.in
1547
+ deleted file mode 100644
1548
+ index 9d15feb..0000000
1549
+ --- a/config.cmake.in
1550
+ +++ /dev/null
1551
+ @@ -1,36 +0,0 @@
1552
+ -# ===================================================================================
1553
+ -# @PROJECT_NAME@ CMake configuration file
1554
+ -#
1555
+ -# ** File generated automatically, do not modify **
1556
+ -#
1557
+ -# Usage from an external project:
1558
+ -# In your CMakeLists.txt, add these lines:
1559
+ -#
1560
+ -# FIND_PACKAGE(@PROJECT_NAME@ REQUIRED )
1561
+ -# TARGET_LINK_LIBRARIES(MY_TARGET_NAME ${@PROJECT_NAME@_LIBS})
1562
+ -#
1563
+ -# This file will define the following variables:
1564
+ -# - @PROJECT_NAME@_LIBS : The list of libraries to links against.
1565
+ -# - @PROJECT_NAME@_LIB_DIR : The directory where lib files are. Calling LINK_DIRECTORIES
1566
+ -# with this path is NOT needed.
1567
+ -# - @PROJECT_NAME@_VERSION : The version of this PROJECT_NAME build. Example: "1.2.0"
1568
+ -# - @PROJECT_NAME@_VERSION_MAJOR : Major version part of VERSION. Example: "1"
1569
+ -# - @PROJECT_NAME@_VERSION_MINOR : Minor version part of VERSION. Example: "2"
1570
+ -# - @PROJECT_NAME@_VERSION_PATCH : Patch version part of VERSION. Example: "0"
1571
+ -#
1572
+ -# ===================================================================================
1573
+ -INCLUDE_DIRECTORIES("@CMAKE_INSTALL_PREFIX@/include")
1574
+ -SET(@PROJECT_NAME@_INCLUDE_DIRS "@CMAKE_INSTALL_PREFIX@/include")
1575
+ -
1576
+ -LINK_DIRECTORIES("@CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_DIR@")
1577
+ -SET(@PROJECT_NAME@_LIB_DIR "@CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_DIR@")
1578
+ -
1579
+ -SET(@PROJECT_NAME@_LIBS @REQUIRED_LIBRARIES@ @PROJECT_NAME@@PROJECT_DLLVERSION@)
1580
+ -SET(@PROJECT_NAME@_LIBRARIES @REQUIRED_LIBRARIES@ @PROJECT_NAME@@PROJECT_DLLVERSION@)
1581
+ -
1582
+ -SET(@PROJECT_NAME@_FOUND YES)
1583
+ -SET(@PROJECT_NAME@_FOUND "YES")
1584
+ -SET(@PROJECT_NAME@_VERSION @PROJECT_VERSION@)
1585
+ -SET(@PROJECT_NAME@_VERSION_MAJOR @PROJECT_VERSION_MAJOR@)
1586
+ -SET(@PROJECT_NAME@_VERSION_MINOR @PROJECT_VERSION_MINOR@)
1587
+ -SET(@PROJECT_NAME@_VERSION_PATCH @PROJECT_VERSION_PATCH@)
1588
+ diff --git a/utils/CMakeLists.txt b/examples/CMakeLists.txt
1589
+ similarity index 100%
1590
+ rename from utils/CMakeLists.txt
1591
+ rename to examples/CMakeLists.txt
1592
+ diff --git a/utils/create_voc_step0.cpp b/examples/create_voc_step0.cpp
1593
+ similarity index 97%
1594
+ rename from utils/create_voc_step0.cpp
1595
+ rename to examples/create_voc_step0.cpp
1596
+ index 4fd78f6..c48a3c4 100644
1597
+ --- a/utils/create_voc_step0.cpp
1598
+ +++ b/examples/create_voc_step0.cpp
1599
+ @@ -1,126 +1,126 @@
1600
+ -
1601
+ -//First step of creating a vocabulary is extracting features from a set of images. We save them to a file for next step
1602
+ -#include <iostream>
1603
+ -#include <vector>
1604
+ -
1605
+ -// DBoW3
1606
+ -#include "DBoW3.h"
1607
+ -
1608
+ -// OpenCV
1609
+ -#include <opencv2/core/core.hpp>
1610
+ -#include <opencv2/highgui/highgui.hpp>
1611
+ -#include <opencv2/features2d/features2d.hpp>
1612
+ -#ifdef USE_CONTRIB
1613
+ -#include <opencv2/xfeatures2d/nonfree.hpp>
1614
+ -#include <opencv2/xfeatures2d.hpp>
1615
+ -#endif
1616
+ -#include "DescManip.h"
1617
+ -
1618
+ -using namespace DBoW3;
1619
+ -using namespace std;
1620
+ -
1621
+ -
1622
+ -//command line parser
1623
+ -class CmdLineParser{int argc; char **argv; public: CmdLineParser(int _argc,char **_argv):argc(_argc),argv(_argv){} bool operator[] ( string param ) {int idx=-1; for ( int i=0; i<argc && idx==-1; i++ ) if ( string ( argv[i] ) ==param ) idx=i; return ( idx!=-1 ) ; } string operator()(string param,string defvalue="-1"){int idx=-1; for ( int i=0; i<argc && idx==-1; i++ ) if ( string ( argv[i] ) ==param ) idx=i; if ( idx==-1 ) return defvalue; else return ( argv[ idx+1] ); }};
1624
+ -
1625
+ -
1626
+ -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1627
+ -
1628
+ -// extended surf gives 128-dimensional vectors
1629
+ -const bool EXTENDED_SURF = false;
1630
+ -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1631
+ -
1632
+ -void wait()
1633
+ -{
1634
+ - cout << endl << "Press enter to continue" << endl;
1635
+ - getchar();
1636
+ -}
1637
+ -
1638
+ -
1639
+ -vector<string> readImagePaths(int argc,char **argv,int start){
1640
+ - vector<string> paths;
1641
+ - for(int i=start;i<argc;i++) paths.push_back(argv[i]);
1642
+ - return paths;
1643
+ -}
1644
+ -
1645
+ -vector< cv::Mat > loadFeatures( std::vector<string> path_to_images,string descriptor="") throw (std::exception){
1646
+ - //select detector
1647
+ - cv::Ptr<cv::Feature2D> fdetector;
1648
+ - if (descriptor=="orb") fdetector=cv::ORB::create();
1649
+ - else if (descriptor=="brisk") fdetector=cv::BRISK::create();
1650
+ -#ifdef OPENCV_VERSION_3
1651
+ - else if (descriptor=="akaze") fdetector=cv::AKAZE::create();
1652
+ -#endif
1653
+ -#ifdef USE_CONTRIB
1654
+ - else if(descriptor=="surf" ) fdetector=cv::xfeatures2d::SURF::create(400, 4, 2, EXTENDED_SURF);
1655
+ -#endif
1656
+ -
1657
+ - else throw std::runtime_error("Invalid descriptor");
1658
+ - assert(!descriptor.empty());
1659
+ - vector<cv::Mat> features;
1660
+ -
1661
+ -
1662
+ - cout << "Extracting features..." << endl;
1663
+ - for(size_t i = 0; i < path_to_images.size(); ++i)
1664
+ - {
1665
+ - vector<cv::KeyPoint> keypoints;
1666
+ - cv::Mat descriptors;
1667
+ - cout<<"reading image: "<<path_to_images[i]<<endl;
1668
+ - cv::Mat image = cv::imread(path_to_images[i], 0);
1669
+ - if(image.empty())throw std::runtime_error("Could not open image"+path_to_images[i]);
1670
+ - cout<<"extracting features"<<endl;
1671
+ - fdetector->detectAndCompute(image, cv::Mat(), keypoints, descriptors);
1672
+ - features.push_back(descriptors);
1673
+ - cout<<"done detecting features"<<endl;
1674
+ - }
1675
+ - return features;
1676
+ -}
1677
+ -
1678
+ -// ----------------------------------------------------------------------------
1679
+ -void saveToFile(string filename,const vector<cv::Mat> &features){
1680
+ -
1681
+ - //test it is not created
1682
+ - std::ifstream ifile(filename);
1683
+ - if (ifile.is_open()){cerr<<"ERROR::: Output File "<<filename<<" already exists!!!!!"<<endl;exit(0);}
1684
+ - std::ofstream ofile(filename);
1685
+ - if (!ofile.is_open()){cerr<<"could not open output file"<<endl;exit(0);}
1686
+ - uint32_t size=features.size();
1687
+ - ofile.write((char*)&size,sizeof(size));
1688
+ - for(auto &f:features){
1689
+ - if( !f.isContinuous()){
1690
+ - cerr<<"Matrices should be continuous"<<endl;exit(0);
1691
+ - }
1692
+ - uint32_t aux=f.cols; ofile.write( (char*)&aux,sizeof(aux));
1693
+ - aux=f.rows; ofile.write( (char*)&aux,sizeof(aux));
1694
+ - aux=f.type(); ofile.write( (char*)&aux,sizeof(aux));
1695
+ - ofile.write( (char*)f.ptr<uchar>(0),f.total()*f.elemSize());
1696
+ - }
1697
+ -}
1698
+ -
1699
+ -// ----------------------------------------------------------------------------
1700
+ -
1701
+ -int main(int argc,char **argv)
1702
+ -{
1703
+ -
1704
+ - try{
1705
+ - CmdLineParser cml(argc,argv);
1706
+ - if (cml["-h"] || argc==1){
1707
+ - cerr<<"Usage: descriptor_name output image0 image1 ... \n\t descriptors:brisk,surf,orb(default),akaze(only if using opencv 3)"<<endl;
1708
+ - return -1;
1709
+ - }
1710
+ -
1711
+ - string descriptor=argv[1];
1712
+ - string output=argv[2];
1713
+ -
1714
+ - auto images=readImagePaths(argc,argv,3);
1715
+ - vector< cv::Mat > features= loadFeatures(images,descriptor);
1716
+ -
1717
+ - //save features to file
1718
+ - saveToFile(argv[2],features);
1719
+ -
1720
+ - }catch(std::exception &ex){
1721
+ - cerr<<ex.what()<<endl;
1722
+ - }
1723
+ -
1724
+ - return 0;
1725
+ -}
1726
+ +
1727
+ +//First step of creating a vocabulary is extracting features from a set of images. We save them to a file for next step
1728
+ +#include <iostream>
1729
+ +#include <vector>
1730
+ +
1731
+ +// DBoW3
1732
+ +#include "DBoW3.h"
1733
+ +
1734
+ +// OpenCV
1735
+ +#include <opencv2/core/core.hpp>
1736
+ +#include <opencv2/highgui/highgui.hpp>
1737
+ +#include <opencv2/features2d/features2d.hpp>
1738
+ +#ifdef USE_CONTRIB
1739
+ +#include <opencv2/xfeatures2d/nonfree.hpp>
1740
+ +#include <opencv2/xfeatures2d.hpp>
1741
+ +#endif
1742
+ +#include "DescManip.h"
1743
+ +
1744
+ +using namespace DBoW3;
1745
+ +using namespace std;
1746
+ +
1747
+ +
1748
+ +//command line parser
1749
+ +class CmdLineParser{int argc; char **argv; public: CmdLineParser(int _argc,char **_argv):argc(_argc),argv(_argv){} bool operator[] ( string param ) {int idx=-1; for ( int i=0; i<argc && idx==-1; i++ ) if ( string ( argv[i] ) ==param ) idx=i; return ( idx!=-1 ) ; } string operator()(string param,string defvalue="-1"){int idx=-1; for ( int i=0; i<argc && idx==-1; i++ ) if ( string ( argv[i] ) ==param ) idx=i; if ( idx==-1 ) return defvalue; else return ( argv[ idx+1] ); }};
1750
+ +
1751
+ +
1752
+ +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1753
+ +
1754
+ +// extended surf gives 128-dimensional vectors
1755
+ +const bool EXTENDED_SURF = false;
1756
+ +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1757
+ +
1758
+ +void wait()
1759
+ +{
1760
+ + cout << endl << "Press enter to continue" << endl;
1761
+ + getchar();
1762
+ +}
1763
+ +
1764
+ +
1765
+ +vector<string> readImagePaths(int argc,char **argv,int start){
1766
+ + vector<string> paths;
1767
+ + for(int i=start;i<argc;i++) paths.push_back(argv[i]);
1768
+ + return paths;
1769
+ +}
1770
+ +
1771
+ +vector< cv::Mat > loadFeatures( std::vector<string> path_to_images,string descriptor="") throw (std::exception){
1772
+ + //select detector
1773
+ + cv::Ptr<cv::Feature2D> fdetector;
1774
+ + if (descriptor=="orb") fdetector=cv::ORB::create();
1775
+ + else if (descriptor=="brisk") fdetector=cv::BRISK::create();
1776
+ +#ifdef OPENCV_VERSION_3
1777
+ + else if (descriptor=="akaze") fdetector=cv::AKAZE::create();
1778
+ +#endif
1779
+ +#ifdef USE_CONTRIB
1780
+ + else if(descriptor=="surf" ) fdetector=cv::xfeatures2d::SURF::create(400, 4, 2, EXTENDED_SURF);
1781
+ +#endif
1782
+ +
1783
+ + else throw std::runtime_error("Invalid descriptor");
1784
+ + assert(!descriptor.empty());
1785
+ + vector<cv::Mat> features;
1786
+ +
1787
+ +
1788
+ + cout << "Extracting features..." << endl;
1789
+ + for(size_t i = 0; i < path_to_images.size(); ++i)
1790
+ + {
1791
+ + vector<cv::KeyPoint> keypoints;
1792
+ + cv::Mat descriptors;
1793
+ + cout<<"reading image: "<<path_to_images[i]<<endl;
1794
+ + cv::Mat image = cv::imread(path_to_images[i], 0);
1795
+ + if(image.empty())throw std::runtime_error("Could not open image"+path_to_images[i]);
1796
+ + cout<<"extracting features"<<endl;
1797
+ + fdetector->detectAndCompute(image, cv::Mat(), keypoints, descriptors);
1798
+ + features.push_back(descriptors);
1799
+ + cout<<"done detecting features"<<endl;
1800
+ + }
1801
+ + return features;
1802
+ +}
1803
+ +
1804
+ +// ----------------------------------------------------------------------------
1805
+ +void saveToFile(string filename,const vector<cv::Mat> &features){
1806
+ +
1807
+ + //test it is not created
1808
+ + std::ifstream ifile(filename);
1809
+ + if (ifile.is_open()){cerr<<"ERROR::: Output File "<<filename<<" already exists!!!!!"<<endl;exit(0);}
1810
+ + std::ofstream ofile(filename);
1811
+ + if (!ofile.is_open()){cerr<<"could not open output file"<<endl;exit(0);}
1812
+ + uint32_t size=features.size();
1813
+ + ofile.write((char*)&size,sizeof(size));
1814
+ + for(auto &f:features){
1815
+ + if( !f.isContinuous()){
1816
+ + cerr<<"Matrices should be continuous"<<endl;exit(0);
1817
+ + }
1818
+ + uint32_t aux=f.cols; ofile.write( (char*)&aux,sizeof(aux));
1819
+ + aux=f.rows; ofile.write( (char*)&aux,sizeof(aux));
1820
+ + aux=f.type(); ofile.write( (char*)&aux,sizeof(aux));
1821
+ + ofile.write( (char*)f.ptr<uchar>(0),f.total()*f.elemSize());
1822
+ + }
1823
+ +}
1824
+ +
1825
+ +// ----------------------------------------------------------------------------
1826
+ +
1827
+ +int main(int argc,char **argv)
1828
+ +{
1829
+ +
1830
+ + try{
1831
+ + CmdLineParser cml(argc,argv);
1832
+ + if (cml["-h"] || argc==1){
1833
+ + cerr<<"Usage: descriptor_name output image0 image1 ... \n\t descriptors:brisk,surf,orb(default),akaze(only if using opencv 3)"<<endl;
1834
+ + return -1;
1835
+ + }
1836
+ +
1837
+ + string descriptor=argv[1];
1838
+ + string output=argv[2];
1839
+ +
1840
+ + auto images=readImagePaths(argc,argv,3);
1841
+ + vector< cv::Mat > features= loadFeatures(images,descriptor);
1842
+ +
1843
+ + //save features to file
1844
+ + saveToFile(argv[2],features);
1845
+ +
1846
+ + }catch(std::exception &ex){
1847
+ + cerr<<ex.what()<<endl;
1848
+ + }
1849
+ +
1850
+ + return 0;
1851
+ +}
1852
+ diff --git a/utils/create_voc_step1.cpp b/examples/create_voc_step1.cpp
1853
+ similarity index 97%
1854
+ rename from utils/create_voc_step1.cpp
1855
+ rename to examples/create_voc_step1.cpp
1856
+ index 8d9de7d..1f82c66 100644
1857
+ --- a/utils/create_voc_step1.cpp
1858
+ +++ b/examples/create_voc_step1.cpp
1859
+ @@ -1,71 +1,71 @@
1860
+ -//Second step,creates the vocabulary from the set of features. It can be slow
1861
+ -#include <iostream>
1862
+ -#include <vector>
1863
+ -
1864
+ -// DBoW3
1865
+ -#include "DBoW3.h"
1866
+ -
1867
+ -// OpenCV
1868
+ -#include <opencv2/core/core.hpp>
1869
+ -using namespace DBoW3;
1870
+ -using namespace std;
1871
+ -
1872
+ -//command line parser
1873
+ -class CmdLineParser{int argc; char **argv; public: CmdLineParser(int _argc,char **_argv):argc(_argc),argv(_argv){} bool operator[] ( string param ) {int idx=-1; for ( int i=0; i<argc && idx==-1; i++ ) if ( string ( argv[i] ) ==param ) idx=i; return ( idx!=-1 ) ; } string operator()(string param,string defvalue="-1"){int idx=-1; for ( int i=0; i<argc && idx==-1; i++ ) if ( string ( argv[i] ) ==param ) idx=i; if ( idx==-1 ) return defvalue; else return ( argv[ idx+1] ); }};
1874
+ -
1875
+ -// ----------------------------------------------------------------------------
1876
+ -
1877
+ -// ----------------------------------------------------------------------------
1878
+ -vector<cv::Mat> readFeaturesFromFile(string filename){
1879
+ -vector<cv::Mat> features;
1880
+ - //test it is not created
1881
+ - std::ifstream ifile(filename);
1882
+ - if (!ifile.is_open()){cerr<<"could not open input file"<<endl;exit(0);}
1883
+ - uint32_t size;
1884
+ - ifile.read((char*)&size,sizeof(size));
1885
+ - features.resize(size);
1886
+ - for(size_t i=0;i<size;i++){
1887
+ -
1888
+ - uint32_t cols,rows,type;
1889
+ - ifile.read( (char*)&cols,sizeof(cols));
1890
+ - ifile.read( (char*)&rows,sizeof(rows));
1891
+ - ifile.read( (char*)&type,sizeof(type));
1892
+ - features[i].create(rows,cols,type);
1893
+ - ifile.read( (char*)features[i].ptr<uchar>(0),features[i].total()*features[i].elemSize());
1894
+ - }
1895
+ - return features;
1896
+ -}
1897
+ -
1898
+ -// ----------------------------------------------------------------------------
1899
+ -
1900
+ -int main(int argc,char **argv)
1901
+ -{
1902
+ -
1903
+ - try{
1904
+ - CmdLineParser cml(argc,argv);
1905
+ - if (cml["-h"] || argc!=3){
1906
+ - cerr<<"Usage: features output_voc.yml[.gz]"<<endl;
1907
+ - return -1;
1908
+ - }
1909
+ -
1910
+ -
1911
+ - auto features=readFeaturesFromFile(argv[1]);
1912
+ -
1913
+ - const int k = 9;
1914
+ - const int L = 3;
1915
+ - const WeightingType weight = TF_IDF;
1916
+ - const ScoringType score = L1_NORM;
1917
+ - DBoW3::Vocabulary voc (k, L, weight, score);
1918
+ -
1919
+ - cout << "Creating a small " << k << "^" << L << " vocabulary..." << endl;
1920
+ - voc.create(features);
1921
+ - cerr<<"Saving "<<argv[2]<<endl;
1922
+ - voc.save(argv[2]);
1923
+ -
1924
+ -
1925
+ - }catch(std::exception &ex){
1926
+ - cerr<<ex.what()<<endl;
1927
+ - }
1928
+ -
1929
+ - return 0;
1930
+ -}
1931
+ +//Second step,creates the vocabulary from the set of features. It can be slow
1932
+ +#include <iostream>
1933
+ +#include <vector>
1934
+ +
1935
+ +// DBoW3
1936
+ +#include "DBoW3.h"
1937
+ +
1938
+ +// OpenCV
1939
+ +#include <opencv2/core/core.hpp>
1940
+ +using namespace DBoW3;
1941
+ +using namespace std;
1942
+ +
1943
+ +//command line parser
1944
+ +class CmdLineParser{int argc; char **argv; public: CmdLineParser(int _argc,char **_argv):argc(_argc),argv(_argv){} bool operator[] ( string param ) {int idx=-1; for ( int i=0; i<argc && idx==-1; i++ ) if ( string ( argv[i] ) ==param ) idx=i; return ( idx!=-1 ) ; } string operator()(string param,string defvalue="-1"){int idx=-1; for ( int i=0; i<argc && idx==-1; i++ ) if ( string ( argv[i] ) ==param ) idx=i; if ( idx==-1 ) return defvalue; else return ( argv[ idx+1] ); }};
1945
+ +
1946
+ +// ----------------------------------------------------------------------------
1947
+ +
1948
+ +// ----------------------------------------------------------------------------
1949
+ +vector<cv::Mat> readFeaturesFromFile(string filename){
1950
+ +vector<cv::Mat> features;
1951
+ + //test it is not created
1952
+ + std::ifstream ifile(filename);
1953
+ + if (!ifile.is_open()){cerr<<"could not open input file"<<endl;exit(0);}
1954
+ + uint32_t size;
1955
+ + ifile.read((char*)&size,sizeof(size));
1956
+ + features.resize(size);
1957
+ + for(size_t i=0;i<size;i++){
1958
+ +
1959
+ + uint32_t cols,rows,type;
1960
+ + ifile.read( (char*)&cols,sizeof(cols));
1961
+ + ifile.read( (char*)&rows,sizeof(rows));
1962
+ + ifile.read( (char*)&type,sizeof(type));
1963
+ + features[i].create(rows,cols,type);
1964
+ + ifile.read( (char*)features[i].ptr<uchar>(0),features[i].total()*features[i].elemSize());
1965
+ + }
1966
+ + return features;
1967
+ +}
1968
+ +
1969
+ +// ----------------------------------------------------------------------------
1970
+ +
1971
+ +int main(int argc,char **argv)
1972
+ +{
1973
+ +
1974
+ + try{
1975
+ + CmdLineParser cml(argc,argv);
1976
+ + if (cml["-h"] || argc!=3){
1977
+ + cerr<<"Usage: features output_voc.yml[.gz]"<<endl;
1978
+ + return -1;
1979
+ + }
1980
+ +
1981
+ +
1982
+ + auto features=readFeaturesFromFile(argv[1]);
1983
+ +
1984
+ + const int k = 9;
1985
+ + const int L = 3;
1986
+ + const WeightingType weight = TF_IDF;
1987
+ + const ScoringType score = L1_NORM;
1988
+ + DBoW3::Vocabulary voc (k, L, weight, score);
1989
+ +
1990
+ + cout << "Creating a small " << k << "^" << L << " vocabulary..." << endl;
1991
+ + voc.create(features);
1992
+ + cerr<<"Saving "<<argv[2]<<endl;
1993
+ + voc.save(argv[2]);
1994
+ +
1995
+ +
1996
+ + }catch(std::exception &ex){
1997
+ + cerr<<ex.what()<<endl;
1998
+ + }
1999
+ +
2000
+ + return 0;
2001
+ +}
2002
+ diff --git a/utils/demo_general.cpp b/examples/demo_general.cpp
2003
+ similarity index 96%
2004
+ rename from utils/demo_general.cpp
2005
+ rename to examples/demo_general.cpp
2006
+ index 63db40b..b4bc391 100644
2007
+ --- a/utils/demo_general.cpp
2008
+ +++ b/examples/demo_general.cpp
2009
+ @@ -1,202 +1,202 @@
2010
+ -/**
2011
+ - * Date: 2016
2012
+ - * Author: Rafael Muñoz Salinas
2013
+ - * Description: demo application of DBoW3
2014
+ - * License: see the LICENSE.txt file
2015
+ - */
2016
+ -
2017
+ -#include <iostream>
2018
+ -#include <vector>
2019
+ -
2020
+ -// DBoW3
2021
+ -#include "DBoW3.h"
2022
+ -
2023
+ -// OpenCV
2024
+ -#include <opencv2/core/core.hpp>
2025
+ -#include <opencv2/highgui/highgui.hpp>
2026
+ -#include <opencv2/features2d/features2d.hpp>
2027
+ -#ifdef USE_CONTRIB
2028
+ -#include <opencv2/xfeatures2d/nonfree.hpp>
2029
+ -#include <opencv2/xfeatures2d.hpp>
2030
+ -#endif
2031
+ -#include "DescManip.h"
2032
+ -
2033
+ -using namespace DBoW3;
2034
+ -using namespace std;
2035
+ -
2036
+ -
2037
+ -//command line parser
2038
+ -class CmdLineParser{int argc; char **argv; public: CmdLineParser(int _argc,char **_argv):argc(_argc),argv(_argv){} bool operator[] ( string param ) {int idx=-1; for ( int i=0; i<argc && idx==-1; i++ ) if ( string ( argv[i] ) ==param ) idx=i; return ( idx!=-1 ) ; } string operator()(string param,string defvalue="-1"){int idx=-1; for ( int i=0; i<argc && idx==-1; i++ ) if ( string ( argv[i] ) ==param ) idx=i; if ( idx==-1 ) return defvalue; else return ( argv[ idx+1] ); }};
2039
+ -
2040
+ -
2041
+ -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2042
+ -
2043
+ -// extended surf gives 128-dimensional vectors
2044
+ -const bool EXTENDED_SURF = false;
2045
+ -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2046
+ -
2047
+ -void wait()
2048
+ -{
2049
+ - cout << endl << "Press enter to continue" << endl;
2050
+ - getchar();
2051
+ -}
2052
+ -
2053
+ -
2054
+ -vector<string> readImagePaths(int argc,char **argv,int start){
2055
+ - vector<string> paths;
2056
+ - for(int i=start;i<argc;i++) paths.push_back(argv[i]);
2057
+ - return paths;
2058
+ -}
2059
+ -
2060
+ -vector< cv::Mat > loadFeatures( std::vector<string> path_to_images,string descriptor="") throw (std::exception){
2061
+ - //select detector
2062
+ - cv::Ptr<cv::Feature2D> fdetector;
2063
+ - if (descriptor=="orb") fdetector=cv::ORB::create();
2064
+ - else if (descriptor=="brisk") fdetector=cv::BRISK::create();
2065
+ -#ifdef OPENCV_VERSION_3
2066
+ - else if (descriptor=="akaze") fdetector=cv::AKAZE::create();
2067
+ -#endif
2068
+ -#ifdef USE_CONTRIB
2069
+ - else if(descriptor=="surf" ) fdetector=cv::xfeatures2d::SURF::create(400, 4, 2, EXTENDED_SURF);
2070
+ -#endif
2071
+ -
2072
+ - else throw std::runtime_error("Invalid descriptor");
2073
+ - assert(!descriptor.empty());
2074
+ - vector<cv::Mat> features;
2075
+ -
2076
+ -
2077
+ - cout << "Extracting features..." << endl;
2078
+ - for(size_t i = 0; i < path_to_images.size(); ++i)
2079
+ - {
2080
+ - vector<cv::KeyPoint> keypoints;
2081
+ - cv::Mat descriptors;
2082
+ - cout<<"reading image: "<<path_to_images[i]<<endl;
2083
+ - cv::Mat image = cv::imread(path_to_images[i], 0);
2084
+ - if(image.empty())throw std::runtime_error("Could not open image"+path_to_images[i]);
2085
+ - cout<<"extracting features"<<endl;
2086
+ - fdetector->detectAndCompute(image, cv::Mat(), keypoints, descriptors);
2087
+ - features.push_back(descriptors);
2088
+ - cout<<"done detecting features"<<endl;
2089
+ - }
2090
+ - return features;
2091
+ -}
2092
+ -
2093
+ -// ----------------------------------------------------------------------------
2094
+ -
2095
+ -void testVocCreation(const vector<cv::Mat> &features)
2096
+ -{
2097
+ - // branching factor and depth levels
2098
+ - const int k = 9;
2099
+ - const int L = 3;
2100
+ - const WeightingType weight = TF_IDF;
2101
+ - const ScoringType score = L1_NORM;
2102
+ -
2103
+ - DBoW3::Vocabulary voc(k, L, weight, score);
2104
+ -
2105
+ - cout << "Creating a small " << k << "^" << L << " vocabulary..." << endl;
2106
+ - voc.create(features);
2107
+ - cout << "... done!" << endl;
2108
+ -
2109
+ - cout << "Vocabulary information: " << endl
2110
+ - << voc << endl << endl;
2111
+ -
2112
+ - // lets do something with this vocabulary
2113
+ - cout << "Matching images against themselves (0 low, 1 high): " << endl;
2114
+ - BowVector v1, v2;
2115
+ - for(size_t i = 0; i < features.size(); i++)
2116
+ - {
2117
+ - voc.transform(features[i], v1);
2118
+ - for(size_t j = 0; j < features.size(); j++)
2119
+ - {
2120
+ - voc.transform(features[j], v2);
2121
+ -
2122
+ - double score = voc.score(v1, v2);
2123
+ - cout << "Image " << i << " vs Image " << j << ": " << score << endl;
2124
+ - }
2125
+ - }
2126
+ -
2127
+ - // save the vocabulary to disk
2128
+ - cout << endl << "Saving vocabulary..." << endl;
2129
+ - voc.save("small_voc.yml.gz");
2130
+ - cout << "Done" << endl;
2131
+ -}
2132
+ -
2133
+ -////// ----------------------------------------------------------------------------
2134
+ -
2135
+ -void testDatabase(const vector<cv::Mat > &features)
2136
+ -{
2137
+ - cout << "Creating a small database..." << endl;
2138
+ -
2139
+ - // load the vocabulary from disk
2140
+ - Vocabulary voc("small_voc.yml.gz");
2141
+ -
2142
+ - Database db(voc, false, 0); // false = do not use direct index
2143
+ - // (so ignore the last param)
2144
+ - // The direct index is useful if we want to retrieve the features that
2145
+ - // belong to some vocabulary node.
2146
+ - // db creates a copy of the vocabulary, we may get rid of "voc" now
2147
+ -
2148
+ - // add images to the database
2149
+ - for(size_t i = 0; i < features.size(); i++)
2150
+ - db.add(features[i]);
2151
+ -
2152
+ - cout << "... done!" << endl;
2153
+ -
2154
+ - cout << "Database information: " << endl << db << endl;
2155
+ -
2156
+ - // and query the database
2157
+ - cout << "Querying the database: " << endl;
2158
+ -
2159
+ - QueryResults ret;
2160
+ - for(size_t i = 0; i < features.size(); i++)
2161
+ - {
2162
+ - db.query(features[i], ret, 4);
2163
+ -
2164
+ - // ret[0] is always the same image in this case, because we added it to the
2165
+ - // database. ret[1] is the second best match.
2166
+ -
2167
+ - cout << "Searching for Image " << i << ". " << ret << endl;
2168
+ - }
2169
+ -
2170
+ - cout << endl;
2171
+ -
2172
+ - // we can save the database. The created file includes the vocabulary
2173
+ - // and the entries added
2174
+ - cout << "Saving database..." << endl;
2175
+ - db.save("small_db.yml.gz");
2176
+ - cout << "... done!" << endl;
2177
+ -
2178
+ - // once saved, we can load it again
2179
+ - cout << "Retrieving database once again..." << endl;
2180
+ - Database db2("small_db.yml.gz");
2181
+ - cout << "... done! This is: " << endl << db2 << endl;
2182
+ -}
2183
+ -
2184
+ -
2185
+ -// ----------------------------------------------------------------------------
2186
+ -
2187
+ -int main(int argc,char **argv)
2188
+ -{
2189
+ -
2190
+ - try{
2191
+ - CmdLineParser cml(argc,argv);
2192
+ - if (cml["-h"] || argc<=2){
2193
+ - cerr<<"Usage: descriptor_name image0 image1 ... \n\t descriptors:brisk,surf,orb ,akaze(only if using opencv 3)"<<endl;
2194
+ - return -1;
2195
+ - }
2196
+ -
2197
+ - string descriptor=argv[1];
2198
+ -
2199
+ - auto images=readImagePaths(argc,argv,2);
2200
+ - vector< cv::Mat > features= loadFeatures(images,descriptor);
2201
+ - testVocCreation(features);
2202
+ -
2203
+ -
2204
+ - testDatabase(features);
2205
+ -
2206
+ - }catch(std::exception &ex){
2207
+ - cerr<<ex.what()<<endl;
2208
+ - }
2209
+ -
2210
+ - return 0;
2211
+ -}
2212
+ +/**
2213
+ + * Date: 2016
2214
+ + * Author: Rafael Muñoz Salinas
2215
+ + * Description: demo application of DBoW3
2216
+ + * License: see the LICENSE.txt file
2217
+ + */
2218
+ +
2219
+ +#include <iostream>
2220
+ +#include <vector>
2221
+ +
2222
+ +// DBoW3
2223
+ +#include "DBoW3.h"
2224
+ +
2225
+ +// OpenCV
2226
+ +#include <opencv2/core/core.hpp>
2227
+ +#include <opencv2/highgui/highgui.hpp>
2228
+ +#include <opencv2/features2d/features2d.hpp>
2229
+ +#ifdef USE_CONTRIB
2230
+ +#include <opencv2/xfeatures2d/nonfree.hpp>
2231
+ +#include <opencv2/xfeatures2d.hpp>
2232
+ +#endif
2233
+ +#include "DescManip.h"
2234
+ +
2235
+ +using namespace DBoW3;
2236
+ +using namespace std;
2237
+ +
2238
+ +
2239
+ +//command line parser
2240
+ +class CmdLineParser{int argc; char **argv; public: CmdLineParser(int _argc,char **_argv):argc(_argc),argv(_argv){} bool operator[] ( string param ) {int idx=-1; for ( int i=0; i<argc && idx==-1; i++ ) if ( string ( argv[i] ) ==param ) idx=i; return ( idx!=-1 ) ; } string operator()(string param,string defvalue="-1"){int idx=-1; for ( int i=0; i<argc && idx==-1; i++ ) if ( string ( argv[i] ) ==param ) idx=i; if ( idx==-1 ) return defvalue; else return ( argv[ idx+1] ); }};
2241
+ +
2242
+ +
2243
+ +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2244
+ +
2245
+ +// extended surf gives 128-dimensional vectors
2246
+ +const bool EXTENDED_SURF = false;
2247
+ +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2248
+ +
2249
+ +void wait()
2250
+ +{
2251
+ + cout << endl << "Press enter to continue" << endl;
2252
+ + getchar();
2253
+ +}
2254
+ +
2255
+ +
2256
+ +vector<string> readImagePaths(int argc,char **argv,int start){
2257
+ + vector<string> paths;
2258
+ + for(int i=start;i<argc;i++) paths.push_back(argv[i]);
2259
+ + return paths;
2260
+ +}
2261
+ +
2262
+ +vector< cv::Mat > loadFeatures( std::vector<string> path_to_images,string descriptor="") throw (std::exception){
2263
+ + //select detector
2264
+ + cv::Ptr<cv::Feature2D> fdetector;
2265
+ + if (descriptor=="orb") fdetector=cv::ORB::create();
2266
+ + else if (descriptor=="brisk") fdetector=cv::BRISK::create();
2267
+ +#ifdef OPENCV_VERSION_3
2268
+ + else if (descriptor=="akaze") fdetector=cv::AKAZE::create();
2269
+ +#endif
2270
+ +#ifdef USE_CONTRIB
2271
+ + else if(descriptor=="surf" ) fdetector=cv::xfeatures2d::SURF::create(400, 4, 2, EXTENDED_SURF);
2272
+ +#endif
2273
+ +
2274
+ + else throw std::runtime_error("Invalid descriptor");
2275
+ + assert(!descriptor.empty());
2276
+ + vector<cv::Mat> features;
2277
+ +
2278
+ +
2279
+ + cout << "Extracting features..." << endl;
2280
+ + for(size_t i = 0; i < path_to_images.size(); ++i)
2281
+ + {
2282
+ + vector<cv::KeyPoint> keypoints;
2283
+ + cv::Mat descriptors;
2284
+ + cout<<"reading image: "<<path_to_images[i]<<endl;
2285
+ + cv::Mat image = cv::imread(path_to_images[i], 0);
2286
+ + if(image.empty())throw std::runtime_error("Could not open image"+path_to_images[i]);
2287
+ + cout<<"extracting features"<<endl;
2288
+ + fdetector->detectAndCompute(image, cv::Mat(), keypoints, descriptors);
2289
+ + features.push_back(descriptors);
2290
+ + cout<<"done detecting features"<<endl;
2291
+ + }
2292
+ + return features;
2293
+ +}
2294
+ +
2295
+ +// ----------------------------------------------------------------------------
2296
+ +
2297
+ +void testVocCreation(const vector<cv::Mat> &features)
2298
+ +{
2299
+ + // branching factor and depth levels
2300
+ + const int k = 9;
2301
+ + const int L = 3;
2302
+ + const WeightingType weight = TF_IDF;
2303
+ + const ScoringType score = L1_NORM;
2304
+ +
2305
+ + DBoW3::Vocabulary voc(k, L, weight, score);
2306
+ +
2307
+ + cout << "Creating a small " << k << "^" << L << " vocabulary..." << endl;
2308
+ + voc.create(features);
2309
+ + cout << "... done!" << endl;
2310
+ +
2311
+ + cout << "Vocabulary information: " << endl
2312
+ + << voc << endl << endl;
2313
+ +
2314
+ + // lets do something with this vocabulary
2315
+ + cout << "Matching images against themselves (0 low, 1 high): " << endl;
2316
+ + BowVector v1, v2;
2317
+ + for(size_t i = 0; i < features.size(); i++)
2318
+ + {
2319
+ + voc.transform(features[i], v1);
2320
+ + for(size_t j = 0; j < features.size(); j++)
2321
+ + {
2322
+ + voc.transform(features[j], v2);
2323
+ +
2324
+ + double score = voc.score(v1, v2);
2325
+ + cout << "Image " << i << " vs Image " << j << ": " << score << endl;
2326
+ + }
2327
+ + }
2328
+ +
2329
+ + // save the vocabulary to disk
2330
+ + cout << endl << "Saving vocabulary..." << endl;
2331
+ + voc.save("small_voc.yml.gz");
2332
+ + cout << "Done" << endl;
2333
+ +}
2334
+ +
2335
+ +////// ----------------------------------------------------------------------------
2336
+ +
2337
+ +void testDatabase(const vector<cv::Mat > &features)
2338
+ +{
2339
+ + cout << "Creating a small database..." << endl;
2340
+ +
2341
+ + // load the vocabulary from disk
2342
+ + Vocabulary voc("small_voc.yml.gz");
2343
+ +
2344
+ + Database db(voc, false, 0); // false = do not use direct index
2345
+ + // (so ignore the last param)
2346
+ + // The direct index is useful if we want to retrieve the features that
2347
+ + // belong to some vocabulary node.
2348
+ + // db creates a copy of the vocabulary, we may get rid of "voc" now
2349
+ +
2350
+ + // add images to the database
2351
+ + for(size_t i = 0; i < features.size(); i++)
2352
+ + db.add(features[i]);
2353
+ +
2354
+ + cout << "... done!" << endl;
2355
+ +
2356
+ + cout << "Database information: " << endl << db << endl;
2357
+ +
2358
+ + // and query the database
2359
+ + cout << "Querying the database: " << endl;
2360
+ +
2361
+ + QueryResults ret;
2362
+ + for(size_t i = 0; i < features.size(); i++)
2363
+ + {
2364
+ + db.query(features[i], ret, 4);
2365
+ +
2366
+ + // ret[0] is always the same image in this case, because we added it to the
2367
+ + // database. ret[1] is the second best match.
2368
+ +
2369
+ + cout << "Searching for Image " << i << ". " << ret << endl;
2370
+ + }
2371
+ +
2372
+ + cout << endl;
2373
+ +
2374
+ + // we can save the database. The created file includes the vocabulary
2375
+ + // and the entries added
2376
+ + cout << "Saving database..." << endl;
2377
+ + db.save("small_db.yml.gz");
2378
+ + cout << "... done!" << endl;
2379
+ +
2380
+ + // once saved, we can load it again
2381
+ + cout << "Retrieving database once again..." << endl;
2382
+ + Database db2("small_db.yml.gz");
2383
+ + cout << "... done! This is: " << endl << db2 << endl;
2384
+ +}
2385
+ +
2386
+ +
2387
+ +// ----------------------------------------------------------------------------
2388
+ +
2389
+ +int main(int argc,char **argv)
2390
+ +{
2391
+ +
2392
+ + try{
2393
+ + CmdLineParser cml(argc,argv);
2394
+ + if (cml["-h"] || argc<=2){
2395
+ + cerr<<"Usage: descriptor_name image0 image1 ... \n\t descriptors:brisk,surf,orb ,akaze(only if using opencv 3)"<<endl;
2396
+ + return -1;
2397
+ + }
2398
+ +
2399
+ + string descriptor=argv[1];
2400
+ +
2401
+ + auto images=readImagePaths(argc,argv,2);
2402
+ + vector< cv::Mat > features= loadFeatures(images,descriptor);
2403
+ + testVocCreation(features);
2404
+ +
2405
+ +
2406
+ + testDatabase(features);
2407
+ +
2408
+ + }catch(std::exception &ex){
2409
+ + cerr<<ex.what()<<endl;
2410
+ + }
2411
+ +
2412
+ + return 0;
2413
+ +}
2414
+ diff --git a/utils/images/image0.png b/examples/images/image0.png
2415
+ similarity index 100%
2416
+ rename from utils/images/image0.png
2417
+ rename to examples/images/image0.png
2418
+ diff --git a/utils/images/image1.png b/examples/images/image1.png
2419
+ similarity index 100%
2420
+ rename from utils/images/image1.png
2421
+ rename to examples/images/image1.png
2422
+ diff --git a/utils/images/image2.png b/examples/images/image2.png
2423
+ similarity index 100%
2424
+ rename from utils/images/image2.png
2425
+ rename to examples/images/image2.png
2426
+ diff --git a/utils/images/image3.png b/examples/images/image3.png
2427
+ similarity index 100%
2428
+ rename from utils/images/image3.png
2429
+ rename to examples/images/image3.png
2430
+ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
2431
+ deleted file mode 100644
2432
+ index a9c52b4..0000000
2433
+ --- a/src/CMakeLists.txt
2434
+ +++ /dev/null
2435
+ @@ -1,35 +0,0 @@
2436
+ -INCLUDE_DIRECTORIES(. ./utils/)
2437
+ -
2438
+ -FILE(GLOB hdrs_base "*.h" )
2439
+ -FILE(GLOB srcs_base "*.c*")
2440
+ -
2441
+ -FILE(GLOB hdrs ${hdrs_base} )
2442
+ -FILE(GLOB srcs ${srcs_base} )
2443
+ -
2444
+ -
2445
+ -ADD_LIBRARY(${PROJECT_NAME} ${srcs} ${hdrs})
2446
+ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} )
2447
+ -
2448
+ -SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES # create *nix style library versions + symbolic links
2449
+ - DEFINE_SYMBOL DBOW_DSO_EXPORTS
2450
+ - VERSION ${PROJECT_VERSION}
2451
+ - SOVERSION ${PROJECT_SOVERSION}
2452
+ - CLEAN_DIRECT_OUTPUT 1 # allow creating static and shared libs without conflicts
2453
+ - OUTPUT_NAME "${PROJECT_NAME}${PROJECT_DLLVERSION}" # avoid conflicts between library and binary target names
2454
+ -)
2455
+ -
2456
+ -TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${REQUIRED_LIBRARIES} )
2457
+ -
2458
+ -INSTALL(TARGETS ${PROJECT_NAME}
2459
+ - RUNTIME DESTINATION bin COMPONENT main # Install the dll file in bin directory
2460
+ - LIBRARY DESTINATION ${LIB_INSTALL_DIR} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE COMPONENT main
2461
+ - ARCHIVE DESTINATION ${LIB_INSTALL_DIR} COMPONENT main) # Install the dll.a file in lib directory
2462
+ -
2463
+ -
2464
+ -
2465
+ -INSTALL(FILES ${hdrs_base}
2466
+ - DESTINATION include/${PROJECT_NAME}
2467
+ - COMPONENT main)
2468
+ -
2469
+ -
2470
+ -
2471
+ diff --git a/orbvoc.dbow3 b/voc/orbvoc.dbow3
2472
+ similarity index 100%
2473
+ rename from orbvoc.dbow3
2474
+ rename to voc/orbvoc.dbow3
2475
+
2476
+ From 9f9a9125423edd0b2cc7c84897d4387c5dcea44b Mon Sep 17 00:00:00 2001
2477
+ From: Ramadan <[email protected]>
2478
+ Date: Thu, 15 Aug 2019 14:00:28 +0200
2479
+ Subject: [PATCH 2/2] Fix DBow3Config.cmake
2480
+
2481
+ ---
2482
+ Lib/DBow3Config.cmake | 2 +-
2483
+ 1 file changed, 1 insertion(+), 1 deletion(-)
2484
+
2485
+ diff --git a/Lib/DBow3Config.cmake b/Lib/DBow3Config.cmake
2486
+ index 9720a14..da63d5e 100644
2487
+ --- a/Lib/DBow3Config.cmake
2488
+ +++ b/Lib/DBow3Config.cmake
2489
+ @@ -1,4 +1,4 @@
2490
+ include(CMakeFindDependencyMacro)
2491
+ find_dependency(OpenCV)
2492
+ find_dependency(OpenMP)
2493
+ -include("${CMAKE_CURRENT_LIST_DIR}/FbowTargets.cmake")
2494
+
2495
+ +include("${CMAKE_CURRENT_LIST_DIR}/DBow3Targets.cmake")
2496
+
third-party/DPVO/Pangolin/scripts/vcpkg/ports/dbow3/portfile.cmake ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #the port produces some empty dlls when building shared libraries, since some components do not export anything, breaking the internal build itself
2
+ vcpkg_from_github(
3
+ OUT_SOURCE_PATH SOURCE_PATH
4
+ REPO rmsalinas/DBow3
5
+ REF master
6
+ SHA512 16e6789b77e8b42428d156ae5efa667861fa8ef2e85b54e3dd1d28e6f8dc7d119e973234c77cac82e775080fb9c859640d04159659a7d63941325e13e40b2814
7
+ PATCHES
8
+ fix_cmake.patch
9
+ )
10
+
11
+
12
+
13
+ vcpkg_configure_cmake(
14
+ SOURCE_PATH ${SOURCE_PATH}
15
+ PREFER_NINJA
16
+ OPTIONS
17
+ -DUSE_SIMD=ON
18
+ -DUSE_OPENCV_CONTRIB=ON
19
+ -DBUILD_EXAMPLES=OFF
20
+ -DBUILD_TESTS=OFF
21
+ )
22
+
23
+ vcpkg_install_cmake()
24
+
25
+ vcpkg_fixup_cmake_targets(CONFIG_PATH cmake/DBow3)
26
+
27
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
28
+
29
+ file(INSTALL
30
+ ${SOURCE_PATH}/LICENSE.txt
31
+ DESTINATION ${CURRENT_PACKAGES_DIR}/share/DBow3 RENAME copyright)
32
+ vcpkg_copy_pdbs()
third-party/DPVO/Pangolin/scripts/vcpkg/ports/dbow3/vcpkg.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "dbow3",
3
+ "version-string": "1.0.0",
4
+ "port-version": 1,
5
+ "description": "DBoW3 is an improved version of the DBow2 library, an open source C++ library for indexing and converting images into a bag-of-word representation.",
6
+ "dependencies": [
7
+ {
8
+ "name": "opencv3",
9
+ "features": [
10
+ "contrib"
11
+ ]
12
+ }
13
+ ]
14
+ }
third-party/DPVO/Pangolin/scripts/vcpkg/ports/dcmtk/dcmtk.patch ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/CMake/dcmtkPrepare.cmake b/CMake/dcmtkPrepare.cmake
2
+ index 23a9278..15e9391 100644
3
+ --- a/CMake/dcmtkPrepare.cmake
4
+ +++ b/CMake/dcmtkPrepare.cmake
5
+ @@ -210,9 +210,9 @@ include(GNUInstallDirs)
6
+ # CMake's files (DCMTKTarget.cmake, DCMTKConfigVersion.cmake and DCMTKConfig.cmake) are installed
7
+ # to different installation paths under Unix- and Windows-based systems
8
+ if(UNIX)
9
+ - set(DCMTK_INSTALL_CMKDIR "${CMAKE_INSTALL_LIBDIR}/cmake/dcmtk")
10
+ + set(DCMTK_INSTALL_CMKDIR "share/dcmtk")
11
+ elseif(WIN32)
12
+ - set(DCMTK_INSTALL_CMKDIR "cmake")
13
+ + set(DCMTK_INSTALL_CMKDIR "share/dcmtk")
14
+ endif()
15
+
16
+ #-----------------------------------------------------------------------------
third-party/DPVO/Pangolin/scripts/vcpkg/ports/dcmtk/portfile.cmake ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
2
+
3
+ vcpkg_from_github(
4
+ OUT_SOURCE_PATH SOURCE_PATH
5
+ REPO DCMTK/dcmtk
6
+ REF 6cb30bd7fb42190e0188afbd8cb961c62a6fb9c9 # DCMTK-3.6.6
7
+ SHA512 3fbd524bc0b9dced2cdddca850c88d8785ca5f333c5f1598ffbffb8e5c33d11eebdce9ed935245048ac45a7ccd7bd9e4ca79eaacf752cba64a5534b76e5efcdb
8
+ HEAD_REF master
9
+ PATCHES ${CMAKE_CURRENT_LIST_DIR}/dcmtk.patch
10
+ )
11
+
12
+ vcpkg_cmake_configure(
13
+ SOURCE_PATH "${SOURCE_PATH}"
14
+ OPTIONS
15
+ -DDCMTK_WITH_DOXYGEN=OFF
16
+ -DDCMTK_WITH_ZLIB=OFF
17
+ -DDCMTK_WITH_OPENSSL=OFF
18
+ -DDCMTK_WITH_PNG=OFF
19
+ -DDCMTK_WITH_TIFF=OFF
20
+ -DDCMTK_WITH_XML=OFF
21
+ -DDCMTK_WITH_ICONV=OFF
22
+ -DDCMTK_FORCE_FPIC_ON_UNIX=ON
23
+ -DDCMTK_OVERWRITE_WIN32_COMPILER_FLAGS=OFF
24
+ -DDCMTK_ENABLE_BUILTIN_DICTIONARY=ON
25
+ -DDCMTK_ENABLE_PRIVATE_TAGS=ON
26
+ -DBUILD_APPS=OFF
27
+ -DDCMTK_ENABLE_CXX11=ON
28
+ -DDCMTK_WIDE_CHAR_FILE_IO_FUNCTIONS=ON
29
+ -DDCMTK_WIDE_CHAR_MAIN_FUNCTION=ON
30
+ -DCMAKE_DEBUG_POSTFIX=d
31
+ OPTIONS_DEBUG
32
+ -DINSTALL_HEADERS=OFF
33
+ -DINSTALL_OTHER=OFF
34
+ )
35
+
36
+ vcpkg_cmake_install()
37
+ vcpkg_copy_pdbs()
38
+
39
+ vcpkg_cmake_config_fixup()
40
+
41
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
42
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
43
+
44
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/dcmtk/config/osconfig.h" "#define DCMTK_PREFIX \"${CURRENT_PACKAGES_DIR}\"" "")
45
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/dcmtk/config/osconfig.h" "#define DCM_DICT_DEFAULT_PATH \"${CURRENT_PACKAGES_DIR}/share/dcmtk/dicom.dic:${CURRENT_PACKAGES_DIR}/share/dcmtk/private.dic\"" "")
46
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/dcmtk/config/osconfig.h" "#define DEFAULT_CONFIGURATION_DIR \"${CURRENT_PACKAGES_DIR}/etc/dcmtk/\"" "")
47
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/dcmtk/config/osconfig.h" "#define DEFAULT_SUPPORT_DATA_DIR \"${CURRENT_PACKAGES_DIR}/share/dcmtk/\"" "")
48
+
49
+ # Handle copyright
50
+ file(INSTALL "${SOURCE_PATH}/COPYRIGHT" DESTINATION "${CURRENT_PACKAGES_DIR}/share/dcmtk" RENAME copyright)
third-party/DPVO/Pangolin/scripts/vcpkg/ports/dcmtk/usage ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ The package dcmtk provides CMake targets:
2
+
3
+ find_package(DCMTK CONFIG REQUIRED)
4
+ # Note: 23 target(s) were omitted.
5
+ target_link_libraries(main PRIVATE cmr i2d ijg8 dcmfg)
6
+
7
+ Add the following cmake code to your CMakeLists.txt to create definitions for DCMTK
8
+ if ("${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" STREQUAL "/")
9
+ message(WARNING "No vcpkg install dir found, DCMTK definitions are not set")
10
+ else()
11
+ target_compile_definitions(main
12
+ PUBLIC
13
+ "DCMTK_PREFIX=${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}"
14
+ "DCM_DICT_DEFAULT_PATH=${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/dcmtk/dicom.dic:${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/dcmtk/private.dic"
15
+ "DEFAULT_CONFIGURATION_DIR=${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/etc/dcmtk/"
16
+ "DEFAULT_SUPPORT_DATA_DIR=${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/dcmtk/"
17
+ )
18
+ endif()
third-party/DPVO/Pangolin/scripts/vcpkg/ports/dcmtk/vcpkg.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "dcmtk",
3
+ "version": "3.6.6",
4
+ "port-version": 3,
5
+ "description": "This DICOM ToolKit (DCMTK) package consists of source code, documentation and installation instructions for a set of software libraries and applications implementing part of the DICOM/MEDICOM Standard.",
6
+ "supports": "!arm",
7
+ "dependencies": [
8
+ {
9
+ "name": "vcpkg-cmake",
10
+ "host": true
11
+ },
12
+ {
13
+ "name": "vcpkg-cmake-config",
14
+ "host": true
15
+ }
16
+ ]
17
+ }
third-party/DPVO/Pangolin/scripts/vcpkg/ports/debug-assert/portfile.cmake ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ vcpkg_from_github(
2
+ OUT_SOURCE_PATH SOURCE_PATH
3
+ REPO foonathan/debug_assert
4
+ REF 0144b6532ec80349780ffac3cf85a92d87eb7b1b
5
+ SHA512 16cf38406d5f71585b763ff8af59b09c7b8b05372b07714cdc82f6f27292597c0b6d9025f823515744f8235b326b95e1d630af34db4a0e15d4ded79364290630
6
+ HEAD_REF v1.3.3
7
+ )
8
+
9
+ vcpkg_configure_cmake(
10
+ SOURCE_PATH ${SOURCE_PATH}
11
+ PREFER_NINJA
12
+ OPTIONS
13
+ -DDEBUG_ASSERT_INSTALL=ON
14
+ )
15
+
16
+ vcpkg_install_cmake()
17
+
18
+ vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/debug_assert TARGET_PATH share/debug_assert)
19
+
20
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug ${CURRENT_PACKAGES_DIR}/lib)
21
+
22
+ vcpkg_copy_pdbs()
23
+
24
+ file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
third-party/DPVO/Pangolin/scripts/vcpkg/ports/debug-assert/vcpkg.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "name": "debug-assert",
3
+ "version-string": "1.3.3",
4
+ "description": "Provides flexible DEBUG_ASSERT() macro.",
5
+ "homepage": "https://github.com/foonathan/debug_assert"
6
+ }
third-party/DPVO/Pangolin/scripts/vcpkg/ports/decimal-for-cpp/portfile.cmake ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ vcpkg_from_github(
2
+ OUT_SOURCE_PATH SOURCE_PATH
3
+ REPO vpiotr/decimal_for_cpp
4
+ REF 98265a57385ec14ae84fc0b2b0f15c770b30f548
5
+ SHA512 b8779ffb81567309ab07fa17eb6d3eb8bb94f77f5a388fd395433a304923ccf75e753a5822f36e5ad9d8959ee1a92b660639367d3a443f353e3e22d36a056f4d
6
+ HEAD_REF master
7
+ )
8
+
9
+ file(COPY ${SOURCE_PATH}/include/decimal.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/decimal-for-cpp)
10
+ file(COPY ${SOURCE_PATH}/doc/license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/decimal-for-cpp)
11
+ file(RENAME ${CURRENT_PACKAGES_DIR}/share/decimal-for-cpp/license.txt ${CURRENT_PACKAGES_DIR}/share/decimal-for-cpp/copyright)
third-party/DPVO/Pangolin/scripts/vcpkg/ports/decimal-for-cpp/vcpkg.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "name": "decimal-for-cpp",
3
+ "version-string": "1.18",
4
+ "description": "Decimal data type support, for COBOL-like fixed-point operations on currency values."
5
+ }
third-party/DPVO/Pangolin/scripts/vcpkg/ports/detours/find-jmp-bounds-arm64.patch ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/src/detours.cpp b/src/detours.cpp
2
+ index 8345c4d..3cd0e9d 100644
3
+ --- a/src/detours.cpp
4
+ +++ b/src/detours.cpp
5
+ @@ -974,6 +974,19 @@ inline PBYTE detour_skip_jmp(PBYTE pbCode, PVOID *ppGlobals)
6
+ return pbCode;
7
+ }
8
+
9
+ +inline void detour_find_jmp_bounds(PBYTE pbCode,
10
+ + PDETOUR_TRAMPOLINE *ppLower,
11
+ + PDETOUR_TRAMPOLINE *ppUpper)
12
+ +{
13
+ + // We have to place trampolines within +/- 2GB of code.
14
+ + ULONG_PTR lo = detour_2gb_below((ULONG_PTR)pbCode);
15
+ + ULONG_PTR hi = detour_2gb_above((ULONG_PTR)pbCode);
16
+ + DETOUR_TRACE(("[%p..%p..%p]\n", lo, pbCode, hi));
17
+ +
18
+ + *ppLower = (PDETOUR_TRAMPOLINE)lo;
19
+ + *ppUpper = (PDETOUR_TRAMPOLINE)hi;
20
+ +}
21
+ +
22
+ inline BOOL detour_does_code_end_function(PBYTE pbCode)
23
+ {
24
+ ULONG Opcode = fetch_opcode(pbCode);
third-party/DPVO/Pangolin/scripts/vcpkg/ports/detours/portfile.cmake ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
2
+
3
+ vcpkg_from_github(
4
+ OUT_SOURCE_PATH SOURCE_PATH
5
+ REPO microsoft/Detours
6
+ REF v4.0.1
7
+ SHA512 0a9c21b8222329add2de190d2e94d99195dfa55de5a914b75d380ffe0fb787b12e016d0723ca821001af0168fd1643ffd2455298bf3de5fdc155b3393a3ccc87
8
+ HEAD_REF master
9
+ PATCHES
10
+ find-jmp-bounds-arm64.patch
11
+ )
12
+
13
+ vcpkg_build_nmake(
14
+ SOURCE_PATH "${SOURCE_PATH}"
15
+ PROJECT_SUBPATH "src"
16
+ PROJECT_NAME "Makefile"
17
+ OPTIONS "PROCESSOR_ARCHITECTURE=${VCPKG_TARGET_ARCHITECTURE}"
18
+ OPTIONS_RELEASE "DETOURS_CONFIG=Release"
19
+ OPTIONS_DEBUG "DETOURS_CONFIG=Debug"
20
+ )
21
+
22
+ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
23
+ file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/lib.${VCPKG_TARGET_ARCHITECTURE}Release/" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
24
+ endif()
25
+ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
26
+ file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/lib.${VCPKG_TARGET_ARCHITECTURE}Debug/" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
27
+ endif()
28
+
29
+ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
30
+ file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/include/" DESTINATION "${CURRENT_PACKAGES_DIR}/include" RENAME detours)
31
+ else()
32
+ file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/include/" DESTINATION "${CURRENT_PACKAGES_DIR}/include" RENAME detours)
33
+ endif()
34
+
35
+ file(INSTALL "${SOURCE_PATH}/LICENSE.md" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
third-party/DPVO/Pangolin/scripts/vcpkg/ports/detours/vcpkg.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "detours",
3
+ "version": "4.0.1",
4
+ "port-version": 5,
5
+ "description": "Detours is a software package for monitoring and instrumenting API calls on Windows.",
6
+ "homepage": "https://github.com/microsoft/Detours",
7
+ "supports": "windows"
8
+ }
third-party/DPVO/Pangolin/scripts/vcpkg/ports/devicenameresolver/CMakeLists.txt ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ cmake_minimum_required(VERSION 3.8.0)
2
+ project(DeviceNameResolver CXX)
3
+
4
+ if(MSVC)
5
+ add_compile_options(/W3 /wd4005 /wd4996 /wd4018 /DUNICODE /D_UNICODE -D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS -D_CRT_SECURE_NO_WARNINGS -DNOMINMAX)
6
+ endif()
7
+
8
+ include_directories(.)
9
+
10
+ file(GLOB DeviceNameResolver_srcs "*.cpp")
11
+
12
+ add_library(DeviceNameResolver ${DeviceNameResolver_srcs})
13
+
14
+ install(
15
+ TARGETS DeviceNameResolver
16
+ RUNTIME DESTINATION bin
17
+ LIBRARY DESTINATION lib
18
+ ARCHIVE DESTINATION lib
19
+ )
20
+
21
+ if(NOT DISABLE_INSTALL_HEADERS)
22
+ install(FILES DeviceNameResolver.h DESTINATION include)
23
+ endif()
third-party/DPVO/Pangolin/scripts/vcpkg/ports/devicenameresolver/add-string-headfile.patch ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/NativeWinApi.h b/NativeWinApi.h
2
+ index 63fced1..582306b 100644
3
+ --- a/NativeWinApi.h
4
+ +++ b/NativeWinApi.h
5
+ @@ -1,6 +1,7 @@
6
+ #pragma once
7
+
8
+ #include <windows.h>
9
+ +#include <string>
10
+
11
+ #define STATUS_INFO_LENGTH_MISMATCH ((NTSTATUS)0xC0000004L)
12
+ #define STATUS_SUCCESS ((NTSTATUS)0x00000000L)
third-party/DPVO/Pangolin/scripts/vcpkg/ports/devicenameresolver/portfile.cmake ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
2
+
3
+ vcpkg_from_bitbucket(
4
+ OUT_SOURCE_PATH SOURCE_PATH
5
+ REPO mrexodia/devicenameresolver
6
+ REF 0850d88fa6a759d79b3c859933870d9aa602aa79
7
+ SHA512 9161411d3c8c17f49f5ff9482a007a6608872c948ef856aa7076a45c246e8d777e4cd6b54169d9c1b9e99e7b383436e1a084e168fafff1ca5f2b28260bac1452
8
+ HEAD_REF master
9
+ PATCHES add-string-headfile.patch
10
+ )
11
+
12
+ file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
13
+
14
+ vcpkg_cmake_configure(
15
+ SOURCE_PATH "${SOURCE_PATH}"
16
+ OPTIONS_DEBUG
17
+ -DDISABLE_INSTALL_HEADERS=ON
18
+ )
19
+
20
+ vcpkg_cmake_install()
21
+ vcpkg_copy_pdbs()
22
+
23
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/DeviceNameResolver.h" "__declspec(dllexport)" "")
24
+
25
+ file(INSTALL "${SOURCE_PATH}/readme.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/devicenameresolver" RENAME copyright)
third-party/DPVO/Pangolin/scripts/vcpkg/ports/devicenameresolver/vcpkg.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "devicenameresolver",
3
+ "version-string": "2016-06-26-0850d88fa6",
4
+ "port-version": 3,
5
+ "description": "a little library that resolves a path from a (virtual) device name.",
6
+ "supports": "windows & !uwp",
7
+ "dependencies": [
8
+ {
9
+ "name": "vcpkg-cmake",
10
+ "host": true
11
+ }
12
+ ]
13
+ }
third-party/DPVO/Pangolin/scripts/vcpkg/ports/devil/0001_fix-encoding.patch ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/DevIL/src-ILU/include/ilu_error/ilu_err-french.h b/DevIL/src-ILU/include/ilu_error/ilu_err-french.h
2
+ index d3b280d..445440e 100644
3
+ --- a/DevIL/src-ILU/include/ilu_error/ilu_err-french.h
4
+ +++ b/DevIL/src-ILU/include/ilu_error/ilu_err-french.h
5
+ @@ -17,19 +17,19 @@
6
+ #include "ilu_internal.h"
7
+
8
+ ILconst_string iluErrorStringsFrench[IL_FILE_READ_ERROR - IL_INVALID_ENUM + 1] = {
9
+ - IL_TEXT("�num�ration invalide"),
10
+ - IL_TEXT("d�passement de m�moire"),
11
+ - IL_TEXT("format non support�"),
12
+ + IL_TEXT("énumération invalide"),
13
+ + IL_TEXT("dépassement de mémoire"),
14
+ + IL_TEXT("format non supporté"),
15
+ IL_TEXT("erreur interne"),
16
+ - IL_TEXT("valeur ill�gale"),
17
+ - IL_TEXT("op�ration ill�gale"),
18
+ - IL_TEXT("valeur de fichier ill�gale"),
19
+ - IL_TEXT("en-t�te de fichier invalide"),
20
+ - IL_TEXT("param�tre invalide"),
21
+ + IL_TEXT("valeur illégale"),
22
+ + IL_TEXT("opération illégale"),
23
+ + IL_TEXT("valeur de fichier illégale"),
24
+ + IL_TEXT("en-tête de fichier invalide"),
25
+ + IL_TEXT("paramètre invalide"),
26
+ IL_TEXT("ne peut pas ouvrir le fichier"),
27
+ IL_TEXT("extension invalide"),
28
+ - IL_TEXT("fichier d�j� existant"),
29
+ - IL_TEXT("�quivalent hors-format"),
30
+ + IL_TEXT("fichier déjà existant"),
31
+ + IL_TEXT("équivalent hors-format"),
32
+ IL_TEXT("stack overflow"), //often used like this in French, so no need to translate
33
+ IL_TEXT("stack underflow"),
34
+ IL_TEXT("conversion invalide"),
35
+ @@ -38,7 +38,7 @@ ILconst_string iluErrorStringsFrench[IL_FILE_READ_ERROR - IL_INVALID_ENUM + 1] =
36
+ };
37
+
38
+ ILconst_string iluLibErrorStringsFrench[IL_LIB_EXR_ERROR - IL_LIB_GIF_ERROR + 1] = {
39
+ - IL_TEXT("gif : erreur dans la librairie"), //or: gif : erreur dans la biblioth�que (but less used)
40
+ + IL_TEXT("gif : erreur dans la librairie"), //or: gif : erreur dans la bibliothèque (but less used)
41
+ IL_TEXT("jpeg : erreur dans la librairie"),
42
+ IL_TEXT("png : erreur dans la librairie"),
43
+ IL_TEXT("tiff : erreur dans la librairie"),
44
+ diff --git a/DevIL/src-ILU/include/ilu_error/ilu_err-german.h b/DevIL/src-ILU/include/ilu_error/ilu_err-german.h
45
+ index bf3f05c..acdbe8a 100644
46
+ --- a/DevIL/src-ILU/include/ilu_error/ilu_err-german.h
47
+ +++ b/DevIL/src-ILU/include/ilu_error/ilu_err-german.h
48
+ @@ -6,7 +6,7 @@
49
+ //
50
+ // Filename: src-ILU/include/ilu_error/ilu_err_German.h
51
+ //
52
+ -// Description: Error functions in German, translated by Andreas St�ckel.
53
+ +// Description: Error functions in German, translated by Andreas Stöckel.
54
+ //
55
+ //-----------------------------------------------------------------------------
56
+
57
+ @@ -17,23 +17,23 @@
58
+ #include "ilu_internal.h"
59
+
60
+ ILconst_string iluErrorStringsGerman[IL_FILE_READ_ERROR - IL_INVALID_ENUM + 1] = {
61
+ - IL_TEXT("Ung�ltiger Enumerator"),
62
+ - IL_TEXT("Kein Speicher verf�gbar"),
63
+ - IL_TEXT("Das Format wird noch nicht unterst�tzt"),
64
+ + IL_TEXT("Ungültiger Enumerator"),
65
+ + IL_TEXT("Kein Speicher verfügbar"),
66
+ + IL_TEXT("Das Format wird noch nicht unterstützt"),
67
+ IL_TEXT("Interner Fehler"),
68
+ - IL_TEXT("Ung�ltiger Wert"),
69
+ - IL_TEXT("Unzul�ssige Operation"),
70
+ - IL_TEXT("Unzul�ssiger Datei-Wert"),
71
+ - IL_TEXT("Unzul�ssiger Datei-Header"),
72
+ - IL_TEXT("Unzul�ssiger Parameter"),
73
+ - IL_TEXT("Datei konnte nicht ge�ffnet werden"),
74
+ - IL_TEXT("Ung�ltiger Erweiterung"),
75
+ + IL_TEXT("Ungültiger Wert"),
76
+ + IL_TEXT("Unzulässige Operation"),
77
+ + IL_TEXT("Unzulässiger Datei-Wert"),
78
+ + IL_TEXT("Unzulässiger Datei-Header"),
79
+ + IL_TEXT("Unzulässiger Parameter"),
80
+ + IL_TEXT("Datei konnte nicht geöffnet werden"),
81
+ + IL_TEXT("Ungültiger Erweiterung"),
82
+ IL_TEXT("Die Datei existiert bereits"),
83
+ IL_TEXT("out format equivalent"),
84
+ - IL_TEXT("Stack �berlauf"),
85
+ + IL_TEXT("Stack Überlauf"),
86
+ IL_TEXT("Stack Unterlauf"),
87
+ - IL_TEXT("Ung�ltige Konvertierung"),
88
+ - IL_TEXT("Unzul�ssige Abmessungen"),
89
+ + IL_TEXT("Ungültige Konvertierung"),
90
+ + IL_TEXT("Unzulässige Abmessungen"),
91
+ IL_TEXT("Fehler beim Lesen der Datei")
92
+ };
93
+
94
+ diff --git a/DevIL/src-ILU/include/ilu_error/ilu_err-italian.h b/DevIL/src-ILU/include/ilu_error/ilu_err-italian.h
95
+ index 09d7bd1..d34b23f 100644
96
+ --- a/DevIL/src-ILU/include/ilu_error/ilu_err-italian.h
97
+ +++ b/DevIL/src-ILU/include/ilu_error/ilu_err-italian.h
98
+ @@ -22,13 +22,13 @@ ILconst_string iluErrorStringsItalian[IL_FILE_READ_ERROR - IL_INVALID_ENUM + 1]
99
+ IL_TEXT("configuri non sostenne"),
100
+ IL_TEXT("erreur interne"),
101
+ IL_TEXT("errore interno"),
102
+ - IL_TEXT("op�ration ill�gale"),
103
+ + IL_TEXT("opération illégale"),
104
+ IL_TEXT("operazione illegale"),
105
+ IL_TEXT("inebri archivio nullo"),
106
+ IL_TEXT("parametro nullo"),
107
+ - IL_TEXT("non pu� aprire l'archivio"),
108
+ + IL_TEXT("non può aprire l'archivio"),
109
+ IL_TEXT("dilazione nulla"),
110
+ - IL_TEXT("archivi gi� esistendo"),
111
+ + IL_TEXT("archivi già esistendo"),
112
+ IL_TEXT("equivalente fuori-configuri"),
113
+ IL_TEXT("inondi di batteria"),
114
+ IL_TEXT("insufficienza di batteria"),
115
+ diff --git a/DevIL/src-ILU/include/ilu_error/ilu_err-spanish.h b/DevIL/src-ILU/include/ilu_error/ilu_err-spanish.h
116
+ index 77b5a24..0945fdf 100644
117
+ --- a/DevIL/src-ILU/include/ilu_error/ilu_err-spanish.h
118
+ +++ b/DevIL/src-ILU/include/ilu_error/ilu_err-spanish.h
119
+ @@ -6,7 +6,7 @@
120
+ //
121
+ // Filename: src-ILU/include/ilu_error/ilu_err-spanish.h
122
+ //
123
+ -// Description: Error functions in Spanish, translated by Carlos Aragon�s
124
+ +// Description: Error functions in Spanish, translated by Carlos Aragonés
125
+ //
126
+ //-----------------------------------------------------------------------------
127
+
128
+ @@ -19,32 +19,32 @@
129
+ ILconst_string iluErrorStringsSpanish[IL_FILE_READ_ERROR - IL_INVALID_ENUM + 1] = {
130
+ IL_TEXT("enumerador incorrecto"),
131
+ IL_TEXT("no queda memoria disponible"),
132
+ - IL_TEXT("formato no soportado todav�a"),
133
+ + IL_TEXT("formato no soportado todavía"),
134
+ IL_TEXT("error interno"),
135
+ IL_TEXT("valor incorrecto"),
136
+ - IL_TEXT("operaci�n ilegaIL_TEXT("),
137
+ + IL_TEXT("operación ilegaIL_TEXT("),
138
+ IL_TEXT("valor de fichero ilegaIL_TEXT("),
139
+ IL_TEXT("cabecera incorrecta"),
140
+ - IL_TEXT("par�metro incorrecto"),
141
+ + IL_TEXT("parámetro incorrecto"),
142
+ IL_TEXT("no se puede abrir el fichero"),
143
+ - IL_TEXT("extensi�n desconocida"),
144
+ + IL_TEXT("extensión desconocida"),
145
+ IL_TEXT("el fichero ya existe"),
146
+ IL_TEXT("formato de salida equivalente"),
147
+ IL_TEXT("desbordamiento superior de pila"),
148
+ IL_TEXT("desbordamiento inferior de pila"),
149
+ - IL_TEXT("conversi�n incorrecta"),
150
+ - IL_TEXT("n�mero de dimensiones incorrecto"),
151
+ + IL_TEXT("conversión incorrecta"),
152
+ + IL_TEXT("número de dimensiones incorrecto"),
153
+ IL_TEXT("error de lectura en el fichero")
154
+ };
155
+
156
+ ILconst_string iluLibErrorStringsSpanish[IL_LIB_EXR_ERROR - IL_LIB_GIF_ERROR + 1] = {
157
+ - IL_TEXT("error en la librer�a gif"), // the correct translation will be 'error en la biblioteca gif', but nobody in spain uses the word 'biblioteca' for the translation the word 'library'. Almost all Spanish programmers translate 'library' incorrectly to 'librer�a'.
158
+ - IL_TEXT("error en la librer�a jpeg"),
159
+ - IL_TEXT("error en la librer�a png"),
160
+ - IL_TEXT("error en la librer�a tiff"),
161
+ - IL_TEXT("error en la librer�a mng"),
162
+ - IL_TEXT("error en la librer�a jp2"),
163
+ - IL_TEXT("error en la librer�a exr"),
164
+ + IL_TEXT("error en la librería gif"), // the correct translation will be 'error en la biblioteca gif', but nobody in spain uses the word 'biblioteca' for the translation the word 'library'. Almost all Spanish programmers translate 'library' incorrectly to 'librería'.
165
+ + IL_TEXT("error en la librería jpeg"),
166
+ + IL_TEXT("error en la librería png"),
167
+ + IL_TEXT("error en la librería tiff"),
168
+ + IL_TEXT("error en la librería mng"),
169
+ + IL_TEXT("error en la librería jp2"),
170
+ + IL_TEXT("error en la librería exr"),
171
+ };
172
+
173
+ ILconst_string iluMiscErrorStringsSpanish[2] = {
third-party/DPVO/Pangolin/scripts/vcpkg/ports/devil/0002_fix-missing-mfc-includes.patch ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/DevIL/src-IL/msvc/IL Unicode.rc b/DevIL/src-IL/msvc/IL Unicode.rc
2
+ index 346758f..298a207 100644
3
+ --- a/DevIL/src-IL/msvc/IL Unicode.rc
4
+ +++ b/DevIL/src-IL/msvc/IL Unicode.rc
5
+ @@ -7,7 +7,11 @@
6
+ //
7
+ // Generated from the TEXTINCLUDE 2 resource.
8
+ //
9
+ -#include "afxres.h"
10
+ +#define APSTUDIO_HIDDEN_SYMBOLS
11
+ +#include "windows.h"
12
+ +#undef APSTUDIO_HIDDEN_SYMBOLS
13
+ +#include "resource.h"
14
+ +
15
+ /////////////////////////////////////////////////////////////////////////////
16
+ #undef APSTUDIO_READONLY_SYMBOLS
17
+
18
+ diff --git a/DevIL/src-IL/msvc/IL.rc b/DevIL/src-IL/msvc/IL.rc
19
+ index 8bfadf9..0b8289f 100644
20
+ --- a/DevIL/src-IL/msvc/IL.rc
21
+ +++ b/DevIL/src-IL/msvc/IL.rc
22
+ @@ -7,10 +7,13 @@
23
+ //
24
+ // Generated from the TEXTINCLUDE 2 resource.
25
+ //
26
+ -#include "afxres.h"
27
+ +#define APSTUDIO_HIDDEN_SYMBOLS
28
+ +#include "windows.h"
29
+ +#undef APSTUDIO_HIDDEN_SYMBOLS
30
+ +#include "resource.h"
31
+
32
+ -/////////////////////////////////////////////////////////////////////////////
33
+ #undef APSTUDIO_READONLY_SYMBOLS
34
+ +/////////////////////////////////////////////////////////////////////////////
35
+
36
+ /////////////////////////////////////////////////////////////////////////////
37
+ // English (United States) resources
38
+ diff --git a/DevIL/src-IL/msvc8/IL Unicode.rc b/DevIL/src-IL/msvc8/IL Unicode.rc
39
+ index 026ee49..66ca4bf 100644
40
+ --- a/DevIL/src-IL/msvc8/IL Unicode.rc
41
+ +++ b/DevIL/src-IL/msvc8/IL Unicode.rc
42
+ @@ -7,7 +7,10 @@
43
+ //
44
+ // Generated from the TEXTINCLUDE 2 resource.
45
+ //
46
+ -#include "afxres.h"
47
+ +#define APSTUDIO_HIDDEN_SYMBOLS
48
+ +#include "windows.h"
49
+ +#undef APSTUDIO_HIDDEN_SYMBOLS
50
+ +#include "resource.h"
51
+
52
+ /////////////////////////////////////////////////////////////////////////////
53
+ #undef APSTUDIO_READONLY_SYMBOLS
54
+ diff --git a/DevIL/src-IL/msvc8/IL.rc b/DevIL/src-IL/msvc8/IL.rc
55
+ index 9301d41..3ad52c0 100644
56
+ --- a/DevIL/src-IL/msvc8/IL.rc
57
+ +++ b/DevIL/src-IL/msvc8/IL.rc
58
+ @@ -7,7 +7,10 @@
59
+ //
60
+ // Generated from the TEXTINCLUDE 2 resource.
61
+ //
62
+ -#include "afxres.h"
63
+ +#define APSTUDIO_HIDDEN_SYMBOLS
64
+ +#include "windows.h"
65
+ +#undef APSTUDIO_HIDDEN_SYMBOLS
66
+ +#include "resource.h"
67
+
68
+ /////////////////////////////////////////////////////////////////////////////
69
+ #undef APSTUDIO_READONLY_SYMBOLS
70
+ diff --git a/DevIL/src-IL/msvc9/IL Unicode.rc b/DevIL/src-IL/msvc9/IL Unicode.rc
71
+ index d0dff4f..c9cf51f 100644
72
+ --- a/DevIL/src-IL/msvc9/IL Unicode.rc
73
+ +++ b/DevIL/src-IL/msvc9/IL Unicode.rc
74
+ @@ -7,7 +7,10 @@
75
+ //
76
+ // Generated from the TEXTINCLUDE 2 resource.
77
+ //
78
+ -#include "afxres.h"
79
+ +#define APSTUDIO_HIDDEN_SYMBOLS
80
+ +#include "windows.h"
81
+ +#undef APSTUDIO_HIDDEN_SYMBOLS
82
+ +#include "resource.h"
83
+
84
+ /////////////////////////////////////////////////////////////////////////////
85
+ #undef APSTUDIO_READONLY_SYMBOLS
86
+ diff --git a/DevIL/src-IL/msvc9/IL.rc b/DevIL/src-IL/msvc9/IL.rc
87
+ index 9f5c795..6b8c891 100644
88
+ --- a/DevIL/src-IL/msvc9/IL.rc
89
+ +++ b/DevIL/src-IL/msvc9/IL.rc
90
+ @@ -7,7 +7,10 @@
91
+ //
92
+ // Generated from the TEXTINCLUDE 2 resource.
93
+ //
94
+ -#include "afxres.h"
95
+ +#define APSTUDIO_HIDDEN_SYMBOLS
96
+ +#include "windows.h"
97
+ +#undef APSTUDIO_HIDDEN_SYMBOLS
98
+ +#include "resource.h"
99
+
100
+ /////////////////////////////////////////////////////////////////////////////
101
+ #undef APSTUDIO_READONLY_SYMBOLS
102
+
third-party/DPVO/Pangolin/scripts/vcpkg/ports/devil/0003_fix-openexr.patch ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/DevIL/src-IL/CMakeLists.txt b/DevIL/src-IL/CMakeLists.txt
2
+ index 02e4f03..4accaa1 100644
3
+ --- a/DevIL/src-IL/CMakeLists.txt
4
+ +++ b/DevIL/src-IL/CMakeLists.txt
5
+ @@ -235,8 +235,12 @@ target_link_libraries(IL ${libs})
6
+
7
+ # generate config.h
8
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/config.h.cmake.in ${CMAKE_CURRENT_SOURCE_DIR}/include/config.h)
9
+ -
10
+ -
11
+ +add_definitions(-DHAVE_CONFIG_H)
12
+ +if(WIN32)
13
+ + if(BUILD_SHARED_LIBS)
14
+ + add_definitions(-DOPENEXR_DLL)
15
+ + endif()
16
+ +endif()
17
+
18
+ # generate pkg-config file
19
+ # TODO: add Requires.private or Libs.private
20
+ diff --git a/DevIL/src-IL/src/il_exr.cpp b/DevIL/src-IL/src/il_exr.cpp
21
+ index bbb3978..3916c6f 100644
22
+ --- a/DevIL/src-IL/src/il_exr.cpp
23
+ +++ b/DevIL/src-IL/src/il_exr.cpp
24
+ @@ -14,15 +14,10 @@
25
+ #include "il_internal.h"
26
+ #ifndef IL_NO_EXR
27
+
28
+ -#ifndef HAVE_CONFIG_H // We are probably on a Windows box .
29
+ -//#define OPENEXR_DLL
30
+ -#define HALF_EXPORTS
31
+ -#endif //HAVE_CONFIG_H
32
+ -
33
+ #include "il_exr.h"
34
+ -#include <ImfRgba.h>
35
+ -#include <ImfArray.h>
36
+ -#include <ImfRgbaFile.h>
37
+ +#include <OpenEXR/ImfRgba.h>
38
+ +#include <OpenEXR/ImfArray.h>
39
+ +#include <OpenEXR/ImfRgbaFile.h>
40
+ //#include <ImfTiledRgbaFile.h>
41
+ //#include <ImfInputFile.h>
42
+ //#include <ImfTiledInputFile.h>
43
+ diff --git a/DevIL/src-IL/include/il_exr.h b/DevIL/src-IL/include/il_exr.h
44
+ index 3d880c4..04d721a 100644
45
+ --- a/DevIL/src-IL/include/il_exr.h
46
+ +++ b/DevIL/src-IL/include/il_exr.h
47
+ @@ -15,7 +15,7 @@
48
+ #define EXR_H
49
+
50
+ #include "il_internal.h"
51
+ -#include <ImfIO.h>
52
+ +#include <OpenEXR/ImfIO.h>
53
+
54
+
55
+ //using namespace Imf; // Using this leads to errors with Microsoft's IStream.
third-party/DPVO/Pangolin/scripts/vcpkg/ports/devil/0004_compatible-jasper-2-0-20.patch ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/DevIL/src-IL/src/il_jp2.cpp b/DevIL/src-IL/src/il_jp2.cpp
2
+ index 730afee..a419c14 100644
3
+ --- a/DevIL/src-IL/src/il_jp2.cpp
4
+ +++ b/DevIL/src-IL/src/il_jp2.cpp
5
+ @@ -313,20 +313,31 @@ ILboolean iLoadJp2Internal(jas_stream_t *Stream, ILimage *Image)
6
+ }
7
+
8
+
9
+ -
10
+ -static int iJp2_file_read(jas_stream_obj_t *obj, char *buf, int cnt)
11
+ +#ifdef __APPLE__
12
+ +static int iJp2_file_read(void *obj, char *buf, unsigned int cnt)
13
+ +#else
14
+ +static int iJp2_file_read(jas_stream_obj_t *obj, char *buf, unsigned int cnt)
15
+ +#endif
16
+ {
17
+ obj;
18
+ - return iread(buf, 1, cnt);
19
+ + return iread((void*)buf, 1, cnt);
20
+ }
21
+
22
+ -static int iJp2_file_write(jas_stream_obj_t *obj, char *buf, int cnt)
23
+ +#ifdef __APPLE__
24
+ +static int iJp2_file_write(void *obj, const char *buf, unsigned int cnt)
25
+ +#else
26
+ +static int iJp2_file_write(jas_stream_obj_t *obj, const char *buf, unsigned int cnt)
27
+ +#endif
28
+ {
29
+ obj;
30
+ return iwrite(buf, 1, cnt);
31
+ }
32
+
33
+ +#ifdef __APPLE__
34
+ static long iJp2_file_seek(jas_stream_obj_t *obj, long offset, int origin)
35
+ +#else
36
+ +static long iJp2_file_seek(void *obj, long offset, int origin)
37
+ +#endif
38
+ {
39
+ obj;
40
+
41
+ @@ -343,7 +354,11 @@ static long iJp2_file_seek(jas_stream_obj_t *obj, long offset, int origin)
42
+ return 0; // Failed
43
+ }
44
+
45
+ +#ifdef __APPLE__
46
+ +static int iJp2_file_close(void *obj)
47
+ +#else
48
+ static int iJp2_file_close(jas_stream_obj_t *obj)
49
+ +#endif
50
+ {
51
+ obj;
52
+ return 0; // We choose when we want to close the file.
third-party/DPVO/Pangolin/scripts/vcpkg/ports/devil/0005-fix-pkgconfig.patch ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/DevIL/src-IL/CMakeLists.txt b/DevIL/src-IL/CMakeLists.txt
2
+ index 4accaa1..c3a1874 100644
3
+ --- a/DevIL/src-IL/CMakeLists.txt
4
+ +++ b/DevIL/src-IL/CMakeLists.txt
5
+ @@ -160,6 +160,27 @@ if(WIN32)
6
+ # Linux uses libIL.so, libILU.so, and libILUT.so, but Windows uses
7
+ # DevIL.dll, ILU.dll, and ILUT.dll.
8
+ set_target_properties(IL PROPERTIES OUTPUT_NAME "DevIL")
9
+ +
10
+ + configure_file(${CMAKE_CURRENT_LIST_DIR}/pkgconfig/IL.pc.cmake.in ${CMAKE_CURRENT_LIST_DIR}/pkgconfig/DevIL.pc.cmake.in COPYONLY)
11
+ +
12
+ + file(READ ${CMAKE_CURRENT_LIST_DIR}/pkgconfig/DevIL.pc.cmake.in PKGCONFIG_FILE)
13
+ + string(REPLACE "IL" "DevIL" PKGCONFIG_FILE "${PKGCONFIG_FILE}")
14
+ + file(WRITE ${CMAKE_CURRENT_LIST_DIR}/pkgconfig/DevIL.pc.cmake.in "${PKGCONFIG_FILE}")
15
+ +
16
+ + file(READ ${CMAKE_CURRENT_LIST_DIR}/../src-ILU/pkgconfig/ILU.pc.cmake.in PKGCONFIG_FILE)
17
+ + string(REPLACE "Requires: IL" "Requires: DevIL" PKGCONFIG_FILE "${PKGCONFIG_FILE}")
18
+ + string(REPLACE "Libs.private: -lIL" "Libs.private: -lDevIL" PKGCONFIG_FILE "${PKGCONFIG_FILE}")
19
+ + file(WRITE ${CMAKE_CURRENT_LIST_DIR}/../src-ILU/pkgconfig/ILU.pc.cmake.in "${PKGCONFIG_FILE}")
20
+ +
21
+ + file(READ ${CMAKE_CURRENT_LIST_DIR}/../src-ILUT/pkgconfig/ILUT.pc.cmake.in PKGCONFIG_FILE)
22
+ + string(REPLACE "Requires: IL" "Requires: DevIL" PKGCONFIG_FILE "${PKGCONFIG_FILE}")
23
+ + string(REPLACE "Libs.private: -lIL" "Libs.private: -lDevIL" PKGCONFIG_FILE "${PKGCONFIG_FILE}")
24
+ + file(WRITE ${CMAKE_CURRENT_LIST_DIR}/../src-ILUT/pkgconfig/ILUT.pc.cmake.in "${PKGCONFIG_FILE}")
25
+ + set(PKGCFG_IN_FILE pkgconfig/DevIL.pc.cmake.in)
26
+ + set(PKGCFG_FILE DevIL.pc)
27
+ +else(WIN32)
28
+ + set(PKGCFG_IN_FILE pkgconfig/IL.pc.cmake.in)
29
+ + set(PKGCFG_FILE IL.pc)
30
+ endif(WIN32)
31
+
32
+ if(UNICODE)
33
+ @@ -246,8 +267,8 @@ endif()
34
+ # TODO: add Requires.private or Libs.private
35
+ # (needed to support static linking?)
36
+ # TODO: sort out version number
37
+ -configure_file( pkgconfig/IL.pc.cmake.in
38
+ - ${CMAKE_CURRENT_BINARY_DIR}/IL.pc @ONLY)
39
+ +configure_file( ${PKGCFG_IN_FILE}
40
+ + ${CMAKE_CURRENT_BINARY_DIR}/${PKGCFG_FILE} @ONLY)
41
+
42
+
43
+ # Installation
44
+ @@ -259,7 +280,7 @@ install (TARGETS IL
45
+ install (FILES ../include/IL/il.h DESTINATION include/IL)
46
+
47
+ install(FILES
48
+ - ${CMAKE_CURRENT_BINARY_DIR}/IL.pc
49
+ + ${CMAKE_CURRENT_BINARY_DIR}/${PKGCFG_FILE}
50
+ DESTINATION lib/pkgconfig
51
+ )
52
+
third-party/DPVO/Pangolin/scripts/vcpkg/ports/devil/0006-fix-ilut-header.patch ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/DevIL/src-ILUT/CMakeLists.txt b/DevIL/src-ILUT/CMakeLists.txt
2
+ index 398d3c1..617c8d8 100644
3
+ --- a/DevIL/src-ILUT/CMakeLists.txt
4
+ +++ b/DevIL/src-ILUT/CMakeLists.txt
5
+ @@ -77,6 +77,7 @@ install (TARGETS ILUT
6
+ RUNTIME DESTINATION bin
7
+ )
8
+ install (FILES ../include/IL/ilut.h DESTINATION include/IL)
9
+ +install (FILES ../include/IL/ilut_config.h DESTINATION include/IL)
10
+
11
+ install(FILES
12
+ ${CMAKE_CURRENT_BINARY_DIR}/ILUT.pc
third-party/DPVO/Pangolin/scripts/vcpkg/ports/devil/enable-static.patch ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/DevIL/src-ILU/CMakeLists.txt b/DevIL/src-ILU/CMakeLists.txt
2
+ index 17a3afe..a46ab41 100644
3
+ --- a/DevIL/src-ILU/CMakeLists.txt
4
+ +++ b/DevIL/src-ILU/CMakeLists.txt
5
+ @@ -43,7 +43,7 @@ source_group("Header Files" FILES ${ILU_INC} )
6
+ source_group("Resource Files" FILES ${ILU_RSRC} )
7
+
8
+ # Remove SHARED to create a static library
9
+ -add_library(ILU SHARED ${ILU_SRCS} ${ILU_INC} ${ILU_RSRC})
10
+ +add_library(ILU ${ILU_SRCS} ${ILU_INC} ${ILU_RSRC})
11
+
12
+
13
+ ## ILU requires IL
14
+ diff --git a/DevIL/src-ILUT/CMakeLists.txt b/DevIL/src-ILUT/CMakeLists.txt
15
+ index 21470cb..398d3c1 100644
16
+ --- a/DevIL/src-ILUT/CMakeLists.txt
17
+ +++ b/DevIL/src-ILUT/CMakeLists.txt
18
+ @@ -43,7 +43,7 @@ source_group("Header Files" FILES ${ILUT_INC} )
19
+ source_group("Resource Files" FILES ${ILUT_RSRC} )
20
+
21
+ # Remove SHARED to create a static library
22
+ -add_library(ILUT SHARED ${ILUT_SRCS} ${ILUT_INC} ${ILUT_RSRC})
23
+ +add_library(ILUT ${ILUT_SRCS} ${ILUT_INC} ${ILUT_RSRC})
24
+
25
+ ## add link sub library info
26
+ target_link_libraries(ILUT
third-party/DPVO/Pangolin/scripts/vcpkg/ports/devil/portfile.cmake ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ vcpkg_from_github(
2
+ OUT_SOURCE_PATH SOURCE_PATH
3
+ REPO DentonW/DevIL
4
+ REF v1.8.0
5
+ SHA512 4aed5e50a730ece8b1eb6b2f6204374c6fb6f5334cf7c880d84c0f79645ea7c6b5118f57a7868a487510fc59c452f51472b272215d4c852f265f58b5857e17c7
6
+ HEAD_REF master
7
+ PATCHES
8
+ 0001_fix-encoding.patch
9
+ 0002_fix-missing-mfc-includes.patch
10
+ 0003_fix-openexr.patch
11
+ enable-static.patch
12
+ 0004_compatible-jasper-2-0-20.patch
13
+ 0005-fix-pkgconfig.patch
14
+ 0006-fix-ilut-header.patch
15
+ )
16
+
17
+ file(REMOVE ${SOURCE_PATH}/DevIL/src-IL/cmake/FindOpenEXR.cmake)
18
+
19
+ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
20
+ FEATURES
21
+ INVERTED_FEATURES
22
+ libpng IL_NO_PNG
23
+ tiff IL_NO_TIF
24
+ libjpeg IL_NO_JPG
25
+ openexr IL_NO_EXR
26
+ jasper IL_NO_JP2
27
+ lcms IL_NO_LCMS
28
+ )
29
+
30
+ vcpkg_configure_cmake(
31
+ SOURCE_PATH ${SOURCE_PATH}/DevIL
32
+ PREFER_NINJA
33
+ DISABLE_PARALLEL_CONFIGURE
34
+ OPTIONS
35
+ ${FEATURE_OPTIONS}
36
+ -DIL_NO_MNG=ON
37
+ -DIL_USE_DXTC_NVIDIA=OFF
38
+ -DIL_USE_DXTC_SQUISH=OFF
39
+ )
40
+
41
+ vcpkg_install_cmake()
42
+ vcpkg_copy_pdbs()
43
+
44
+ vcpkg_fixup_pkgconfig()
45
+
46
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
47
+
48
+ # Handle copyright
49
+ file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
third-party/DPVO/Pangolin/scripts/vcpkg/ports/devil/vcpkg.json ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "devil",
3
+ "version": "1.8.0",
4
+ "port-version": 8,
5
+ "description": "A full featured cross-platform image library",
6
+ "homepage": "https://github.com/DentonW/DevIL",
7
+ "default-features": [
8
+ "jasper",
9
+ "lcms",
10
+ "libjpeg",
11
+ "libpng",
12
+ "openexr",
13
+ "tiff"
14
+ ],
15
+ "features": {
16
+ "jasper": {
17
+ "description": "Use JasPer for .jp2 (and some .icns) support",
18
+ "dependencies": [
19
+ "jasper"
20
+ ]
21
+ },
22
+ "lcms": {
23
+ "description": "Use Little CMS for color profiles",
24
+ "dependencies": [
25
+ "lcms"
26
+ ]
27
+ },
28
+ "libjpeg": {
29
+ "description": "Use Libjpeg for .jpg (and some .blp) support",
30
+ "dependencies": [
31
+ "libjpeg-turbo"
32
+ ]
33
+ },
34
+ "libpng": {
35
+ "description": "Use Libpng for .png (and some .ico)",
36
+ "dependencies": [
37
+ "libpng"
38
+ ]
39
+ },
40
+ "openexr": {
41
+ "description": " Use openexr",
42
+ "dependencies": [
43
+ "openexr"
44
+ ]
45
+ },
46
+ "tiff": {
47
+ "description": "Use Libtiff for .tif support",
48
+ "dependencies": [
49
+ "tiff"
50
+ ]
51
+ }
52
+ }
53
+ }
third-party/DPVO/Pangolin/scripts/vcpkg/ports/dimcli/fix-build.patch ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/CMakeLists.txt b/CMakeLists.txt
2
+ index 509e634..8b5a30b 100644
3
+ --- a/CMakeLists.txt
4
+ +++ b/CMakeLists.txt
5
+ @@ -392,7 +392,7 @@ if(MSVC)
6
+ set(CMAKE_CXX_FLAGS "\
7
+ /EHsc /GF /nologo /std:c++latest /utf-8 /W4 /WX \
8
+ /Zc:inline /Zc:rvalueCast /Zc:strictStrings \
9
+ - /Fa$(IntDir)")
10
+ + /Fa${CMAKE_SOURCE_DIR}/libs/dimcli")
11
+ if(NOT MSVC_VERSION LESS 1910)
12
+ # /permissive- // reject non-conforming backward compatibility-isms
13
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /permissive-")
14
+ @@ -431,8 +431,8 @@ elseif(CMAKE_COMPILER_IS_GNUCXX)
15
+ if(BUILD_COVERAGE)
16
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
17
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
18
+ endif()
19
+ -elseif(CMAKE_CXX_COMPILER_ID STREQUAL Clang)
20
+ +elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
21
+ if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5")
22
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1z")
23
+ else()
24
+ @@ -533,7 +533,6 @@ endforeach()
25
+ # test targets
26
+ if(BUILD_TESTING)
27
+ enable_testing()
28
+ -endif()
29
+ file(GLOB allnames tests/*)
30
+ foreach(var ${allnames})
31
+ if(IS_DIRECTORY "${var}")
32
+ @@ -548,6 +547,7 @@ foreach(var ${allnames})
33
+ endif()
34
+ endif()
35
+ endforeach()
36
+ +endif()
37
+
38
+ # update deps file
39
+ update_deps_file(${deps})
third-party/DPVO/Pangolin/scripts/vcpkg/ports/dimcli/portfile.cmake ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ vcpkg_from_github(
2
+ OUT_SOURCE_PATH SOURCE_PATH
3
+ REPO gknowles/dimcli
4
+ REF a4dbb4b1c8a3825fc304bbbad3438dbe1840feae # v5.0.2
5
+ SHA512 25cc9002fd46856854545934f385d8578f207b1ce01802a172e49e008cdf1db0db11db7cefeef18258b99c13570af9193e83f5826613d8b0a118d7bae3f0d03f
6
+ HEAD_REF master
7
+ PATCHES fix-build.patch
8
+ )
9
+
10
+ string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" staticCrt)
11
+
12
+ vcpkg_cmake_configure(
13
+ SOURCE_PATH "${SOURCE_PATH}"
14
+ DISABLE_PARALLEL_CONFIGURE
15
+ OPTIONS
16
+ -DLINK_STATIC_RUNTIME:BOOL=${staticCrt}
17
+ -DINSTALL_LIBS:BOOL=ON
18
+ -DBUILD_PROJECT_NAME=dimcli
19
+ -DBUILD_TESTING=OFF
20
+ -DINSTALL_TOOLS=OFF
21
+ -DINSTALL_TESTS=OFF
22
+ )
23
+
24
+ vcpkg_cmake_install()
25
+ vcpkg_copy_pdbs()
26
+
27
+ # Remove includes from ${CMAKE_INSTALL_PREFIX}/debug
28
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
29
+
30
+ # Handle copyright
31
+ file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/dimcli" RENAME copyright)
third-party/DPVO/Pangolin/scripts/vcpkg/ports/dimcli/vcpkg.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "dimcli",
3
+ "version-semver": "5.0.2",
4
+ "port-version": 3,
5
+ "description": "C++ command line parser toolkit",
6
+ "homepage": "https://github.com/gknowles/dimcli",
7
+ "supports": "!uwp",
8
+ "dependencies": [
9
+ {
10
+ "name": "vcpkg-cmake",
11
+ "host": true
12
+ }
13
+ ]
14
+ }
third-party/DPVO/Pangolin/scripts/vcpkg/ports/directx-headers/portfile.cmake ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ vcpkg_from_github(
2
+ OUT_SOURCE_PATH SOURCE_PATH
3
+ REPO Microsoft/DirectX-Headers
4
+ REF v1.4.9
5
+ SHA512 439d28a8344ef3a012428f53fcb9d2d9823d51c61786363d87f8ba15921326c220478b2557aab3f641a2406f1e5f299a8e21a82547febff3b9cd7b26b09b1c22
6
+ HEAD_REF master
7
+ )
8
+
9
+ vcpkg_configure_cmake(
10
+ SOURCE_PATH ${SOURCE_PATH}
11
+ PREFER_NINJA
12
+ OPTIONS -DDXHEADERS_BUILD_TEST=OFF
13
+ )
14
+
15
+ vcpkg_install_cmake()
16
+ vcpkg_fixup_cmake_targets(CONFIG_PATH share/directx-headers/cmake)
17
+
18
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
19
+
20
+ file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
third-party/DPVO/Pangolin/scripts/vcpkg/ports/directx-headers/vcpkg.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "directx-headers",
3
+ "version": "1.4.9",
4
+ "port-version": 1,
5
+ "description": "Official DirectX 12 Headers",
6
+ "homepage": "https://devblogs.microsoft.com/directx/",
7
+ "supports": "windows | linux"
8
+ }
third-party/DPVO/Pangolin/scripts/vcpkg/ports/directxmath/portfile.cmake ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ vcpkg_from_github(
2
+ OUT_SOURCE_PATH SOURCE_PATH
3
+ REPO Microsoft/DirectXMath
4
+ REF jan2022
5
+ SHA512 8defaa693c8b8aed05791c83b99fa73aac2fc18475b0d51337a81f7d9807b53e426fdf530ed6f1d2d0ebd259e87cc42ac881bdb168387d883998f58a5c0a4886
6
+ HEAD_REF main
7
+ )
8
+
9
+ vcpkg_cmake_configure(
10
+ SOURCE_PATH "${SOURCE_PATH}"
11
+ )
12
+
13
+ vcpkg_cmake_install()
14
+ vcpkg_cmake_config_fixup(CONFIG_PATH cmake)
15
+
16
+ if(NOT VCPKG_TARGET_IS_WINDOWS)
17
+ vcpkg_download_distfile(
18
+ SAL_HEADER
19
+ URLS "https://raw.githubusercontent.com/dotnet/corert/master/src/Native/inc/unix/sal.h"
20
+ FILENAME "sal.h"
21
+ SHA512 1643571673195d9eb892d2f2ac76eac7113ef7aa0ca116d79f3e4d3dc9df8a31600a9668b7e7678dfbe5a76906f9e0734ef8d6db0903ccc68fc742dd8238d8b0
22
+ )
23
+
24
+ file(INSTALL
25
+ ${DOWNLOADS}/sal.h
26
+ DESTINATION ${CURRENT_PACKAGES_DIR}/include/DirectXMath)
27
+ endif()
28
+
29
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug")
30
+
31
+ file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)