diff --git a/codes/Azure-Kinect-Samples/build/CMakeCache.txt b/codes/Azure-Kinect-Samples/build/CMakeCache.txt
new file mode 100644
index 0000000..959694b
--- /dev/null
+++ b/codes/Azure-Kinect-Samples/build/CMakeCache.txt
@@ -0,0 +1,384 @@
+# This is the CMakeCache file.
+# For build in directory: /mnt/g/working-projects/kinect/codes/Azure-Kinect-Samples/build
+# It was generated by CMake: /usr/bin/cmake
+# You can edit this file to change values found and used by cmake.
+# If you do not want to change any of the values, simply exit the editor.
+# If you do want to change a value, simply edit, save, and exit the editor.
+# The syntax for the file is as follows:
+# KEY:TYPE=VALUE
+# KEY is the name of a variable in the cache.
+# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!.
+# VALUE is the current value for the KEY.
+
+########################
+# EXTERNAL cache entries
+########################
+
+//Value Computed by CMake
+Azure-Kinect-Samples_BINARY_DIR:STATIC=/mnt/g/working-projects/kinect/codes/Azure-Kinect-Samples/build
+
+//Value Computed by CMake
+Azure-Kinect-Samples_SOURCE_DIR:STATIC=/mnt/g/working-projects/kinect/codes/Azure-Kinect-Samples
+
+//Path to a program.
+CMAKE_ADDR2LINE:FILEPATH=/usr/bin/addr2line
+
+//Path to a program.
+CMAKE_AR:FILEPATH=/usr/bin/ar
+
+//Choose the type of build, options are: None Debug Release RelWithDebInfo
+// MinSizeRel ...
+CMAKE_BUILD_TYPE:STRING=
+
+//Enable/Disable color output during build.
+CMAKE_COLOR_MAKEFILE:BOOL=ON
+
+//CXX compiler
+CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++
+
+//A wrapper around 'ar' adding the appropriate '--plugin' option
+// for the GCC compiler
+CMAKE_CXX_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar-9
+
+//A wrapper around 'ranlib' adding the appropriate '--plugin' option
+// for the GCC compiler
+CMAKE_CXX_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib-9
+
+//Flags used by the CXX compiler during all build types.
+CMAKE_CXX_FLAGS:STRING=
+
+//Flags used by the CXX compiler during DEBUG builds.
+CMAKE_CXX_FLAGS_DEBUG:STRING=-g
+
+//Flags used by the CXX compiler during MINSIZEREL builds.
+CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
+
+//Flags used by the CXX compiler during RELEASE builds.
+CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
+
+//Flags used by the CXX compiler during RELWITHDEBINFO builds.
+CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
+
+//C compiler
+CMAKE_C_COMPILER:FILEPATH=/usr/bin/cc
+
+//A wrapper around 'ar' adding the appropriate '--plugin' option
+// for the GCC compiler
+CMAKE_C_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar-9
+
+//A wrapper around 'ranlib' adding the appropriate '--plugin' option
+// for the GCC compiler
+CMAKE_C_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib-9
+
+//Flags used by the C compiler during all build types.
+CMAKE_C_FLAGS:STRING=
+
+//Flags used by the C compiler during DEBUG builds.
+CMAKE_C_FLAGS_DEBUG:STRING=-g
+
+//Flags used by the C compiler during MINSIZEREL builds.
+CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
+
+//Flags used by the C compiler during RELEASE builds.
+CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
+
+//Flags used by the C compiler during RELWITHDEBINFO builds.
+CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
+
+//Path to a program.
+CMAKE_DLLTOOL:FILEPATH=CMAKE_DLLTOOL-NOTFOUND
+
+//Flags used by the linker during all build types.
+CMAKE_EXE_LINKER_FLAGS:STRING=
+
+//Flags used by the linker during DEBUG builds.
+CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=
+
+//Flags used by the linker during MINSIZEREL builds.
+CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=
+
+//Flags used by the linker during RELEASE builds.
+CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=
+
+//Flags used by the linker during RELWITHDEBINFO builds.
+CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
+
+//Enable/Disable output of compile commands during generation.
+CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF
+
+//Install path prefix, prepended onto install directories.
+CMAKE_INSTALL_PREFIX:PATH=/usr/local
+
+//Path to a program.
+CMAKE_LINKER:FILEPATH=/usr/bin/ld
+
+//Path to a program.
+CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make
+
+//Flags used by the linker during the creation of modules during
+// all build types.
+CMAKE_MODULE_LINKER_FLAGS:STRING=
+
+//Flags used by the linker during the creation of modules during
+// DEBUG builds.
+CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=
+
+//Flags used by the linker during the creation of modules during
+// MINSIZEREL builds.
+CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=
+
+//Flags used by the linker during the creation of modules during
+// RELEASE builds.
+CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=
+
+//Flags used by the linker during the creation of modules during
+// RELWITHDEBINFO builds.
+CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
+
+//Path to a program.
+CMAKE_NM:FILEPATH=/usr/bin/nm
+
+//Path to a program.
+CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy
+
+//Path to a program.
+CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump
+
+//Value Computed by CMake
+CMAKE_PROJECT_DESCRIPTION:STATIC=
+
+//Value Computed by CMake
+CMAKE_PROJECT_HOMEPAGE_URL:STATIC=
+
+//Value Computed by CMake
+CMAKE_PROJECT_NAME:STATIC=Azure-Kinect-Samples
+
+//Value Computed by CMake
+CMAKE_PROJECT_VERSION:STATIC=1.4
+
+//Value Computed by CMake
+CMAKE_PROJECT_VERSION_MAJOR:STATIC=1
+
+//Value Computed by CMake
+CMAKE_PROJECT_VERSION_MINOR:STATIC=4
+
+//Value Computed by CMake
+CMAKE_PROJECT_VERSION_PATCH:STATIC=
+
+//Value Computed by CMake
+CMAKE_PROJECT_VERSION_TWEAK:STATIC=
+
+//Path to a program.
+CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib
+
+//Path to a program.
+CMAKE_READELF:FILEPATH=/usr/bin/readelf
+
+//Flags used by the linker during the creation of shared libraries
+// during all build types.
+CMAKE_SHARED_LINKER_FLAGS:STRING=
+
+//Flags used by the linker during the creation of shared libraries
+// during DEBUG builds.
+CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=
+
+//Flags used by the linker during the creation of shared libraries
+// during MINSIZEREL builds.
+CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=
+
+//Flags used by the linker during the creation of shared libraries
+// during RELEASE builds.
+CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=
+
+//Flags used by the linker during the creation of shared libraries
+// during RELWITHDEBINFO builds.
+CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=
+
+//If set, runtime paths are not added when installing shared libraries,
+// but are added when building.
+CMAKE_SKIP_INSTALL_RPATH:BOOL=NO
+
+//If set, runtime paths are not added when using shared libraries.
+CMAKE_SKIP_RPATH:BOOL=NO
+
+//Flags used by the linker during the creation of static libraries
+// during all build types.
+CMAKE_STATIC_LINKER_FLAGS:STRING=
+
+//Flags used by the linker during the creation of static libraries
+// during DEBUG builds.
+CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING=
+
+//Flags used by the linker during the creation of static libraries
+// during MINSIZEREL builds.
+CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING=
+
+//Flags used by the linker during the creation of static libraries
+// during RELEASE builds.
+CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING=
+
+//Flags used by the linker during the creation of static libraries
+// during RELWITHDEBINFO builds.
+CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING=
+
+//Path to a program.
+CMAKE_STRIP:FILEPATH=/usr/bin/strip
+
+//If this value is on, makefiles will be generated without the
+// .SILENT directive, and all commands will be echoed to the console
+// during the make. This is useful for debugging only. With Visual
+// Studio IDE projects all commands are done without /nologo.
+CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE
+
+//The directory containing a CMake configuration file for k4a.
+k4a_DIR:PATH=k4a_DIR-NOTFOUND
+
+
+########################
+# INTERNAL cache entries
+########################
+
+//ADVANCED property for variable: CMAKE_ADDR2LINE
+CMAKE_ADDR2LINE-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_AR
+CMAKE_AR-ADVANCED:INTERNAL=1
+//This is the directory where this CMakeCache.txt was created
+CMAKE_CACHEFILE_DIR:INTERNAL=/mnt/g/working-projects/kinect/codes/Azure-Kinect-Samples/build
+//Major version of cmake used to create the current loaded cache
+CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3
+//Minor version of cmake used to create the current loaded cache
+CMAKE_CACHE_MINOR_VERSION:INTERNAL=16
+//Patch version of cmake used to create the current loaded cache
+CMAKE_CACHE_PATCH_VERSION:INTERNAL=3
+//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE
+CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1
+//Path to CMake executable.
+CMAKE_COMMAND:INTERNAL=/usr/bin/cmake
+//Path to cpack program executable.
+CMAKE_CPACK_COMMAND:INTERNAL=/usr/bin/cpack
+//Path to ctest program executable.
+CMAKE_CTEST_COMMAND:INTERNAL=/usr/bin/ctest
+//ADVANCED property for variable: CMAKE_CXX_COMPILER
+CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_CXX_COMPILER_AR
+CMAKE_CXX_COMPILER_AR-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_CXX_COMPILER_RANLIB
+CMAKE_CXX_COMPILER_RANLIB-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_CXX_FLAGS
+CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG
+CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL
+CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE
+CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO
+CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_C_COMPILER
+CMAKE_C_COMPILER-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_C_COMPILER_AR
+CMAKE_C_COMPILER_AR-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_C_COMPILER_RANLIB
+CMAKE_C_COMPILER_RANLIB-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_C_FLAGS
+CMAKE_C_FLAGS-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG
+CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL
+CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE
+CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO
+CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_DLLTOOL
+CMAKE_DLLTOOL-ADVANCED:INTERNAL=1
+//Executable file format
+CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF
+//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS
+CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG
+CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL
+CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE
+CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
+CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS
+CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1
+//Name of external makefile project generator.
+CMAKE_EXTRA_GENERATOR:INTERNAL=
+//Name of generator.
+CMAKE_GENERATOR:INTERNAL=Unix Makefiles
+//Generator instance identifier.
+CMAKE_GENERATOR_INSTANCE:INTERNAL=
+//Name of generator platform.
+CMAKE_GENERATOR_PLATFORM:INTERNAL=
+//Name of generator toolset.
+CMAKE_GENERATOR_TOOLSET:INTERNAL=
+//Source directory with the top level CMakeLists.txt file for this
+// project
+CMAKE_HOME_DIRECTORY:INTERNAL=/mnt/g/working-projects/kinect/codes/Azure-Kinect-Samples
+//Install .so files without execute permission.
+CMAKE_INSTALL_SO_NO_EXE:INTERNAL=1
+//ADVANCED property for variable: CMAKE_LINKER
+CMAKE_LINKER-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_MAKE_PROGRAM
+CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS
+CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG
+CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL
+CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE
+CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
+CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_NM
+CMAKE_NM-ADVANCED:INTERNAL=1
+//number of local generators
+CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1
+//ADVANCED property for variable: CMAKE_OBJCOPY
+CMAKE_OBJCOPY-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_OBJDUMP
+CMAKE_OBJDUMP-ADVANCED:INTERNAL=1
+//Platform information initialized
+CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_RANLIB
+CMAKE_RANLIB-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_READELF
+CMAKE_READELF-ADVANCED:INTERNAL=1
+//Path to CMake installation.
+CMAKE_ROOT:INTERNAL=/usr/share/cmake-3.16
+//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS
+CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG
+CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL
+CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE
+CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
+CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH
+CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_SKIP_RPATH
+CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS
+CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG
+CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL
+CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE
+CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO
+CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
+//ADVANCED property for variable: CMAKE_STRIP
+CMAKE_STRIP-ADVANCED:INTERNAL=1
+//uname command
+CMAKE_UNAME:INTERNAL=/usr/bin/uname
+//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE
+CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1
+
diff --git a/codes/Azure-Kinect-Samples/build/CMakeFiles/3.16.3/CMakeCCompiler.cmake b/codes/Azure-Kinect-Samples/build/CMakeFiles/3.16.3/CMakeCCompiler.cmake
new file mode 100644
index 0000000..c5ece7b
--- /dev/null
+++ b/codes/Azure-Kinect-Samples/build/CMakeFiles/3.16.3/CMakeCCompiler.cmake
@@ -0,0 +1,76 @@
+set(CMAKE_C_COMPILER "/usr/bin/cc")
+set(CMAKE_C_COMPILER_ARG1 "")
+set(CMAKE_C_COMPILER_ID "GNU")
+set(CMAKE_C_COMPILER_VERSION "9.4.0")
+set(CMAKE_C_COMPILER_VERSION_INTERNAL "")
+set(CMAKE_C_COMPILER_WRAPPER "")
+set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11")
+set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert")
+set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes")
+set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros")
+set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert")
+
+set(CMAKE_C_PLATFORM_ID "Linux")
+set(CMAKE_C_SIMULATE_ID "")
+set(CMAKE_C_COMPILER_FRONTEND_VARIANT "")
+set(CMAKE_C_SIMULATE_VERSION "")
+
+
+
+set(CMAKE_AR "/usr/bin/ar")
+set(CMAKE_C_COMPILER_AR "/usr/bin/gcc-ar-9")
+set(CMAKE_RANLIB "/usr/bin/ranlib")
+set(CMAKE_C_COMPILER_RANLIB "/usr/bin/gcc-ranlib-9")
+set(CMAKE_LINKER "/usr/bin/ld")
+set(CMAKE_MT "")
+set(CMAKE_COMPILER_IS_GNUCC 1)
+set(CMAKE_C_COMPILER_LOADED 1)
+set(CMAKE_C_COMPILER_WORKS TRUE)
+set(CMAKE_C_ABI_COMPILED TRUE)
+set(CMAKE_COMPILER_IS_MINGW )
+set(CMAKE_COMPILER_IS_CYGWIN )
+if(CMAKE_COMPILER_IS_CYGWIN)
+ set(CYGWIN 1)
+ set(UNIX 1)
+endif()
+
+set(CMAKE_C_COMPILER_ENV_VAR "CC")
+
+if(CMAKE_COMPILER_IS_MINGW)
+ set(MINGW 1)
+endif()
+set(CMAKE_C_COMPILER_ID_RUN 1)
+set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m)
+set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
+set(CMAKE_C_LINKER_PREFERENCE 10)
+
+# Save compiler ABI information.
+set(CMAKE_C_SIZEOF_DATA_PTR "8")
+set(CMAKE_C_COMPILER_ABI "ELF")
+set(CMAKE_C_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
+
+if(CMAKE_C_SIZEOF_DATA_PTR)
+ set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}")
+endif()
+
+if(CMAKE_C_COMPILER_ABI)
+ set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}")
+endif()
+
+if(CMAKE_C_LIBRARY_ARCHITECTURE)
+ set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
+endif()
+
+set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "")
+if(CMAKE_C_CL_SHOWINCLUDES_PREFIX)
+ set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}")
+endif()
+
+
+
+
+
+set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/9/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include")
+set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "gcc;gcc_s;c;gcc;gcc_s")
+set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/9;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib")
+set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "")
diff --git a/codes/Azure-Kinect-Samples/build/CMakeFiles/3.16.3/CMakeCXXCompiler.cmake b/codes/Azure-Kinect-Samples/build/CMakeFiles/3.16.3/CMakeCXXCompiler.cmake
new file mode 100644
index 0000000..278ef39
--- /dev/null
+++ b/codes/Azure-Kinect-Samples/build/CMakeFiles/3.16.3/CMakeCXXCompiler.cmake
@@ -0,0 +1,88 @@
+set(CMAKE_CXX_COMPILER "/usr/bin/c++")
+set(CMAKE_CXX_COMPILER_ARG1 "")
+set(CMAKE_CXX_COMPILER_ID "GNU")
+set(CMAKE_CXX_COMPILER_VERSION "9.4.0")
+set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "")
+set(CMAKE_CXX_COMPILER_WRAPPER "")
+set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "14")
+set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20")
+set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters")
+set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates")
+set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates")
+set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17")
+set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20")
+
+set(CMAKE_CXX_PLATFORM_ID "Linux")
+set(CMAKE_CXX_SIMULATE_ID "")
+set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "")
+set(CMAKE_CXX_SIMULATE_VERSION "")
+
+
+
+set(CMAKE_AR "/usr/bin/ar")
+set(CMAKE_CXX_COMPILER_AR "/usr/bin/gcc-ar-9")
+set(CMAKE_RANLIB "/usr/bin/ranlib")
+set(CMAKE_CXX_COMPILER_RANLIB "/usr/bin/gcc-ranlib-9")
+set(CMAKE_LINKER "/usr/bin/ld")
+set(CMAKE_MT "")
+set(CMAKE_COMPILER_IS_GNUCXX 1)
+set(CMAKE_CXX_COMPILER_LOADED 1)
+set(CMAKE_CXX_COMPILER_WORKS TRUE)
+set(CMAKE_CXX_ABI_COMPILED TRUE)
+set(CMAKE_COMPILER_IS_MINGW )
+set(CMAKE_COMPILER_IS_CYGWIN )
+if(CMAKE_COMPILER_IS_CYGWIN)
+ set(CYGWIN 1)
+ set(UNIX 1)
+endif()
+
+set(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
+
+if(CMAKE_COMPILER_IS_MINGW)
+ set(MINGW 1)
+endif()
+set(CMAKE_CXX_COMPILER_ID_RUN 1)
+set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP)
+set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC)
+
+foreach (lang C OBJC OBJCXX)
+ if (CMAKE_${lang}_COMPILER_ID_RUN)
+ foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS)
+ list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension})
+ endforeach()
+ endif()
+endforeach()
+
+set(CMAKE_CXX_LINKER_PREFERENCE 30)
+set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1)
+
+# Save compiler ABI information.
+set(CMAKE_CXX_SIZEOF_DATA_PTR "8")
+set(CMAKE_CXX_COMPILER_ABI "ELF")
+set(CMAKE_CXX_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
+
+if(CMAKE_CXX_SIZEOF_DATA_PTR)
+ set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}")
+endif()
+
+if(CMAKE_CXX_COMPILER_ABI)
+ set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}")
+endif()
+
+if(CMAKE_CXX_LIBRARY_ARCHITECTURE)
+ set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
+endif()
+
+set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "")
+if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX)
+ set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}")
+endif()
+
+
+
+
+
+set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/usr/include/c++/9;/usr/include/x86_64-linux-gnu/c++/9;/usr/include/c++/9/backward;/usr/lib/gcc/x86_64-linux-gnu/9/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include")
+set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;m;gcc_s;gcc;c;gcc_s;gcc")
+set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/9;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib")
+set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "")
diff --git a/codes/Azure-Kinect-Samples/build/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_C.bin b/codes/Azure-Kinect-Samples/build/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_C.bin
new file mode 100644
index 0000000..b7a0b09
Binary files /dev/null and b/codes/Azure-Kinect-Samples/build/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_C.bin differ
diff --git a/codes/Azure-Kinect-Samples/build/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_CXX.bin b/codes/Azure-Kinect-Samples/build/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_CXX.bin
new file mode 100644
index 0000000..a9f2f4f
Binary files /dev/null and b/codes/Azure-Kinect-Samples/build/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_CXX.bin differ
diff --git a/codes/Azure-Kinect-Samples/build/CMakeFiles/3.16.3/CMakeSystem.cmake b/codes/Azure-Kinect-Samples/build/CMakeFiles/3.16.3/CMakeSystem.cmake
new file mode 100644
index 0000000..2ede6c3
--- /dev/null
+++ b/codes/Azure-Kinect-Samples/build/CMakeFiles/3.16.3/CMakeSystem.cmake
@@ -0,0 +1,15 @@
+set(CMAKE_HOST_SYSTEM "Linux-5.15.133.1-microsoft-standard-WSL2")
+set(CMAKE_HOST_SYSTEM_NAME "Linux")
+set(CMAKE_HOST_SYSTEM_VERSION "5.15.133.1-microsoft-standard-WSL2")
+set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64")
+
+
+
+set(CMAKE_SYSTEM "Linux-5.15.133.1-microsoft-standard-WSL2")
+set(CMAKE_SYSTEM_NAME "Linux")
+set(CMAKE_SYSTEM_VERSION "5.15.133.1-microsoft-standard-WSL2")
+set(CMAKE_SYSTEM_PROCESSOR "x86_64")
+
+set(CMAKE_CROSSCOMPILING "FALSE")
+
+set(CMAKE_SYSTEM_LOADED 1)
diff --git a/codes/Azure-Kinect-Samples/build/CMakeFiles/3.16.3/CompilerIdC/CMakeCCompilerId.c b/codes/Azure-Kinect-Samples/build/CMakeFiles/3.16.3/CompilerIdC/CMakeCCompilerId.c
new file mode 100644
index 0000000..d884b50
--- /dev/null
+++ b/codes/Azure-Kinect-Samples/build/CMakeFiles/3.16.3/CompilerIdC/CMakeCCompilerId.c
@@ -0,0 +1,671 @@
+#ifdef __cplusplus
+# error "A C++ compiler has been selected for C."
+#endif
+
+#if defined(__18CXX)
+# define ID_VOID_MAIN
+#endif
+#if defined(__CLASSIC_C__)
+/* cv-qualifiers did not exist in K&R C */
+# define const
+# define volatile
+#endif
+
+
+/* Version number components: V=Version, R=Revision, P=Patch
+ Version date components: YYYY=Year, MM=Month, DD=Day */
+
+#if defined(__INTEL_COMPILER) || defined(__ICC)
+# define COMPILER_ID "Intel"
+# if defined(_MSC_VER)
+# define SIMULATE_ID "MSVC"
+# endif
+# if defined(__GNUC__)
+# define SIMULATE_ID "GNU"
+# endif
+ /* __INTEL_COMPILER = VRP */
+# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
+# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
+# if defined(__INTEL_COMPILER_UPDATE)
+# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
+# else
+# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
+# endif
+# if defined(__INTEL_COMPILER_BUILD_DATE)
+ /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
+# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
+# endif
+# if defined(_MSC_VER)
+ /* _MSC_VER = VVRR */
+# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
+# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
+# endif
+# if defined(__GNUC__)
+# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
+# elif defined(__GNUG__)
+# define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
+# endif
+# if defined(__GNUC_MINOR__)
+# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
+# endif
+# if defined(__GNUC_PATCHLEVEL__)
+# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
+# endif
+
+#elif defined(__PATHCC__)
+# define COMPILER_ID "PathScale"
+# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
+# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
+# if defined(__PATHCC_PATCHLEVEL__)
+# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
+# endif
+
+#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
+# define COMPILER_ID "Embarcadero"
+# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
+# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
+# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF)
+
+#elif defined(__BORLANDC__)
+# define COMPILER_ID "Borland"
+ /* __BORLANDC__ = 0xVRR */
+# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
+# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
+
+#elif defined(__WATCOMC__) && __WATCOMC__ < 1200
+# define COMPILER_ID "Watcom"
+ /* __WATCOMC__ = VVRR */
+# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
+# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
+# if (__WATCOMC__ % 10) > 0
+# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
+# endif
+
+#elif defined(__WATCOMC__)
+# define COMPILER_ID "OpenWatcom"
+ /* __WATCOMC__ = VVRP + 1100 */
+# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
+# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
+# if (__WATCOMC__ % 10) > 0
+# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
+# endif
+
+#elif defined(__SUNPRO_C)
+# define COMPILER_ID "SunPro"
+# if __SUNPRO_C >= 0x5100
+ /* __SUNPRO_C = 0xVRRP */
+# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12)
+# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF)
+# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
+# else
+ /* __SUNPRO_CC = 0xVRP */
+# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8)
+# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF)
+# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
+# endif
+
+#elif defined(__HP_cc)
+# define COMPILER_ID "HP"
+ /* __HP_cc = VVRRPP */
+# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000)
+# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100)
+# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100)
+
+#elif defined(__DECC)
+# define COMPILER_ID "Compaq"
+ /* __DECC_VER = VVRRTPPPP */
+# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000)
+# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100)
+# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000)
+
+#elif defined(__IBMC__) && defined(__COMPILER_VER__)
+# define COMPILER_ID "zOS"
+ /* __IBMC__ = VRP */
+# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
+# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
+# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
+
+#elif defined(__ibmxl__) && defined(__clang__)
+# define COMPILER_ID "XLClang"
+# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__)
+# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__)
+# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__)
+# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__)
+
+
+#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800
+# define COMPILER_ID "XL"
+ /* __IBMC__ = VRP */
+# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
+# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
+# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
+
+#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800
+# define COMPILER_ID "VisualAge"
+ /* __IBMC__ = VRP */
+# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
+# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
+# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
+
+#elif defined(__PGI)
+# define COMPILER_ID "PGI"
+# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
+# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
+# if defined(__PGIC_PATCHLEVEL__)
+# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
+# endif
+
+#elif defined(_CRAYC)
+# define COMPILER_ID "Cray"
+# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR)
+# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
+
+#elif defined(__TI_COMPILER_VERSION__)
+# define COMPILER_ID "TI"
+ /* __TI_COMPILER_VERSION__ = VVVRRRPPP */
+# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
+# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
+# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
+
+#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version)
+# define COMPILER_ID "Fujitsu"
+
+#elif defined(__ghs__)
+# define COMPILER_ID "GHS"
+/* __GHS_VERSION_NUMBER = VVVVRP */
+# ifdef __GHS_VERSION_NUMBER
+# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100)
+# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10)
+# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10)
+# endif
+
+#elif defined(__TINYC__)
+# define COMPILER_ID "TinyCC"
+
+#elif defined(__BCC__)
+# define COMPILER_ID "Bruce"
+
+#elif defined(__SCO_VERSION__)
+# define COMPILER_ID "SCO"
+
+#elif defined(__ARMCC_VERSION) && !defined(__clang__)
+# define COMPILER_ID "ARMCC"
+#if __ARMCC_VERSION >= 1000000
+ /* __ARMCC_VERSION = VRRPPPP */
+ # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000)
+ # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100)
+ # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
+#else
+ /* __ARMCC_VERSION = VRPPPP */
+ # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000)
+ # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10)
+ # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
+#endif
+
+
+#elif defined(__clang__) && defined(__apple_build_version__)
+# define COMPILER_ID "AppleClang"
+# if defined(_MSC_VER)
+# define SIMULATE_ID "MSVC"
+# endif
+# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
+# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
+# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
+# if defined(_MSC_VER)
+ /* _MSC_VER = VVRR */
+# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
+# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
+# endif
+# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__)
+
+#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION)
+# define COMPILER_ID "ARMClang"
+ # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000)
+ # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100)
+ # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000)
+# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION)
+
+#elif defined(__clang__)
+# define COMPILER_ID "Clang"
+# if defined(_MSC_VER)
+# define SIMULATE_ID "MSVC"
+# endif
+# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
+# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
+# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
+# if defined(_MSC_VER)
+ /* _MSC_VER = VVRR */
+# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
+# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
+# endif
+
+#elif defined(__GNUC__)
+# define COMPILER_ID "GNU"
+# define COMPILER_VERSION_MAJOR DEC(__GNUC__)
+# if defined(__GNUC_MINOR__)
+# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
+# endif
+# if defined(__GNUC_PATCHLEVEL__)
+# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
+# endif
+
+#elif defined(_MSC_VER)
+# define COMPILER_ID "MSVC"
+ /* _MSC_VER = VVRR */
+# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
+# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
+# if defined(_MSC_FULL_VER)
+# if _MSC_VER >= 1400
+ /* _MSC_FULL_VER = VVRRPPPPP */
+# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
+# else
+ /* _MSC_FULL_VER = VVRRPPPP */
+# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
+# endif
+# endif
+# if defined(_MSC_BUILD)
+# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
+# endif
+
+#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
+# define COMPILER_ID "ADSP"
+#if defined(__VISUALDSPVERSION__)
+ /* __VISUALDSPVERSION__ = 0xVVRRPP00 */
+# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24)
+# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF)
+# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF)
+#endif
+
+#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
+# define COMPILER_ID "IAR"
+# if defined(__VER__) && defined(__ICCARM__)
+# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000)
+# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000)
+# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000)
+# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
+# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__))
+# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100)
+# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100))
+# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__)
+# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
+# endif
+
+#elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC)
+# define COMPILER_ID "SDCC"
+# if defined(__SDCC_VERSION_MAJOR)
+# define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR)
+# define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR)
+# define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH)
+# else
+ /* SDCC = VRP */
+# define COMPILER_VERSION_MAJOR DEC(SDCC/100)
+# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10)
+# define COMPILER_VERSION_PATCH DEC(SDCC % 10)
+# endif
+
+
+/* These compilers are either not known or too old to define an
+ identification macro. Try to identify the platform and guess that
+ it is the native compiler. */
+#elif defined(__hpux) || defined(__hpua)
+# define COMPILER_ID "HP"
+
+#else /* unknown compiler */
+# define COMPILER_ID ""
+#endif
+
+/* Construct the string literal in pieces to prevent the source from
+ getting matched. Store it in a pointer rather than an array
+ because some compilers will just produce instructions to fill the
+ array rather than assigning a pointer to a static array. */
+char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
+#ifdef SIMULATE_ID
+char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
+#endif
+
+#ifdef __QNXNTO__
+char const* qnxnto = "INFO" ":" "qnxnto[]";
+#endif
+
+#if defined(__CRAYXE) || defined(__CRAYXC)
+char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
+#endif
+
+#define STRINGIFY_HELPER(X) #X
+#define STRINGIFY(X) STRINGIFY_HELPER(X)
+
+/* Identify known platforms by name. */
+#if defined(__linux) || defined(__linux__) || defined(linux)
+# define PLATFORM_ID "Linux"
+
+#elif defined(__CYGWIN__)
+# define PLATFORM_ID "Cygwin"
+
+#elif defined(__MINGW32__)
+# define PLATFORM_ID "MinGW"
+
+#elif defined(__APPLE__)
+# define PLATFORM_ID "Darwin"
+
+#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
+# define PLATFORM_ID "Windows"
+
+#elif defined(__FreeBSD__) || defined(__FreeBSD)
+# define PLATFORM_ID "FreeBSD"
+
+#elif defined(__NetBSD__) || defined(__NetBSD)
+# define PLATFORM_ID "NetBSD"
+
+#elif defined(__OpenBSD__) || defined(__OPENBSD)
+# define PLATFORM_ID "OpenBSD"
+
+#elif defined(__sun) || defined(sun)
+# define PLATFORM_ID "SunOS"
+
+#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
+# define PLATFORM_ID "AIX"
+
+#elif defined(__hpux) || defined(__hpux__)
+# define PLATFORM_ID "HP-UX"
+
+#elif defined(__HAIKU__)
+# define PLATFORM_ID "Haiku"
+
+#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
+# define PLATFORM_ID "BeOS"
+
+#elif defined(__QNX__) || defined(__QNXNTO__)
+# define PLATFORM_ID "QNX"
+
+#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
+# define PLATFORM_ID "Tru64"
+
+#elif defined(__riscos) || defined(__riscos__)
+# define PLATFORM_ID "RISCos"
+
+#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
+# define PLATFORM_ID "SINIX"
+
+#elif defined(__UNIX_SV__)
+# define PLATFORM_ID "UNIX_SV"
+
+#elif defined(__bsdos__)
+# define PLATFORM_ID "BSDOS"
+
+#elif defined(_MPRAS) || defined(MPRAS)
+# define PLATFORM_ID "MP-RAS"
+
+#elif defined(__osf) || defined(__osf__)
+# define PLATFORM_ID "OSF1"
+
+#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
+# define PLATFORM_ID "SCO_SV"
+
+#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
+# define PLATFORM_ID "ULTRIX"
+
+#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
+# define PLATFORM_ID "Xenix"
+
+#elif defined(__WATCOMC__)
+# if defined(__LINUX__)
+# define PLATFORM_ID "Linux"
+
+# elif defined(__DOS__)
+# define PLATFORM_ID "DOS"
+
+# elif defined(__OS2__)
+# define PLATFORM_ID "OS2"
+
+# elif defined(__WINDOWS__)
+# define PLATFORM_ID "Windows3x"
+
+# else /* unknown platform */
+# define PLATFORM_ID
+# endif
+
+#elif defined(__INTEGRITY)
+# if defined(INT_178B)
+# define PLATFORM_ID "Integrity178"
+
+# else /* regular Integrity */
+# define PLATFORM_ID "Integrity"
+# endif
+
+#else /* unknown platform */
+# define PLATFORM_ID
+
+#endif
+
+/* For windows compilers MSVC and Intel we can determine
+ the architecture of the compiler being used. This is because
+ the compilers do not have flags that can change the architecture,
+ but rather depend on which compiler is being used
+*/
+#if defined(_WIN32) && defined(_MSC_VER)
+# if defined(_M_IA64)
+# define ARCHITECTURE_ID "IA64"
+
+# elif defined(_M_X64) || defined(_M_AMD64)
+# define ARCHITECTURE_ID "x64"
+
+# elif defined(_M_IX86)
+# define ARCHITECTURE_ID "X86"
+
+# elif defined(_M_ARM64)
+# define ARCHITECTURE_ID "ARM64"
+
+# elif defined(_M_ARM)
+# if _M_ARM == 4
+# define ARCHITECTURE_ID "ARMV4I"
+# elif _M_ARM == 5
+# define ARCHITECTURE_ID "ARMV5I"
+# else
+# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM)
+# endif
+
+# elif defined(_M_MIPS)
+# define ARCHITECTURE_ID "MIPS"
+
+# elif defined(_M_SH)
+# define ARCHITECTURE_ID "SHx"
+
+# else /* unknown architecture */
+# define ARCHITECTURE_ID ""
+# endif
+
+#elif defined(__WATCOMC__)
+# if defined(_M_I86)
+# define ARCHITECTURE_ID "I86"
+
+# elif defined(_M_IX86)
+# define ARCHITECTURE_ID "X86"
+
+# else /* unknown architecture */
+# define ARCHITECTURE_ID ""
+# endif
+
+#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
+# if defined(__ICCARM__)
+# define ARCHITECTURE_ID "ARM"
+
+# elif defined(__ICCRX__)
+# define ARCHITECTURE_ID "RX"
+
+# elif defined(__ICCRH850__)
+# define ARCHITECTURE_ID "RH850"
+
+# elif defined(__ICCRL78__)
+# define ARCHITECTURE_ID "RL78"
+
+# elif defined(__ICCRISCV__)
+# define ARCHITECTURE_ID "RISCV"
+
+# elif defined(__ICCAVR__)
+# define ARCHITECTURE_ID "AVR"
+
+# elif defined(__ICC430__)
+# define ARCHITECTURE_ID "MSP430"
+
+# elif defined(__ICCV850__)
+# define ARCHITECTURE_ID "V850"
+
+# elif defined(__ICC8051__)
+# define ARCHITECTURE_ID "8051"
+
+# else /* unknown architecture */
+# define ARCHITECTURE_ID ""
+# endif
+
+#elif defined(__ghs__)
+# if defined(__PPC64__)
+# define ARCHITECTURE_ID "PPC64"
+
+# elif defined(__ppc__)
+# define ARCHITECTURE_ID "PPC"
+
+# elif defined(__ARM__)
+# define ARCHITECTURE_ID "ARM"
+
+# elif defined(__x86_64__)
+# define ARCHITECTURE_ID "x64"
+
+# elif defined(__i386__)
+# define ARCHITECTURE_ID "X86"
+
+# else /* unknown architecture */
+# define ARCHITECTURE_ID ""
+# endif
+#else
+# define ARCHITECTURE_ID
+#endif
+
+/* Convert integer to decimal digit literals. */
+#define DEC(n) \
+ ('0' + (((n) / 10000000)%10)), \
+ ('0' + (((n) / 1000000)%10)), \
+ ('0' + (((n) / 100000)%10)), \
+ ('0' + (((n) / 10000)%10)), \
+ ('0' + (((n) / 1000)%10)), \
+ ('0' + (((n) / 100)%10)), \
+ ('0' + (((n) / 10)%10)), \
+ ('0' + ((n) % 10))
+
+/* Convert integer to hex digit literals. */
+#define HEX(n) \
+ ('0' + ((n)>>28 & 0xF)), \
+ ('0' + ((n)>>24 & 0xF)), \
+ ('0' + ((n)>>20 & 0xF)), \
+ ('0' + ((n)>>16 & 0xF)), \
+ ('0' + ((n)>>12 & 0xF)), \
+ ('0' + ((n)>>8 & 0xF)), \
+ ('0' + ((n)>>4 & 0xF)), \
+ ('0' + ((n) & 0xF))
+
+/* Construct a string literal encoding the version number components. */
+#ifdef COMPILER_VERSION_MAJOR
+char const info_version[] = {
+ 'I', 'N', 'F', 'O', ':',
+ 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
+ COMPILER_VERSION_MAJOR,
+# ifdef COMPILER_VERSION_MINOR
+ '.', COMPILER_VERSION_MINOR,
+# ifdef COMPILER_VERSION_PATCH
+ '.', COMPILER_VERSION_PATCH,
+# ifdef COMPILER_VERSION_TWEAK
+ '.', COMPILER_VERSION_TWEAK,
+# endif
+# endif
+# endif
+ ']','\0'};
+#endif
+
+/* Construct a string literal encoding the internal version number. */
+#ifdef COMPILER_VERSION_INTERNAL
+char const info_version_internal[] = {
+ 'I', 'N', 'F', 'O', ':',
+ 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_',
+ 'i','n','t','e','r','n','a','l','[',
+ COMPILER_VERSION_INTERNAL,']','\0'};
+#endif
+
+/* Construct a string literal encoding the version number components. */
+#ifdef SIMULATE_VERSION_MAJOR
+char const info_simulate_version[] = {
+ 'I', 'N', 'F', 'O', ':',
+ 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[',
+ SIMULATE_VERSION_MAJOR,
+# ifdef SIMULATE_VERSION_MINOR
+ '.', SIMULATE_VERSION_MINOR,
+# ifdef SIMULATE_VERSION_PATCH
+ '.', SIMULATE_VERSION_PATCH,
+# ifdef SIMULATE_VERSION_TWEAK
+ '.', SIMULATE_VERSION_TWEAK,
+# endif
+# endif
+# endif
+ ']','\0'};
+#endif
+
+/* Construct the string literal in pieces to prevent the source from
+ getting matched. Store it in a pointer rather than an array
+ because some compilers will just produce instructions to fill the
+ array rather than assigning a pointer to a static array. */
+char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
+char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
+
+
+
+
+#if !defined(__STDC__)
+# if (defined(_MSC_VER) && !defined(__clang__)) \
+ || (defined(__ibmxl__) || defined(__IBMC__))
+# define C_DIALECT "90"
+# else
+# define C_DIALECT
+# endif
+#elif __STDC_VERSION__ >= 201000L
+# define C_DIALECT "11"
+#elif __STDC_VERSION__ >= 199901L
+# define C_DIALECT "99"
+#else
+# define C_DIALECT "90"
+#endif
+const char* info_language_dialect_default =
+ "INFO" ":" "dialect_default[" C_DIALECT "]";
+
+/*--------------------------------------------------------------------------*/
+
+#ifdef ID_VOID_MAIN
+void main() {}
+#else
+# if defined(__CLASSIC_C__)
+int main(argc, argv) int argc; char *argv[];
+# else
+int main(int argc, char* argv[])
+# endif
+{
+ int require = 0;
+ require += info_compiler[argc];
+ require += info_platform[argc];
+ require += info_arch[argc];
+#ifdef COMPILER_VERSION_MAJOR
+ require += info_version[argc];
+#endif
+#ifdef COMPILER_VERSION_INTERNAL
+ require += info_version_internal[argc];
+#endif
+#ifdef SIMULATE_ID
+ require += info_simulate[argc];
+#endif
+#ifdef SIMULATE_VERSION_MAJOR
+ require += info_simulate_version[argc];
+#endif
+#if defined(__CRAYXE) || defined(__CRAYXC)
+ require += info_cray[argc];
+#endif
+ require += info_language_dialect_default[argc];
+ (void)argv;
+ return require;
+}
+#endif
diff --git a/codes/Azure-Kinect-Samples/build/CMakeFiles/3.16.3/CompilerIdC/a.out b/codes/Azure-Kinect-Samples/build/CMakeFiles/3.16.3/CompilerIdC/a.out
new file mode 100644
index 0000000..b5c91a3
Binary files /dev/null and b/codes/Azure-Kinect-Samples/build/CMakeFiles/3.16.3/CompilerIdC/a.out differ
diff --git a/codes/Azure-Kinect-Samples/build/CMakeFiles/3.16.3/CompilerIdCXX/CMakeCXXCompilerId.cpp b/codes/Azure-Kinect-Samples/build/CMakeFiles/3.16.3/CompilerIdCXX/CMakeCXXCompilerId.cpp
new file mode 100644
index 0000000..69cfdba
--- /dev/null
+++ b/codes/Azure-Kinect-Samples/build/CMakeFiles/3.16.3/CompilerIdCXX/CMakeCXXCompilerId.cpp
@@ -0,0 +1,660 @@
+/* This source file must have a .cpp extension so that all C++ compilers
+ recognize the extension without flags. Borland does not know .cxx for
+ example. */
+#ifndef __cplusplus
+# error "A C compiler has been selected for C++."
+#endif
+
+
+/* Version number components: V=Version, R=Revision, P=Patch
+ Version date components: YYYY=Year, MM=Month, DD=Day */
+
+#if defined(__COMO__)
+# define COMPILER_ID "Comeau"
+ /* __COMO_VERSION__ = VRR */
+# define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100)
+# define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100)
+
+#elif defined(__INTEL_COMPILER) || defined(__ICC)
+# define COMPILER_ID "Intel"
+# if defined(_MSC_VER)
+# define SIMULATE_ID "MSVC"
+# endif
+# if defined(__GNUC__)
+# define SIMULATE_ID "GNU"
+# endif
+ /* __INTEL_COMPILER = VRP */
+# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
+# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
+# if defined(__INTEL_COMPILER_UPDATE)
+# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
+# else
+# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
+# endif
+# if defined(__INTEL_COMPILER_BUILD_DATE)
+ /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
+# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
+# endif
+# if defined(_MSC_VER)
+ /* _MSC_VER = VVRR */
+# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
+# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
+# endif
+# if defined(__GNUC__)
+# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
+# elif defined(__GNUG__)
+# define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
+# endif
+# if defined(__GNUC_MINOR__)
+# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
+# endif
+# if defined(__GNUC_PATCHLEVEL__)
+# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
+# endif
+
+#elif defined(__PATHCC__)
+# define COMPILER_ID "PathScale"
+# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
+# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
+# if defined(__PATHCC_PATCHLEVEL__)
+# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
+# endif
+
+#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
+# define COMPILER_ID "Embarcadero"
+# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
+# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
+# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF)
+
+#elif defined(__BORLANDC__)
+# define COMPILER_ID "Borland"
+ /* __BORLANDC__ = 0xVRR */
+# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
+# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
+
+#elif defined(__WATCOMC__) && __WATCOMC__ < 1200
+# define COMPILER_ID "Watcom"
+ /* __WATCOMC__ = VVRR */
+# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
+# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
+# if (__WATCOMC__ % 10) > 0
+# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
+# endif
+
+#elif defined(__WATCOMC__)
+# define COMPILER_ID "OpenWatcom"
+ /* __WATCOMC__ = VVRP + 1100 */
+# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
+# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
+# if (__WATCOMC__ % 10) > 0
+# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
+# endif
+
+#elif defined(__SUNPRO_CC)
+# define COMPILER_ID "SunPro"
+# if __SUNPRO_CC >= 0x5100
+ /* __SUNPRO_CC = 0xVRRP */
+# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12)
+# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF)
+# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
+# else
+ /* __SUNPRO_CC = 0xVRP */
+# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8)
+# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF)
+# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
+# endif
+
+#elif defined(__HP_aCC)
+# define COMPILER_ID "HP"
+ /* __HP_aCC = VVRRPP */
+# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000)
+# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100)
+# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100)
+
+#elif defined(__DECCXX)
+# define COMPILER_ID "Compaq"
+ /* __DECCXX_VER = VVRRTPPPP */
+# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000)
+# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100)
+# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000)
+
+#elif defined(__IBMCPP__) && defined(__COMPILER_VER__)
+# define COMPILER_ID "zOS"
+ /* __IBMCPP__ = VRP */
+# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
+# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
+# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
+
+#elif defined(__ibmxl__) && defined(__clang__)
+# define COMPILER_ID "XLClang"
+# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__)
+# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__)
+# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__)
+# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__)
+
+
+#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800
+# define COMPILER_ID "XL"
+ /* __IBMCPP__ = VRP */
+# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
+# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
+# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
+
+#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800
+# define COMPILER_ID "VisualAge"
+ /* __IBMCPP__ = VRP */
+# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
+# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
+# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
+
+#elif defined(__PGI)
+# define COMPILER_ID "PGI"
+# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
+# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
+# if defined(__PGIC_PATCHLEVEL__)
+# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
+# endif
+
+#elif defined(_CRAYC)
+# define COMPILER_ID "Cray"
+# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR)
+# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
+
+#elif defined(__TI_COMPILER_VERSION__)
+# define COMPILER_ID "TI"
+ /* __TI_COMPILER_VERSION__ = VVVRRRPPP */
+# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
+# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
+# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
+
+#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version)
+# define COMPILER_ID "Fujitsu"
+
+#elif defined(__ghs__)
+# define COMPILER_ID "GHS"
+/* __GHS_VERSION_NUMBER = VVVVRP */
+# ifdef __GHS_VERSION_NUMBER
+# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100)
+# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10)
+# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10)
+# endif
+
+#elif defined(__SCO_VERSION__)
+# define COMPILER_ID "SCO"
+
+#elif defined(__ARMCC_VERSION) && !defined(__clang__)
+# define COMPILER_ID "ARMCC"
+#if __ARMCC_VERSION >= 1000000
+ /* __ARMCC_VERSION = VRRPPPP */
+ # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000)
+ # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100)
+ # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
+#else
+ /* __ARMCC_VERSION = VRPPPP */
+ # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000)
+ # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10)
+ # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
+#endif
+
+
+#elif defined(__clang__) && defined(__apple_build_version__)
+# define COMPILER_ID "AppleClang"
+# if defined(_MSC_VER)
+# define SIMULATE_ID "MSVC"
+# endif
+# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
+# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
+# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
+# if defined(_MSC_VER)
+ /* _MSC_VER = VVRR */
+# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
+# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
+# endif
+# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__)
+
+#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION)
+# define COMPILER_ID "ARMClang"
+ # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000)
+ # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100)
+ # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000)
+# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION)
+
+#elif defined(__clang__)
+# define COMPILER_ID "Clang"
+# if defined(_MSC_VER)
+# define SIMULATE_ID "MSVC"
+# endif
+# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
+# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
+# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
+# if defined(_MSC_VER)
+ /* _MSC_VER = VVRR */
+# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
+# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
+# endif
+
+#elif defined(__GNUC__) || defined(__GNUG__)
+# define COMPILER_ID "GNU"
+# if defined(__GNUC__)
+# define COMPILER_VERSION_MAJOR DEC(__GNUC__)
+# else
+# define COMPILER_VERSION_MAJOR DEC(__GNUG__)
+# endif
+# if defined(__GNUC_MINOR__)
+# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
+# endif
+# if defined(__GNUC_PATCHLEVEL__)
+# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
+# endif
+
+#elif defined(_MSC_VER)
+# define COMPILER_ID "MSVC"
+ /* _MSC_VER = VVRR */
+# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
+# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
+# if defined(_MSC_FULL_VER)
+# if _MSC_VER >= 1400
+ /* _MSC_FULL_VER = VVRRPPPPP */
+# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
+# else
+ /* _MSC_FULL_VER = VVRRPPPP */
+# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
+# endif
+# endif
+# if defined(_MSC_BUILD)
+# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
+# endif
+
+#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
+# define COMPILER_ID "ADSP"
+#if defined(__VISUALDSPVERSION__)
+ /* __VISUALDSPVERSION__ = 0xVVRRPP00 */
+# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24)
+# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF)
+# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF)
+#endif
+
+#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
+# define COMPILER_ID "IAR"
+# if defined(__VER__) && defined(__ICCARM__)
+# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000)
+# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000)
+# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000)
+# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
+# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__))
+# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100)
+# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100))
+# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__)
+# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
+# endif
+
+
+/* These compilers are either not known or too old to define an
+ identification macro. Try to identify the platform and guess that
+ it is the native compiler. */
+#elif defined(__hpux) || defined(__hpua)
+# define COMPILER_ID "HP"
+
+#else /* unknown compiler */
+# define COMPILER_ID ""
+#endif
+
+/* Construct the string literal in pieces to prevent the source from
+ getting matched. Store it in a pointer rather than an array
+ because some compilers will just produce instructions to fill the
+ array rather than assigning a pointer to a static array. */
+char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
+#ifdef SIMULATE_ID
+char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
+#endif
+
+#ifdef __QNXNTO__
+char const* qnxnto = "INFO" ":" "qnxnto[]";
+#endif
+
+#if defined(__CRAYXE) || defined(__CRAYXC)
+char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
+#endif
+
+#define STRINGIFY_HELPER(X) #X
+#define STRINGIFY(X) STRINGIFY_HELPER(X)
+
+/* Identify known platforms by name. */
+#if defined(__linux) || defined(__linux__) || defined(linux)
+# define PLATFORM_ID "Linux"
+
+#elif defined(__CYGWIN__)
+# define PLATFORM_ID "Cygwin"
+
+#elif defined(__MINGW32__)
+# define PLATFORM_ID "MinGW"
+
+#elif defined(__APPLE__)
+# define PLATFORM_ID "Darwin"
+
+#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
+# define PLATFORM_ID "Windows"
+
+#elif defined(__FreeBSD__) || defined(__FreeBSD)
+# define PLATFORM_ID "FreeBSD"
+
+#elif defined(__NetBSD__) || defined(__NetBSD)
+# define PLATFORM_ID "NetBSD"
+
+#elif defined(__OpenBSD__) || defined(__OPENBSD)
+# define PLATFORM_ID "OpenBSD"
+
+#elif defined(__sun) || defined(sun)
+# define PLATFORM_ID "SunOS"
+
+#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
+# define PLATFORM_ID "AIX"
+
+#elif defined(__hpux) || defined(__hpux__)
+# define PLATFORM_ID "HP-UX"
+
+#elif defined(__HAIKU__)
+# define PLATFORM_ID "Haiku"
+
+#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
+# define PLATFORM_ID "BeOS"
+
+#elif defined(__QNX__) || defined(__QNXNTO__)
+# define PLATFORM_ID "QNX"
+
+#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
+# define PLATFORM_ID "Tru64"
+
+#elif defined(__riscos) || defined(__riscos__)
+# define PLATFORM_ID "RISCos"
+
+#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
+# define PLATFORM_ID "SINIX"
+
+#elif defined(__UNIX_SV__)
+# define PLATFORM_ID "UNIX_SV"
+
+#elif defined(__bsdos__)
+# define PLATFORM_ID "BSDOS"
+
+#elif defined(_MPRAS) || defined(MPRAS)
+# define PLATFORM_ID "MP-RAS"
+
+#elif defined(__osf) || defined(__osf__)
+# define PLATFORM_ID "OSF1"
+
+#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
+# define PLATFORM_ID "SCO_SV"
+
+#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
+# define PLATFORM_ID "ULTRIX"
+
+#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
+# define PLATFORM_ID "Xenix"
+
+#elif defined(__WATCOMC__)
+# if defined(__LINUX__)
+# define PLATFORM_ID "Linux"
+
+# elif defined(__DOS__)
+# define PLATFORM_ID "DOS"
+
+# elif defined(__OS2__)
+# define PLATFORM_ID "OS2"
+
+# elif defined(__WINDOWS__)
+# define PLATFORM_ID "Windows3x"
+
+# else /* unknown platform */
+# define PLATFORM_ID
+# endif
+
+#elif defined(__INTEGRITY)
+# if defined(INT_178B)
+# define PLATFORM_ID "Integrity178"
+
+# else /* regular Integrity */
+# define PLATFORM_ID "Integrity"
+# endif
+
+#else /* unknown platform */
+# define PLATFORM_ID
+
+#endif
+
+/* For windows compilers MSVC and Intel we can determine
+ the architecture of the compiler being used. This is because
+ the compilers do not have flags that can change the architecture,
+ but rather depend on which compiler is being used
+*/
+#if defined(_WIN32) && defined(_MSC_VER)
+# if defined(_M_IA64)
+# define ARCHITECTURE_ID "IA64"
+
+# elif defined(_M_X64) || defined(_M_AMD64)
+# define ARCHITECTURE_ID "x64"
+
+# elif defined(_M_IX86)
+# define ARCHITECTURE_ID "X86"
+
+# elif defined(_M_ARM64)
+# define ARCHITECTURE_ID "ARM64"
+
+# elif defined(_M_ARM)
+# if _M_ARM == 4
+# define ARCHITECTURE_ID "ARMV4I"
+# elif _M_ARM == 5
+# define ARCHITECTURE_ID "ARMV5I"
+# else
+# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM)
+# endif
+
+# elif defined(_M_MIPS)
+# define ARCHITECTURE_ID "MIPS"
+
+# elif defined(_M_SH)
+# define ARCHITECTURE_ID "SHx"
+
+# else /* unknown architecture */
+# define ARCHITECTURE_ID ""
+# endif
+
+#elif defined(__WATCOMC__)
+# if defined(_M_I86)
+# define ARCHITECTURE_ID "I86"
+
+# elif defined(_M_IX86)
+# define ARCHITECTURE_ID "X86"
+
+# else /* unknown architecture */
+# define ARCHITECTURE_ID ""
+# endif
+
+#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
+# if defined(__ICCARM__)
+# define ARCHITECTURE_ID "ARM"
+
+# elif defined(__ICCRX__)
+# define ARCHITECTURE_ID "RX"
+
+# elif defined(__ICCRH850__)
+# define ARCHITECTURE_ID "RH850"
+
+# elif defined(__ICCRL78__)
+# define ARCHITECTURE_ID "RL78"
+
+# elif defined(__ICCRISCV__)
+# define ARCHITECTURE_ID "RISCV"
+
+# elif defined(__ICCAVR__)
+# define ARCHITECTURE_ID "AVR"
+
+# elif defined(__ICC430__)
+# define ARCHITECTURE_ID "MSP430"
+
+# elif defined(__ICCV850__)
+# define ARCHITECTURE_ID "V850"
+
+# elif defined(__ICC8051__)
+# define ARCHITECTURE_ID "8051"
+
+# else /* unknown architecture */
+# define ARCHITECTURE_ID ""
+# endif
+
+#elif defined(__ghs__)
+# if defined(__PPC64__)
+# define ARCHITECTURE_ID "PPC64"
+
+# elif defined(__ppc__)
+# define ARCHITECTURE_ID "PPC"
+
+# elif defined(__ARM__)
+# define ARCHITECTURE_ID "ARM"
+
+# elif defined(__x86_64__)
+# define ARCHITECTURE_ID "x64"
+
+# elif defined(__i386__)
+# define ARCHITECTURE_ID "X86"
+
+# else /* unknown architecture */
+# define ARCHITECTURE_ID ""
+# endif
+#else
+# define ARCHITECTURE_ID
+#endif
+
+/* Convert integer to decimal digit literals. */
+#define DEC(n) \
+ ('0' + (((n) / 10000000)%10)), \
+ ('0' + (((n) / 1000000)%10)), \
+ ('0' + (((n) / 100000)%10)), \
+ ('0' + (((n) / 10000)%10)), \
+ ('0' + (((n) / 1000)%10)), \
+ ('0' + (((n) / 100)%10)), \
+ ('0' + (((n) / 10)%10)), \
+ ('0' + ((n) % 10))
+
+/* Convert integer to hex digit literals. */
+#define HEX(n) \
+ ('0' + ((n)>>28 & 0xF)), \
+ ('0' + ((n)>>24 & 0xF)), \
+ ('0' + ((n)>>20 & 0xF)), \
+ ('0' + ((n)>>16 & 0xF)), \
+ ('0' + ((n)>>12 & 0xF)), \
+ ('0' + ((n)>>8 & 0xF)), \
+ ('0' + ((n)>>4 & 0xF)), \
+ ('0' + ((n) & 0xF))
+
+/* Construct a string literal encoding the version number components. */
+#ifdef COMPILER_VERSION_MAJOR
+char const info_version[] = {
+ 'I', 'N', 'F', 'O', ':',
+ 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
+ COMPILER_VERSION_MAJOR,
+# ifdef COMPILER_VERSION_MINOR
+ '.', COMPILER_VERSION_MINOR,
+# ifdef COMPILER_VERSION_PATCH
+ '.', COMPILER_VERSION_PATCH,
+# ifdef COMPILER_VERSION_TWEAK
+ '.', COMPILER_VERSION_TWEAK,
+# endif
+# endif
+# endif
+ ']','\0'};
+#endif
+
+/* Construct a string literal encoding the internal version number. */
+#ifdef COMPILER_VERSION_INTERNAL
+char const info_version_internal[] = {
+ 'I', 'N', 'F', 'O', ':',
+ 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_',
+ 'i','n','t','e','r','n','a','l','[',
+ COMPILER_VERSION_INTERNAL,']','\0'};
+#endif
+
+/* Construct a string literal encoding the version number components. */
+#ifdef SIMULATE_VERSION_MAJOR
+char const info_simulate_version[] = {
+ 'I', 'N', 'F', 'O', ':',
+ 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[',
+ SIMULATE_VERSION_MAJOR,
+# ifdef SIMULATE_VERSION_MINOR
+ '.', SIMULATE_VERSION_MINOR,
+# ifdef SIMULATE_VERSION_PATCH
+ '.', SIMULATE_VERSION_PATCH,
+# ifdef SIMULATE_VERSION_TWEAK
+ '.', SIMULATE_VERSION_TWEAK,
+# endif
+# endif
+# endif
+ ']','\0'};
+#endif
+
+/* Construct the string literal in pieces to prevent the source from
+ getting matched. Store it in a pointer rather than an array
+ because some compilers will just produce instructions to fill the
+ array rather than assigning a pointer to a static array. */
+char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
+char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
+
+
+
+
+#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) && _MSVC_LANG < 201403L
+# if defined(__INTEL_CXX11_MODE__)
+# if defined(__cpp_aggregate_nsdmi)
+# define CXX_STD 201402L
+# else
+# define CXX_STD 201103L
+# endif
+# else
+# define CXX_STD 199711L
+# endif
+#elif defined(_MSC_VER) && defined(_MSVC_LANG)
+# define CXX_STD _MSVC_LANG
+#else
+# define CXX_STD __cplusplus
+#endif
+
+const char* info_language_dialect_default = "INFO" ":" "dialect_default["
+#if CXX_STD > 201703L
+ "20"
+#elif CXX_STD >= 201703L
+ "17"
+#elif CXX_STD >= 201402L
+ "14"
+#elif CXX_STD >= 201103L
+ "11"
+#else
+ "98"
+#endif
+"]";
+
+/*--------------------------------------------------------------------------*/
+
+int main(int argc, char* argv[])
+{
+ int require = 0;
+ require += info_compiler[argc];
+ require += info_platform[argc];
+#ifdef COMPILER_VERSION_MAJOR
+ require += info_version[argc];
+#endif
+#ifdef COMPILER_VERSION_INTERNAL
+ require += info_version_internal[argc];
+#endif
+#ifdef SIMULATE_ID
+ require += info_simulate[argc];
+#endif
+#ifdef SIMULATE_VERSION_MAJOR
+ require += info_simulate_version[argc];
+#endif
+#if defined(__CRAYXE) || defined(__CRAYXC)
+ require += info_cray[argc];
+#endif
+ require += info_language_dialect_default[argc];
+ (void)argv;
+ return require;
+}
diff --git a/codes/Azure-Kinect-Samples/build/CMakeFiles/3.16.3/CompilerIdCXX/a.out b/codes/Azure-Kinect-Samples/build/CMakeFiles/3.16.3/CompilerIdCXX/a.out
new file mode 100644
index 0000000..2881803
Binary files /dev/null and b/codes/Azure-Kinect-Samples/build/CMakeFiles/3.16.3/CompilerIdCXX/a.out differ
diff --git a/codes/Azure-Kinect-Samples/build/CMakeFiles/CMakeOutput.log b/codes/Azure-Kinect-Samples/build/CMakeFiles/CMakeOutput.log
new file mode 100644
index 0000000..b7f0f34
--- /dev/null
+++ b/codes/Azure-Kinect-Samples/build/CMakeFiles/CMakeOutput.log
@@ -0,0 +1,461 @@
+The system is: Linux - 5.15.133.1-microsoft-standard-WSL2 - x86_64
+Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
+Compiler: /usr/bin/cc
+Build flags:
+Id flags:
+
+The output was:
+0
+
+
+Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.out"
+
+The C compiler identification is GNU, found in "/mnt/g/working-projects/kinect/codes/Azure-Kinect-Samples/build/CMakeFiles/3.16.3/CompilerIdC/a.out"
+
+Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
+Compiler: /usr/bin/c++
+Build flags:
+Id flags:
+
+The output was:
+0
+
+
+Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out"
+
+The CXX compiler identification is GNU, found in "/mnt/g/working-projects/kinect/codes/Azure-Kinect-Samples/build/CMakeFiles/3.16.3/CompilerIdCXX/a.out"
+
+Determining if the C compiler works passed with the following output:
+Change Dir: /mnt/g/working-projects/kinect/codes/Azure-Kinect-Samples/build/CMakeFiles/CMakeTmp
+
+Run Build Command(s):/usr/bin/make cmTC_baa20/fast && /usr/bin/make -f CMakeFiles/cmTC_baa20.dir/build.make CMakeFiles/cmTC_baa20.dir/build
+make[1]: Entering directory '/mnt/g/working-projects/kinect/codes/Azure-Kinect-Samples/build/CMakeFiles/CMakeTmp'
+Building C object CMakeFiles/cmTC_baa20.dir/testCCompiler.c.o
+/usr/bin/cc -o CMakeFiles/cmTC_baa20.dir/testCCompiler.c.o -c /mnt/g/working-projects/kinect/codes/Azure-Kinect-Samples/build/CMakeFiles/CMakeTmp/testCCompiler.c
+Linking C executable cmTC_baa20
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_baa20.dir/link.txt --verbose=1
+/usr/bin/cc CMakeFiles/cmTC_baa20.dir/testCCompiler.c.o -o cmTC_baa20
+make[1]: Leaving directory '/mnt/g/working-projects/kinect/codes/Azure-Kinect-Samples/build/CMakeFiles/CMakeTmp'
+
+
+
+Detecting C compiler ABI info compiled with the following output:
+Change Dir: /mnt/g/working-projects/kinect/codes/Azure-Kinect-Samples/build/CMakeFiles/CMakeTmp
+
+Run Build Command(s):/usr/bin/make cmTC_18660/fast && /usr/bin/make -f CMakeFiles/cmTC_18660.dir/build.make CMakeFiles/cmTC_18660.dir/build
+make[1]: Entering directory '/mnt/g/working-projects/kinect/codes/Azure-Kinect-Samples/build/CMakeFiles/CMakeTmp'
+Building C object CMakeFiles/cmTC_18660.dir/CMakeCCompilerABI.c.o
+/usr/bin/cc -v -o CMakeFiles/cmTC_18660.dir/CMakeCCompilerABI.c.o -c /usr/share/cmake-3.16/Modules/CMakeCCompilerABI.c
+Using built-in specs.
+COLLECT_GCC=/usr/bin/cc
+OFFLOAD_TARGET_NAMES=nvptx-none:hsa
+OFFLOAD_TARGET_DEFAULT=1
+Target: x86_64-linux-gnu
+Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-9QDOt0/gcc-9-9.4.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
+Thread model: posix
+gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2)
+COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_18660.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64'
+ /usr/lib/gcc/x86_64-linux-gnu/9/cc1 -quiet -v -imultiarch x86_64-linux-gnu /usr/share/cmake-3.16/Modules/CMakeCCompilerABI.c -quiet -dumpbase CMakeCCompilerABI.c -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_18660.dir/CMakeCCompilerABI.c.o -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -o /tmp/ccGJGVqy.s
+GNU C17 (Ubuntu 9.4.0-1ubuntu1~20.04.2) version 9.4.0 (x86_64-linux-gnu)
+ compiled by GNU C version 9.4.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP
+
+GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
+ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
+ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/include-fixed"
+ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ /usr/lib/gcc/x86_64-linux-gnu/9/include
+ /usr/local/include
+ /usr/include/x86_64-linux-gnu
+ /usr/include
+End of search list.
+GNU C17 (Ubuntu 9.4.0-1ubuntu1~20.04.2) version 9.4.0 (x86_64-linux-gnu)
+ compiled by GNU C version 9.4.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP
+
+GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
+Compiler executable checksum: 01da938ff5dc2163489aa33cb3b747a7
+COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_18660.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64'
+ as -v --64 -o CMakeFiles/cmTC_18660.dir/CMakeCCompilerABI.c.o /tmp/ccGJGVqy.s
+GNU assembler version 2.34 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.34
+COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/
+LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/
+COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_18660.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64'
+Linking C executable cmTC_18660
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_18660.dir/link.txt --verbose=1
+/usr/bin/cc -v CMakeFiles/cmTC_18660.dir/CMakeCCompilerABI.c.o -o cmTC_18660
+Using built-in specs.
+COLLECT_GCC=/usr/bin/cc
+COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
+OFFLOAD_TARGET_NAMES=nvptx-none:hsa
+OFFLOAD_TARGET_DEFAULT=1
+Target: x86_64-linux-gnu
+Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-9QDOt0/gcc-9-9.4.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
+Thread model: posix
+gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2)
+COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/
+LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/
+COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_18660' '-mtune=generic' '-march=x86-64'
+ /usr/lib/gcc/x86_64-linux-gnu/9/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/9/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper -plugin-opt=-fresolution=/tmp/cc8Q0pJZ.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_18660 /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/9 -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/9/../../.. CMakeFiles/cmTC_18660.dir/CMakeCCompilerABI.c.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o
+COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_18660' '-mtune=generic' '-march=x86-64'
+make[1]: Leaving directory '/mnt/g/working-projects/kinect/codes/Azure-Kinect-Samples/build/CMakeFiles/CMakeTmp'
+
+
+
+Parsed C implicit include dir info from above output: rv=done
+ found start of include info
+ found start of implicit include info
+ add: [/usr/lib/gcc/x86_64-linux-gnu/9/include]
+ add: [/usr/local/include]
+ add: [/usr/include/x86_64-linux-gnu]
+ add: [/usr/include]
+ end of search list found
+ collapse include dir [/usr/lib/gcc/x86_64-linux-gnu/9/include] ==> [/usr/lib/gcc/x86_64-linux-gnu/9/include]
+ collapse include dir [/usr/local/include] ==> [/usr/local/include]
+ collapse include dir [/usr/include/x86_64-linux-gnu] ==> [/usr/include/x86_64-linux-gnu]
+ collapse include dir [/usr/include] ==> [/usr/include]
+ implicit include dirs: [/usr/lib/gcc/x86_64-linux-gnu/9/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include]
+
+
+Parsed C implicit link information from above output:
+ link line regex: [^( *|.*[/\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)]
+ ignore line: [Change Dir: /mnt/g/working-projects/kinect/codes/Azure-Kinect-Samples/build/CMakeFiles/CMakeTmp]
+ ignore line: []
+ ignore line: [Run Build Command(s):/usr/bin/make cmTC_18660/fast && /usr/bin/make -f CMakeFiles/cmTC_18660.dir/build.make CMakeFiles/cmTC_18660.dir/build]
+ ignore line: [make[1]: Entering directory '/mnt/g/working-projects/kinect/codes/Azure-Kinect-Samples/build/CMakeFiles/CMakeTmp']
+ ignore line: [Building C object CMakeFiles/cmTC_18660.dir/CMakeCCompilerABI.c.o]
+ ignore line: [/usr/bin/cc -v -o CMakeFiles/cmTC_18660.dir/CMakeCCompilerABI.c.o -c /usr/share/cmake-3.16/Modules/CMakeCCompilerABI.c]
+ ignore line: [Using built-in specs.]
+ ignore line: [COLLECT_GCC=/usr/bin/cc]
+ ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none:hsa]
+ ignore line: [OFFLOAD_TARGET_DEFAULT=1]
+ ignore line: [Target: x86_64-linux-gnu]
+ ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c ada c++ go brig d fortran objc obj-c++ gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32 m64 mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-9QDOt0/gcc-9-9.4.0/debian/tmp-nvptx/usr hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu]
+ ignore line: [Thread model: posix]
+ ignore line: [gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2) ]
+ ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_18660.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64']
+ ignore line: [ /usr/lib/gcc/x86_64-linux-gnu/9/cc1 -quiet -v -imultiarch x86_64-linux-gnu /usr/share/cmake-3.16/Modules/CMakeCCompilerABI.c -quiet -dumpbase CMakeCCompilerABI.c -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_18660.dir/CMakeCCompilerABI.c.o -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -o /tmp/ccGJGVqy.s]
+ ignore line: [GNU C17 (Ubuntu 9.4.0-1ubuntu1~20.04.2) version 9.4.0 (x86_64-linux-gnu)]
+ ignore line: [ compiled by GNU C version 9.4.0 GMP version 6.2.0 MPFR version 4.0.2 MPC version 1.1.0 isl version isl-0.22.1-GMP]
+ ignore line: []
+ ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072]
+ ignore line: [ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"]
+ ignore line: [ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/include-fixed"]
+ ignore line: [ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include"]
+ ignore line: [#include "..." search starts here:]
+ ignore line: [#include <...> search starts here:]
+ ignore line: [ /usr/lib/gcc/x86_64-linux-gnu/9/include]
+ ignore line: [ /usr/local/include]
+ ignore line: [ /usr/include/x86_64-linux-gnu]
+ ignore line: [ /usr/include]
+ ignore line: [End of search list.]
+ ignore line: [GNU C17 (Ubuntu 9.4.0-1ubuntu1~20.04.2) version 9.4.0 (x86_64-linux-gnu)]
+ ignore line: [ compiled by GNU C version 9.4.0 GMP version 6.2.0 MPFR version 4.0.2 MPC version 1.1.0 isl version isl-0.22.1-GMP]
+ ignore line: []
+ ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072]
+ ignore line: [Compiler executable checksum: 01da938ff5dc2163489aa33cb3b747a7]
+ ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_18660.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64']
+ ignore line: [ as -v --64 -o CMakeFiles/cmTC_18660.dir/CMakeCCompilerABI.c.o /tmp/ccGJGVqy.s]
+ ignore line: [GNU assembler version 2.34 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.34]
+ ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/]
+ ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/]
+ ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_18660.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64']
+ ignore line: [Linking C executable cmTC_18660]
+ ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_18660.dir/link.txt --verbose=1]
+ ignore line: [/usr/bin/cc -v CMakeFiles/cmTC_18660.dir/CMakeCCompilerABI.c.o -o cmTC_18660 ]
+ ignore line: [Using built-in specs.]
+ ignore line: [COLLECT_GCC=/usr/bin/cc]
+ ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper]
+ ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none:hsa]
+ ignore line: [OFFLOAD_TARGET_DEFAULT=1]
+ ignore line: [Target: x86_64-linux-gnu]
+ ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c ada c++ go brig d fortran objc obj-c++ gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32 m64 mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-9QDOt0/gcc-9-9.4.0/debian/tmp-nvptx/usr hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu]
+ ignore line: [Thread model: posix]
+ ignore line: [gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2) ]
+ ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/]
+ ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/]
+ ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_18660' '-mtune=generic' '-march=x86-64']
+ link line: [ /usr/lib/gcc/x86_64-linux-gnu/9/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/9/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper -plugin-opt=-fresolution=/tmp/cc8Q0pJZ.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_18660 /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/9 -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/9/../../.. CMakeFiles/cmTC_18660.dir/CMakeCCompilerABI.c.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o]
+ arg [/usr/lib/gcc/x86_64-linux-gnu/9/collect2] ==> ignore
+ arg [-plugin] ==> ignore
+ arg [/usr/lib/gcc/x86_64-linux-gnu/9/liblto_plugin.so] ==> ignore
+ arg [-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper] ==> ignore
+ arg [-plugin-opt=-fresolution=/tmp/cc8Q0pJZ.res] ==> ignore
+ arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
+ arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
+ arg [-plugin-opt=-pass-through=-lc] ==> ignore
+ arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
+ arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
+ arg [--build-id] ==> ignore
+ arg [--eh-frame-hdr] ==> ignore
+ arg [-m] ==> ignore
+ arg [elf_x86_64] ==> ignore
+ arg [--hash-style=gnu] ==> ignore
+ arg [--as-needed] ==> ignore
+ arg [-dynamic-linker] ==> ignore
+ arg [/lib64/ld-linux-x86-64.so.2] ==> ignore
+ arg [-pie] ==> ignore
+ arg [-znow] ==> ignore
+ arg [-zrelro] ==> ignore
+ arg [-o] ==> ignore
+ arg [cmTC_18660] ==> ignore
+ arg [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o] ==> ignore
+ arg [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o] ==> ignore
+ arg [/usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o] ==> ignore
+ arg [-L/usr/lib/gcc/x86_64-linux-gnu/9] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/9]
+ arg [-L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu]
+ arg [-L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib]
+ arg [-L/lib/x86_64-linux-gnu] ==> dir [/lib/x86_64-linux-gnu]
+ arg [-L/lib/../lib] ==> dir [/lib/../lib]
+ arg [-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu]
+ arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib]
+ arg [-L/usr/lib/gcc/x86_64-linux-gnu/9/../../..] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../..]
+ arg [CMakeFiles/cmTC_18660.dir/CMakeCCompilerABI.c.o] ==> ignore
+ arg [-lgcc] ==> lib [gcc]
+ arg [--push-state] ==> ignore
+ arg [--as-needed] ==> ignore
+ arg [-lgcc_s] ==> lib [gcc_s]
+ arg [--pop-state] ==> ignore
+ arg [-lc] ==> lib [c]
+ arg [-lgcc] ==> lib [gcc]
+ arg [--push-state] ==> ignore
+ arg [--as-needed] ==> ignore
+ arg [-lgcc_s] ==> lib [gcc_s]
+ arg [--pop-state] ==> ignore
+ arg [/usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o] ==> ignore
+ arg [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o] ==> ignore
+ collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/9] ==> [/usr/lib/gcc/x86_64-linux-gnu/9]
+ collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu]
+ collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib] ==> [/usr/lib]
+ collapse library dir [/lib/x86_64-linux-gnu] ==> [/lib/x86_64-linux-gnu]
+ collapse library dir [/lib/../lib] ==> [/lib]
+ collapse library dir [/usr/lib/x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu]
+ collapse library dir [/usr/lib/../lib] ==> [/usr/lib]
+ collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../..] ==> [/usr/lib]
+ implicit libs: [gcc;gcc_s;c;gcc;gcc_s]
+ implicit dirs: [/usr/lib/gcc/x86_64-linux-gnu/9;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib]
+ implicit fwks: []
+
+
+Determining if the CXX compiler works passed with the following output:
+Change Dir: /mnt/g/working-projects/kinect/codes/Azure-Kinect-Samples/build/CMakeFiles/CMakeTmp
+
+Run Build Command(s):/usr/bin/make cmTC_b4062/fast && /usr/bin/make -f CMakeFiles/cmTC_b4062.dir/build.make CMakeFiles/cmTC_b4062.dir/build
+make[1]: Entering directory '/mnt/g/working-projects/kinect/codes/Azure-Kinect-Samples/build/CMakeFiles/CMakeTmp'
+Building CXX object CMakeFiles/cmTC_b4062.dir/testCXXCompiler.cxx.o
+/usr/bin/c++ -o CMakeFiles/cmTC_b4062.dir/testCXXCompiler.cxx.o -c /mnt/g/working-projects/kinect/codes/Azure-Kinect-Samples/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
+Linking CXX executable cmTC_b4062
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b4062.dir/link.txt --verbose=1
+/usr/bin/c++ CMakeFiles/cmTC_b4062.dir/testCXXCompiler.cxx.o -o cmTC_b4062
+make[1]: Leaving directory '/mnt/g/working-projects/kinect/codes/Azure-Kinect-Samples/build/CMakeFiles/CMakeTmp'
+
+
+
+Detecting CXX compiler ABI info compiled with the following output:
+Change Dir: /mnt/g/working-projects/kinect/codes/Azure-Kinect-Samples/build/CMakeFiles/CMakeTmp
+
+Run Build Command(s):/usr/bin/make cmTC_0534b/fast && /usr/bin/make -f CMakeFiles/cmTC_0534b.dir/build.make CMakeFiles/cmTC_0534b.dir/build
+make[1]: Entering directory '/mnt/g/working-projects/kinect/codes/Azure-Kinect-Samples/build/CMakeFiles/CMakeTmp'
+Building CXX object CMakeFiles/cmTC_0534b.dir/CMakeCXXCompilerABI.cpp.o
+/usr/bin/c++ -v -o CMakeFiles/cmTC_0534b.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp
+Using built-in specs.
+COLLECT_GCC=/usr/bin/c++
+OFFLOAD_TARGET_NAMES=nvptx-none:hsa
+OFFLOAD_TARGET_DEFAULT=1
+Target: x86_64-linux-gnu
+Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-9QDOt0/gcc-9-9.4.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
+Thread model: posix
+gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2)
+COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_0534b.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
+ /usr/lib/gcc/x86_64-linux-gnu/9/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE /usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpbase CMakeCXXCompilerABI.cpp -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_0534b.dir/CMakeCXXCompilerABI.cpp.o -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -o /tmp/ccdeOE1s.s
+GNU C++14 (Ubuntu 9.4.0-1ubuntu1~20.04.2) version 9.4.0 (x86_64-linux-gnu)
+ compiled by GNU C version 9.4.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP
+
+GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
+ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/9"
+ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
+ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/include-fixed"
+ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ /usr/include/c++/9
+ /usr/include/x86_64-linux-gnu/c++/9
+ /usr/include/c++/9/backward
+ /usr/lib/gcc/x86_64-linux-gnu/9/include
+ /usr/local/include
+ /usr/include/x86_64-linux-gnu
+ /usr/include
+End of search list.
+GNU C++14 (Ubuntu 9.4.0-1ubuntu1~20.04.2) version 9.4.0 (x86_64-linux-gnu)
+ compiled by GNU C version 9.4.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP
+
+GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
+Compiler executable checksum: 3d1eba838554fa2348dba760e4770469
+COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_0534b.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
+ as -v --64 -o CMakeFiles/cmTC_0534b.dir/CMakeCXXCompilerABI.cpp.o /tmp/ccdeOE1s.s
+GNU assembler version 2.34 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.34
+COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/
+LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/
+COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_0534b.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
+Linking CXX executable cmTC_0534b
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_0534b.dir/link.txt --verbose=1
+/usr/bin/c++ -v CMakeFiles/cmTC_0534b.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_0534b
+Using built-in specs.
+COLLECT_GCC=/usr/bin/c++
+COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
+OFFLOAD_TARGET_NAMES=nvptx-none:hsa
+OFFLOAD_TARGET_DEFAULT=1
+Target: x86_64-linux-gnu
+Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-9QDOt0/gcc-9-9.4.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
+Thread model: posix
+gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2)
+COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/
+LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/
+COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_0534b' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
+ /usr/lib/gcc/x86_64-linux-gnu/9/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/9/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper -plugin-opt=-fresolution=/tmp/cct0E6QW.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_0534b /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/9 -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/9/../../.. CMakeFiles/cmTC_0534b.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o
+COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_0534b' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
+make[1]: Leaving directory '/mnt/g/working-projects/kinect/codes/Azure-Kinect-Samples/build/CMakeFiles/CMakeTmp'
+
+
+
+Parsed CXX implicit include dir info from above output: rv=done
+ found start of include info
+ found start of implicit include info
+ add: [/usr/include/c++/9]
+ add: [/usr/include/x86_64-linux-gnu/c++/9]
+ add: [/usr/include/c++/9/backward]
+ add: [/usr/lib/gcc/x86_64-linux-gnu/9/include]
+ add: [/usr/local/include]
+ add: [/usr/include/x86_64-linux-gnu]
+ add: [/usr/include]
+ end of search list found
+ collapse include dir [/usr/include/c++/9] ==> [/usr/include/c++/9]
+ collapse include dir [/usr/include/x86_64-linux-gnu/c++/9] ==> [/usr/include/x86_64-linux-gnu/c++/9]
+ collapse include dir [/usr/include/c++/9/backward] ==> [/usr/include/c++/9/backward]
+ collapse include dir [/usr/lib/gcc/x86_64-linux-gnu/9/include] ==> [/usr/lib/gcc/x86_64-linux-gnu/9/include]
+ collapse include dir [/usr/local/include] ==> [/usr/local/include]
+ collapse include dir [/usr/include/x86_64-linux-gnu] ==> [/usr/include/x86_64-linux-gnu]
+ collapse include dir [/usr/include] ==> [/usr/include]
+ implicit include dirs: [/usr/include/c++/9;/usr/include/x86_64-linux-gnu/c++/9;/usr/include/c++/9/backward;/usr/lib/gcc/x86_64-linux-gnu/9/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include]
+
+
+Parsed CXX implicit link information from above output:
+ link line regex: [^( *|.*[/\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)]
+ ignore line: [Change Dir: /mnt/g/working-projects/kinect/codes/Azure-Kinect-Samples/build/CMakeFiles/CMakeTmp]
+ ignore line: []
+ ignore line: [Run Build Command(s):/usr/bin/make cmTC_0534b/fast && /usr/bin/make -f CMakeFiles/cmTC_0534b.dir/build.make CMakeFiles/cmTC_0534b.dir/build]
+ ignore line: [make[1]: Entering directory '/mnt/g/working-projects/kinect/codes/Azure-Kinect-Samples/build/CMakeFiles/CMakeTmp']
+ ignore line: [Building CXX object CMakeFiles/cmTC_0534b.dir/CMakeCXXCompilerABI.cpp.o]
+ ignore line: [/usr/bin/c++ -v -o CMakeFiles/cmTC_0534b.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp]
+ ignore line: [Using built-in specs.]
+ ignore line: [COLLECT_GCC=/usr/bin/c++]
+ ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none:hsa]
+ ignore line: [OFFLOAD_TARGET_DEFAULT=1]
+ ignore line: [Target: x86_64-linux-gnu]
+ ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c ada c++ go brig d fortran objc obj-c++ gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32 m64 mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-9QDOt0/gcc-9-9.4.0/debian/tmp-nvptx/usr hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu]
+ ignore line: [Thread model: posix]
+ ignore line: [gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2) ]
+ ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_0534b.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64']
+ ignore line: [ /usr/lib/gcc/x86_64-linux-gnu/9/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE /usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpbase CMakeCXXCompilerABI.cpp -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_0534b.dir/CMakeCXXCompilerABI.cpp.o -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -o /tmp/ccdeOE1s.s]
+ ignore line: [GNU C++14 (Ubuntu 9.4.0-1ubuntu1~20.04.2) version 9.4.0 (x86_64-linux-gnu)]
+ ignore line: [ compiled by GNU C version 9.4.0 GMP version 6.2.0 MPFR version 4.0.2 MPC version 1.1.0 isl version isl-0.22.1-GMP]
+ ignore line: []
+ ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072]
+ ignore line: [ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/9"]
+ ignore line: [ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"]
+ ignore line: [ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/include-fixed"]
+ ignore line: [ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include"]
+ ignore line: [#include "..." search starts here:]
+ ignore line: [#include <...> search starts here:]
+ ignore line: [ /usr/include/c++/9]
+ ignore line: [ /usr/include/x86_64-linux-gnu/c++/9]
+ ignore line: [ /usr/include/c++/9/backward]
+ ignore line: [ /usr/lib/gcc/x86_64-linux-gnu/9/include]
+ ignore line: [ /usr/local/include]
+ ignore line: [ /usr/include/x86_64-linux-gnu]
+ ignore line: [ /usr/include]
+ ignore line: [End of search list.]
+ ignore line: [GNU C++14 (Ubuntu 9.4.0-1ubuntu1~20.04.2) version 9.4.0 (x86_64-linux-gnu)]
+ ignore line: [ compiled by GNU C version 9.4.0 GMP version 6.2.0 MPFR version 4.0.2 MPC version 1.1.0 isl version isl-0.22.1-GMP]
+ ignore line: []
+ ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072]
+ ignore line: [Compiler executable checksum: 3d1eba838554fa2348dba760e4770469]
+ ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_0534b.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64']
+ ignore line: [ as -v --64 -o CMakeFiles/cmTC_0534b.dir/CMakeCXXCompilerABI.cpp.o /tmp/ccdeOE1s.s]
+ ignore line: [GNU assembler version 2.34 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.34]
+ ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/]
+ ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/]
+ ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_0534b.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64']
+ ignore line: [Linking CXX executable cmTC_0534b]
+ ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_0534b.dir/link.txt --verbose=1]
+ ignore line: [/usr/bin/c++ -v CMakeFiles/cmTC_0534b.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_0534b ]
+ ignore line: [Using built-in specs.]
+ ignore line: [COLLECT_GCC=/usr/bin/c++]
+ ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper]
+ ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none:hsa]
+ ignore line: [OFFLOAD_TARGET_DEFAULT=1]
+ ignore line: [Target: x86_64-linux-gnu]
+ ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c ada c++ go brig d fortran objc obj-c++ gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32 m64 mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-9QDOt0/gcc-9-9.4.0/debian/tmp-nvptx/usr hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu]
+ ignore line: [Thread model: posix]
+ ignore line: [gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2) ]
+ ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/]
+ ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/]
+ ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_0534b' '-shared-libgcc' '-mtune=generic' '-march=x86-64']
+ link line: [ /usr/lib/gcc/x86_64-linux-gnu/9/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/9/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper -plugin-opt=-fresolution=/tmp/cct0E6QW.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_0534b /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/9 -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/9/../../.. CMakeFiles/cmTC_0534b.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o]
+ arg [/usr/lib/gcc/x86_64-linux-gnu/9/collect2] ==> ignore
+ arg [-plugin] ==> ignore
+ arg [/usr/lib/gcc/x86_64-linux-gnu/9/liblto_plugin.so] ==> ignore
+ arg [-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper] ==> ignore
+ arg [-plugin-opt=-fresolution=/tmp/cct0E6QW.res] ==> ignore
+ arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
+ arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
+ arg [-plugin-opt=-pass-through=-lc] ==> ignore
+ arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
+ arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
+ arg [--build-id] ==> ignore
+ arg [--eh-frame-hdr] ==> ignore
+ arg [-m] ==> ignore
+ arg [elf_x86_64] ==> ignore
+ arg [--hash-style=gnu] ==> ignore
+ arg [--as-needed] ==> ignore
+ arg [-dynamic-linker] ==> ignore
+ arg [/lib64/ld-linux-x86-64.so.2] ==> ignore
+ arg [-pie] ==> ignore
+ arg [-znow] ==> ignore
+ arg [-zrelro] ==> ignore
+ arg [-o] ==> ignore
+ arg [cmTC_0534b] ==> ignore
+ arg [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o] ==> ignore
+ arg [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o] ==> ignore
+ arg [/usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o] ==> ignore
+ arg [-L/usr/lib/gcc/x86_64-linux-gnu/9] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/9]
+ arg [-L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu]
+ arg [-L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib]
+ arg [-L/lib/x86_64-linux-gnu] ==> dir [/lib/x86_64-linux-gnu]
+ arg [-L/lib/../lib] ==> dir [/lib/../lib]
+ arg [-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu]
+ arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib]
+ arg [-L/usr/lib/gcc/x86_64-linux-gnu/9/../../..] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../..]
+ arg [CMakeFiles/cmTC_0534b.dir/CMakeCXXCompilerABI.cpp.o] ==> ignore
+ arg [-lstdc++] ==> lib [stdc++]
+ arg [-lm] ==> lib [m]
+ arg [-lgcc_s] ==> lib [gcc_s]
+ arg [-lgcc] ==> lib [gcc]
+ arg [-lc] ==> lib [c]
+ arg [-lgcc_s] ==> lib [gcc_s]
+ arg [-lgcc] ==> lib [gcc]
+ arg [/usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o] ==> ignore
+ arg [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o] ==> ignore
+ collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/9] ==> [/usr/lib/gcc/x86_64-linux-gnu/9]
+ collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu]
+ collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib] ==> [/usr/lib]
+ collapse library dir [/lib/x86_64-linux-gnu] ==> [/lib/x86_64-linux-gnu]
+ collapse library dir [/lib/../lib] ==> [/lib]
+ collapse library dir [/usr/lib/x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu]
+ collapse library dir [/usr/lib/../lib] ==> [/usr/lib]
+ collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../..] ==> [/usr/lib]
+ implicit libs: [stdc++;m;gcc_s;gcc;c;gcc_s;gcc]
+ implicit dirs: [/usr/lib/gcc/x86_64-linux-gnu/9;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib]
+ implicit fwks: []
+
+
diff --git a/codes/Azure-Kinect-Samples/build/CMakeFiles/cmake.check_cache b/codes/Azure-Kinect-Samples/build/CMakeFiles/cmake.check_cache
new file mode 100644
index 0000000..3dccd73
--- /dev/null
+++ b/codes/Azure-Kinect-Samples/build/CMakeFiles/cmake.check_cache
@@ -0,0 +1 @@
+# This file is generated by cmake for dependency checking of the CMakeCache.txt file
diff --git a/codes/Kinect2Sample-master/.github/FUNDING.yml b/codes/Kinect2Sample-master/.github/FUNDING.yml
new file mode 100644
index 0000000..fe6c3b5
--- /dev/null
+++ b/codes/Kinect2Sample-master/.github/FUNDING.yml
@@ -0,0 +1,3 @@
+# These are supported funding model platforms
+
+github: [UnaNancyOwen] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
diff --git a/codes/Kinect2Sample-master/HOWTOBUILD.md b/codes/Kinect2Sample-master/HOWTOBUILD.md
new file mode 100644
index 0000000..2833a60
--- /dev/null
+++ b/codes/Kinect2Sample-master/HOWTOBUILD.md
@@ -0,0 +1,74 @@
+How to Build Sample Program
+===================
+
+How to Install Tools and Libraries
+--------------------------------------
+* Visual Studio 2015
+ In Visual Studio 2015, Visual C++ is not installed by default. When installing, be sure to choose Custom installation and then choose the C++ components you require.
+ Or, if Visual Studio is already installed, choose [File]>[New]>[Project]>[C++] and you will be prompted to install the necessary components.
+
+* Kinect for Windows SDK v2.0
+ Please download installer, and install follow the instructions of installer.
+
+* OpenCV 3.1.0
+ Please download pre-built package, and unzip the self-extracting file.
+ Then, Please placed OpenCV folder in any directory. ( e.g. C:\Program Files\opencv
)
+
+* CMake 3.6.1
+ Please download installer, and install follow the instructions of installer.
+
+* Speech Platform SDK 11 ( and Kinect for Windows SDK v2.0 Language Packs (en-US) )
+ Please download installer for target platform, and install follow the instructions of installer.
+
+How to Generate Project of Samples using CMake
+--------------------------------------------------------
+1. Run CMake GUI
+
+2. Fill These Fields
+ * **Where is the source code**
+ This area is directory containing CMakeLists.txt file.
+ If you want to build all samples, please fill path of sample directory. ( e.g. C:/Kinect2Sample/sample
)
+ If you want to build any one sample, please fill path of any one directory. ( e.g. C:/Kinect2Sample/sample/Color
)
+
+ * **Where to build the binaries**
+ This area is directory Visual Studio project files will be generated.
+ By convention, Fill the path that added the \/build
to above path. ( e.g. C:/Kinect2Sample/sample/build
)
+
+3. Click Configure Button
+ You will be prompted for compiler and target platform.
+ Please specify compiler and target platform to use. ( e.g. Visual Studio 14 2015 Win64
)
+ Then, click finish button.
+
+4. Fill Configuration Fields
+ It will be entered almost automatically.
+ Please check configuration settings.
+ Then, click configure button.
+ * **KINECTSDK\_DIR** ... The directory path of Kinect for Windows SDK v2.0 ( e.g. C:/Program Files/Microsoft SDKs/Kinect/v2.0_1409
)
+ * **OPENCV\_DIR** ... The directory path that to search CMake configuration file for OpenCV. ( e.g. C:/Program Files/opencv/build
)
+
+5. Click Generate Button
+ If there is no errors, the Visual Studio project files will be generated into the "Where to build the binaries" directory.
+
+6. Set Environment Variable
+ You might need to add OpenCV binary directory path to environment variable "PATH" to be able to run applications. (e.g. C:\Program Filesopencv\build\x64\vc14\bin
)
+ The path that have to be added to environment variable will be displayed in output area of CMake GUI.
+ This path is depend on Compiler, Target Platform and OpenCV Directory.
+
+How to Build and Start Samples
+------------------------------------
+1. Open Visual Studio Solution File ( e.g. ..\build\Sample.sln
)
+
+2. Set Solution Configurations
+ Select Release from the Solution Configuration drop-down list, which is on the Standard toolbar. ( e.g. Release
)
+ Release build will be enabled optimization by compiler.
+
+3. Build Solution ( or Project )
+ On the Build menu, Click "Build Solution".
+ Or, In Solution Explorer, select the desired build target project within your solution. Then Click "Build Project".
+
+4. Set Startup Project
+ In Solution Explorer, select the desired startup project within your solution.
+ On the Project menu, choose "Set as StartUp Project".
+
+5. Start Without Debugging
+ On the Debug menu, choose "Start Without Debugging".
diff --git a/codes/Kinect2Sample-master/LICENSE b/codes/Kinect2Sample-master/LICENSE
new file mode 100644
index 0000000..484e9b4
--- /dev/null
+++ b/codes/Kinect2Sample-master/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2016 Tsukasa Sugiura
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/codes/Kinect2Sample-master/README.md b/codes/Kinect2Sample-master/README.md
new file mode 100644
index 0000000..00ddfc3
--- /dev/null
+++ b/codes/Kinect2Sample-master/README.md
@@ -0,0 +1,38 @@
+
+Kinect for Windows SDK v2 Sample Program
+============================
+
+This repository is Sample Program of Kinect for Windows SDK v2 written in Native C++.
+
+Environment
+--------------
+* Visual Studio Community 2015 *1
+* Kinect for Windows SDK v2.0
+* Kinect for Windows SDK v2.0 Language Packs (en-US)
+* Speech Platform SDK 11
+* OpenCV 3.1.0 *2
+* CMake 3.6.1 *3
+
+*1 This sample program need Visual Studio Community (or upper version), because depends on ATL.
+*2 Pre-built OpenCV that is distributed by official team does not include library for Win32 (x86) target platform. If you want to build sample program for Win32 (x86) target platform, You need build OpenCV yourself. Similarly, If it does not include library for your target compiler, You need build OpenCV yourself.
+*3 You need generate project of this sample program using CMake. Please read [this document](HOWTOBUILD.md) about how to generate project using CMake.
+
+License
+---------
+Copyright © 2016 Tsukasa SUGIURA
+Distributed under the [MIT License](http://www.opensource.org/licenses/mit-license.php "MIT License | Open Source Initiative").
+
+Contact
+---------
+* Tsukasa Sugiura
+ *
+ *
+ *
+
+Reference
+------------
+* KINECT for Windows SDK programming - Kinect for Windows v2 sensor supported version | Shuwa System Co.,Ltd.
+
+
+* Kinect for Windows SDK 2.0 | MSDN Library
+
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/AudioBeam/CMakeLists.txt b/codes/Kinect2Sample-master/sample/AudioBeam/CMakeLists.txt
new file mode 100644
index 0000000..5cb94b7
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/AudioBeam/CMakeLists.txt
@@ -0,0 +1,23 @@
+cmake_minimum_required( VERSION 3.6 )
+
+# Create Project
+project( Sample )
+add_executable( AudioBeam app.h app.cpp main.cpp util.h )
+
+# Set StartUp Project
+set_property( DIRECTORY PROPERTY VS_STARTUP_PROJECT "AudioBeam" )
+
+# Find Package
+set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}" ${CMAKE_MODULE_PATH} )
+find_package( KinectSDK2 REQUIRED )
+
+if( KinectSDK2_FOUND )
+ # Additional Include Directories
+ include_directories( ${KinectSDK2_INCLUDE_DIRS} )
+
+ # Additional Library Directories
+ link_directories( ${KinectSDK2_LIBRARY_DIRS} )
+
+ # Additional Dependencies
+ target_link_libraries( AudioBeam ${KinectSDK2_LIBRARIES} )
+endif()
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/AudioBeam/FindKinectSDK2.cmake b/codes/Kinect2Sample-master/sample/AudioBeam/FindKinectSDK2.cmake
new file mode 100644
index 0000000..00a2036
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/AudioBeam/FindKinectSDK2.cmake
@@ -0,0 +1,182 @@
+#.rst:
+# FindKinectSDK2
+# --------------
+#
+# Find Kinect for Windows SDK v2 (Kinect SDK v2) include dirs, library dirs, libraries and post-build commands
+#
+# Use this module by invoking find_package with the form::
+#
+# find_package( KinectSDK2 [REQUIRED] )
+#
+# Results for users are reported in following variables::
+#
+# KinectSDK2_FOUND - Return "TRUE" when Kinect SDK v2 found. Otherwise, Return "FALSE".
+# KinectSDK2_INCLUDE_DIRS - Kinect SDK v2 include directories. (${KinectSDK2_DIR}/inc)
+# KinectSDK2_LIBRARY_DIRS - Kinect SDK v2 library directories. (${KinectSDK2_DIR}/Lib/x86 or ${KinectSDK2_DIR}/Lib/x64)
+# KinectSDK2_LIBRARIES - Kinect SDK v2 library files. (${KinectSDK2_LIBRARY_DIRS}/Kinect20.lib (If check the box of any application festures, corresponding library will be added.))
+# KinectSDK2_COMMANDS - Copy commands of redist files for application functions of Kinect SDK v2. (If uncheck the box of all application features, this variable has defined empty command.)
+#
+# This module reads hints about search locations from following environment variables::
+#
+# KINECTSDK20_DIR - Kinect SDK v2 root directory. (This environment variable has been set by installer of Kinect SDK v2.)
+#
+# CMake entries::
+#
+# KinectSDK2_DIR - Kinect SDK v2 root directory. (Default $ENV{KINECTSDK20_DIR})
+# KinectSDK2_FACE - Check the box when using Face or HDFace features. (Default uncheck)
+# KinectSDK2_FUSION - Check the box when using Fusion features. (Default uncheck)
+# KinectSDK2_VGB - Check the box when using Visual Gesture Builder features. (Default uncheck)
+#
+# Example to find Kinect SDK v2::
+#
+# cmake_minimum_required( VERSION 2.8 )
+#
+# project( project )
+# add_executable( project main.cpp )
+#
+# # Find package using this module.
+# find_package( KinectSDK2 REQUIRED )
+#
+# if(KinectSDK2_FOUND)
+# # [C/C++]>[General]>[Additional Include Directories]
+# include_directories( ${KinectSDK2_INCLUDE_DIRS} )
+#
+# # [Linker]>[General]>[Additional Library Directories]
+# link_directories( ${KinectSDK2_LIBRARY_DIRS} )
+#
+# # [Linker]>[Input]>[Additional Dependencies]
+# target_link_libraries( project ${KinectSDK2_LIBRARIES} )
+#
+# # [Build Events]>[Post-Build Event]>[Command Line]
+# add_custom_command( TARGET project POST_BUILD ${KinectSDK2_COMMANDS} )
+# endif()
+#
+# =============================================================================
+#
+# Copyright (c) 2016 Tsukasa SUGIURA
+# Distributed under the MIT License.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# =============================================================================
+
+##### Utility #####
+
+# Check Directory Macro
+macro(CHECK_DIR _DIR)
+ if(NOT EXISTS "${${_DIR}}")
+ message(WARNING "Directory \"${${_DIR}}\" not found.")
+ set(KinectSDK2_FOUND FALSE)
+ unset(_DIR)
+ endif()
+endmacro()
+
+# Check Files Macro
+macro(CHECK_FILES _FILES _DIR)
+ set(_MISSING_FILES)
+ foreach(_FILE ${${_FILES}})
+ if(NOT EXISTS "${_FILE}")
+ get_filename_component(_FILE ${_FILE} NAME)
+ set(_MISSING_FILES "${_MISSING_FILES}${_FILE}, ")
+ endif()
+ endforeach()
+ if(_MISSING_FILES)
+ message(WARNING "In directory \"${${_DIR}}\" not found files: ${_MISSING_FILES}")
+ set(KinectSDK2_FOUND FALSE)
+ unset(_FILES)
+ endif()
+endmacro()
+
+# Target Platform
+set(TARGET_PLATFORM)
+if(NOT CMAKE_CL_64)
+ set(TARGET_PLATFORM x86)
+else()
+ set(TARGET_PLATFORM x64)
+endif()
+
+##### Find Kinect SDK v2 #####
+
+# Found
+set(KinectSDK2_FOUND TRUE)
+if(MSVC_VERSION LESS 1700)
+ message(WARNING "Kinect for Windows SDK v2 supported Visual Studio 2012 or later.")
+ set(KinectSDK2_FOUND FALSE)
+endif()
+
+# Options
+option(KinectSDK2_FACE "Face and HDFace features" FALSE)
+option(KinectSDK2_FUSION "Fusion features" FALSE)
+option(KinectSDK2_VGB "Visual Gesture Builder features" FALSE)
+
+# Root Directoty
+set(KinectSDK2_DIR)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_DIR $ENV{KINECTSDK20_DIR} CACHE PATH "Kinect for Windows SDK v2 Install Path." FORCE)
+ check_dir(KinectSDK2_DIR)
+endif()
+
+# Include Directories
+set(KinectSDK2_INCLUDE_DIRS)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_INCLUDE_DIRS ${KinectSDK2_DIR}/inc)
+ check_dir(KinectSDK2_INCLUDE_DIRS)
+endif()
+
+# Library Directories
+set(KinectSDK2_LIBRARY_DIRS)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_LIBRARY_DIRS ${KinectSDK2_DIR}/Lib/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_LIBRARY_DIRS)
+endif()
+
+# Dependencies
+set(KinectSDK2_LIBRARIES)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARY_DIRS}/Kinect20.lib)
+
+ if(KinectSDK2_FACE)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARIES};${KinectSDK2_LIBRARY_DIRS}/Kinect20.Face.lib)
+ endif()
+
+ if(KinectSDK2_FUSION)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARIES};${KinectSDK2_LIBRARY_DIRS}/Kinect20.Fusion.lib)
+ endif()
+
+ if(KinectSDK2_VGB)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARIES};${KinectSDK2_LIBRARY_DIRS}/Kinect20.VisualGestureBuilder.lib)
+ endif()
+
+ check_files(KinectSDK2_LIBRARIES KinectSDK2_LIBRARY_DIRS)
+endif()
+
+# Custom Commands
+set(KinectSDK2_COMMANDS)
+if(KinectSDK2_FOUND)
+ if(KinectSDK2_FACE)
+ set(KinectSDK2_REDIST_DIR ${KinectSDK2_DIR}/Redist/Face/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_REDIST_DIR)
+ list(APPEND KinectSDK2_COMMANDS COMMAND xcopy "${KinectSDK2_REDIST_DIR}" "$(OutDir)" /e /y /i /r > NUL)
+ endif()
+
+ if(KinectSDK2_FUSION)
+ set(KinectSDK2_REDIST_DIR ${KinectSDK2_DIR}/Redist/Fusion/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_REDIST_DIR)
+ list(APPEND KinectSDK2_COMMANDS COMMAND xcopy "${KinectSDK2_REDIST_DIR}" "$(OutDir)" /e /y /i /r > NUL)
+ endif()
+
+ if(KinectSDK2_VGB)
+ set(KinectSDK2_REDIST_DIR ${KinectSDK2_DIR}/Redist/VGB/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_REDIST_DIR)
+ list(APPEND KinectSDK2_COMMANDS COMMAND xcopy "${KinectSDK2_REDIST_DIR}" "$(OutDir)" /e /y /i /r > NUL)
+ endif()
+
+ # Empty Commands
+ if(NOT KinectSDK2_COMMANDS)
+ set(KinectSDK2_COMMANDS COMMAND)
+ endif()
+endif()
+
+message(STATUS "KinectSDK2_FOUND : ${KinectSDK2_FOUND}")
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/AudioBeam/app.cpp b/codes/Kinect2Sample-master/sample/AudioBeam/app.cpp
new file mode 100644
index 0000000..8eb51b8
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/AudioBeam/app.cpp
@@ -0,0 +1,179 @@
+#include "app.h"
+#include "util.h"
+
+#include
+#include
+#include
+#include
+
+#include
+
+// Constructor
+Kinect::Kinect()
+{
+ // Initialize
+ initialize();
+}
+
+// Destructor
+Kinect::~Kinect()
+{
+ // Finalize
+ finalize();
+}
+
+// Processing
+void Kinect::run()
+{
+ // Main Loop
+ while( true ){
+ // Update Data
+ update();
+
+ // Draw Data
+ draw();
+
+ // Show Data
+ show();
+
+ // Key Check
+ if( GetKeyState( VK_ESCAPE ) < 0 ){
+ break;
+ }
+ }
+}
+
+// Initialize
+void Kinect::initialize()
+{
+ // Initialize Sensor
+ initializeSensor();
+
+ // Initialize Audio
+ initializeAudio();
+
+ // Wait a Few Seconds until begins to Retrieve Data from Sensor ( about 2000-[ms] )
+ std::this_thread::sleep_for( std::chrono::seconds( 2 ) );
+}
+
+// Initialize Sensor
+inline void Kinect::initializeSensor()
+{
+ // Open Sensor
+ ERROR_CHECK( GetDefaultKinectSensor( &kinect ) );
+
+ ERROR_CHECK( kinect->Open() );
+
+ // Check Open
+ BOOLEAN isOpen = FALSE;
+ ERROR_CHECK( kinect->get_IsOpen( &isOpen ) );
+ if( !isOpen ){
+ throw std::runtime_error( "failed IKinectSensor::get_IsOpen( &isOpen )" );
+ }
+}
+
+// Initialize Audio
+inline void Kinect::initializeAudio()
+{
+ // Retrieve Audio Source
+ ComPtr audioSource;
+ ERROR_CHECK( kinect->get_AudioSource( &audioSource ) );
+
+ // Open Audio Beam Reader
+ ERROR_CHECK( audioSource->OpenReader( &audioBeamFrameReader ) );
+}
+
+// Finalize
+void Kinect::finalize()
+{
+ // Close Sensor
+ if( kinect != nullptr ){
+ kinect->Close();
+ }
+}
+
+// Update Data
+void Kinect::update()
+{
+ // Update Audio
+ updateAudio();
+}
+
+// Update Audio
+inline void Kinect::updateAudio()
+{
+ // Retrieve Audio Beam Frame List
+ ComPtr audioBeamFrameList;
+ const HRESULT ret = audioBeamFrameReader->AcquireLatestBeamFrames( &audioBeamFrameList );
+ if( FAILED( ret ) ){
+ return;
+ }
+
+ // Retrieve Audio Beam Frame Count
+ UINT beamCount = 0;
+ ERROR_CHECK( audioBeamFrameList->get_BeamCount( &beamCount ) );
+
+ Concurrency::parallel_for( 0, static_cast( beamCount ), [&]( int i ){
+ // Retrieve Audio Beam Frame
+ ComPtr audioBeamFrame;
+ ERROR_CHECK( audioBeamFrameList->OpenAudioBeamFrame( i, &audioBeamFrame ) );
+
+ // Retrieve Audio Beam SubFrame Count
+ UINT subFrameCount = 0;
+ ERROR_CHECK( audioBeamFrame->get_SubFrameCount( &subFrameCount ) );
+
+ Concurrency::parallel_for( 0, static_cast( subFrameCount ), [&]( int j ){
+ // Retrieve Audio Beam SubFrame
+ ComPtr audioBeamSubFrame;
+ ERROR_CHECK( audioBeamFrame->GetSubFrame( j, &audioBeamSubFrame ) );
+
+ // Retrieve Beam Angle ( Radian +/- 1.0 )
+ ERROR_CHECK( audioBeamSubFrame->get_BeamAngle( &beamAngle ) );
+
+ // Retrieve Beam Angle Confidence ( 0.0 - 1.0 )
+ ERROR_CHECK( audioBeamSubFrame->get_BeamAngleConfidence( &beamAngleConfidence ) );
+ } );
+ } );
+}
+
+// Draw Data
+void Kinect::draw()
+{
+ // Draw Audio
+ drawAudio();
+}
+
+// Draw Audio
+inline void Kinect::drawAudio()
+{
+ // Clear Beam Angle Result Buffer
+ beamAngleResult.clear();
+
+ // Check Beam Angle Confidence
+ if( beamAngleConfidence > confidenceThreshold ){
+ // Convert Degree from Radian
+ const float degree = static_cast( beamAngle * 180.0 / M_PI );
+
+ // Add Beam Angle to Result Buffer
+ beamAngleResult = std::to_string( degree ) + " (" + std::to_string( beamAngleConfidence ) + ")";
+ }
+}
+
+// Show Data
+void Kinect::show()
+{
+ // Show Audio
+ showAudio();
+}
+
+// Show Audio
+inline void Kinect::showAudio()
+{
+ // Check Empty Result Buffer
+ if( !beamAngleResult.size() ){
+ return;
+ }
+
+ // Show Result
+ std::cout << beamAngleResult << std::endl;
+}
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/AudioBeam/app.h b/codes/Kinect2Sample-master/sample/AudioBeam/app.h
new file mode 100644
index 0000000..4b99b85
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/AudioBeam/app.h
@@ -0,0 +1,70 @@
+#ifndef __APP__
+#define __APP__
+
+#define _USE_MATH_DEFINES
+#include
+#include
+
+#include
+
+#include
+using namespace Microsoft::WRL;
+
+class Kinect
+{
+private:
+ // Sensor
+ ComPtr kinect;
+
+ // Reader
+ ComPtr audioBeamFrameReader;
+
+ // Audio Buffer
+ float beamAngle = 0.f;
+ float beamAngleConfidence = 0.f;
+ std::string beamAngleResult;
+ const float confidenceThreshold = 0.3f;
+
+public:
+ // Constructor
+ Kinect();
+
+ // Destructor
+ ~Kinect();
+
+ // Processing
+ void run();
+
+private:
+ // Initialize
+ void initialize();
+
+ // Initialize Sensor
+ inline void initializeSensor();
+
+ // Initialize Audio
+ inline void initializeAudio();
+
+ // Finalize
+ void finalize();
+
+ // Update Data
+ void update();
+
+ // Update Audio
+ inline void updateAudio();
+
+ // Draw Data
+ void draw();
+
+ // Draw Audio
+ inline void drawAudio();
+
+ // Show Data
+ void show();
+
+ // Show Audio
+ inline void showAudio();
+};
+
+#endif // __APP__
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/AudioBeam/main.cpp b/codes/Kinect2Sample-master/sample/AudioBeam/main.cpp
new file mode 100644
index 0000000..d88643c
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/AudioBeam/main.cpp
@@ -0,0 +1,16 @@
+#include
+#include
+
+#include "app.h"
+
+int main( int argc, char* argv[] )
+{
+ try{
+ Kinect kinect;
+ kinect.run();
+ } catch( std::exception& ex ){
+ std::cout << ex.what() << std::endl;
+ }
+
+ return 0;
+}
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/AudioBeam/util.h b/codes/Kinect2Sample-master/sample/AudioBeam/util.h
new file mode 100644
index 0000000..0d9787f
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/AudioBeam/util.h
@@ -0,0 +1,37 @@
+#ifndef __UTIL__
+#define __UTIL__
+
+#include
+#include
+
+// Error Check Macro
+#define ERROR_CHECK( ret ) \
+ if( FAILED( ret ) ){ \
+ std::stringstream ss; \
+ ss << "failed " #ret " " << std::hex << ret << std::endl; \
+ throw std::runtime_error( ss.str().c_str() ); \
+ }
+
+// Safe Release
+template
+inline void SafeRelease( T*& rel )
+{
+ if( rel != NULL ){
+ rel->Release();
+ rel = NULL;
+ }
+}
+
+// C++ Style Line Types For OpenCV 2.x
+#if ( CV_MAJOR_VERSION < 3 )
+namespace cv{
+ enum LineTypes{
+ FILLED = -1,
+ LINE_4 = 4,
+ LINE_8 = 8,
+ LINE_AA = 16
+ };
+}
+#endif
+
+#endif // __UTIL__
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/AudioBody/CMakeLists.txt b/codes/Kinect2Sample-master/sample/AudioBody/CMakeLists.txt
new file mode 100644
index 0000000..6be74c4
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/AudioBody/CMakeLists.txt
@@ -0,0 +1,43 @@
+cmake_minimum_required( VERSION 3.6 )
+
+# Create Project
+project( Sample )
+add_executable( AudioBody app.h app.cpp main.cpp util.h )
+
+# Set StartUp Project
+set_property( DIRECTORY PROPERTY VS_STARTUP_PROJECT "AudioBody" )
+
+# Find Package
+set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}" ${CMAKE_MODULE_PATH} )
+find_package( KinectSDK2 REQUIRED )
+
+set( OpenCV_DIR "C:/Program Files/opencv/build" )
+option( OpenCV_STATIC OFF )
+find_package( OpenCV REQUIRED )
+
+# Set Static Link Runtime Library
+if( OpenCV_STATIC )
+ foreach( flag_var
+ CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
+ CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
+ CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
+ CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO )
+ if( ${flag_var} MATCHES "/MD" )
+ string( REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}" )
+ endif()
+ endforeach()
+endif()
+
+if( KinectSDK2_FOUND AND OpenCV_FOUND )
+ # Additional Include Directories
+ include_directories( ${KinectSDK2_INCLUDE_DIRS} )
+ include_directories( ${OpenCV_INCLUDE_DIRS} )
+
+ # Additional Library Directories
+ link_directories( ${KinectSDK2_LIBRARY_DIRS} )
+ link_directories( ${OpenCV_LIB_DIR} )
+
+ # Additional Dependencies
+ target_link_libraries( AudioBody ${KinectSDK2_LIBRARIES} )
+ target_link_libraries( AudioBody ${OpenCV_LIBS} )
+endif()
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/AudioBody/FindKinectSDK2.cmake b/codes/Kinect2Sample-master/sample/AudioBody/FindKinectSDK2.cmake
new file mode 100644
index 0000000..00a2036
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/AudioBody/FindKinectSDK2.cmake
@@ -0,0 +1,182 @@
+#.rst:
+# FindKinectSDK2
+# --------------
+#
+# Find Kinect for Windows SDK v2 (Kinect SDK v2) include dirs, library dirs, libraries and post-build commands
+#
+# Use this module by invoking find_package with the form::
+#
+# find_package( KinectSDK2 [REQUIRED] )
+#
+# Results for users are reported in following variables::
+#
+# KinectSDK2_FOUND - Return "TRUE" when Kinect SDK v2 found. Otherwise, Return "FALSE".
+# KinectSDK2_INCLUDE_DIRS - Kinect SDK v2 include directories. (${KinectSDK2_DIR}/inc)
+# KinectSDK2_LIBRARY_DIRS - Kinect SDK v2 library directories. (${KinectSDK2_DIR}/Lib/x86 or ${KinectSDK2_DIR}/Lib/x64)
+# KinectSDK2_LIBRARIES - Kinect SDK v2 library files. (${KinectSDK2_LIBRARY_DIRS}/Kinect20.lib (If check the box of any application festures, corresponding library will be added.))
+# KinectSDK2_COMMANDS - Copy commands of redist files for application functions of Kinect SDK v2. (If uncheck the box of all application features, this variable has defined empty command.)
+#
+# This module reads hints about search locations from following environment variables::
+#
+# KINECTSDK20_DIR - Kinect SDK v2 root directory. (This environment variable has been set by installer of Kinect SDK v2.)
+#
+# CMake entries::
+#
+# KinectSDK2_DIR - Kinect SDK v2 root directory. (Default $ENV{KINECTSDK20_DIR})
+# KinectSDK2_FACE - Check the box when using Face or HDFace features. (Default uncheck)
+# KinectSDK2_FUSION - Check the box when using Fusion features. (Default uncheck)
+# KinectSDK2_VGB - Check the box when using Visual Gesture Builder features. (Default uncheck)
+#
+# Example to find Kinect SDK v2::
+#
+# cmake_minimum_required( VERSION 2.8 )
+#
+# project( project )
+# add_executable( project main.cpp )
+#
+# # Find package using this module.
+# find_package( KinectSDK2 REQUIRED )
+#
+# if(KinectSDK2_FOUND)
+# # [C/C++]>[General]>[Additional Include Directories]
+# include_directories( ${KinectSDK2_INCLUDE_DIRS} )
+#
+# # [Linker]>[General]>[Additional Library Directories]
+# link_directories( ${KinectSDK2_LIBRARY_DIRS} )
+#
+# # [Linker]>[Input]>[Additional Dependencies]
+# target_link_libraries( project ${KinectSDK2_LIBRARIES} )
+#
+# # [Build Events]>[Post-Build Event]>[Command Line]
+# add_custom_command( TARGET project POST_BUILD ${KinectSDK2_COMMANDS} )
+# endif()
+#
+# =============================================================================
+#
+# Copyright (c) 2016 Tsukasa SUGIURA
+# Distributed under the MIT License.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# =============================================================================
+
+##### Utility #####
+
+# Check Directory Macro
+macro(CHECK_DIR _DIR)
+ if(NOT EXISTS "${${_DIR}}")
+ message(WARNING "Directory \"${${_DIR}}\" not found.")
+ set(KinectSDK2_FOUND FALSE)
+ unset(_DIR)
+ endif()
+endmacro()
+
+# Check Files Macro
+macro(CHECK_FILES _FILES _DIR)
+ set(_MISSING_FILES)
+ foreach(_FILE ${${_FILES}})
+ if(NOT EXISTS "${_FILE}")
+ get_filename_component(_FILE ${_FILE} NAME)
+ set(_MISSING_FILES "${_MISSING_FILES}${_FILE}, ")
+ endif()
+ endforeach()
+ if(_MISSING_FILES)
+ message(WARNING "In directory \"${${_DIR}}\" not found files: ${_MISSING_FILES}")
+ set(KinectSDK2_FOUND FALSE)
+ unset(_FILES)
+ endif()
+endmacro()
+
+# Target Platform
+set(TARGET_PLATFORM)
+if(NOT CMAKE_CL_64)
+ set(TARGET_PLATFORM x86)
+else()
+ set(TARGET_PLATFORM x64)
+endif()
+
+##### Find Kinect SDK v2 #####
+
+# Found
+set(KinectSDK2_FOUND TRUE)
+if(MSVC_VERSION LESS 1700)
+ message(WARNING "Kinect for Windows SDK v2 supported Visual Studio 2012 or later.")
+ set(KinectSDK2_FOUND FALSE)
+endif()
+
+# Options
+option(KinectSDK2_FACE "Face and HDFace features" FALSE)
+option(KinectSDK2_FUSION "Fusion features" FALSE)
+option(KinectSDK2_VGB "Visual Gesture Builder features" FALSE)
+
+# Root Directoty
+set(KinectSDK2_DIR)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_DIR $ENV{KINECTSDK20_DIR} CACHE PATH "Kinect for Windows SDK v2 Install Path." FORCE)
+ check_dir(KinectSDK2_DIR)
+endif()
+
+# Include Directories
+set(KinectSDK2_INCLUDE_DIRS)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_INCLUDE_DIRS ${KinectSDK2_DIR}/inc)
+ check_dir(KinectSDK2_INCLUDE_DIRS)
+endif()
+
+# Library Directories
+set(KinectSDK2_LIBRARY_DIRS)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_LIBRARY_DIRS ${KinectSDK2_DIR}/Lib/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_LIBRARY_DIRS)
+endif()
+
+# Dependencies
+set(KinectSDK2_LIBRARIES)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARY_DIRS}/Kinect20.lib)
+
+ if(KinectSDK2_FACE)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARIES};${KinectSDK2_LIBRARY_DIRS}/Kinect20.Face.lib)
+ endif()
+
+ if(KinectSDK2_FUSION)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARIES};${KinectSDK2_LIBRARY_DIRS}/Kinect20.Fusion.lib)
+ endif()
+
+ if(KinectSDK2_VGB)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARIES};${KinectSDK2_LIBRARY_DIRS}/Kinect20.VisualGestureBuilder.lib)
+ endif()
+
+ check_files(KinectSDK2_LIBRARIES KinectSDK2_LIBRARY_DIRS)
+endif()
+
+# Custom Commands
+set(KinectSDK2_COMMANDS)
+if(KinectSDK2_FOUND)
+ if(KinectSDK2_FACE)
+ set(KinectSDK2_REDIST_DIR ${KinectSDK2_DIR}/Redist/Face/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_REDIST_DIR)
+ list(APPEND KinectSDK2_COMMANDS COMMAND xcopy "${KinectSDK2_REDIST_DIR}" "$(OutDir)" /e /y /i /r > NUL)
+ endif()
+
+ if(KinectSDK2_FUSION)
+ set(KinectSDK2_REDIST_DIR ${KinectSDK2_DIR}/Redist/Fusion/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_REDIST_DIR)
+ list(APPEND KinectSDK2_COMMANDS COMMAND xcopy "${KinectSDK2_REDIST_DIR}" "$(OutDir)" /e /y /i /r > NUL)
+ endif()
+
+ if(KinectSDK2_VGB)
+ set(KinectSDK2_REDIST_DIR ${KinectSDK2_DIR}/Redist/VGB/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_REDIST_DIR)
+ list(APPEND KinectSDK2_COMMANDS COMMAND xcopy "${KinectSDK2_REDIST_DIR}" "$(OutDir)" /e /y /i /r > NUL)
+ endif()
+
+ # Empty Commands
+ if(NOT KinectSDK2_COMMANDS)
+ set(KinectSDK2_COMMANDS COMMAND)
+ endif()
+endif()
+
+message(STATUS "KinectSDK2_FOUND : ${KinectSDK2_FOUND}")
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/AudioBody/app.cpp b/codes/Kinect2Sample-master/sample/AudioBody/app.cpp
new file mode 100644
index 0000000..59c1439
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/AudioBody/app.cpp
@@ -0,0 +1,308 @@
+#include "app.h"
+#include "util.h"
+
+#include
+#include
+#include
+
+#include
+
+// Constructor
+Kinect::Kinect()
+{
+ // Initialize
+ initialize();
+}
+
+// Destructor
+Kinect::~Kinect()
+{
+ // Finalize
+ finalize();
+}
+
+// Processing
+void Kinect::run()
+{
+ // Main Loop
+ while( true ){
+ // Update Data
+ update();
+
+ // Draw Data
+ draw();
+
+ // Show Data
+ show();
+
+ // Key Check
+ const int key = cv::waitKey( 10 );
+ if( key == VK_ESCAPE ){
+ break;
+ }
+ }
+}
+
+// Initialize
+void Kinect::initialize()
+{
+ cv::setUseOptimized( true );
+
+ // Initialize Sensor
+ initializeSensor();
+
+ // Initialize Audio
+ initializeAudio();
+
+ // Initialize Body
+ initializeBody();
+
+ // Initialize BodyIndex
+ initializeBodyIndex();
+
+ // Wait a Few Seconds until begins to Retrieve Data from Sensor ( about 2000-[ms] )
+ std::this_thread::sleep_for( std::chrono::seconds( 2 ) );
+}
+
+// Initialize Sensor
+inline void Kinect::initializeSensor()
+{
+ // Open Sensor
+ ERROR_CHECK( GetDefaultKinectSensor( &kinect ) );
+
+ ERROR_CHECK( kinect->Open() );
+
+ // Check Open
+ BOOLEAN isOpen = FALSE;
+ ERROR_CHECK( kinect->get_IsOpen( &isOpen ) );
+ if( !isOpen ){
+ throw std::runtime_error( "failed IKinectSensor::get_IsOpen( &isOpen )" );
+ }
+}
+
+// Initialize Audio
+inline void Kinect::initializeAudio()
+{
+ // Retrieve Audio Source
+ ComPtr audioSource;
+ ERROR_CHECK( kinect->get_AudioSource( &audioSource ) );
+
+ // Open Audio Beam Reader
+ ERROR_CHECK( audioSource->OpenReader( &audioBeamFrameReader ) );
+}
+
+// Initialize Body
+inline void Kinect::initializeBody()
+{
+ // Open Body Reader
+ ComPtr bodyFrameSource;
+ ERROR_CHECK( kinect->get_BodyFrameSource( &bodyFrameSource ) );
+ ERROR_CHECK( bodyFrameSource->OpenReader( &bodyFrameReader ) );
+
+ // Initialize Body Buffer
+ Concurrency::parallel_for_each( bodies.begin(), bodies.end(), []( IBody*& body ){
+ SafeRelease( body );
+ } );
+}
+
+// Initialize BodyIndex
+inline void Kinect::initializeBodyIndex()
+{
+ // Open BodyIndex Reader
+ ComPtr bodyIndexFrameSource;
+ ERROR_CHECK( kinect->get_BodyIndexFrameSource( &bodyIndexFrameSource ) );
+ ERROR_CHECK( bodyIndexFrameSource->OpenReader( &bodyIndexFrameReader ) );
+
+ // Retrieve BodyIndex Description
+ ComPtr bodyIndexFrameDescription;
+ ERROR_CHECK( bodyIndexFrameSource->get_FrameDescription( &bodyIndexFrameDescription ) );
+ ERROR_CHECK( bodyIndexFrameDescription->get_Width( &bodyIndexWidth ) ); // 512
+ ERROR_CHECK( bodyIndexFrameDescription->get_Height( &bodyIndexHeight ) ); // 424
+
+ // Allocation BodyIndex Buffer
+ bodyIndexBuffer.resize( bodyIndexWidth * bodyIndexHeight );
+
+ // Color Table for Visualization
+ colors[0] = cv::Vec3b( 255, 0, 0 ); // Blue
+ colors[1] = cv::Vec3b( 0, 255, 0 ); // Green
+ colors[2] = cv::Vec3b( 0, 0, 255 ); // Red
+ colors[3] = cv::Vec3b( 255, 255, 0 ); // Cyan
+ colors[4] = cv::Vec3b( 255, 0, 255 ); // Magenta
+ colors[5] = cv::Vec3b( 0, 255, 255 ); // Yellow
+}
+
+// Finalize
+void Kinect::finalize()
+{
+ cv::destroyAllWindows();
+
+ // Release Body Buffer
+ Concurrency::parallel_for_each( bodies.begin(), bodies.end(), []( IBody*& body ){
+ SafeRelease( body );
+ } );
+
+ // Close Sensor
+ if( kinect != nullptr ){
+ kinect->Close();
+ }
+}
+
+// Update Data
+void Kinect::update()
+{
+ // Update Audio
+ updateAudio();
+
+ // Update Body
+ updateBody();
+
+ // Update BodyIndex
+ updateBodyIndex();
+}
+
+// Update Audio
+inline void Kinect::updateAudio()
+{
+ // Initialize Tracking ID
+ audioTrackingId = std::numeric_limits::max() - 1;
+
+ // Retrieve Audio Beam Frame List
+ ComPtr audioBeamFrameList;
+ const HRESULT ret = audioBeamFrameReader->AcquireLatestBeamFrames( &audioBeamFrameList );
+ if( FAILED( ret ) ){
+ return;
+ }
+
+ // Retrieve Audio Beam Frame Count
+ UINT beamCount = 0;
+ ERROR_CHECK( audioBeamFrameList->get_BeamCount( &beamCount ) );
+
+ for( int i = 0; i < beamCount; i++ ){
+ // Retrieve Audio Beam Frame
+ ComPtr audioBeamFrame;
+ ERROR_CHECK( audioBeamFrameList->OpenAudioBeamFrame( i, &audioBeamFrame ) );
+
+ // Retrieve Audio Beam SubFrame Count
+ UINT subFrameCount = 0;
+ ERROR_CHECK( audioBeamFrame->get_SubFrameCount( &subFrameCount ) );
+
+ for( int j = 0; j < subFrameCount; j++ ){
+ // Retrieve Audio Beam SubFrame
+ ComPtr audioBeamSubFrame;
+ ERROR_CHECK( audioBeamFrame->GetSubFrame( j, &audioBeamSubFrame ) );
+
+ // Retrieve Audio Body Correlation Count
+ UINT32 correlationCount;
+ ERROR_CHECK( audioBeamSubFrame->get_AudioBodyCorrelationCount( &correlationCount ) );
+
+ // Check Correlation Count
+ if( correlationCount == 0 ){
+ return;
+ }
+
+ // Retrieve First Audio Body Correlation
+ ComPtr audioBodyCorrelation;
+ ERROR_CHECK( audioBeamSubFrame->GetAudioBodyCorrelation( 0, &audioBodyCorrelation ) );
+
+ // Retrieve Tracking ID
+ ERROR_CHECK( audioBodyCorrelation->get_BodyTrackingId( &audioTrackingId ) );
+ }
+ }
+}
+
+// Update Body
+inline void Kinect::updateBody()
+{
+ // Initialize Tracking Index
+ audioTrackingIndex = -1;
+
+ // Check Tracking ID
+ if( audioTrackingId == std::numeric_limits::max() - 1 ){
+ return;
+ }
+
+ // Retrieve Body Frame
+ ComPtr bodyFrame;
+ const HRESULT ret = bodyFrameReader->AcquireLatestFrame( &bodyFrame );
+ if( FAILED( ret ) ){
+ return;
+ }
+
+ // Release Previous Bodies
+ Concurrency::parallel_for_each( bodies.begin(), bodies.end(), []( IBody*& body ){
+ SafeRelease( body );
+ } );
+
+ // Retrieve Body Data
+ ERROR_CHECK( bodyFrame->GetAndRefreshBodyData( static_cast( bodies.size() ), &bodies[0] ) );
+
+ for( int count = 0; count < BODY_COUNT; count++ ){
+ // Retrive Tracking ID
+ UINT64 trackingId;
+ bodies[count]->get_TrackingId( &trackingId );
+
+ // Check Tracking ID
+ if( trackingId == audioTrackingId ){
+ audioTrackingIndex = count;
+ break;
+ }
+ }
+}
+
+// Update BodyIndex
+inline void Kinect::updateBodyIndex()
+{
+
+ // Retrieve BodyIndex Frame
+ ComPtr bodyIndexFrame;
+ const HRESULT ret = bodyIndexFrameReader->AcquireLatestFrame( &bodyIndexFrame );
+ if( FAILED( ret ) ){
+ return;
+ }
+
+ // Retrieve BodyIndex Data
+ ERROR_CHECK( bodyIndexFrame->CopyFrameDataToArray( static_cast( bodyIndexBuffer.size() ), &bodyIndexBuffer[0] ) );
+}
+
+// Draw Data
+void Kinect::draw()
+{
+ // Draw BodyIndex
+ drawBodyIndex();
+}
+
+// Draw BodyIndex
+inline void Kinect::drawBodyIndex()
+{
+ // Check Tracking Index
+ if( audioTrackingIndex == -1 ){
+ return;
+ }
+
+ // Visualization BodyIndex
+ bodyIndexMat = cv::Mat::zeros( bodyIndexHeight, bodyIndexWidth, CV_8UC3 );
+ bodyIndexMat.forEach( [&]( cv::Vec3b &p, const int* position ){
+ uchar index = bodyIndexBuffer[position[0] * bodyIndexWidth + position[1]];
+ if( index == audioTrackingIndex ){
+ p = colors[index];
+ }
+ } );
+}
+
+// Show Data
+void Kinect::show()
+{
+ // Show BodyIndex
+ showBodyIndex();
+}
+
+// Show BodyIndex
+inline void Kinect::showBodyIndex()
+{
+ if( bodyIndexMat.empty() ){
+ return;
+ }
+
+ // Show Image
+ cv::imshow( "AudiBody", bodyIndexMat );
+}
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/AudioBody/app.h b/codes/Kinect2Sample-master/sample/AudioBody/app.h
new file mode 100644
index 0000000..a73feee
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/AudioBody/app.h
@@ -0,0 +1,96 @@
+#ifndef __APP__
+#define __APP__
+
+#include
+#include
+#include
+
+#include
+#include
+
+#include
+using namespace Microsoft::WRL;
+
+class Kinect
+{
+private:
+ // Sensor
+ ComPtr kinect;
+
+ // Reader
+ ComPtr bodyFrameReader;
+ ComPtr bodyIndexFrameReader;
+ ComPtr audioBeamFrameReader;
+
+ // Body Buffer
+ std::array bodies = { nullptr };
+
+ // BodyIndex Buffer
+ std::vector bodyIndexBuffer;
+ int bodyIndexWidth;
+ int bodyIndexHeight;
+ cv::Mat bodyIndexMat;
+ std::array colors;
+
+ // Audio Buffer
+ UINT64 audioTrackingId;
+ int audioTrackingIndex;
+
+public:
+ // Constructor
+ Kinect();
+
+ // Destructor
+ ~Kinect();
+
+ // Processing
+ void run();
+
+private:
+ // Initialize
+ void initialize();
+
+ // Initialize Sensor
+ inline void initializeSensor();
+
+ // Initialize Body
+ inline void initializeBody();
+
+ // Initialize BodyIndex
+ inline void initializeBodyIndex();
+
+ // Initialize Audio
+ inline void initializeAudio();
+
+ // Finalize
+ void finalize();
+
+ // Update Data
+ void update();
+
+ // Update Body
+ inline void updateBody();
+
+ // Update BodyIndex
+ inline void updateBodyIndex();
+
+ // Update Audio
+ inline void updateAudio();
+
+ // Draw Data
+ void draw();
+
+ // Draw BodyIndex
+ inline void drawBodyIndex();
+
+ // Draw Audio
+ inline void drawAudio();
+
+ // Show Data
+ void show();
+
+ // Show BodyIndex
+ inline void showBodyIndex();
+};
+
+#endif // __APP__
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/AudioBody/main.cpp b/codes/Kinect2Sample-master/sample/AudioBody/main.cpp
new file mode 100644
index 0000000..d88643c
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/AudioBody/main.cpp
@@ -0,0 +1,16 @@
+#include
+#include
+
+#include "app.h"
+
+int main( int argc, char* argv[] )
+{
+ try{
+ Kinect kinect;
+ kinect.run();
+ } catch( std::exception& ex ){
+ std::cout << ex.what() << std::endl;
+ }
+
+ return 0;
+}
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/AudioBody/util.h b/codes/Kinect2Sample-master/sample/AudioBody/util.h
new file mode 100644
index 0000000..0d9787f
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/AudioBody/util.h
@@ -0,0 +1,37 @@
+#ifndef __UTIL__
+#define __UTIL__
+
+#include
+#include
+
+// Error Check Macro
+#define ERROR_CHECK( ret ) \
+ if( FAILED( ret ) ){ \
+ std::stringstream ss; \
+ ss << "failed " #ret " " << std::hex << ret << std::endl; \
+ throw std::runtime_error( ss.str().c_str() ); \
+ }
+
+// Safe Release
+template
+inline void SafeRelease( T*& rel )
+{
+ if( rel != NULL ){
+ rel->Release();
+ rel = NULL;
+ }
+}
+
+// C++ Style Line Types For OpenCV 2.x
+#if ( CV_MAJOR_VERSION < 3 )
+namespace cv{
+ enum LineTypes{
+ FILLED = -1,
+ LINE_4 = 4,
+ LINE_8 = 8,
+ LINE_AA = 16
+ };
+}
+#endif
+
+#endif // __UTIL__
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/Body/CMakeLists.txt b/codes/Kinect2Sample-master/sample/Body/CMakeLists.txt
new file mode 100644
index 0000000..d7d6afc
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/Body/CMakeLists.txt
@@ -0,0 +1,43 @@
+cmake_minimum_required( VERSION 3.6 )
+
+# Create Project
+project( Sample )
+add_executable( Body app.h app.cpp main.cpp util.h )
+
+# Set StartUp Project
+set_property( DIRECTORY PROPERTY VS_STARTUP_PROJECT "Body" )
+
+# Find Package
+set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}" ${CMAKE_MODULE_PATH} )
+find_package( KinectSDK2 REQUIRED )
+
+set( OpenCV_DIR "C:/Program Files/opencv/build" )
+option( OpenCV_STATIC OFF )
+find_package( OpenCV REQUIRED )
+
+# Set Static Link Runtime Library
+if( OpenCV_STATIC )
+ foreach( flag_var
+ CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
+ CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
+ CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
+ CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO )
+ if( ${flag_var} MATCHES "/MD" )
+ string( REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}" )
+ endif()
+ endforeach()
+endif()
+
+if( KinectSDK2_FOUND AND OpenCV_FOUND )
+ # Additional Include Directories
+ include_directories( ${KinectSDK2_INCLUDE_DIRS} )
+ include_directories( ${OpenCV_INCLUDE_DIRS} )
+
+ # Additional Library Directories
+ link_directories( ${KinectSDK2_LIBRARY_DIRS} )
+ link_directories( ${OpenCV_LIB_DIR} )
+
+ # Additional Dependencies
+ target_link_libraries( Body ${KinectSDK2_LIBRARIES} )
+ target_link_libraries( Body ${OpenCV_LIBS} )
+endif()
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/Body/FindKinectSDK2.cmake b/codes/Kinect2Sample-master/sample/Body/FindKinectSDK2.cmake
new file mode 100644
index 0000000..00a2036
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/Body/FindKinectSDK2.cmake
@@ -0,0 +1,182 @@
+#.rst:
+# FindKinectSDK2
+# --------------
+#
+# Find Kinect for Windows SDK v2 (Kinect SDK v2) include dirs, library dirs, libraries and post-build commands
+#
+# Use this module by invoking find_package with the form::
+#
+# find_package( KinectSDK2 [REQUIRED] )
+#
+# Results for users are reported in following variables::
+#
+# KinectSDK2_FOUND - Return "TRUE" when Kinect SDK v2 found. Otherwise, Return "FALSE".
+# KinectSDK2_INCLUDE_DIRS - Kinect SDK v2 include directories. (${KinectSDK2_DIR}/inc)
+# KinectSDK2_LIBRARY_DIRS - Kinect SDK v2 library directories. (${KinectSDK2_DIR}/Lib/x86 or ${KinectSDK2_DIR}/Lib/x64)
+# KinectSDK2_LIBRARIES - Kinect SDK v2 library files. (${KinectSDK2_LIBRARY_DIRS}/Kinect20.lib (If check the box of any application festures, corresponding library will be added.))
+# KinectSDK2_COMMANDS - Copy commands of redist files for application functions of Kinect SDK v2. (If uncheck the box of all application features, this variable has defined empty command.)
+#
+# This module reads hints about search locations from following environment variables::
+#
+# KINECTSDK20_DIR - Kinect SDK v2 root directory. (This environment variable has been set by installer of Kinect SDK v2.)
+#
+# CMake entries::
+#
+# KinectSDK2_DIR - Kinect SDK v2 root directory. (Default $ENV{KINECTSDK20_DIR})
+# KinectSDK2_FACE - Check the box when using Face or HDFace features. (Default uncheck)
+# KinectSDK2_FUSION - Check the box when using Fusion features. (Default uncheck)
+# KinectSDK2_VGB - Check the box when using Visual Gesture Builder features. (Default uncheck)
+#
+# Example to find Kinect SDK v2::
+#
+# cmake_minimum_required( VERSION 2.8 )
+#
+# project( project )
+# add_executable( project main.cpp )
+#
+# # Find package using this module.
+# find_package( KinectSDK2 REQUIRED )
+#
+# if(KinectSDK2_FOUND)
+# # [C/C++]>[General]>[Additional Include Directories]
+# include_directories( ${KinectSDK2_INCLUDE_DIRS} )
+#
+# # [Linker]>[General]>[Additional Library Directories]
+# link_directories( ${KinectSDK2_LIBRARY_DIRS} )
+#
+# # [Linker]>[Input]>[Additional Dependencies]
+# target_link_libraries( project ${KinectSDK2_LIBRARIES} )
+#
+# # [Build Events]>[Post-Build Event]>[Command Line]
+# add_custom_command( TARGET project POST_BUILD ${KinectSDK2_COMMANDS} )
+# endif()
+#
+# =============================================================================
+#
+# Copyright (c) 2016 Tsukasa SUGIURA
+# Distributed under the MIT License.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# =============================================================================
+
+##### Utility #####
+
+# Check Directory Macro
+macro(CHECK_DIR _DIR)
+ if(NOT EXISTS "${${_DIR}}")
+ message(WARNING "Directory \"${${_DIR}}\" not found.")
+ set(KinectSDK2_FOUND FALSE)
+ unset(_DIR)
+ endif()
+endmacro()
+
+# Check Files Macro
+macro(CHECK_FILES _FILES _DIR)
+ set(_MISSING_FILES)
+ foreach(_FILE ${${_FILES}})
+ if(NOT EXISTS "${_FILE}")
+ get_filename_component(_FILE ${_FILE} NAME)
+ set(_MISSING_FILES "${_MISSING_FILES}${_FILE}, ")
+ endif()
+ endforeach()
+ if(_MISSING_FILES)
+ message(WARNING "In directory \"${${_DIR}}\" not found files: ${_MISSING_FILES}")
+ set(KinectSDK2_FOUND FALSE)
+ unset(_FILES)
+ endif()
+endmacro()
+
+# Target Platform
+set(TARGET_PLATFORM)
+if(NOT CMAKE_CL_64)
+ set(TARGET_PLATFORM x86)
+else()
+ set(TARGET_PLATFORM x64)
+endif()
+
+##### Find Kinect SDK v2 #####
+
+# Found
+set(KinectSDK2_FOUND TRUE)
+if(MSVC_VERSION LESS 1700)
+ message(WARNING "Kinect for Windows SDK v2 supported Visual Studio 2012 or later.")
+ set(KinectSDK2_FOUND FALSE)
+endif()
+
+# Options
+option(KinectSDK2_FACE "Face and HDFace features" FALSE)
+option(KinectSDK2_FUSION "Fusion features" FALSE)
+option(KinectSDK2_VGB "Visual Gesture Builder features" FALSE)
+
+# Root Directoty
+set(KinectSDK2_DIR)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_DIR $ENV{KINECTSDK20_DIR} CACHE PATH "Kinect for Windows SDK v2 Install Path." FORCE)
+ check_dir(KinectSDK2_DIR)
+endif()
+
+# Include Directories
+set(KinectSDK2_INCLUDE_DIRS)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_INCLUDE_DIRS ${KinectSDK2_DIR}/inc)
+ check_dir(KinectSDK2_INCLUDE_DIRS)
+endif()
+
+# Library Directories
+set(KinectSDK2_LIBRARY_DIRS)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_LIBRARY_DIRS ${KinectSDK2_DIR}/Lib/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_LIBRARY_DIRS)
+endif()
+
+# Dependencies
+set(KinectSDK2_LIBRARIES)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARY_DIRS}/Kinect20.lib)
+
+ if(KinectSDK2_FACE)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARIES};${KinectSDK2_LIBRARY_DIRS}/Kinect20.Face.lib)
+ endif()
+
+ if(KinectSDK2_FUSION)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARIES};${KinectSDK2_LIBRARY_DIRS}/Kinect20.Fusion.lib)
+ endif()
+
+ if(KinectSDK2_VGB)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARIES};${KinectSDK2_LIBRARY_DIRS}/Kinect20.VisualGestureBuilder.lib)
+ endif()
+
+ check_files(KinectSDK2_LIBRARIES KinectSDK2_LIBRARY_DIRS)
+endif()
+
+# Custom Commands
+set(KinectSDK2_COMMANDS)
+if(KinectSDK2_FOUND)
+ if(KinectSDK2_FACE)
+ set(KinectSDK2_REDIST_DIR ${KinectSDK2_DIR}/Redist/Face/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_REDIST_DIR)
+ list(APPEND KinectSDK2_COMMANDS COMMAND xcopy "${KinectSDK2_REDIST_DIR}" "$(OutDir)" /e /y /i /r > NUL)
+ endif()
+
+ if(KinectSDK2_FUSION)
+ set(KinectSDK2_REDIST_DIR ${KinectSDK2_DIR}/Redist/Fusion/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_REDIST_DIR)
+ list(APPEND KinectSDK2_COMMANDS COMMAND xcopy "${KinectSDK2_REDIST_DIR}" "$(OutDir)" /e /y /i /r > NUL)
+ endif()
+
+ if(KinectSDK2_VGB)
+ set(KinectSDK2_REDIST_DIR ${KinectSDK2_DIR}/Redist/VGB/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_REDIST_DIR)
+ list(APPEND KinectSDK2_COMMANDS COMMAND xcopy "${KinectSDK2_REDIST_DIR}" "$(OutDir)" /e /y /i /r > NUL)
+ endif()
+
+ # Empty Commands
+ if(NOT KinectSDK2_COMMANDS)
+ set(KinectSDK2_COMMANDS COMMAND)
+ endif()
+endif()
+
+message(STATUS "KinectSDK2_FOUND : ${KinectSDK2_FOUND}")
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/Body/app.cpp b/codes/Kinect2Sample-master/sample/Body/app.cpp
new file mode 100644
index 0000000..6f9a4ed
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/Body/app.cpp
@@ -0,0 +1,335 @@
+#include "app.h"
+#include "util.h"
+
+#include
+#include
+
+#include
+
+// Constructor
+Kinect::Kinect()
+{
+ // Initialize
+ initialize();
+}
+
+// Destructor
+Kinect::~Kinect()
+{
+ // Finalize
+ finalize();
+}
+
+// Processing
+void Kinect::run()
+{
+ // Main Loop
+ while( true ){
+ // Update Data
+ update();
+
+ // Draw Data
+ draw();
+
+ // Show Data
+ show();
+
+ // Key Check
+ const int key = cv::waitKey( 10 );
+ if( key == VK_ESCAPE ){
+ break;
+ }
+ }
+}
+
+// Initialize
+void Kinect::initialize()
+{
+ cv::setUseOptimized( true );
+
+ // Initialize Sensor
+ initializeSensor();
+
+ // Initialize Color
+ initializeColor();
+
+ // Initialize Body
+ initializeBody();
+
+ // Wait a Few Seconds until begins to Retrieve Data from Sensor ( about 2000-[ms] )
+ std::this_thread::sleep_for( std::chrono::seconds( 2 ) );
+}
+
+// Initialize Sensor
+inline void Kinect::initializeSensor()
+{
+ // Open Sensor
+ ERROR_CHECK( GetDefaultKinectSensor( &kinect ) );
+
+ ERROR_CHECK( kinect->Open() );
+
+ // Check Open
+ BOOLEAN isOpen = FALSE;
+ ERROR_CHECK( kinect->get_IsOpen( &isOpen ) );
+ if( !isOpen ){
+ throw std::runtime_error( "failed IKinectSensor::get_IsOpen( &isOpen )" );
+ }
+
+ // Retrieve Coordinate Mapper
+ ERROR_CHECK( kinect->get_CoordinateMapper( &coordinateMapper ) );
+}
+
+// Initialize Color
+inline void Kinect::initializeColor()
+{
+ // Open Color Reader
+ ComPtr colorFrameSource;
+ ERROR_CHECK( kinect->get_ColorFrameSource( &colorFrameSource ) );
+ ERROR_CHECK( colorFrameSource->OpenReader( &colorFrameReader ) );
+
+ // Retrieve Color Description
+ ComPtr colorFrameDescription;
+ ERROR_CHECK( colorFrameSource->CreateFrameDescription( ColorImageFormat::ColorImageFormat_Bgra, &colorFrameDescription ) );
+ ERROR_CHECK( colorFrameDescription->get_Width( &colorWidth ) ); // 1920
+ ERROR_CHECK( colorFrameDescription->get_Height( &colorHeight ) ); // 1080
+ ERROR_CHECK( colorFrameDescription->get_BytesPerPixel( &colorBytesPerPixel ) ); // 4
+
+ // Allocation Color Buffer
+ colorBuffer.resize( colorWidth * colorHeight * colorBytesPerPixel );
+}
+
+// Initialize Body
+inline void Kinect::initializeBody()
+{
+ // Open Body Reader
+ ComPtr bodyFrameSource;
+ ERROR_CHECK( kinect->get_BodyFrameSource( &bodyFrameSource ) );
+ ERROR_CHECK( bodyFrameSource->OpenReader( &bodyFrameReader ) );
+
+ // Initialize Body Buffer
+ Concurrency::parallel_for_each( bodies.begin(), bodies.end(), []( IBody*& body ){
+ SafeRelease( body );
+ } );
+
+ // Color Table for Visualization
+ colors[0] = cv::Vec3b( 255, 0, 0 ); // Blue
+ colors[1] = cv::Vec3b( 0, 255, 0 ); // Green
+ colors[2] = cv::Vec3b( 0, 0, 255 ); // Red
+ colors[3] = cv::Vec3b( 255, 255, 0 ); // Cyan
+ colors[4] = cv::Vec3b( 255, 0, 255 ); // Magenta
+ colors[5] = cv::Vec3b( 0, 255, 255 ); // Yellow
+}
+
+// Finalize
+void Kinect::finalize()
+{
+ cv::destroyAllWindows();
+
+ // Release Body Buffer
+ Concurrency::parallel_for_each( bodies.begin(), bodies.end(), []( IBody*& body ){
+ SafeRelease( body );
+ } );
+
+ // Close Sensor
+ if( kinect != nullptr ){
+ kinect->Close();
+ }
+}
+
+// Update Data
+void Kinect::update()
+{
+ // Update Color
+ updateColor();
+
+ // Update Body
+ updateBody();
+}
+
+// Update Color
+inline void Kinect::updateColor()
+{
+ // Retrieve Color Frame
+ ComPtr colorFrame;
+ const HRESULT ret = colorFrameReader->AcquireLatestFrame( &colorFrame );
+ if( FAILED( ret ) ){
+ return;
+ }
+
+ // Convert Format ( YUY2 -> BGRA )
+ ERROR_CHECK( colorFrame->CopyConvertedFrameDataToArray( static_cast( colorBuffer.size() ), &colorBuffer[0], ColorImageFormat::ColorImageFormat_Bgra ) );
+}
+
+// Update Body
+inline void Kinect::updateBody()
+{
+ // Retrieve Body Frame
+ ComPtr bodyFrame;
+ const HRESULT ret = bodyFrameReader->AcquireLatestFrame( &bodyFrame );
+ if( FAILED( ret ) ){
+ return;
+ }
+
+ // Release Previous Bodies
+ Concurrency::parallel_for_each( bodies.begin(), bodies.end(), []( IBody*& body ){
+ SafeRelease( body );
+ } );
+
+ // Retrieve Body Data
+ ERROR_CHECK( bodyFrame->GetAndRefreshBodyData( static_cast( bodies.size() ), &bodies[0] ) );
+}
+
+// Draw Data
+void Kinect::draw()
+{
+ // Draw Color
+ drawColor();
+
+ // Draw Body
+ drawBody();
+}
+
+// Draw Color
+inline void Kinect::drawColor()
+{
+ // Create cv::Mat from Color Buffer
+ colorMat = cv::Mat( colorHeight, colorWidth, CV_8UC4, &colorBuffer[0] );
+}
+
+// Draw Body
+inline void Kinect::drawBody()
+{
+ // Draw Body Data to Color Data
+ Concurrency::parallel_for( 0, BODY_COUNT, [&]( const int count ){
+ const ComPtr body = bodies[count];
+ if( body == nullptr ){
+ return;
+ }
+
+ // Check Body Tracked
+ BOOLEAN tracked = FALSE;
+ ERROR_CHECK( body->get_IsTracked( &tracked ) );
+ if( !tracked ){
+ return;
+ }
+
+ // Retrieve Joints
+ std::array joints;
+ ERROR_CHECK( body->GetJoints( static_cast( joints.size() ), &joints[0] ) );
+
+ Concurrency::parallel_for_each( joints.begin(), joints.end(), [&]( const Joint& joint ){
+ // Check Joint Tracked
+ if( joint.TrackingState == TrackingState::TrackingState_NotTracked ){
+ return;
+ }
+
+ // Draw Joint Position
+ drawEllipse( colorMat, joint, 5, colors[count] );
+
+ // Draw Left Hand State
+ if( joint.JointType == JointType::JointType_HandLeft ){
+ HandState handState;
+ TrackingConfidence handConfidence;
+ ERROR_CHECK( body->get_HandLeftState( &handState ) );
+ ERROR_CHECK( body->get_HandLeftConfidence( &handConfidence ) );
+
+ drawHandState( colorMat, joint, handState, handConfidence );
+ }
+
+ // Draw Right Hand State
+ if( joint.JointType == JointType::JointType_HandRight ){
+ HandState handState;
+ TrackingConfidence handConfidence;
+ ERROR_CHECK( body->get_HandRightState( &handState ) );
+ ERROR_CHECK( body->get_HandRightConfidence( &handConfidence ) );
+
+ drawHandState( colorMat, joint, handState, handConfidence );
+ }
+ } );
+
+ /*
+ // Retrieve Joint Orientations
+ std::array orientations;
+ ERROR_CHECK( body->GetJointOrientations( JointType::JointType_Count, &orientations[0] ) );
+ */
+
+ /*
+ // Retrieve Amount of Body Lean
+ PointF amount;
+ ERROR_CHECK( body->get_Lean( &amount ) );
+ */
+ } );
+}
+
+// Draw Ellipse
+inline void Kinect::drawEllipse( cv::Mat& image, const Joint& joint, const int radius, const cv::Vec3b& color, const int thickness )
+{
+ if( image.empty() ){
+ return;
+ }
+
+ // Convert Coordinate System and Draw Joint
+ ColorSpacePoint colorSpacePoint;
+ ERROR_CHECK( coordinateMapper->MapCameraPointToColorSpace( joint.Position, &colorSpacePoint ) );
+ const int x = static_cast( colorSpacePoint.X + 0.5f );
+ const int y = static_cast( colorSpacePoint.Y + 0.5f );
+ if( ( 0 <= x ) && ( x < image.cols ) && ( 0 <= y ) && ( y < image.rows ) ){
+ cv::circle( image, cv::Point( x, y ), radius, static_cast( color ), thickness, cv::LINE_AA );
+ }
+}
+
+// Draw Hand State
+inline void Kinect::drawHandState( cv::Mat& image, const Joint& joint, HandState handState, TrackingConfidence handConfidence )
+{
+ if( image.empty() ){
+ return;
+ }
+
+ // Check Tracking Confidence
+ if( handConfidence != TrackingConfidence::TrackingConfidence_High ){
+ return;
+ }
+
+ // Draw Hand State
+ const int radius = 75;
+ const cv::Vec3b blue = cv::Vec3b( 128, 0, 0 ), green = cv::Vec3b( 0, 128, 0 ), red = cv::Vec3b( 0, 0, 128 );
+ switch( handState ){
+ // Open
+ case HandState::HandState_Open:
+ drawEllipse( image, joint, radius, green, 5 );
+ break;
+ // Close
+ case HandState::HandState_Closed:
+ drawEllipse( image, joint, radius, red, 5 );
+ break;
+ // Lasso
+ case HandState::HandState_Lasso:
+ drawEllipse( image, joint, radius, blue, 5 );
+ break;
+ default:
+ break;
+ }
+}
+
+// Show Data
+void Kinect::show()
+{
+ // Show Body
+ showBody();
+}
+
+// Show Body
+inline void Kinect::showBody()
+{
+ if( colorMat.empty() ){
+ return;
+ }
+
+ // Resize Image
+ cv::Mat resizeMat;
+ const double scale = 0.5;
+ cv::resize( colorMat, resizeMat, cv::Size(), scale, scale );
+
+ // Show Image
+ cv::imshow( "Body", resizeMat );
+}
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/Body/app.h b/codes/Kinect2Sample-master/sample/Body/app.h
new file mode 100644
index 0000000..f659522
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/Body/app.h
@@ -0,0 +1,95 @@
+#ifndef __APP__
+#define __APP__
+
+#include
+#include
+#include
+
+#include
+#include
+
+#include
+using namespace Microsoft::WRL;
+
+class Kinect
+{
+private:
+ // Sensor
+ ComPtr kinect;
+
+ // Coordinate Mapper
+ ComPtr coordinateMapper;
+
+ // Reader
+ ComPtr colorFrameReader;
+ ComPtr bodyFrameReader;
+
+ // Color Buffer
+ std::vector colorBuffer;
+ int colorWidth;
+ int colorHeight;
+ unsigned int colorBytesPerPixel;
+ cv::Mat colorMat;
+
+ // Body Buffer
+ std::array bodies = { nullptr };
+ std::array colors;
+
+public:
+ // Constructor
+ Kinect();
+
+ // Destructor
+ ~Kinect();
+
+ // Processing
+ void run();
+
+private:
+ // Initialize
+ void initialize();
+
+ // Initialize Sensor
+ inline void initializeSensor();
+
+ // Initialize Color
+ inline void initializeColor();
+
+ // Initialize Body
+ inline void initializeBody();
+
+ // Finalize
+ void finalize();
+
+ // Update Data
+ void update();
+
+ // Update Color
+ inline void updateColor();
+
+ // Update Body
+ inline void updateBody();
+
+ // Draw Data
+ void draw();
+
+ // Draw Color
+ inline void drawColor();
+
+ // Draw Body
+ inline void drawBody();
+
+ // Draw Circle
+ inline void drawEllipse( cv::Mat& image, const Joint& joint, const int radius, const cv::Vec3b& color, const int thickness = -1 );
+
+ // Draw Hand State
+ inline void drawHandState( cv::Mat& image, const Joint& joint, HandState handState, TrackingConfidence handConfidence );
+
+ // Show Data
+ void show();
+
+ // Show Body
+ inline void showBody();
+};
+
+#endif // __APP__
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/Body/main.cpp b/codes/Kinect2Sample-master/sample/Body/main.cpp
new file mode 100644
index 0000000..d88643c
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/Body/main.cpp
@@ -0,0 +1,16 @@
+#include
+#include
+
+#include "app.h"
+
+int main( int argc, char* argv[] )
+{
+ try{
+ Kinect kinect;
+ kinect.run();
+ } catch( std::exception& ex ){
+ std::cout << ex.what() << std::endl;
+ }
+
+ return 0;
+}
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/Body/util.h b/codes/Kinect2Sample-master/sample/Body/util.h
new file mode 100644
index 0000000..0d9787f
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/Body/util.h
@@ -0,0 +1,37 @@
+#ifndef __UTIL__
+#define __UTIL__
+
+#include
+#include
+
+// Error Check Macro
+#define ERROR_CHECK( ret ) \
+ if( FAILED( ret ) ){ \
+ std::stringstream ss; \
+ ss << "failed " #ret " " << std::hex << ret << std::endl; \
+ throw std::runtime_error( ss.str().c_str() ); \
+ }
+
+// Safe Release
+template
+inline void SafeRelease( T*& rel )
+{
+ if( rel != NULL ){
+ rel->Release();
+ rel = NULL;
+ }
+}
+
+// C++ Style Line Types For OpenCV 2.x
+#if ( CV_MAJOR_VERSION < 3 )
+namespace cv{
+ enum LineTypes{
+ FILLED = -1,
+ LINE_4 = 4,
+ LINE_8 = 8,
+ LINE_AA = 16
+ };
+}
+#endif
+
+#endif // __UTIL__
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/BodyIndex/CMakeLists.txt b/codes/Kinect2Sample-master/sample/BodyIndex/CMakeLists.txt
new file mode 100644
index 0000000..89ffd22
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/BodyIndex/CMakeLists.txt
@@ -0,0 +1,43 @@
+cmake_minimum_required( VERSION 3.6 )
+
+# Create Project
+project( Sample )
+add_executable( BodyIndex app.h app.cpp main.cpp util.h )
+
+# Set StartUp Project
+set_property( DIRECTORY PROPERTY VS_STARTUP_PROJECT "BodyIndex" )
+
+# Find Package
+set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}" ${CMAKE_MODULE_PATH} )
+find_package( KinectSDK2 REQUIRED )
+
+set( OpenCV_DIR "C:/Program Files/opencv/build" )
+option( OpenCV_STATIC OFF )
+find_package( OpenCV REQUIRED )
+
+# Set Static Link Runtime Library
+if( OpenCV_STATIC )
+ foreach( flag_var
+ CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
+ CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
+ CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
+ CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO )
+ if( ${flag_var} MATCHES "/MD" )
+ string( REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}" )
+ endif()
+ endforeach()
+endif()
+
+if( KinectSDK2_FOUND AND OpenCV_FOUND )
+ # Additional Include Directories
+ include_directories( ${KinectSDK2_INCLUDE_DIRS} )
+ include_directories( ${OpenCV_INCLUDE_DIRS} )
+
+ # Additional Library Directories
+ link_directories( ${KinectSDK2_LIBRARY_DIRS} )
+ link_directories( ${OpenCV_LIB_DIR} )
+
+ # Additional Dependencies
+ target_link_libraries( BodyIndex ${KinectSDK2_LIBRARIES} )
+ target_link_libraries( BodyIndex ${OpenCV_LIBS} )
+endif()
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/BodyIndex/FindKinectSDK2.cmake b/codes/Kinect2Sample-master/sample/BodyIndex/FindKinectSDK2.cmake
new file mode 100644
index 0000000..00a2036
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/BodyIndex/FindKinectSDK2.cmake
@@ -0,0 +1,182 @@
+#.rst:
+# FindKinectSDK2
+# --------------
+#
+# Find Kinect for Windows SDK v2 (Kinect SDK v2) include dirs, library dirs, libraries and post-build commands
+#
+# Use this module by invoking find_package with the form::
+#
+# find_package( KinectSDK2 [REQUIRED] )
+#
+# Results for users are reported in following variables::
+#
+# KinectSDK2_FOUND - Return "TRUE" when Kinect SDK v2 found. Otherwise, Return "FALSE".
+# KinectSDK2_INCLUDE_DIRS - Kinect SDK v2 include directories. (${KinectSDK2_DIR}/inc)
+# KinectSDK2_LIBRARY_DIRS - Kinect SDK v2 library directories. (${KinectSDK2_DIR}/Lib/x86 or ${KinectSDK2_DIR}/Lib/x64)
+# KinectSDK2_LIBRARIES - Kinect SDK v2 library files. (${KinectSDK2_LIBRARY_DIRS}/Kinect20.lib (If check the box of any application festures, corresponding library will be added.))
+# KinectSDK2_COMMANDS - Copy commands of redist files for application functions of Kinect SDK v2. (If uncheck the box of all application features, this variable has defined empty command.)
+#
+# This module reads hints about search locations from following environment variables::
+#
+# KINECTSDK20_DIR - Kinect SDK v2 root directory. (This environment variable has been set by installer of Kinect SDK v2.)
+#
+# CMake entries::
+#
+# KinectSDK2_DIR - Kinect SDK v2 root directory. (Default $ENV{KINECTSDK20_DIR})
+# KinectSDK2_FACE - Check the box when using Face or HDFace features. (Default uncheck)
+# KinectSDK2_FUSION - Check the box when using Fusion features. (Default uncheck)
+# KinectSDK2_VGB - Check the box when using Visual Gesture Builder features. (Default uncheck)
+#
+# Example to find Kinect SDK v2::
+#
+# cmake_minimum_required( VERSION 2.8 )
+#
+# project( project )
+# add_executable( project main.cpp )
+#
+# # Find package using this module.
+# find_package( KinectSDK2 REQUIRED )
+#
+# if(KinectSDK2_FOUND)
+# # [C/C++]>[General]>[Additional Include Directories]
+# include_directories( ${KinectSDK2_INCLUDE_DIRS} )
+#
+# # [Linker]>[General]>[Additional Library Directories]
+# link_directories( ${KinectSDK2_LIBRARY_DIRS} )
+#
+# # [Linker]>[Input]>[Additional Dependencies]
+# target_link_libraries( project ${KinectSDK2_LIBRARIES} )
+#
+# # [Build Events]>[Post-Build Event]>[Command Line]
+# add_custom_command( TARGET project POST_BUILD ${KinectSDK2_COMMANDS} )
+# endif()
+#
+# =============================================================================
+#
+# Copyright (c) 2016 Tsukasa SUGIURA
+# Distributed under the MIT License.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# =============================================================================
+
+##### Utility #####
+
+# Check Directory Macro
+macro(CHECK_DIR _DIR)
+ if(NOT EXISTS "${${_DIR}}")
+ message(WARNING "Directory \"${${_DIR}}\" not found.")
+ set(KinectSDK2_FOUND FALSE)
+ unset(_DIR)
+ endif()
+endmacro()
+
+# Check Files Macro
+macro(CHECK_FILES _FILES _DIR)
+ set(_MISSING_FILES)
+ foreach(_FILE ${${_FILES}})
+ if(NOT EXISTS "${_FILE}")
+ get_filename_component(_FILE ${_FILE} NAME)
+ set(_MISSING_FILES "${_MISSING_FILES}${_FILE}, ")
+ endif()
+ endforeach()
+ if(_MISSING_FILES)
+ message(WARNING "In directory \"${${_DIR}}\" not found files: ${_MISSING_FILES}")
+ set(KinectSDK2_FOUND FALSE)
+ unset(_FILES)
+ endif()
+endmacro()
+
+# Target Platform
+set(TARGET_PLATFORM)
+if(NOT CMAKE_CL_64)
+ set(TARGET_PLATFORM x86)
+else()
+ set(TARGET_PLATFORM x64)
+endif()
+
+##### Find Kinect SDK v2 #####
+
+# Found
+set(KinectSDK2_FOUND TRUE)
+if(MSVC_VERSION LESS 1700)
+ message(WARNING "Kinect for Windows SDK v2 supported Visual Studio 2012 or later.")
+ set(KinectSDK2_FOUND FALSE)
+endif()
+
+# Options
+option(KinectSDK2_FACE "Face and HDFace features" FALSE)
+option(KinectSDK2_FUSION "Fusion features" FALSE)
+option(KinectSDK2_VGB "Visual Gesture Builder features" FALSE)
+
+# Root Directoty
+set(KinectSDK2_DIR)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_DIR $ENV{KINECTSDK20_DIR} CACHE PATH "Kinect for Windows SDK v2 Install Path." FORCE)
+ check_dir(KinectSDK2_DIR)
+endif()
+
+# Include Directories
+set(KinectSDK2_INCLUDE_DIRS)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_INCLUDE_DIRS ${KinectSDK2_DIR}/inc)
+ check_dir(KinectSDK2_INCLUDE_DIRS)
+endif()
+
+# Library Directories
+set(KinectSDK2_LIBRARY_DIRS)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_LIBRARY_DIRS ${KinectSDK2_DIR}/Lib/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_LIBRARY_DIRS)
+endif()
+
+# Dependencies
+set(KinectSDK2_LIBRARIES)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARY_DIRS}/Kinect20.lib)
+
+ if(KinectSDK2_FACE)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARIES};${KinectSDK2_LIBRARY_DIRS}/Kinect20.Face.lib)
+ endif()
+
+ if(KinectSDK2_FUSION)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARIES};${KinectSDK2_LIBRARY_DIRS}/Kinect20.Fusion.lib)
+ endif()
+
+ if(KinectSDK2_VGB)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARIES};${KinectSDK2_LIBRARY_DIRS}/Kinect20.VisualGestureBuilder.lib)
+ endif()
+
+ check_files(KinectSDK2_LIBRARIES KinectSDK2_LIBRARY_DIRS)
+endif()
+
+# Custom Commands
+set(KinectSDK2_COMMANDS)
+if(KinectSDK2_FOUND)
+ if(KinectSDK2_FACE)
+ set(KinectSDK2_REDIST_DIR ${KinectSDK2_DIR}/Redist/Face/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_REDIST_DIR)
+ list(APPEND KinectSDK2_COMMANDS COMMAND xcopy "${KinectSDK2_REDIST_DIR}" "$(OutDir)" /e /y /i /r > NUL)
+ endif()
+
+ if(KinectSDK2_FUSION)
+ set(KinectSDK2_REDIST_DIR ${KinectSDK2_DIR}/Redist/Fusion/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_REDIST_DIR)
+ list(APPEND KinectSDK2_COMMANDS COMMAND xcopy "${KinectSDK2_REDIST_DIR}" "$(OutDir)" /e /y /i /r > NUL)
+ endif()
+
+ if(KinectSDK2_VGB)
+ set(KinectSDK2_REDIST_DIR ${KinectSDK2_DIR}/Redist/VGB/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_REDIST_DIR)
+ list(APPEND KinectSDK2_COMMANDS COMMAND xcopy "${KinectSDK2_REDIST_DIR}" "$(OutDir)" /e /y /i /r > NUL)
+ endif()
+
+ # Empty Commands
+ if(NOT KinectSDK2_COMMANDS)
+ set(KinectSDK2_COMMANDS COMMAND)
+ endif()
+endif()
+
+message(STATUS "KinectSDK2_FOUND : ${KinectSDK2_FOUND}")
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/BodyIndex/app.cpp b/codes/Kinect2Sample-master/sample/BodyIndex/app.cpp
new file mode 100644
index 0000000..41b81cd
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/BodyIndex/app.cpp
@@ -0,0 +1,165 @@
+#include "app.h"
+#include "util.h"
+
+#include
+#include
+
+// Constructor
+Kinect::Kinect()
+{
+ // Initialize
+ initialize();
+}
+
+// Destructor
+Kinect::~Kinect()
+{
+ // Finalize
+ finalize();
+}
+
+// Processing
+void Kinect::run()
+{
+ // Main Loop
+ while( true ){
+ // Update Data
+ update();
+
+ // Draw Data
+ draw();
+
+ // Show Data
+ show();
+
+ // Key Check
+ const int key = cv::waitKey( 10 );
+ if( key == VK_ESCAPE ){
+ break;
+ }
+ }
+}
+
+// Initialize
+void Kinect::initialize()
+{
+ cv::setUseOptimized( true );
+
+ // Initialize Sensor
+ initializeSensor();
+
+ // Initialize BodyIndex
+ initializeBodyIndex();
+
+ // Wait a Few Seconds until begins to Retrieve Data from Sensor ( about 2000-[ms] )
+ std::this_thread::sleep_for( std::chrono::seconds( 2 ) );
+}
+
+// Initialize Sensor
+inline void Kinect::initializeSensor()
+{
+ // Open Sensor
+ ERROR_CHECK( GetDefaultKinectSensor( &kinect ) );
+
+ ERROR_CHECK( kinect->Open() );
+
+ // Check Open
+ BOOLEAN isOpen = FALSE;
+ ERROR_CHECK( kinect->get_IsOpen( &isOpen ) );
+ if( !isOpen ){
+ throw std::runtime_error( "failed IKinectSensor::get_IsOpen( &isOpen )" );
+ }
+}
+
+// Initialize BodyIndex
+inline void Kinect::initializeBodyIndex()
+{
+ // Open BodyIndex Reader
+ ComPtr bodyIndexFrameSource;
+ ERROR_CHECK( kinect->get_BodyIndexFrameSource( &bodyIndexFrameSource ) );
+ ERROR_CHECK( bodyIndexFrameSource->OpenReader( &bodyIndexFrameReader ) );
+
+ // Retrieve BodyIndex Description
+ ComPtr bodyIndexFrameDescription;
+ ERROR_CHECK( bodyIndexFrameSource->get_FrameDescription( &bodyIndexFrameDescription ) );
+ ERROR_CHECK( bodyIndexFrameDescription->get_Width( &bodyIndexWidth ) ); // 512
+ ERROR_CHECK( bodyIndexFrameDescription->get_Height( &bodyIndexHeight ) ); // 424
+ ERROR_CHECK( bodyIndexFrameDescription->get_BytesPerPixel( &bodyIndexBytesPerPixel ) ); // 1
+
+ // Allocation BodyIndex Buffer
+ bodyIndexBuffer.resize( bodyIndexWidth * bodyIndexHeight );
+
+ // Color Table for Visualization
+ colors[0] = cv::Vec3b( 255, 0, 0 ); // Blue
+ colors[1] = cv::Vec3b( 0, 255, 0 ); // Green
+ colors[2] = cv::Vec3b( 0, 0, 255 ); // Red
+ colors[3] = cv::Vec3b( 255, 255, 0 ); // Cyan
+ colors[4] = cv::Vec3b( 255, 0, 255 ); // Magenta
+ colors[5] = cv::Vec3b( 0, 255, 255 ); // Yellow
+}
+
+// Finalize
+void Kinect::finalize()
+{
+ cv::destroyAllWindows();
+
+ // Close Sensor
+ if( kinect != nullptr ){
+ kinect->Close();
+ }
+}
+
+// Update Data
+void Kinect::update()
+{
+ // Update BodyIndex
+ updateBodyIndex();
+}
+
+// Update BodyIndex
+inline void Kinect::updateBodyIndex()
+{
+ // Retrieve BodyIndex Frame
+ ComPtr bodyIndexFrame;
+ const HRESULT ret = bodyIndexFrameReader->AcquireLatestFrame( &bodyIndexFrame );
+ if( FAILED( ret ) ){
+ return;
+ }
+
+ // Retrieve BodyIndex Data
+ ERROR_CHECK( bodyIndexFrame->CopyFrameDataToArray( static_cast( bodyIndexBuffer.size() ), &bodyIndexBuffer[0] ) );
+}
+
+// Draw Data
+void Kinect::draw()
+{
+ // Draw BodyIndex
+ drawBodyIndex();
+}
+
+// Draw BodyIndex
+inline void Kinect::drawBodyIndex()
+{
+ // Visualization Color to Each Index
+ bodyIndexMat = cv::Mat::zeros( bodyIndexHeight, bodyIndexWidth, CV_8UC3 );
+ bodyIndexMat.forEach( [&]( cv::Vec3b &p, const int* position ){
+ uchar index = bodyIndexBuffer[position[0] * bodyIndexWidth + position[1]];
+ if( index != 0xff ){
+ p = colors[index];
+ }
+ } );
+}
+
+// Show Data
+void Kinect::show()
+{
+ // Show BodyIndex
+ showBodyIndex();
+}
+
+// Show BodyIndex
+inline void Kinect::showBodyIndex()
+{
+ // Show Image
+ cv::imshow( "BodyIndex", bodyIndexMat );
+}
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/BodyIndex/app.h b/codes/Kinect2Sample-master/sample/BodyIndex/app.h
new file mode 100644
index 0000000..5a5bf2d
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/BodyIndex/app.h
@@ -0,0 +1,74 @@
+#ifndef __APP__
+#define __APP__
+
+#include
+#include
+#include
+
+#include
+
+#include
+using namespace Microsoft::WRL;
+
+#include
+
+class Kinect
+{
+private:
+ // Sensor
+ ComPtr kinect;
+
+ // Reader
+ ComPtr bodyIndexFrameReader;
+
+ // BodyIndex Buffer
+ std::vector bodyIndexBuffer;
+ int bodyIndexWidth;
+ int bodyIndexHeight;
+ unsigned int bodyIndexBytesPerPixel;
+ cv::Mat bodyIndexMat;
+ std::array colors;
+
+public:
+ // Constructor
+ Kinect();
+
+ // Destructor
+ ~Kinect();
+
+ // Processing
+ void run();
+
+private:
+ // Initialize
+ void initialize();
+
+ // Initialize Sensor
+ inline void initializeSensor();
+
+ // Initialize BodyIndex
+ inline void initializeBodyIndex();
+
+ // Finalize
+ void finalize();
+
+ // Update Data
+ void update();
+
+ // Update BodyIndex
+ inline void updateBodyIndex();
+
+ // Draw Data
+ void draw();
+
+ // Draw BodyIndex
+ inline void drawBodyIndex();
+
+ // Show Data
+ void show();
+
+ // Show BodyIndex
+ inline void showBodyIndex();
+};
+
+#endif // __APP__
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/BodyIndex/main.cpp b/codes/Kinect2Sample-master/sample/BodyIndex/main.cpp
new file mode 100644
index 0000000..d88643c
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/BodyIndex/main.cpp
@@ -0,0 +1,16 @@
+#include
+#include
+
+#include "app.h"
+
+int main( int argc, char* argv[] )
+{
+ try{
+ Kinect kinect;
+ kinect.run();
+ } catch( std::exception& ex ){
+ std::cout << ex.what() << std::endl;
+ }
+
+ return 0;
+}
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/BodyIndex/util.h b/codes/Kinect2Sample-master/sample/BodyIndex/util.h
new file mode 100644
index 0000000..0d9787f
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/BodyIndex/util.h
@@ -0,0 +1,37 @@
+#ifndef __UTIL__
+#define __UTIL__
+
+#include
+#include
+
+// Error Check Macro
+#define ERROR_CHECK( ret ) \
+ if( FAILED( ret ) ){ \
+ std::stringstream ss; \
+ ss << "failed " #ret " " << std::hex << ret << std::endl; \
+ throw std::runtime_error( ss.str().c_str() ); \
+ }
+
+// Safe Release
+template
+inline void SafeRelease( T*& rel )
+{
+ if( rel != NULL ){
+ rel->Release();
+ rel = NULL;
+ }
+}
+
+// C++ Style Line Types For OpenCV 2.x
+#if ( CV_MAJOR_VERSION < 3 )
+namespace cv{
+ enum LineTypes{
+ FILLED = -1,
+ LINE_4 = 4,
+ LINE_8 = 8,
+ LINE_AA = 16
+ };
+}
+#endif
+
+#endif // __UTIL__
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/CMakeLists.txt b/codes/Kinect2Sample-master/sample/CMakeLists.txt
new file mode 100644
index 0000000..20bd161
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/CMakeLists.txt
@@ -0,0 +1,32 @@
+cmake_minimum_required( VERSION 3.6 )
+
+# Create Project
+project( Sample )
+
+# Set Binary Output Directory
+set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
+
+# Sample Sub-Directories Name
+set( SAMPLES Color Depth Infrared BodyIndex Body JointSmooth MultiSource CoordinateMapper Face HDFace Fusion Gesture Speech AudioBeam AudioBody ChromaKey FaceClip )
+
+# Sample Build Option
+foreach( SAMPLE ${SAMPLES} )
+ option( BUILD_${SAMPLE} "Build ${SAMPLE} Sample Project" ON )
+endforeach()
+
+# Sample Add Sub-Directories
+foreach( SAMPLE ${SAMPLES} )
+ if( BUILD_${SAMPLE} )
+ add_subdirectory( ${SAMPLE} )
+ endif()
+endforeach()
+
+# Adjust ( Copy Run-Time Files )
+if( BUILD_Speech )
+ file( COPY ${CMAKE_SOURCE_DIR}/Speech/Grammar_enUS.grxml DESTINATION ${CMAKE_BINARY_DIR}/bin )
+ file( COPY ${CMAKE_SOURCE_DIR}/Speech/Grammar_jaJP.grxml DESTINATION ${CMAKE_BINARY_DIR}/bin )
+endif()
+
+if( BUILD_Gesture )
+ file( COPY ${CMAKE_SOURCE_DIR}/Gesture/SampleDatabase.gbd DESTINATION ${CMAKE_BINARY_DIR}/bin )
+endif()
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/ChromaKey/CMakeLists.txt b/codes/Kinect2Sample-master/sample/ChromaKey/CMakeLists.txt
new file mode 100644
index 0000000..fbbe3a0
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/ChromaKey/CMakeLists.txt
@@ -0,0 +1,43 @@
+cmake_minimum_required( VERSION 3.6 )
+
+# Create Project
+project( Sample )
+add_executable( ChromaKey app.h app.cpp main.cpp util.h )
+
+# Set StartUp Project
+set_property( DIRECTORY PROPERTY VS_STARTUP_PROJECT "ChromaKey" )
+
+# Find Package
+set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}" ${CMAKE_MODULE_PATH} )
+find_package( KinectSDK2 REQUIRED )
+
+set( OpenCV_DIR "C:/Program Files/opencv/build" )
+option( OpenCV_STATIC OFF )
+find_package( OpenCV REQUIRED )
+
+# Set Static Link Runtime Library
+if( OpenCV_STATIC )
+ foreach( flag_var
+ CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
+ CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
+ CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
+ CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO )
+ if( ${flag_var} MATCHES "/MD" )
+ string( REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}" )
+ endif()
+ endforeach()
+endif()
+
+if( KinectSDK2_FOUND AND OpenCV_FOUND )
+ # Additional Include Directories
+ include_directories( ${KinectSDK2_INCLUDE_DIRS} )
+ include_directories( ${OpenCV_INCLUDE_DIRS} )
+
+ # Additional Library Directories
+ link_directories( ${KinectSDK2_LIBRARY_DIRS} )
+ link_directories( ${OpenCV_LIB_DIR} )
+
+ # Additional Dependencies
+ target_link_libraries( ChromaKey ${KinectSDK2_LIBRARIES} )
+ target_link_libraries( ChromaKey ${OpenCV_LIBS} )
+endif()
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/ChromaKey/FindKinectSDK2.cmake b/codes/Kinect2Sample-master/sample/ChromaKey/FindKinectSDK2.cmake
new file mode 100644
index 0000000..00a2036
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/ChromaKey/FindKinectSDK2.cmake
@@ -0,0 +1,182 @@
+#.rst:
+# FindKinectSDK2
+# --------------
+#
+# Find Kinect for Windows SDK v2 (Kinect SDK v2) include dirs, library dirs, libraries and post-build commands
+#
+# Use this module by invoking find_package with the form::
+#
+# find_package( KinectSDK2 [REQUIRED] )
+#
+# Results for users are reported in following variables::
+#
+# KinectSDK2_FOUND - Return "TRUE" when Kinect SDK v2 found. Otherwise, Return "FALSE".
+# KinectSDK2_INCLUDE_DIRS - Kinect SDK v2 include directories. (${KinectSDK2_DIR}/inc)
+# KinectSDK2_LIBRARY_DIRS - Kinect SDK v2 library directories. (${KinectSDK2_DIR}/Lib/x86 or ${KinectSDK2_DIR}/Lib/x64)
+# KinectSDK2_LIBRARIES - Kinect SDK v2 library files. (${KinectSDK2_LIBRARY_DIRS}/Kinect20.lib (If check the box of any application festures, corresponding library will be added.))
+# KinectSDK2_COMMANDS - Copy commands of redist files for application functions of Kinect SDK v2. (If uncheck the box of all application features, this variable has defined empty command.)
+#
+# This module reads hints about search locations from following environment variables::
+#
+# KINECTSDK20_DIR - Kinect SDK v2 root directory. (This environment variable has been set by installer of Kinect SDK v2.)
+#
+# CMake entries::
+#
+# KinectSDK2_DIR - Kinect SDK v2 root directory. (Default $ENV{KINECTSDK20_DIR})
+# KinectSDK2_FACE - Check the box when using Face or HDFace features. (Default uncheck)
+# KinectSDK2_FUSION - Check the box when using Fusion features. (Default uncheck)
+# KinectSDK2_VGB - Check the box when using Visual Gesture Builder features. (Default uncheck)
+#
+# Example to find Kinect SDK v2::
+#
+# cmake_minimum_required( VERSION 2.8 )
+#
+# project( project )
+# add_executable( project main.cpp )
+#
+# # Find package using this module.
+# find_package( KinectSDK2 REQUIRED )
+#
+# if(KinectSDK2_FOUND)
+# # [C/C++]>[General]>[Additional Include Directories]
+# include_directories( ${KinectSDK2_INCLUDE_DIRS} )
+#
+# # [Linker]>[General]>[Additional Library Directories]
+# link_directories( ${KinectSDK2_LIBRARY_DIRS} )
+#
+# # [Linker]>[Input]>[Additional Dependencies]
+# target_link_libraries( project ${KinectSDK2_LIBRARIES} )
+#
+# # [Build Events]>[Post-Build Event]>[Command Line]
+# add_custom_command( TARGET project POST_BUILD ${KinectSDK2_COMMANDS} )
+# endif()
+#
+# =============================================================================
+#
+# Copyright (c) 2016 Tsukasa SUGIURA
+# Distributed under the MIT License.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# =============================================================================
+
+##### Utility #####
+
+# Check Directory Macro
+macro(CHECK_DIR _DIR)
+ if(NOT EXISTS "${${_DIR}}")
+ message(WARNING "Directory \"${${_DIR}}\" not found.")
+ set(KinectSDK2_FOUND FALSE)
+ unset(_DIR)
+ endif()
+endmacro()
+
+# Check Files Macro
+macro(CHECK_FILES _FILES _DIR)
+ set(_MISSING_FILES)
+ foreach(_FILE ${${_FILES}})
+ if(NOT EXISTS "${_FILE}")
+ get_filename_component(_FILE ${_FILE} NAME)
+ set(_MISSING_FILES "${_MISSING_FILES}${_FILE}, ")
+ endif()
+ endforeach()
+ if(_MISSING_FILES)
+ message(WARNING "In directory \"${${_DIR}}\" not found files: ${_MISSING_FILES}")
+ set(KinectSDK2_FOUND FALSE)
+ unset(_FILES)
+ endif()
+endmacro()
+
+# Target Platform
+set(TARGET_PLATFORM)
+if(NOT CMAKE_CL_64)
+ set(TARGET_PLATFORM x86)
+else()
+ set(TARGET_PLATFORM x64)
+endif()
+
+##### Find Kinect SDK v2 #####
+
+# Found
+set(KinectSDK2_FOUND TRUE)
+if(MSVC_VERSION LESS 1700)
+ message(WARNING "Kinect for Windows SDK v2 supported Visual Studio 2012 or later.")
+ set(KinectSDK2_FOUND FALSE)
+endif()
+
+# Options
+option(KinectSDK2_FACE "Face and HDFace features" FALSE)
+option(KinectSDK2_FUSION "Fusion features" FALSE)
+option(KinectSDK2_VGB "Visual Gesture Builder features" FALSE)
+
+# Root Directoty
+set(KinectSDK2_DIR)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_DIR $ENV{KINECTSDK20_DIR} CACHE PATH "Kinect for Windows SDK v2 Install Path." FORCE)
+ check_dir(KinectSDK2_DIR)
+endif()
+
+# Include Directories
+set(KinectSDK2_INCLUDE_DIRS)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_INCLUDE_DIRS ${KinectSDK2_DIR}/inc)
+ check_dir(KinectSDK2_INCLUDE_DIRS)
+endif()
+
+# Library Directories
+set(KinectSDK2_LIBRARY_DIRS)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_LIBRARY_DIRS ${KinectSDK2_DIR}/Lib/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_LIBRARY_DIRS)
+endif()
+
+# Dependencies
+set(KinectSDK2_LIBRARIES)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARY_DIRS}/Kinect20.lib)
+
+ if(KinectSDK2_FACE)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARIES};${KinectSDK2_LIBRARY_DIRS}/Kinect20.Face.lib)
+ endif()
+
+ if(KinectSDK2_FUSION)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARIES};${KinectSDK2_LIBRARY_DIRS}/Kinect20.Fusion.lib)
+ endif()
+
+ if(KinectSDK2_VGB)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARIES};${KinectSDK2_LIBRARY_DIRS}/Kinect20.VisualGestureBuilder.lib)
+ endif()
+
+ check_files(KinectSDK2_LIBRARIES KinectSDK2_LIBRARY_DIRS)
+endif()
+
+# Custom Commands
+set(KinectSDK2_COMMANDS)
+if(KinectSDK2_FOUND)
+ if(KinectSDK2_FACE)
+ set(KinectSDK2_REDIST_DIR ${KinectSDK2_DIR}/Redist/Face/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_REDIST_DIR)
+ list(APPEND KinectSDK2_COMMANDS COMMAND xcopy "${KinectSDK2_REDIST_DIR}" "$(OutDir)" /e /y /i /r > NUL)
+ endif()
+
+ if(KinectSDK2_FUSION)
+ set(KinectSDK2_REDIST_DIR ${KinectSDK2_DIR}/Redist/Fusion/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_REDIST_DIR)
+ list(APPEND KinectSDK2_COMMANDS COMMAND xcopy "${KinectSDK2_REDIST_DIR}" "$(OutDir)" /e /y /i /r > NUL)
+ endif()
+
+ if(KinectSDK2_VGB)
+ set(KinectSDK2_REDIST_DIR ${KinectSDK2_DIR}/Redist/VGB/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_REDIST_DIR)
+ list(APPEND KinectSDK2_COMMANDS COMMAND xcopy "${KinectSDK2_REDIST_DIR}" "$(OutDir)" /e /y /i /r > NUL)
+ endif()
+
+ # Empty Commands
+ if(NOT KinectSDK2_COMMANDS)
+ set(KinectSDK2_COMMANDS COMMAND)
+ endif()
+endif()
+
+message(STATUS "KinectSDK2_FOUND : ${KinectSDK2_FOUND}")
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/ChromaKey/app.cpp b/codes/Kinect2Sample-master/sample/ChromaKey/app.cpp
new file mode 100644
index 0000000..fadd399
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/ChromaKey/app.cpp
@@ -0,0 +1,351 @@
+#include "app.h"
+#include "util.h"
+
+#include
+#include
+
+#include
+
+// Choose Resolution
+#define COLOR
+//#define DEPTH
+
+// Constructor
+Kinect::Kinect()
+{
+ // Initialize
+ initialize();
+}
+
+// Destructor
+Kinect::~Kinect()
+{
+ // Finalize
+ finalize();
+}
+
+// Processing
+void Kinect::run()
+{
+ // Main Loop
+ while( true ){
+ // Update Data
+ update();
+
+ // Draw Data
+ draw();
+
+ // Show Data
+ show();
+
+ // Key Check
+ const int key = cv::waitKey( 10 );
+ if( key == VK_ESCAPE ){
+ break;
+ }
+ }
+}
+
+// Initialize
+void Kinect::initialize()
+{
+ cv::setUseOptimized( true );
+
+ // Initialize Sensor
+ initializeSensor();
+
+ // Initialize Color
+ initializeColor();
+
+ // Initialize Depth
+ initializeDepth();
+
+ // Initialize BodyIndex
+ initializeBodyIndex();
+
+ // Wait a Few Seconds until begins to Retrieve Data from Sensor ( about 2000-[ms] )
+ std::this_thread::sleep_for( std::chrono::seconds( 2 ) );
+}
+
+// Initialize Sensor
+inline void Kinect::initializeSensor()
+{
+ // Open Sensor
+ ERROR_CHECK( GetDefaultKinectSensor( &kinect ) );
+
+ ERROR_CHECK( kinect->Open() );
+
+ // Check Open
+ BOOLEAN isOpen = FALSE;
+ ERROR_CHECK( kinect->get_IsOpen( &isOpen ) );
+ if( !isOpen ){
+ throw std::runtime_error( "failed IKinectSensor::get_IsOpen( &isOpen )" );
+ }
+
+ // Retrieve Coordinate Mapper
+ ERROR_CHECK( kinect->get_CoordinateMapper( &coordinateMapper ) );
+}
+
+// Initialize Color
+inline void Kinect::initializeColor()
+{
+ // Open Color Reader
+ ComPtr colorFrameSource;
+ ERROR_CHECK( kinect->get_ColorFrameSource( &colorFrameSource ) );
+ ERROR_CHECK( colorFrameSource->OpenReader( &colorFrameReader ) );
+
+ // Retrieve Color Description
+ ComPtr colorFrameDescription;
+ ERROR_CHECK( colorFrameSource->CreateFrameDescription( ColorImageFormat::ColorImageFormat_Bgra, &colorFrameDescription ) );
+ ERROR_CHECK( colorFrameDescription->get_Width( &colorWidth ) ); // 1920
+ ERROR_CHECK( colorFrameDescription->get_Height( &colorHeight ) ); // 1080
+ ERROR_CHECK( colorFrameDescription->get_BytesPerPixel( &colorBytesPerPixel ) ); // 4
+
+ // Allocation Color Buffer
+ colorBuffer.resize( colorWidth * colorHeight * colorBytesPerPixel );
+}
+
+// Initialize Depth
+inline void Kinect::initializeDepth()
+{
+ // Open Depth Reader
+ ComPtr depthFrameSource;
+ ERROR_CHECK( kinect->get_DepthFrameSource( &depthFrameSource ) );
+ ERROR_CHECK( depthFrameSource->OpenReader( &depthFrameReader ) );
+
+ // Retrieve Depth Description
+ ComPtr depthFrameDescription;
+ ERROR_CHECK( depthFrameSource->get_FrameDescription( &depthFrameDescription ) );
+ ERROR_CHECK( depthFrameDescription->get_Width( &depthWidth ) ); // 512
+ ERROR_CHECK( depthFrameDescription->get_Height( &depthHeight ) ); // 424
+ ERROR_CHECK( depthFrameDescription->get_BytesPerPixel( &depthBytesPerPixel ) ); // 2
+
+ // Allocation Depth Buffer
+ depthBuffer.resize( depthWidth * depthHeight );
+}
+
+// Initialize BodyIndex
+inline void Kinect::initializeBodyIndex()
+{
+ // Open BodyIndex Reader
+ ComPtr bodyIndexFrameSource;
+ ERROR_CHECK( kinect->get_BodyIndexFrameSource( &bodyIndexFrameSource ) );
+ ERROR_CHECK( bodyIndexFrameSource->OpenReader( &bodyIndexFrameReader ) );
+
+ // Retrieve BodyIndex Description
+ ComPtr bodyIndexFrameDescription;
+ ERROR_CHECK( bodyIndexFrameSource->get_FrameDescription( &bodyIndexFrameDescription ) );
+ ERROR_CHECK( bodyIndexFrameDescription->get_Width( &bodyIndexWidth ) ); // 512
+ ERROR_CHECK( bodyIndexFrameDescription->get_Height( &bodyIndexHeight ) ); // 424
+ ERROR_CHECK( bodyIndexFrameDescription->get_BytesPerPixel( &bodyIndexBytesPerPixel ) ); // 1
+
+ // Allocation BodyIndex Buffer
+ bodyIndexBuffer.resize( bodyIndexWidth * bodyIndexHeight );
+}
+
+// Finalize
+void Kinect::finalize()
+{
+ cv::destroyAllWindows();
+
+ // Close Sensor
+ if( kinect != nullptr ){
+ kinect->Close();
+ }
+}
+
+// Update Data
+void Kinect::update()
+{
+ // Update Color
+ updateColor();
+
+ // Update Depth
+ updateDepth();
+
+ // Update BodyIndex
+ updateBodyIndex();
+}
+
+// Update Color
+inline void Kinect::updateColor()
+{
+ // Retrieve Color Frame
+ ComPtr colorFrame;
+ const HRESULT ret = colorFrameReader->AcquireLatestFrame( &colorFrame );
+ if( FAILED( ret ) ){
+ return;
+ }
+
+ // Convert Format ( YUY2 -> BGRA )
+ ERROR_CHECK( colorFrame->CopyConvertedFrameDataToArray( static_cast( colorBuffer.size() ), &colorBuffer[0], ColorImageFormat::ColorImageFormat_Bgra ) );
+}
+
+// Update Depth
+inline void Kinect::updateDepth()
+{
+ // Retrieve Depth Frame
+ ComPtr depthFrame;
+ const HRESULT ret = depthFrameReader->AcquireLatestFrame( &depthFrame );
+ if( FAILED( ret ) ){
+ return;
+ }
+
+ // Retrieve Depth Data
+ ERROR_CHECK( depthFrame->CopyFrameDataToArray( static_cast( depthBuffer.size() ), &depthBuffer[0] ) );
+}
+
+// Update BodyIndex
+inline void Kinect::updateBodyIndex()
+{
+ // Retrieve BodyIndex Frame
+ ComPtr bodyIndexFrame;
+ const HRESULT ret = bodyIndexFrameReader->AcquireLatestFrame( &bodyIndexFrame );
+ if( FAILED( ret ) ){
+ return;
+ }
+
+ // Retrieve BodyIndex Data
+ ERROR_CHECK( bodyIndexFrame->CopyFrameDataToArray( static_cast( bodyIndexBuffer.size() ), &bodyIndexBuffer[0] ) );
+}
+
+// Draw Data
+void Kinect::draw()
+{
+ // Draw Color
+ drawColor();
+
+ // Draw BodyIndex
+ drawBodyIndex();
+
+ // Draw ChromaKey
+ drawChromaKey();
+}
+
+// Draw Color
+inline void Kinect::drawColor()
+{
+#ifdef COLOR
+ // Create cv::Mat from Color Buffer
+ colorMat = cv::Mat( colorHeight, colorWidth, CV_8UC4, &colorBuffer[0] );
+#endif
+
+#ifdef DEPTH
+ // Retrieve Mapped Coordinates
+ std::vector colorSpacePoints( depthWidth * depthHeight );
+ ERROR_CHECK( coordinateMapper->MapDepthFrameToColorSpace( depthBuffer.size(), &depthBuffer[0], colorSpacePoints.size(), &colorSpacePoints[0] ) );
+
+ // Mapping Color to Depth Resolution
+ std::vector buffer( depthWidth * depthHeight * colorBytesPerPixel );
+
+ Concurrency::parallel_for( 0, depthHeight, [&]( const int depthY ){
+ const unsigned int depthOffset = depthY * depthWidth;
+ for( int depthX = 0; depthX < depthWidth; depthX++ ){
+ unsigned int depthIndex = depthOffset + depthX;
+ const int colorX = static_cast( colorSpacePoints[depthIndex].X + 0.5f );
+ const int colorY = static_cast( colorSpacePoints[depthIndex].Y + 0.5f );
+ if( ( 0 <= colorX ) && ( colorX < colorWidth ) && ( 0 <= colorY ) && ( colorY < colorHeight ) ){
+ const unsigned int colorIndex = ( colorY * colorWidth + colorX ) * colorBytesPerPixel;
+ depthIndex = depthIndex * colorBytesPerPixel;
+ buffer[depthIndex + 0] = colorBuffer[colorIndex + 0];
+ buffer[depthIndex + 1] = colorBuffer[colorIndex + 1];
+ buffer[depthIndex + 2] = colorBuffer[colorIndex + 2];
+ buffer[depthIndex + 3] = colorBuffer[colorIndex + 3];
+ }
+ }
+ } );
+
+ // Create cv::Mat from Coordinate Buffer
+ colorMat = cv::Mat( depthHeight, depthWidth, CV_8UC4, &buffer[0] ).clone();
+#endif
+}
+
+// Draw BodyIndex
+inline void Kinect::drawBodyIndex()
+{
+#ifdef COLOR
+ // Retrieve Mapped Coordinates
+ std::vector bodyIndexSpacePoints( colorWidth * colorHeight );
+ ERROR_CHECK( coordinateMapper->MapColorFrameToDepthSpace( depthBuffer.size(), &depthBuffer[0], bodyIndexSpacePoints.size(), &bodyIndexSpacePoints[0] ) );
+
+ // Mapping BodyIndex to Color Resolution
+ std::vector buffer( colorWidth * colorHeight, 0xff );
+
+ Concurrency::parallel_for( 0, colorHeight, [&]( const int colorY ){
+ const unsigned int colorOffset = colorY * colorWidth;
+ for( int colorX = 0; colorX < colorWidth; colorX++ ){
+ const unsigned int colorIndex = colorOffset + colorX;
+ const int bodyIndexX = static_cast( bodyIndexSpacePoints[colorIndex].X + 0.5f );
+ const int bodyIndexY = static_cast( bodyIndexSpacePoints[colorIndex].Y + 0.5f );
+ if( ( 0 <= bodyIndexX ) && ( bodyIndexX < bodyIndexWidth ) && ( 0 <= bodyIndexY ) && ( bodyIndexY < bodyIndexHeight ) ){
+ const unsigned char bodyIndex = bodyIndexBuffer[bodyIndexY * bodyIndexWidth + bodyIndexX];
+ buffer[colorIndex] = bodyIndex;
+ }
+ }
+ } );
+
+ // Create cv::Mat from Coordinate Buffer
+ bodyIndexMat = cv::Mat( colorHeight, colorWidth, CV_8UC1, &buffer[0] ).clone();
+#endif
+
+#ifdef DEPTH
+ // Create cv::Mat from BodyIndex Buffer
+ bodyIndexMat = cv::Mat( bodyIndexHeight, bodyIndexWidth, CV_8UC1, &bodyIndexBuffer[0] );
+#endif
+}
+
+// Draw ChromaKey
+inline void Kinect::drawChromaKey()
+{
+ if( colorMat.empty() ){
+ return;
+ }
+
+ if( bodyIndexMat.empty() ){
+ return;
+ }
+
+ // ChromaKey
+#ifdef COLOR
+ chromaKeyMat = cv::Mat::zeros( colorHeight, colorWidth, CV_8UC4 );
+#endif
+#ifdef DEPTH
+ chromaKeyMat = cv::Mat::zeros( depthHeight, depthWidth, CV_8UC4 );
+#endif
+ chromaKeyMat.forEach( [&]( cv::Vec4b &p, const int* position ){
+ uchar bodyIndex = bodyIndexMat.at( position[0], position[1] );
+ if( bodyIndex != 0xff ){
+ p = colorMat.at( position[0], position[1] );
+ }
+ } );
+}
+
+// Show Data
+void Kinect::show()
+{
+ // Show ChromaKey
+ showChromaKey();
+}
+
+// Show ChromaKey
+inline void Kinect::showChromaKey()
+{
+ if( chromaKeyMat.empty() ){
+ return;
+ }
+
+#ifdef COLOR
+ // Resize Image
+ cv::Mat resizeMat;
+ const double scale = 0.5;
+ cv::resize( chromaKeyMat, resizeMat, cv::Size(), scale, scale );
+
+ // Show Image
+ cv::imshow( "ChromaKey", resizeMat );
+#endif
+
+#ifdef DEPTH
+ // Show Image
+ cv::imshow( "ChromaKey", chromaKeyMat );
+#endif
+}
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/ChromaKey/app.h b/codes/Kinect2Sample-master/sample/ChromaKey/app.h
new file mode 100644
index 0000000..1835bd9
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/ChromaKey/app.h
@@ -0,0 +1,110 @@
+#ifndef __APP__
+#define __APP__
+
+#include
+#include
+#include
+
+#include
+
+#include
+using namespace Microsoft::WRL;
+
+class Kinect
+{
+private:
+ // Sensor
+ ComPtr kinect;
+
+ // Coordinate Mapper
+ ComPtr coordinateMapper;
+
+ // Reader
+ ComPtr colorFrameReader;
+ ComPtr depthFrameReader;
+ ComPtr bodyIndexFrameReader;
+
+ // Color Buffer
+ std::vector colorBuffer;
+ int colorWidth;
+ int colorHeight;
+ unsigned int colorBytesPerPixel;
+ cv::Mat colorMat;
+
+ // Depth Buffer
+ std::vector depthBuffer;
+ int depthWidth;
+ int depthHeight;
+ unsigned int depthBytesPerPixel;
+
+ // BodyIndex Buffer
+ std::vector bodyIndexBuffer;
+ int bodyIndexWidth;
+ int bodyIndexHeight;
+ unsigned int bodyIndexBytesPerPixel;
+ cv::Mat bodyIndexMat;
+
+ // ChromaKey Buffer
+ cv::Mat chromaKeyMat;
+
+public:
+ // Constructor
+ Kinect();
+
+ // Destructor
+ ~Kinect();
+
+ // Processing
+ void run();
+
+private:
+ // Initialize
+ void initialize();
+
+ // Initialize Sensor
+ inline void initializeSensor();
+
+ // Initialize Color
+ inline void initializeColor();
+
+ // Initialize Depth
+ inline void initializeDepth();
+
+ // Initialize BodyIndex
+ inline void initializeBodyIndex();
+
+ // Finalize
+ void finalize();
+
+ // Update Data
+ void update();
+
+ // Update Color
+ inline void updateColor();
+
+ // Update Depth
+ inline void updateDepth();
+
+ // Update BodyIndex
+ inline void updateBodyIndex();
+
+ // Draw Data
+ void draw();
+
+ // Draw Color
+ inline void drawColor();
+
+ // Draw BodyIndex
+ inline void drawBodyIndex();
+
+ // Draw ChromaKey
+ inline void drawChromaKey();
+
+ // Show Data
+ void show();
+
+ // Show ChromaKey
+ inline void showChromaKey();
+};
+
+#endif // __APP__
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/ChromaKey/main.cpp b/codes/Kinect2Sample-master/sample/ChromaKey/main.cpp
new file mode 100644
index 0000000..d88643c
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/ChromaKey/main.cpp
@@ -0,0 +1,16 @@
+#include
+#include
+
+#include "app.h"
+
+int main( int argc, char* argv[] )
+{
+ try{
+ Kinect kinect;
+ kinect.run();
+ } catch( std::exception& ex ){
+ std::cout << ex.what() << std::endl;
+ }
+
+ return 0;
+}
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/ChromaKey/util.h b/codes/Kinect2Sample-master/sample/ChromaKey/util.h
new file mode 100644
index 0000000..0d9787f
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/ChromaKey/util.h
@@ -0,0 +1,37 @@
+#ifndef __UTIL__
+#define __UTIL__
+
+#include
+#include
+
+// Error Check Macro
+#define ERROR_CHECK( ret ) \
+ if( FAILED( ret ) ){ \
+ std::stringstream ss; \
+ ss << "failed " #ret " " << std::hex << ret << std::endl; \
+ throw std::runtime_error( ss.str().c_str() ); \
+ }
+
+// Safe Release
+template
+inline void SafeRelease( T*& rel )
+{
+ if( rel != NULL ){
+ rel->Release();
+ rel = NULL;
+ }
+}
+
+// C++ Style Line Types For OpenCV 2.x
+#if ( CV_MAJOR_VERSION < 3 )
+namespace cv{
+ enum LineTypes{
+ FILLED = -1,
+ LINE_4 = 4,
+ LINE_8 = 8,
+ LINE_AA = 16
+ };
+}
+#endif
+
+#endif // __UTIL__
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/Color/CMakeLists.txt b/codes/Kinect2Sample-master/sample/Color/CMakeLists.txt
new file mode 100644
index 0000000..6230a34
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/Color/CMakeLists.txt
@@ -0,0 +1,43 @@
+cmake_minimum_required( VERSION 3.6 )
+
+# Create Project
+project( Sample )
+add_executable( Color app.h app.cpp main.cpp util.h )
+
+# Set StartUp Project
+set_property( DIRECTORY PROPERTY VS_STARTUP_PROJECT "Color" )
+
+# Find Package
+set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}" ${CMAKE_MODULE_PATH} )
+find_package( KinectSDK2 REQUIRED )
+
+set( OpenCV_DIR "C:/Program Files/opencv/build" )
+option( OpenCV_STATIC OFF )
+find_package( OpenCV REQUIRED )
+
+# Set Static Link Runtime Library
+if( OpenCV_STATIC )
+ foreach( flag_var
+ CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
+ CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
+ CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
+ CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO )
+ if( ${flag_var} MATCHES "/MD" )
+ string( REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}" )
+ endif()
+ endforeach()
+endif()
+
+if( KinectSDK2_FOUND AND OpenCV_FOUND )
+ # Additional Include Directories
+ include_directories( ${KinectSDK2_INCLUDE_DIRS} )
+ include_directories( ${OpenCV_INCLUDE_DIRS} )
+
+ # Additional Library Directories
+ link_directories( ${KinectSDK2_LIBRARY_DIRS} )
+ link_directories( ${OpenCV_LIB_DIR} )
+
+ # Additional Dependencies
+ target_link_libraries( Color ${KinectSDK2_LIBRARIES} )
+ target_link_libraries( Color ${OpenCV_LIBS} )
+endif()
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/Color/FindKinectSDK2.cmake b/codes/Kinect2Sample-master/sample/Color/FindKinectSDK2.cmake
new file mode 100644
index 0000000..00a2036
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/Color/FindKinectSDK2.cmake
@@ -0,0 +1,182 @@
+#.rst:
+# FindKinectSDK2
+# --------------
+#
+# Find Kinect for Windows SDK v2 (Kinect SDK v2) include dirs, library dirs, libraries and post-build commands
+#
+# Use this module by invoking find_package with the form::
+#
+# find_package( KinectSDK2 [REQUIRED] )
+#
+# Results for users are reported in following variables::
+#
+# KinectSDK2_FOUND - Return "TRUE" when Kinect SDK v2 found. Otherwise, Return "FALSE".
+# KinectSDK2_INCLUDE_DIRS - Kinect SDK v2 include directories. (${KinectSDK2_DIR}/inc)
+# KinectSDK2_LIBRARY_DIRS - Kinect SDK v2 library directories. (${KinectSDK2_DIR}/Lib/x86 or ${KinectSDK2_DIR}/Lib/x64)
+# KinectSDK2_LIBRARIES - Kinect SDK v2 library files. (${KinectSDK2_LIBRARY_DIRS}/Kinect20.lib (If check the box of any application festures, corresponding library will be added.))
+# KinectSDK2_COMMANDS - Copy commands of redist files for application functions of Kinect SDK v2. (If uncheck the box of all application features, this variable has defined empty command.)
+#
+# This module reads hints about search locations from following environment variables::
+#
+# KINECTSDK20_DIR - Kinect SDK v2 root directory. (This environment variable has been set by installer of Kinect SDK v2.)
+#
+# CMake entries::
+#
+# KinectSDK2_DIR - Kinect SDK v2 root directory. (Default $ENV{KINECTSDK20_DIR})
+# KinectSDK2_FACE - Check the box when using Face or HDFace features. (Default uncheck)
+# KinectSDK2_FUSION - Check the box when using Fusion features. (Default uncheck)
+# KinectSDK2_VGB - Check the box when using Visual Gesture Builder features. (Default uncheck)
+#
+# Example to find Kinect SDK v2::
+#
+# cmake_minimum_required( VERSION 2.8 )
+#
+# project( project )
+# add_executable( project main.cpp )
+#
+# # Find package using this module.
+# find_package( KinectSDK2 REQUIRED )
+#
+# if(KinectSDK2_FOUND)
+# # [C/C++]>[General]>[Additional Include Directories]
+# include_directories( ${KinectSDK2_INCLUDE_DIRS} )
+#
+# # [Linker]>[General]>[Additional Library Directories]
+# link_directories( ${KinectSDK2_LIBRARY_DIRS} )
+#
+# # [Linker]>[Input]>[Additional Dependencies]
+# target_link_libraries( project ${KinectSDK2_LIBRARIES} )
+#
+# # [Build Events]>[Post-Build Event]>[Command Line]
+# add_custom_command( TARGET project POST_BUILD ${KinectSDK2_COMMANDS} )
+# endif()
+#
+# =============================================================================
+#
+# Copyright (c) 2016 Tsukasa SUGIURA
+# Distributed under the MIT License.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# =============================================================================
+
+##### Utility #####
+
+# Check Directory Macro
+macro(CHECK_DIR _DIR)
+ if(NOT EXISTS "${${_DIR}}")
+ message(WARNING "Directory \"${${_DIR}}\" not found.")
+ set(KinectSDK2_FOUND FALSE)
+ unset(_DIR)
+ endif()
+endmacro()
+
+# Check Files Macro
+macro(CHECK_FILES _FILES _DIR)
+ set(_MISSING_FILES)
+ foreach(_FILE ${${_FILES}})
+ if(NOT EXISTS "${_FILE}")
+ get_filename_component(_FILE ${_FILE} NAME)
+ set(_MISSING_FILES "${_MISSING_FILES}${_FILE}, ")
+ endif()
+ endforeach()
+ if(_MISSING_FILES)
+ message(WARNING "In directory \"${${_DIR}}\" not found files: ${_MISSING_FILES}")
+ set(KinectSDK2_FOUND FALSE)
+ unset(_FILES)
+ endif()
+endmacro()
+
+# Target Platform
+set(TARGET_PLATFORM)
+if(NOT CMAKE_CL_64)
+ set(TARGET_PLATFORM x86)
+else()
+ set(TARGET_PLATFORM x64)
+endif()
+
+##### Find Kinect SDK v2 #####
+
+# Found
+set(KinectSDK2_FOUND TRUE)
+if(MSVC_VERSION LESS 1700)
+ message(WARNING "Kinect for Windows SDK v2 supported Visual Studio 2012 or later.")
+ set(KinectSDK2_FOUND FALSE)
+endif()
+
+# Options
+option(KinectSDK2_FACE "Face and HDFace features" FALSE)
+option(KinectSDK2_FUSION "Fusion features" FALSE)
+option(KinectSDK2_VGB "Visual Gesture Builder features" FALSE)
+
+# Root Directoty
+set(KinectSDK2_DIR)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_DIR $ENV{KINECTSDK20_DIR} CACHE PATH "Kinect for Windows SDK v2 Install Path." FORCE)
+ check_dir(KinectSDK2_DIR)
+endif()
+
+# Include Directories
+set(KinectSDK2_INCLUDE_DIRS)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_INCLUDE_DIRS ${KinectSDK2_DIR}/inc)
+ check_dir(KinectSDK2_INCLUDE_DIRS)
+endif()
+
+# Library Directories
+set(KinectSDK2_LIBRARY_DIRS)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_LIBRARY_DIRS ${KinectSDK2_DIR}/Lib/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_LIBRARY_DIRS)
+endif()
+
+# Dependencies
+set(KinectSDK2_LIBRARIES)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARY_DIRS}/Kinect20.lib)
+
+ if(KinectSDK2_FACE)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARIES};${KinectSDK2_LIBRARY_DIRS}/Kinect20.Face.lib)
+ endif()
+
+ if(KinectSDK2_FUSION)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARIES};${KinectSDK2_LIBRARY_DIRS}/Kinect20.Fusion.lib)
+ endif()
+
+ if(KinectSDK2_VGB)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARIES};${KinectSDK2_LIBRARY_DIRS}/Kinect20.VisualGestureBuilder.lib)
+ endif()
+
+ check_files(KinectSDK2_LIBRARIES KinectSDK2_LIBRARY_DIRS)
+endif()
+
+# Custom Commands
+set(KinectSDK2_COMMANDS)
+if(KinectSDK2_FOUND)
+ if(KinectSDK2_FACE)
+ set(KinectSDK2_REDIST_DIR ${KinectSDK2_DIR}/Redist/Face/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_REDIST_DIR)
+ list(APPEND KinectSDK2_COMMANDS COMMAND xcopy "${KinectSDK2_REDIST_DIR}" "$(OutDir)" /e /y /i /r > NUL)
+ endif()
+
+ if(KinectSDK2_FUSION)
+ set(KinectSDK2_REDIST_DIR ${KinectSDK2_DIR}/Redist/Fusion/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_REDIST_DIR)
+ list(APPEND KinectSDK2_COMMANDS COMMAND xcopy "${KinectSDK2_REDIST_DIR}" "$(OutDir)" /e /y /i /r > NUL)
+ endif()
+
+ if(KinectSDK2_VGB)
+ set(KinectSDK2_REDIST_DIR ${KinectSDK2_DIR}/Redist/VGB/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_REDIST_DIR)
+ list(APPEND KinectSDK2_COMMANDS COMMAND xcopy "${KinectSDK2_REDIST_DIR}" "$(OutDir)" /e /y /i /r > NUL)
+ endif()
+
+ # Empty Commands
+ if(NOT KinectSDK2_COMMANDS)
+ set(KinectSDK2_COMMANDS COMMAND)
+ endif()
+endif()
+
+message(STATUS "KinectSDK2_FOUND : ${KinectSDK2_FOUND}")
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/Color/app.cpp b/codes/Kinect2Sample-master/sample/Color/app.cpp
new file mode 100644
index 0000000..6ecc9a8
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/Color/app.cpp
@@ -0,0 +1,160 @@
+#include "app.h"
+#include "util.h"
+
+#include
+#include
+
+// Constructor
+Kinect::Kinect()
+{
+ // Initialize
+ initialize();
+}
+
+// Destructor
+Kinect::~Kinect()
+{
+ // Finalize
+ finalize();
+}
+
+// Processing
+void Kinect::run()
+{
+ // Main Loop
+ while( true ){
+ // Update Data
+ update();
+
+ // Draw Data
+ draw();
+
+ // Show Data
+ show();
+
+ // Key Check
+ const int key = cv::waitKey( 10 );
+ if( key == VK_ESCAPE ){
+ break;
+ }
+ }
+}
+
+// Initialize
+void Kinect::initialize()
+{
+ cv::setUseOptimized( true );
+
+ // Initialize Sensor
+ initializeSensor();
+
+ // Initialize Color
+ initializeColor();
+
+ // Wait a Few Seconds until begins to Retrieve Data from Sensor ( about 2000-[ms] )
+ std::this_thread::sleep_for( std::chrono::seconds( 2 ) );
+}
+
+// Initialize Sensor
+inline void Kinect::initializeSensor()
+{
+ // Open Sensor
+ ERROR_CHECK( GetDefaultKinectSensor( &kinect ) );
+
+ ERROR_CHECK( kinect->Open() );
+
+ // Check Open
+ BOOLEAN isOpen = FALSE;
+ ERROR_CHECK( kinect->get_IsOpen( &isOpen ) );
+ if( !isOpen ){
+ throw std::runtime_error( "failed IKinectSensor::get_IsOpen( &isOpen )" );
+ }
+}
+
+// Initialize Color
+inline void Kinect::initializeColor()
+{
+ // Open Color Reader
+ ComPtr colorFrameSource;
+ ERROR_CHECK( kinect->get_ColorFrameSource( &colorFrameSource ) );
+ ERROR_CHECK( colorFrameSource->OpenReader( &colorFrameReader ) );
+
+ // Retrieve Color Description
+ ComPtr colorFrameDescription;
+ ERROR_CHECK( colorFrameSource->CreateFrameDescription( ColorImageFormat::ColorImageFormat_Bgra, &colorFrameDescription ) );
+ ERROR_CHECK( colorFrameDescription->get_Width( &colorWidth ) ); // 1920
+ ERROR_CHECK( colorFrameDescription->get_Height( &colorHeight ) ); // 1080
+ ERROR_CHECK( colorFrameDescription->get_BytesPerPixel( &colorBytesPerPixel ) ); // 4
+
+ // Allocation Color Buffer
+ colorBuffer.resize( colorWidth * colorHeight * colorBytesPerPixel );
+}
+
+// Finalize
+void Kinect::finalize()
+{
+ cv::destroyAllWindows();
+
+ // Close Sensor
+ if( kinect != nullptr ){
+ kinect->Close();
+ }
+}
+
+// Update Data
+void Kinect::update()
+{
+ // Update Color
+ updateColor();
+}
+
+// Update Color
+inline void Kinect::updateColor()
+{
+ // Retrieve Color Frame
+ ComPtr colorFrame;
+ const HRESULT ret = colorFrameReader->AcquireLatestFrame( &colorFrame );
+ if( FAILED( ret ) ){
+ return;
+ }
+
+ // Convert Format ( YUY2 -> BGRA )
+ ERROR_CHECK( colorFrame->CopyConvertedFrameDataToArray( static_cast( colorBuffer.size() ), &colorBuffer[0], ColorImageFormat::ColorImageFormat_Bgra ) );
+}
+
+// Draw Data
+void Kinect::draw()
+{
+ // Draw Color
+ drawColor();
+}
+
+// Draw Color
+inline void Kinect::drawColor()
+{
+ // Create cv::Mat from Color Buffer
+ colorMat = cv::Mat( colorHeight, colorWidth, CV_8UC4, &colorBuffer[0] );
+}
+
+// Show Data
+void Kinect::show()
+{
+ // Show Color
+ showColor();
+}
+
+// Show Color
+inline void Kinect::showColor()
+{
+ if( colorMat.empty() ){
+ return;
+ }
+
+ // Resize Image
+ cv::Mat resizeMat;
+ const double scale = 0.5;
+ cv::resize( colorMat, resizeMat, cv::Size(), scale, scale );
+
+ // Show Image
+ cv::imshow( "Color", resizeMat );
+}
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/Color/app.h b/codes/Kinect2Sample-master/sample/Color/app.h
new file mode 100644
index 0000000..4843a5d
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/Color/app.h
@@ -0,0 +1,71 @@
+#ifndef __APP__
+#define __APP__
+
+#include
+#include
+#include
+
+#include
+
+#include
+using namespace Microsoft::WRL;
+
+class Kinect
+{
+private:
+ // Sensor
+ ComPtr kinect;
+
+ // Reader
+ ComPtr colorFrameReader;
+
+ // Color Buffer
+ std::vector colorBuffer;
+ int colorWidth;
+ int colorHeight;
+ unsigned int colorBytesPerPixel;
+ cv::Mat colorMat;
+
+public:
+ // Constructor
+ Kinect();
+
+ // Destructor
+ ~Kinect();
+
+ // Processing
+ void run();
+
+private:
+ // Initialize
+ void initialize();
+
+ // Initialize Sensor
+ inline void initializeSensor();
+
+ // Initialize Color
+ inline void initializeColor();
+
+ // Finalize
+ void finalize();
+
+ // Update Data
+ void update();
+
+ // Update Color
+ inline void updateColor();
+
+ // Draw Data
+ void draw();
+
+ // Draw Color
+ inline void drawColor();
+
+ // Show Data
+ void show();
+
+ // Show Color
+ inline void showColor();
+};
+
+#endif // __APP__
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/Color/main.cpp b/codes/Kinect2Sample-master/sample/Color/main.cpp
new file mode 100644
index 0000000..d88643c
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/Color/main.cpp
@@ -0,0 +1,16 @@
+#include
+#include
+
+#include "app.h"
+
+int main( int argc, char* argv[] )
+{
+ try{
+ Kinect kinect;
+ kinect.run();
+ } catch( std::exception& ex ){
+ std::cout << ex.what() << std::endl;
+ }
+
+ return 0;
+}
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/Color/util.h b/codes/Kinect2Sample-master/sample/Color/util.h
new file mode 100644
index 0000000..0d9787f
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/Color/util.h
@@ -0,0 +1,37 @@
+#ifndef __UTIL__
+#define __UTIL__
+
+#include
+#include
+
+// Error Check Macro
+#define ERROR_CHECK( ret ) \
+ if( FAILED( ret ) ){ \
+ std::stringstream ss; \
+ ss << "failed " #ret " " << std::hex << ret << std::endl; \
+ throw std::runtime_error( ss.str().c_str() ); \
+ }
+
+// Safe Release
+template
+inline void SafeRelease( T*& rel )
+{
+ if( rel != NULL ){
+ rel->Release();
+ rel = NULL;
+ }
+}
+
+// C++ Style Line Types For OpenCV 2.x
+#if ( CV_MAJOR_VERSION < 3 )
+namespace cv{
+ enum LineTypes{
+ FILLED = -1,
+ LINE_4 = 4,
+ LINE_8 = 8,
+ LINE_AA = 16
+ };
+}
+#endif
+
+#endif // __UTIL__
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/CoordinateMapper/CMakeLists.txt b/codes/Kinect2Sample-master/sample/CoordinateMapper/CMakeLists.txt
new file mode 100644
index 0000000..fecf614
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/CoordinateMapper/CMakeLists.txt
@@ -0,0 +1,43 @@
+cmake_minimum_required( VERSION 3.6 )
+
+# Create Project
+project( Sample )
+add_executable( CoordinateMapper app.h app.cpp main.cpp util.h )
+
+# Set StartUp Project
+set_property( DIRECTORY PROPERTY VS_STARTUP_PROJECT "CoordinateMapper" )
+
+# Find Package
+set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}" ${CMAKE_MODULE_PATH} )
+find_package( KinectSDK2 REQUIRED )
+
+set( OpenCV_DIR "C:/Program Files/opencv/build" )
+option( OpenCV_STATIC OFF )
+find_package( OpenCV REQUIRED )
+
+# Set Static Link Runtime Library
+if( OpenCV_STATIC )
+ foreach( flag_var
+ CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
+ CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
+ CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
+ CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO )
+ if( ${flag_var} MATCHES "/MD" )
+ string( REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}" )
+ endif()
+ endforeach()
+endif()
+
+if( KinectSDK2_FOUND AND OpenCV_FOUND )
+ # Additional Include Directories
+ include_directories( ${KinectSDK2_INCLUDE_DIRS} )
+ include_directories( ${OpenCV_INCLUDE_DIRS} )
+
+ # Additional Library Directories
+ link_directories( ${KinectSDK2_LIBRARY_DIRS} )
+ link_directories( ${OpenCV_LIB_DIR} )
+
+ # Additional Dependencies
+ target_link_libraries( CoordinateMapper ${KinectSDK2_LIBRARIES} )
+ target_link_libraries( CoordinateMapper ${OpenCV_LIBS} )
+endif()
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/CoordinateMapper/FindKinectSDK2.cmake b/codes/Kinect2Sample-master/sample/CoordinateMapper/FindKinectSDK2.cmake
new file mode 100644
index 0000000..00a2036
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/CoordinateMapper/FindKinectSDK2.cmake
@@ -0,0 +1,182 @@
+#.rst:
+# FindKinectSDK2
+# --------------
+#
+# Find Kinect for Windows SDK v2 (Kinect SDK v2) include dirs, library dirs, libraries and post-build commands
+#
+# Use this module by invoking find_package with the form::
+#
+# find_package( KinectSDK2 [REQUIRED] )
+#
+# Results for users are reported in following variables::
+#
+# KinectSDK2_FOUND - Return "TRUE" when Kinect SDK v2 found. Otherwise, Return "FALSE".
+# KinectSDK2_INCLUDE_DIRS - Kinect SDK v2 include directories. (${KinectSDK2_DIR}/inc)
+# KinectSDK2_LIBRARY_DIRS - Kinect SDK v2 library directories. (${KinectSDK2_DIR}/Lib/x86 or ${KinectSDK2_DIR}/Lib/x64)
+# KinectSDK2_LIBRARIES - Kinect SDK v2 library files. (${KinectSDK2_LIBRARY_DIRS}/Kinect20.lib (If check the box of any application festures, corresponding library will be added.))
+# KinectSDK2_COMMANDS - Copy commands of redist files for application functions of Kinect SDK v2. (If uncheck the box of all application features, this variable has defined empty command.)
+#
+# This module reads hints about search locations from following environment variables::
+#
+# KINECTSDK20_DIR - Kinect SDK v2 root directory. (This environment variable has been set by installer of Kinect SDK v2.)
+#
+# CMake entries::
+#
+# KinectSDK2_DIR - Kinect SDK v2 root directory. (Default $ENV{KINECTSDK20_DIR})
+# KinectSDK2_FACE - Check the box when using Face or HDFace features. (Default uncheck)
+# KinectSDK2_FUSION - Check the box when using Fusion features. (Default uncheck)
+# KinectSDK2_VGB - Check the box when using Visual Gesture Builder features. (Default uncheck)
+#
+# Example to find Kinect SDK v2::
+#
+# cmake_minimum_required( VERSION 2.8 )
+#
+# project( project )
+# add_executable( project main.cpp )
+#
+# # Find package using this module.
+# find_package( KinectSDK2 REQUIRED )
+#
+# if(KinectSDK2_FOUND)
+# # [C/C++]>[General]>[Additional Include Directories]
+# include_directories( ${KinectSDK2_INCLUDE_DIRS} )
+#
+# # [Linker]>[General]>[Additional Library Directories]
+# link_directories( ${KinectSDK2_LIBRARY_DIRS} )
+#
+# # [Linker]>[Input]>[Additional Dependencies]
+# target_link_libraries( project ${KinectSDK2_LIBRARIES} )
+#
+# # [Build Events]>[Post-Build Event]>[Command Line]
+# add_custom_command( TARGET project POST_BUILD ${KinectSDK2_COMMANDS} )
+# endif()
+#
+# =============================================================================
+#
+# Copyright (c) 2016 Tsukasa SUGIURA
+# Distributed under the MIT License.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# =============================================================================
+
+##### Utility #####
+
+# Check Directory Macro
+macro(CHECK_DIR _DIR)
+ if(NOT EXISTS "${${_DIR}}")
+ message(WARNING "Directory \"${${_DIR}}\" not found.")
+ set(KinectSDK2_FOUND FALSE)
+ unset(_DIR)
+ endif()
+endmacro()
+
+# Check Files Macro
+macro(CHECK_FILES _FILES _DIR)
+ set(_MISSING_FILES)
+ foreach(_FILE ${${_FILES}})
+ if(NOT EXISTS "${_FILE}")
+ get_filename_component(_FILE ${_FILE} NAME)
+ set(_MISSING_FILES "${_MISSING_FILES}${_FILE}, ")
+ endif()
+ endforeach()
+ if(_MISSING_FILES)
+ message(WARNING "In directory \"${${_DIR}}\" not found files: ${_MISSING_FILES}")
+ set(KinectSDK2_FOUND FALSE)
+ unset(_FILES)
+ endif()
+endmacro()
+
+# Target Platform
+set(TARGET_PLATFORM)
+if(NOT CMAKE_CL_64)
+ set(TARGET_PLATFORM x86)
+else()
+ set(TARGET_PLATFORM x64)
+endif()
+
+##### Find Kinect SDK v2 #####
+
+# Found
+set(KinectSDK2_FOUND TRUE)
+if(MSVC_VERSION LESS 1700)
+ message(WARNING "Kinect for Windows SDK v2 supported Visual Studio 2012 or later.")
+ set(KinectSDK2_FOUND FALSE)
+endif()
+
+# Options
+option(KinectSDK2_FACE "Face and HDFace features" FALSE)
+option(KinectSDK2_FUSION "Fusion features" FALSE)
+option(KinectSDK2_VGB "Visual Gesture Builder features" FALSE)
+
+# Root Directoty
+set(KinectSDK2_DIR)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_DIR $ENV{KINECTSDK20_DIR} CACHE PATH "Kinect for Windows SDK v2 Install Path." FORCE)
+ check_dir(KinectSDK2_DIR)
+endif()
+
+# Include Directories
+set(KinectSDK2_INCLUDE_DIRS)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_INCLUDE_DIRS ${KinectSDK2_DIR}/inc)
+ check_dir(KinectSDK2_INCLUDE_DIRS)
+endif()
+
+# Library Directories
+set(KinectSDK2_LIBRARY_DIRS)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_LIBRARY_DIRS ${KinectSDK2_DIR}/Lib/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_LIBRARY_DIRS)
+endif()
+
+# Dependencies
+set(KinectSDK2_LIBRARIES)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARY_DIRS}/Kinect20.lib)
+
+ if(KinectSDK2_FACE)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARIES};${KinectSDK2_LIBRARY_DIRS}/Kinect20.Face.lib)
+ endif()
+
+ if(KinectSDK2_FUSION)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARIES};${KinectSDK2_LIBRARY_DIRS}/Kinect20.Fusion.lib)
+ endif()
+
+ if(KinectSDK2_VGB)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARIES};${KinectSDK2_LIBRARY_DIRS}/Kinect20.VisualGestureBuilder.lib)
+ endif()
+
+ check_files(KinectSDK2_LIBRARIES KinectSDK2_LIBRARY_DIRS)
+endif()
+
+# Custom Commands
+set(KinectSDK2_COMMANDS)
+if(KinectSDK2_FOUND)
+ if(KinectSDK2_FACE)
+ set(KinectSDK2_REDIST_DIR ${KinectSDK2_DIR}/Redist/Face/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_REDIST_DIR)
+ list(APPEND KinectSDK2_COMMANDS COMMAND xcopy "${KinectSDK2_REDIST_DIR}" "$(OutDir)" /e /y /i /r > NUL)
+ endif()
+
+ if(KinectSDK2_FUSION)
+ set(KinectSDK2_REDIST_DIR ${KinectSDK2_DIR}/Redist/Fusion/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_REDIST_DIR)
+ list(APPEND KinectSDK2_COMMANDS COMMAND xcopy "${KinectSDK2_REDIST_DIR}" "$(OutDir)" /e /y /i /r > NUL)
+ endif()
+
+ if(KinectSDK2_VGB)
+ set(KinectSDK2_REDIST_DIR ${KinectSDK2_DIR}/Redist/VGB/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_REDIST_DIR)
+ list(APPEND KinectSDK2_COMMANDS COMMAND xcopy "${KinectSDK2_REDIST_DIR}" "$(OutDir)" /e /y /i /r > NUL)
+ endif()
+
+ # Empty Commands
+ if(NOT KinectSDK2_COMMANDS)
+ set(KinectSDK2_COMMANDS COMMAND)
+ endif()
+endif()
+
+message(STATUS "KinectSDK2_FOUND : ${KinectSDK2_FOUND}")
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/CoordinateMapper/app.cpp b/codes/Kinect2Sample-master/sample/CoordinateMapper/app.cpp
new file mode 100644
index 0000000..554730b
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/CoordinateMapper/app.cpp
@@ -0,0 +1,307 @@
+#include "app.h"
+#include "util.h"
+
+#include
+#include
+
+#include
+
+// Choose Resolution
+//#define COLOR
+#define DEPTH
+
+// Constructor
+Kinect::Kinect()
+{
+ // Initialize
+ initialize();
+}
+
+// Destructor
+Kinect::~Kinect()
+{
+ // Finalize
+ finalize();
+}
+
+// Processing
+void Kinect::run()
+{
+ // Main Loop
+ while( true ){
+ // Update Data
+ update();
+
+ // Draw Data
+ draw();
+
+ // Show Data
+ show();
+
+ // Key Check
+ const int key = cv::waitKey( 10 );
+ if( key == VK_ESCAPE ){
+ break;
+ }
+ }
+}
+
+// Initialize
+void Kinect::initialize()
+{
+ cv::setUseOptimized( true );
+
+ // Initialize Sensor
+ initializeSensor();
+
+ // Initialize Color
+ initializeColor();
+
+ // Initialize Depth
+ initializeDepth();
+
+ // Wait a Few Seconds until begins to Retrieve Data from Sensor ( about 2000-[ms] )
+ std::this_thread::sleep_for( std::chrono::seconds( 2 ) );
+}
+
+// Initialize Sensor
+inline void Kinect::initializeSensor()
+{
+ // Open Sensor
+ ERROR_CHECK( GetDefaultKinectSensor( &kinect ) );
+
+ ERROR_CHECK( kinect->Open() );
+
+ // Check Open
+ BOOLEAN isOpen = FALSE;
+ ERROR_CHECK( kinect->get_IsOpen( &isOpen ) );
+ if( !isOpen ){
+ throw std::runtime_error( "failed IKinectSensor::get_IsOpen( &isOpen )" );
+ }
+
+ // Retrieve Coordinate Mapper
+ ERROR_CHECK( kinect->get_CoordinateMapper( &coordinateMapper ) );
+}
+
+// Initialize Color
+inline void Kinect::initializeColor()
+{
+ // Open Color Reader
+ ComPtr colorFrameSource;
+ ERROR_CHECK( kinect->get_ColorFrameSource( &colorFrameSource ) );
+ ERROR_CHECK( colorFrameSource->OpenReader( &colorFrameReader ) );
+
+ // Retrieve Color Description
+ ComPtr colorFrameDescription;
+ ERROR_CHECK( colorFrameSource->CreateFrameDescription( ColorImageFormat::ColorImageFormat_Bgra, &colorFrameDescription ) );
+ ERROR_CHECK( colorFrameDescription->get_Width( &colorWidth ) ); // 1920
+ ERROR_CHECK( colorFrameDescription->get_Height( &colorHeight ) ); // 1080
+ ERROR_CHECK( colorFrameDescription->get_BytesPerPixel( &colorBytesPerPixel ) ); // 4
+
+ // Allocation Color Buffer
+ colorBuffer.resize( colorWidth * colorHeight * colorBytesPerPixel );
+}
+
+// Initialize Depth
+inline void Kinect::initializeDepth()
+{
+ // Open Depth Reader
+ ComPtr depthFrameSource;
+ ERROR_CHECK( kinect->get_DepthFrameSource( &depthFrameSource ) );
+ ERROR_CHECK( depthFrameSource->OpenReader( &depthFrameReader ) );
+
+ // Retrieve Depth Description
+ ComPtr depthFrameDescription;
+ ERROR_CHECK( depthFrameSource->get_FrameDescription( &depthFrameDescription ) );
+ ERROR_CHECK( depthFrameDescription->get_Width( &depthWidth ) ); // 512
+ ERROR_CHECK( depthFrameDescription->get_Height( &depthHeight ) ); // 424
+ ERROR_CHECK( depthFrameDescription->get_BytesPerPixel( &depthBytesPerPixel ) ); // 2
+
+ // Allocation Depth Buffer
+ depthBuffer.resize( depthWidth * depthHeight );
+}
+
+// Finalize
+void Kinect::finalize()
+{
+ cv::destroyAllWindows();
+
+ // Close Sensor
+ if( kinect != nullptr ){
+ kinect->Close();
+ }
+}
+
+// Update Data
+void Kinect::update()
+{
+ // Update Color
+ updateColor();
+
+ // Update Depth
+ updateDepth();
+}
+
+// Update Color
+inline void Kinect::updateColor()
+{
+ // Retrieve Color Frame
+ ComPtr colorFrame;
+ const HRESULT ret = colorFrameReader->AcquireLatestFrame( &colorFrame );
+ if( FAILED( ret ) ){
+ return;
+ }
+
+ // Convert Format ( YUY2 -> BGRA )
+ ERROR_CHECK( colorFrame->CopyConvertedFrameDataToArray( static_cast( colorBuffer.size() ), &colorBuffer[0], ColorImageFormat::ColorImageFormat_Bgra ) );
+}
+
+// Update Depth
+inline void Kinect::updateDepth()
+{
+ // Retrieve Depth Frame
+ ComPtr depthFrame;
+ const HRESULT ret = depthFrameReader->AcquireLatestFrame( &depthFrame );
+ if( FAILED( ret ) ){
+ return;
+ }
+
+ // Retrieve Depth Data
+ ERROR_CHECK( depthFrame->CopyFrameDataToArray( static_cast( depthBuffer.size() ), &depthBuffer[0] ) );
+}
+
+// Draw Data
+void Kinect::draw()
+{
+ // Draw Color
+ drawColor();
+
+ // Draw Depth
+ drawDepth();
+}
+
+// Draw Color
+inline void Kinect::drawColor()
+{
+#ifdef DEPTH
+ // Retrieve Mapped Coordinates
+ std::vector colorSpacePoints( depthWidth * depthHeight );
+ ERROR_CHECK( coordinateMapper->MapDepthFrameToColorSpace( depthBuffer.size(), &depthBuffer[0], colorSpacePoints.size(), &colorSpacePoints[0] ) );
+
+ // Mapping Color to Depth Resolution
+ std::vector buffer( depthWidth * depthHeight * colorBytesPerPixel );
+
+ Concurrency::parallel_for( 0, depthHeight, [&]( const int depthY ){
+ const unsigned int depthOffset = depthY * depthWidth;
+ for( int depthX = 0; depthX < depthWidth; depthX++ ){
+ unsigned int depthIndex = depthOffset + depthX;
+ const int colorX = static_cast( colorSpacePoints[depthIndex].X + 0.5f );
+ const int colorY = static_cast( colorSpacePoints[depthIndex].Y + 0.5f );
+ if( ( 0 <= colorX ) && ( colorX < colorWidth ) && ( 0 <= colorY ) && ( colorY < colorHeight ) ){
+ const unsigned int colorIndex = ( colorY * colorWidth + colorX ) * colorBytesPerPixel;
+ depthIndex = depthIndex * colorBytesPerPixel;
+ buffer[depthIndex + 0] = colorBuffer[colorIndex + 0];
+ buffer[depthIndex + 1] = colorBuffer[colorIndex + 1];
+ buffer[depthIndex + 2] = colorBuffer[colorIndex + 2];
+ buffer[depthIndex + 3] = colorBuffer[colorIndex + 3];
+ }
+ }
+ } );
+
+ // Create cv::Mat from Coordinate Buffer
+ colorMat = cv::Mat( depthHeight, depthWidth, CV_8UC4, &buffer[0] ).clone();
+#else
+ // Create cv::Mat from Color Buffer
+ colorMat = cv::Mat( colorHeight, colorWidth, CV_8UC4, &colorBuffer[0]);
+#endif
+
+}
+
+// Draw Depth
+inline void Kinect::drawDepth()
+{
+#ifdef COLOR
+ // Retrieve Mapped Coordinates
+ std::vector depthSpacePoints( colorWidth * colorHeight );
+ ERROR_CHECK( coordinateMapper->MapColorFrameToDepthSpace( depthBuffer.size(), &depthBuffer[0], depthSpacePoints.size(), &depthSpacePoints[0] ) );
+
+ // Mapping Depth to Color Resolution
+ std::vector buffer( colorWidth * colorHeight );
+
+ Concurrency::parallel_for( 0, colorHeight, [&]( const int colorY ){
+ const unsigned int colorOffset = colorY * colorWidth;
+ for( int colorX = 0; colorX < colorWidth; colorX++ ){
+ const unsigned int colorIndex = colorOffset + colorX;
+ const int depthX = static_cast( depthSpacePoints[colorIndex].X + 0.5f );
+ const int depthY = static_cast( depthSpacePoints[colorIndex].Y + 0.5f );
+ if( ( 0 <= depthX ) && ( depthX < depthWidth ) && ( 0 <= depthY ) && ( depthY < depthHeight ) ){
+ const unsigned int depthIndex = depthY * depthWidth + depthX;
+ buffer[colorIndex] = depthBuffer[depthIndex];
+ }
+ }
+ } );
+
+ // Create cv::Mat from Coordinate Buffer
+ depthMat = cv::Mat( colorHeight, colorWidth, CV_16UC1, &buffer[0] ).clone();
+#else
+ // Create cv::Mat from Depth Buffer
+ depthMat = cv::Mat( depthHeight, depthWidth, CV_16UC1, &depthBuffer[0]);
+#endif
+}
+
+// Show Data
+void Kinect::show()
+{
+ // Show Color
+ showColor();
+
+ // Show Depth
+ showDepth();
+}
+
+// Show Color
+inline void Kinect::showColor()
+{
+ if( colorMat.empty() ){
+ return;
+ }
+
+#ifdef COLOR
+ // Resize Image
+ cv::Mat resizeMat;
+ const double scale = 0.5;
+ cv::resize( colorMat, resizeMat, cv::Size(), scale, scale );
+
+ // Show Image
+ cv::imshow( "Color", resizeMat );
+#else
+ // Show Image
+ cv::imshow( "Color", colorMat );
+#endif
+}
+
+// Show Depth
+inline void Kinect::showDepth()
+{
+ if( depthMat.empty() ){
+ return;
+ }
+
+ // Scaling ( 0-8000 -> 255-0 )
+ cv::Mat scaleMat;
+ depthMat.convertTo( scaleMat, CV_8U, -255.0 / 8000.0, 255.0 );
+ //cv::applyColorMap( scaleMat, scaleMat, cv::COLORMAP_BONE );
+
+#ifdef COLOR
+ // Resize Image
+ cv::Mat resizeMat;
+ const double scale = 0.5;
+ cv::resize( scaleMat, resizeMat, cv::Size(), scale, scale );
+
+ // Show Image
+ cv::imshow( "Depth", resizeMat );
+#else
+ // Show Image
+ cv::imshow( "Depth", scaleMat );
+#endif
+}
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/CoordinateMapper/app.h b/codes/Kinect2Sample-master/sample/CoordinateMapper/app.h
new file mode 100644
index 0000000..d598f68
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/CoordinateMapper/app.h
@@ -0,0 +1,94 @@
+#ifndef __APP__
+#define __APP__
+
+#include
+#include
+#include
+
+#include
+
+#include
+using namespace Microsoft::WRL;
+
+class Kinect
+{
+private:
+ // Sensor
+ ComPtr kinect;
+
+ // Coordinate Mapper
+ ComPtr coordinateMapper;
+
+ // Reader
+ ComPtr colorFrameReader;
+ ComPtr depthFrameReader;
+
+ // Color Buffer
+ std::vector colorBuffer;
+ int colorWidth;
+ int colorHeight;
+ unsigned int colorBytesPerPixel;
+ cv::Mat colorMat;
+
+ // Depth Buffer
+ std::vector depthBuffer;
+ int depthWidth;
+ int depthHeight;
+ unsigned int depthBytesPerPixel;
+ cv::Mat depthMat;
+
+public:
+ // Constructor
+ Kinect();
+
+ // Destructor
+ ~Kinect();
+
+ // Processing
+ void run();
+
+private:
+ // Initialize
+ void initialize();
+
+ // Initialize Sensor
+ inline void initializeSensor();
+
+ // Initialize Color
+ inline void initializeColor();
+
+ // Initialize Depth
+ inline void initializeDepth();
+
+ // Finalize
+ void finalize();
+
+ // Update Data
+ void update();
+
+ // Update Color
+ inline void updateColor();
+
+ // Update Depth
+ inline void updateDepth();
+
+ // Draw Data
+ void draw();
+
+ // Draw Color
+ inline void drawColor();
+
+ // Draw Depth
+ inline void drawDepth();
+
+ // Show Data
+ void show();
+
+ // Show Color
+ inline void showColor();
+
+ // Show Depth
+ inline void showDepth();
+};
+
+#endif // __APP__
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/CoordinateMapper/main.cpp b/codes/Kinect2Sample-master/sample/CoordinateMapper/main.cpp
new file mode 100644
index 0000000..d88643c
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/CoordinateMapper/main.cpp
@@ -0,0 +1,16 @@
+#include
+#include
+
+#include "app.h"
+
+int main( int argc, char* argv[] )
+{
+ try{
+ Kinect kinect;
+ kinect.run();
+ } catch( std::exception& ex ){
+ std::cout << ex.what() << std::endl;
+ }
+
+ return 0;
+}
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/CoordinateMapper/util.h b/codes/Kinect2Sample-master/sample/CoordinateMapper/util.h
new file mode 100644
index 0000000..0d9787f
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/CoordinateMapper/util.h
@@ -0,0 +1,37 @@
+#ifndef __UTIL__
+#define __UTIL__
+
+#include
+#include
+
+// Error Check Macro
+#define ERROR_CHECK( ret ) \
+ if( FAILED( ret ) ){ \
+ std::stringstream ss; \
+ ss << "failed " #ret " " << std::hex << ret << std::endl; \
+ throw std::runtime_error( ss.str().c_str() ); \
+ }
+
+// Safe Release
+template
+inline void SafeRelease( T*& rel )
+{
+ if( rel != NULL ){
+ rel->Release();
+ rel = NULL;
+ }
+}
+
+// C++ Style Line Types For OpenCV 2.x
+#if ( CV_MAJOR_VERSION < 3 )
+namespace cv{
+ enum LineTypes{
+ FILLED = -1,
+ LINE_4 = 4,
+ LINE_8 = 8,
+ LINE_AA = 16
+ };
+}
+#endif
+
+#endif // __UTIL__
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/Depth/CMakeLists.txt b/codes/Kinect2Sample-master/sample/Depth/CMakeLists.txt
new file mode 100644
index 0000000..1b42d61
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/Depth/CMakeLists.txt
@@ -0,0 +1,43 @@
+cmake_minimum_required( VERSION 3.6 )
+
+# Create Project
+project( Sample )
+add_executable( Depth app.h app.cpp main.cpp util.h )
+
+# Set StartUp Project
+set_property( DIRECTORY PROPERTY VS_STARTUP_PROJECT "Depth" )
+
+# Find Package
+set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}" ${CMAKE_MODULE_PATH} )
+find_package( KinectSDK2 REQUIRED )
+
+set( OpenCV_DIR "C:/Program Files/opencv/build" )
+option( OpenCV_STATIC OFF )
+find_package( OpenCV REQUIRED )
+
+# Set Static Link Runtime Library
+if( OpenCV_STATIC )
+ foreach( flag_var
+ CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
+ CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
+ CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
+ CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO )
+ if( ${flag_var} MATCHES "/MD" )
+ string( REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}" )
+ endif()
+ endforeach()
+endif()
+
+if( KinectSDK2_FOUND AND OpenCV_FOUND )
+ # Additional Include Directories
+ include_directories( ${KinectSDK2_INCLUDE_DIRS} )
+ include_directories( ${OpenCV_INCLUDE_DIRS} )
+
+ # Additional Library Directories
+ link_directories( ${KinectSDK2_LIBRARY_DIRS} )
+ link_directories( ${OpenCV_LIB_DIR} )
+
+ # Additional Dependencies
+ target_link_libraries( Depth ${KinectSDK2_LIBRARIES} )
+ target_link_libraries( Depth ${OpenCV_LIBS} )
+endif()
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/Depth/FindKinectSDK2.cmake b/codes/Kinect2Sample-master/sample/Depth/FindKinectSDK2.cmake
new file mode 100644
index 0000000..00a2036
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/Depth/FindKinectSDK2.cmake
@@ -0,0 +1,182 @@
+#.rst:
+# FindKinectSDK2
+# --------------
+#
+# Find Kinect for Windows SDK v2 (Kinect SDK v2) include dirs, library dirs, libraries and post-build commands
+#
+# Use this module by invoking find_package with the form::
+#
+# find_package( KinectSDK2 [REQUIRED] )
+#
+# Results for users are reported in following variables::
+#
+# KinectSDK2_FOUND - Return "TRUE" when Kinect SDK v2 found. Otherwise, Return "FALSE".
+# KinectSDK2_INCLUDE_DIRS - Kinect SDK v2 include directories. (${KinectSDK2_DIR}/inc)
+# KinectSDK2_LIBRARY_DIRS - Kinect SDK v2 library directories. (${KinectSDK2_DIR}/Lib/x86 or ${KinectSDK2_DIR}/Lib/x64)
+# KinectSDK2_LIBRARIES - Kinect SDK v2 library files. (${KinectSDK2_LIBRARY_DIRS}/Kinect20.lib (If check the box of any application festures, corresponding library will be added.))
+# KinectSDK2_COMMANDS - Copy commands of redist files for application functions of Kinect SDK v2. (If uncheck the box of all application features, this variable has defined empty command.)
+#
+# This module reads hints about search locations from following environment variables::
+#
+# KINECTSDK20_DIR - Kinect SDK v2 root directory. (This environment variable has been set by installer of Kinect SDK v2.)
+#
+# CMake entries::
+#
+# KinectSDK2_DIR - Kinect SDK v2 root directory. (Default $ENV{KINECTSDK20_DIR})
+# KinectSDK2_FACE - Check the box when using Face or HDFace features. (Default uncheck)
+# KinectSDK2_FUSION - Check the box when using Fusion features. (Default uncheck)
+# KinectSDK2_VGB - Check the box when using Visual Gesture Builder features. (Default uncheck)
+#
+# Example to find Kinect SDK v2::
+#
+# cmake_minimum_required( VERSION 2.8 )
+#
+# project( project )
+# add_executable( project main.cpp )
+#
+# # Find package using this module.
+# find_package( KinectSDK2 REQUIRED )
+#
+# if(KinectSDK2_FOUND)
+# # [C/C++]>[General]>[Additional Include Directories]
+# include_directories( ${KinectSDK2_INCLUDE_DIRS} )
+#
+# # [Linker]>[General]>[Additional Library Directories]
+# link_directories( ${KinectSDK2_LIBRARY_DIRS} )
+#
+# # [Linker]>[Input]>[Additional Dependencies]
+# target_link_libraries( project ${KinectSDK2_LIBRARIES} )
+#
+# # [Build Events]>[Post-Build Event]>[Command Line]
+# add_custom_command( TARGET project POST_BUILD ${KinectSDK2_COMMANDS} )
+# endif()
+#
+# =============================================================================
+#
+# Copyright (c) 2016 Tsukasa SUGIURA
+# Distributed under the MIT License.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# =============================================================================
+
+##### Utility #####
+
+# Check Directory Macro
+macro(CHECK_DIR _DIR)
+ if(NOT EXISTS "${${_DIR}}")
+ message(WARNING "Directory \"${${_DIR}}\" not found.")
+ set(KinectSDK2_FOUND FALSE)
+ unset(_DIR)
+ endif()
+endmacro()
+
+# Check Files Macro
+macro(CHECK_FILES _FILES _DIR)
+ set(_MISSING_FILES)
+ foreach(_FILE ${${_FILES}})
+ if(NOT EXISTS "${_FILE}")
+ get_filename_component(_FILE ${_FILE} NAME)
+ set(_MISSING_FILES "${_MISSING_FILES}${_FILE}, ")
+ endif()
+ endforeach()
+ if(_MISSING_FILES)
+ message(WARNING "In directory \"${${_DIR}}\" not found files: ${_MISSING_FILES}")
+ set(KinectSDK2_FOUND FALSE)
+ unset(_FILES)
+ endif()
+endmacro()
+
+# Target Platform
+set(TARGET_PLATFORM)
+if(NOT CMAKE_CL_64)
+ set(TARGET_PLATFORM x86)
+else()
+ set(TARGET_PLATFORM x64)
+endif()
+
+##### Find Kinect SDK v2 #####
+
+# Found
+set(KinectSDK2_FOUND TRUE)
+if(MSVC_VERSION LESS 1700)
+ message(WARNING "Kinect for Windows SDK v2 supported Visual Studio 2012 or later.")
+ set(KinectSDK2_FOUND FALSE)
+endif()
+
+# Options
+option(KinectSDK2_FACE "Face and HDFace features" FALSE)
+option(KinectSDK2_FUSION "Fusion features" FALSE)
+option(KinectSDK2_VGB "Visual Gesture Builder features" FALSE)
+
+# Root Directoty
+set(KinectSDK2_DIR)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_DIR $ENV{KINECTSDK20_DIR} CACHE PATH "Kinect for Windows SDK v2 Install Path." FORCE)
+ check_dir(KinectSDK2_DIR)
+endif()
+
+# Include Directories
+set(KinectSDK2_INCLUDE_DIRS)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_INCLUDE_DIRS ${KinectSDK2_DIR}/inc)
+ check_dir(KinectSDK2_INCLUDE_DIRS)
+endif()
+
+# Library Directories
+set(KinectSDK2_LIBRARY_DIRS)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_LIBRARY_DIRS ${KinectSDK2_DIR}/Lib/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_LIBRARY_DIRS)
+endif()
+
+# Dependencies
+set(KinectSDK2_LIBRARIES)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARY_DIRS}/Kinect20.lib)
+
+ if(KinectSDK2_FACE)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARIES};${KinectSDK2_LIBRARY_DIRS}/Kinect20.Face.lib)
+ endif()
+
+ if(KinectSDK2_FUSION)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARIES};${KinectSDK2_LIBRARY_DIRS}/Kinect20.Fusion.lib)
+ endif()
+
+ if(KinectSDK2_VGB)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARIES};${KinectSDK2_LIBRARY_DIRS}/Kinect20.VisualGestureBuilder.lib)
+ endif()
+
+ check_files(KinectSDK2_LIBRARIES KinectSDK2_LIBRARY_DIRS)
+endif()
+
+# Custom Commands
+set(KinectSDK2_COMMANDS)
+if(KinectSDK2_FOUND)
+ if(KinectSDK2_FACE)
+ set(KinectSDK2_REDIST_DIR ${KinectSDK2_DIR}/Redist/Face/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_REDIST_DIR)
+ list(APPEND KinectSDK2_COMMANDS COMMAND xcopy "${KinectSDK2_REDIST_DIR}" "$(OutDir)" /e /y /i /r > NUL)
+ endif()
+
+ if(KinectSDK2_FUSION)
+ set(KinectSDK2_REDIST_DIR ${KinectSDK2_DIR}/Redist/Fusion/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_REDIST_DIR)
+ list(APPEND KinectSDK2_COMMANDS COMMAND xcopy "${KinectSDK2_REDIST_DIR}" "$(OutDir)" /e /y /i /r > NUL)
+ endif()
+
+ if(KinectSDK2_VGB)
+ set(KinectSDK2_REDIST_DIR ${KinectSDK2_DIR}/Redist/VGB/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_REDIST_DIR)
+ list(APPEND KinectSDK2_COMMANDS COMMAND xcopy "${KinectSDK2_REDIST_DIR}" "$(OutDir)" /e /y /i /r > NUL)
+ endif()
+
+ # Empty Commands
+ if(NOT KinectSDK2_COMMANDS)
+ set(KinectSDK2_COMMANDS COMMAND)
+ endif()
+endif()
+
+message(STATUS "KinectSDK2_FOUND : ${KinectSDK2_FOUND}")
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/Depth/app.cpp b/codes/Kinect2Sample-master/sample/Depth/app.cpp
new file mode 100644
index 0000000..4eb9472
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/Depth/app.cpp
@@ -0,0 +1,167 @@
+#include "app.h"
+#include "util.h"
+
+#include
+#include
+
+// Constructor
+Kinect::Kinect()
+{
+ // Initialize
+ initialize();
+}
+
+// Destructor
+Kinect::~Kinect()
+{
+ // Finalize
+ finalize();
+}
+
+// Processing
+void Kinect::run()
+{
+ // Main Loop
+ while( true ){
+ // Update Data
+ update();
+
+ // Draw Data
+ draw();
+
+ // Show Data
+ show();
+
+ // Key Check
+ const int key = cv::waitKey( 10 );
+ if( key == VK_ESCAPE ){
+ break;
+ }
+ }
+}
+
+// Initialize
+void Kinect::initialize()
+{
+ cv::setUseOptimized( true );
+
+ // Initialize Sensor
+ initializeSensor();
+
+ // Initialize Depth
+ initializeDepth();
+
+ // Wait a Few Seconds until begins to Retrieve Data from Sensor ( about 2000-[ms] )
+ std::this_thread::sleep_for( std::chrono::seconds( 2 ) );
+}
+
+// Initialize Sensor
+inline void Kinect::initializeSensor()
+{
+ // Open Sensor
+ ERROR_CHECK( GetDefaultKinectSensor( &kinect ) );
+
+ ERROR_CHECK( kinect->Open() );
+
+ // Check Open
+ BOOLEAN isOpen = FALSE;
+ ERROR_CHECK( kinect->get_IsOpen( &isOpen ) );
+ if( !isOpen ){
+ throw std::runtime_error( "failed IKinectSensor::get_IsOpen( &isOpen )" );
+ }
+}
+
+// Initialize Depth
+inline void Kinect::initializeDepth()
+{
+ // Open Depth Reader
+ ComPtr depthFrameSource;
+ ERROR_CHECK( kinect->get_DepthFrameSource( &depthFrameSource ) );
+ ERROR_CHECK( depthFrameSource->OpenReader( &depthFrameReader ) );
+
+ // Retrieve Depth Description
+ ComPtr depthFrameDescription;
+ ERROR_CHECK( depthFrameSource->get_FrameDescription( &depthFrameDescription ) );
+ ERROR_CHECK( depthFrameDescription->get_Width( &depthWidth ) ); // 512
+ ERROR_CHECK( depthFrameDescription->get_Height( &depthHeight ) ); // 424
+ ERROR_CHECK( depthFrameDescription->get_BytesPerPixel( &depthBytesPerPixel ) ); // 2
+
+ // Retrieve Depth Reliable Range
+ UINT16 minReliableDistance;
+ UINT16 maxReliableDistance;
+ ERROR_CHECK( depthFrameSource->get_DepthMinReliableDistance( &minReliableDistance ) ); // 500
+ ERROR_CHECK( depthFrameSource->get_DepthMaxReliableDistance( &maxReliableDistance ) ); // 4500
+ std::cout << "Depth Reliable Range : " << minReliableDistance << " - " << maxReliableDistance << std::endl;
+
+ // Allocation Depth Buffer
+ depthBuffer.resize( depthWidth * depthHeight );
+}
+
+// Finalize
+void Kinect::finalize()
+{
+ cv::destroyAllWindows();
+
+ // Close Sensor
+ if( kinect != nullptr ){
+ kinect->Close();
+ }
+}
+
+// Update Data
+void Kinect::update()
+{
+ // Update Depth
+ updateDepth();
+}
+
+// Update Depth
+inline void Kinect::updateDepth()
+{
+ // Retrieve Depth Frame
+ ComPtr depthFrame;
+ const HRESULT ret = depthFrameReader->AcquireLatestFrame( &depthFrame );
+ if( FAILED( ret ) ){
+ return;
+ }
+
+ // Retrieve Depth Data
+ ERROR_CHECK( depthFrame->CopyFrameDataToArray( static_cast( depthBuffer.size() ), &depthBuffer[0] ) );
+}
+
+// Draw Data
+void Kinect::draw()
+{
+ // Draw Depth
+ drawDepth();
+}
+
+// Draw Depth
+inline void Kinect::drawDepth()
+{
+ // Create cv::Mat from Depth Buffer
+ depthMat = cv::Mat( depthHeight, depthWidth, CV_16UC1, &depthBuffer[0] );
+}
+
+// Show Data
+void Kinect::show()
+{
+ // Show Depth
+ showDepth();
+}
+
+// Show Depth
+inline void Kinect::showDepth()
+{
+ if( depthMat.empty() ){
+ return;
+ }
+
+ // Scaling ( 0-8000 -> 255-0 )
+ cv::Mat scaleMat;
+ depthMat.convertTo( scaleMat, CV_8U, -255.0 / 8000.0, 255.0 );
+ //cv::applyColorMap( scaleMat, scaleMat, cv::COLORMAP_BONE );
+
+ // Show Image
+ cv::imshow( "Depth", scaleMat );
+}
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/Depth/app.h b/codes/Kinect2Sample-master/sample/Depth/app.h
new file mode 100644
index 0000000..0afc2f0
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/Depth/app.h
@@ -0,0 +1,71 @@
+#ifndef __APP__
+#define __APP__
+
+#include
+#include
+#include
+
+#include
+
+#include
+using namespace Microsoft::WRL;
+
+class Kinect
+{
+private:
+ // Sensor
+ ComPtr kinect;
+
+ // Reader
+ ComPtr depthFrameReader;
+
+ // Depth Buffer
+ std::vector depthBuffer;
+ int depthWidth;
+ int depthHeight;
+ unsigned int depthBytesPerPixel;
+ cv::Mat depthMat;
+
+public:
+ // Constructor
+ Kinect();
+
+ // Destructor
+ ~Kinect();
+
+ // Processing
+ void run();
+
+private:
+ // Initialize
+ void initialize();
+
+ // Initialize Sensor
+ inline void initializeSensor();
+
+ // Initialize Depth
+ inline void initializeDepth();
+
+ // Finalize
+ void finalize();
+
+ // Update Data
+ void update();
+
+ // Update Depth
+ inline void updateDepth();
+
+ // Draw Data
+ void draw();
+
+ // Draw Depth
+ inline void drawDepth();
+
+ // Show Data
+ void show();
+
+ // Show Depth
+ inline void showDepth();
+};
+
+#endif // __APP__
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/Depth/main.cpp b/codes/Kinect2Sample-master/sample/Depth/main.cpp
new file mode 100644
index 0000000..d88643c
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/Depth/main.cpp
@@ -0,0 +1,16 @@
+#include
+#include
+
+#include "app.h"
+
+int main( int argc, char* argv[] )
+{
+ try{
+ Kinect kinect;
+ kinect.run();
+ } catch( std::exception& ex ){
+ std::cout << ex.what() << std::endl;
+ }
+
+ return 0;
+}
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/Depth/util.h b/codes/Kinect2Sample-master/sample/Depth/util.h
new file mode 100644
index 0000000..0d9787f
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/Depth/util.h
@@ -0,0 +1,37 @@
+#ifndef __UTIL__
+#define __UTIL__
+
+#include
+#include
+
+// Error Check Macro
+#define ERROR_CHECK( ret ) \
+ if( FAILED( ret ) ){ \
+ std::stringstream ss; \
+ ss << "failed " #ret " " << std::hex << ret << std::endl; \
+ throw std::runtime_error( ss.str().c_str() ); \
+ }
+
+// Safe Release
+template
+inline void SafeRelease( T*& rel )
+{
+ if( rel != NULL ){
+ rel->Release();
+ rel = NULL;
+ }
+}
+
+// C++ Style Line Types For OpenCV 2.x
+#if ( CV_MAJOR_VERSION < 3 )
+namespace cv{
+ enum LineTypes{
+ FILLED = -1,
+ LINE_4 = 4,
+ LINE_8 = 8,
+ LINE_AA = 16
+ };
+}
+#endif
+
+#endif // __UTIL__
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/Face/CMakeLists.txt b/codes/Kinect2Sample-master/sample/Face/CMakeLists.txt
new file mode 100644
index 0000000..ee899c6
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/Face/CMakeLists.txt
@@ -0,0 +1,47 @@
+cmake_minimum_required( VERSION 3.6 )
+
+# Create Project
+project( Sample )
+add_executable( Face app.h app.cpp main.cpp util.h )
+
+# Set StartUp Project
+set_property( DIRECTORY PROPERTY VS_STARTUP_PROJECT "Face" )
+
+# Find Package
+set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}" ${CMAKE_MODULE_PATH} )
+set( KinectSDK2_FACE TRUE )
+find_package( KinectSDK2 REQUIRED )
+
+set( OpenCV_DIR "C:/Program Files/opencv/build" )
+option( OpenCV_STATIC OFF )
+find_package( OpenCV REQUIRED )
+
+# Set Static Link Runtime Library
+if( OpenCV_STATIC )
+ foreach( flag_var
+ CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
+ CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
+ CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
+ CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO )
+ if( ${flag_var} MATCHES "/MD" )
+ string( REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}" )
+ endif()
+ endforeach()
+endif()
+
+if( KinectSDK2_FOUND AND OpenCV_FOUND )
+ # Additional Include Directories
+ include_directories( ${KinectSDK2_INCLUDE_DIRS} )
+ include_directories( ${OpenCV_INCLUDE_DIRS} )
+
+ # Additional Library Directories
+ link_directories( ${KinectSDK2_LIBRARY_DIRS} )
+ link_directories( ${OpenCV_LIB_DIR} )
+
+ # Additional Dependencies
+ target_link_libraries( Face ${KinectSDK2_LIBRARIES} )
+ target_link_libraries( Face ${OpenCV_LIBS} )
+
+ # Post Build Event
+ add_custom_command( TARGET Face POST_BUILD ${KinectSDK2_COMMANDS} )
+endif()
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/Face/FindKinectSDK2.cmake b/codes/Kinect2Sample-master/sample/Face/FindKinectSDK2.cmake
new file mode 100644
index 0000000..00a2036
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/Face/FindKinectSDK2.cmake
@@ -0,0 +1,182 @@
+#.rst:
+# FindKinectSDK2
+# --------------
+#
+# Find Kinect for Windows SDK v2 (Kinect SDK v2) include dirs, library dirs, libraries and post-build commands
+#
+# Use this module by invoking find_package with the form::
+#
+# find_package( KinectSDK2 [REQUIRED] )
+#
+# Results for users are reported in following variables::
+#
+# KinectSDK2_FOUND - Return "TRUE" when Kinect SDK v2 found. Otherwise, Return "FALSE".
+# KinectSDK2_INCLUDE_DIRS - Kinect SDK v2 include directories. (${KinectSDK2_DIR}/inc)
+# KinectSDK2_LIBRARY_DIRS - Kinect SDK v2 library directories. (${KinectSDK2_DIR}/Lib/x86 or ${KinectSDK2_DIR}/Lib/x64)
+# KinectSDK2_LIBRARIES - Kinect SDK v2 library files. (${KinectSDK2_LIBRARY_DIRS}/Kinect20.lib (If check the box of any application festures, corresponding library will be added.))
+# KinectSDK2_COMMANDS - Copy commands of redist files for application functions of Kinect SDK v2. (If uncheck the box of all application features, this variable has defined empty command.)
+#
+# This module reads hints about search locations from following environment variables::
+#
+# KINECTSDK20_DIR - Kinect SDK v2 root directory. (This environment variable has been set by installer of Kinect SDK v2.)
+#
+# CMake entries::
+#
+# KinectSDK2_DIR - Kinect SDK v2 root directory. (Default $ENV{KINECTSDK20_DIR})
+# KinectSDK2_FACE - Check the box when using Face or HDFace features. (Default uncheck)
+# KinectSDK2_FUSION - Check the box when using Fusion features. (Default uncheck)
+# KinectSDK2_VGB - Check the box when using Visual Gesture Builder features. (Default uncheck)
+#
+# Example to find Kinect SDK v2::
+#
+# cmake_minimum_required( VERSION 2.8 )
+#
+# project( project )
+# add_executable( project main.cpp )
+#
+# # Find package using this module.
+# find_package( KinectSDK2 REQUIRED )
+#
+# if(KinectSDK2_FOUND)
+# # [C/C++]>[General]>[Additional Include Directories]
+# include_directories( ${KinectSDK2_INCLUDE_DIRS} )
+#
+# # [Linker]>[General]>[Additional Library Directories]
+# link_directories( ${KinectSDK2_LIBRARY_DIRS} )
+#
+# # [Linker]>[Input]>[Additional Dependencies]
+# target_link_libraries( project ${KinectSDK2_LIBRARIES} )
+#
+# # [Build Events]>[Post-Build Event]>[Command Line]
+# add_custom_command( TARGET project POST_BUILD ${KinectSDK2_COMMANDS} )
+# endif()
+#
+# =============================================================================
+#
+# Copyright (c) 2016 Tsukasa SUGIURA
+# Distributed under the MIT License.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# =============================================================================
+
+##### Utility #####
+
+# Check Directory Macro
+macro(CHECK_DIR _DIR)
+ if(NOT EXISTS "${${_DIR}}")
+ message(WARNING "Directory \"${${_DIR}}\" not found.")
+ set(KinectSDK2_FOUND FALSE)
+ unset(_DIR)
+ endif()
+endmacro()
+
+# Check Files Macro
+macro(CHECK_FILES _FILES _DIR)
+ set(_MISSING_FILES)
+ foreach(_FILE ${${_FILES}})
+ if(NOT EXISTS "${_FILE}")
+ get_filename_component(_FILE ${_FILE} NAME)
+ set(_MISSING_FILES "${_MISSING_FILES}${_FILE}, ")
+ endif()
+ endforeach()
+ if(_MISSING_FILES)
+ message(WARNING "In directory \"${${_DIR}}\" not found files: ${_MISSING_FILES}")
+ set(KinectSDK2_FOUND FALSE)
+ unset(_FILES)
+ endif()
+endmacro()
+
+# Target Platform
+set(TARGET_PLATFORM)
+if(NOT CMAKE_CL_64)
+ set(TARGET_PLATFORM x86)
+else()
+ set(TARGET_PLATFORM x64)
+endif()
+
+##### Find Kinect SDK v2 #####
+
+# Found
+set(KinectSDK2_FOUND TRUE)
+if(MSVC_VERSION LESS 1700)
+ message(WARNING "Kinect for Windows SDK v2 supported Visual Studio 2012 or later.")
+ set(KinectSDK2_FOUND FALSE)
+endif()
+
+# Options
+option(KinectSDK2_FACE "Face and HDFace features" FALSE)
+option(KinectSDK2_FUSION "Fusion features" FALSE)
+option(KinectSDK2_VGB "Visual Gesture Builder features" FALSE)
+
+# Root Directoty
+set(KinectSDK2_DIR)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_DIR $ENV{KINECTSDK20_DIR} CACHE PATH "Kinect for Windows SDK v2 Install Path." FORCE)
+ check_dir(KinectSDK2_DIR)
+endif()
+
+# Include Directories
+set(KinectSDK2_INCLUDE_DIRS)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_INCLUDE_DIRS ${KinectSDK2_DIR}/inc)
+ check_dir(KinectSDK2_INCLUDE_DIRS)
+endif()
+
+# Library Directories
+set(KinectSDK2_LIBRARY_DIRS)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_LIBRARY_DIRS ${KinectSDK2_DIR}/Lib/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_LIBRARY_DIRS)
+endif()
+
+# Dependencies
+set(KinectSDK2_LIBRARIES)
+if(KinectSDK2_FOUND)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARY_DIRS}/Kinect20.lib)
+
+ if(KinectSDK2_FACE)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARIES};${KinectSDK2_LIBRARY_DIRS}/Kinect20.Face.lib)
+ endif()
+
+ if(KinectSDK2_FUSION)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARIES};${KinectSDK2_LIBRARY_DIRS}/Kinect20.Fusion.lib)
+ endif()
+
+ if(KinectSDK2_VGB)
+ set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARIES};${KinectSDK2_LIBRARY_DIRS}/Kinect20.VisualGestureBuilder.lib)
+ endif()
+
+ check_files(KinectSDK2_LIBRARIES KinectSDK2_LIBRARY_DIRS)
+endif()
+
+# Custom Commands
+set(KinectSDK2_COMMANDS)
+if(KinectSDK2_FOUND)
+ if(KinectSDK2_FACE)
+ set(KinectSDK2_REDIST_DIR ${KinectSDK2_DIR}/Redist/Face/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_REDIST_DIR)
+ list(APPEND KinectSDK2_COMMANDS COMMAND xcopy "${KinectSDK2_REDIST_DIR}" "$(OutDir)" /e /y /i /r > NUL)
+ endif()
+
+ if(KinectSDK2_FUSION)
+ set(KinectSDK2_REDIST_DIR ${KinectSDK2_DIR}/Redist/Fusion/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_REDIST_DIR)
+ list(APPEND KinectSDK2_COMMANDS COMMAND xcopy "${KinectSDK2_REDIST_DIR}" "$(OutDir)" /e /y /i /r > NUL)
+ endif()
+
+ if(KinectSDK2_VGB)
+ set(KinectSDK2_REDIST_DIR ${KinectSDK2_DIR}/Redist/VGB/${TARGET_PLATFORM})
+ check_dir(KinectSDK2_REDIST_DIR)
+ list(APPEND KinectSDK2_COMMANDS COMMAND xcopy "${KinectSDK2_REDIST_DIR}" "$(OutDir)" /e /y /i /r > NUL)
+ endif()
+
+ # Empty Commands
+ if(NOT KinectSDK2_COMMANDS)
+ set(KinectSDK2_COMMANDS COMMAND)
+ endif()
+endif()
+
+message(STATUS "KinectSDK2_FOUND : ${KinectSDK2_FOUND}")
\ No newline at end of file
diff --git a/codes/Kinect2Sample-master/sample/Face/app.cpp b/codes/Kinect2Sample-master/sample/Face/app.cpp
new file mode 100644
index 0000000..334314b
--- /dev/null
+++ b/codes/Kinect2Sample-master/sample/Face/app.cpp
@@ -0,0 +1,440 @@
+#include "app.h"
+#include "util.h"
+
+#include
+#include
+#define _USE_MATH_DEFINES
+#include
+
+#include
+
+// Constructor
+Kinect::Kinect()
+{
+ // Initialize
+ initialize();
+}
+
+// Destructor
+Kinect::~Kinect()
+{
+ // Finalize
+ finalize();
+}
+
+// Processing
+void Kinect::run()
+{
+ // Main Loop
+ while( true ){
+ // Update Data
+ update();
+
+ // Draw Data
+ draw();
+
+ // Show Data
+ show();
+
+ // Key Check
+ const int key = cv::waitKey( 10 );
+ if( key == VK_ESCAPE ){
+ break;
+ }
+ }
+}
+
+// Initialize
+void Kinect::initialize()
+{
+ cv::setUseOptimized( true );
+
+ // Initialize Sensor
+ initializeSensor();
+
+ // Initialize Color
+ initializeColor();
+
+ // Initialize Body
+ initializeBody();
+
+ // Initialize Face
+ initializeFace();
+
+ // Wait a Few Seconds until begins to Retrieve Data from Sensor ( about 2000-[ms] )
+ std::this_thread::sleep_for( std::chrono::seconds( 2 ) );
+}
+
+// Initialize Sensor
+inline void Kinect::initializeSensor()
+{
+ // Open Sensor
+ ERROR_CHECK( GetDefaultKinectSensor( &kinect ) );
+
+ ERROR_CHECK( kinect->Open() );
+
+ // Check Open
+ BOOLEAN isOpen = FALSE;
+ ERROR_CHECK( kinect->get_IsOpen( &isOpen ) );
+ if( !isOpen ){
+ throw std::runtime_error( "failed IKinectSensor::get_IsOpen( &isOpen )" );
+ }
+
+ // Retrieve Coordinate Mapper
+ ERROR_CHECK( kinect->get_CoordinateMapper( &coordinateMapper ) );
+}
+
+// Initialize Color
+inline void Kinect::initializeColor()
+{
+ // Open Color Reader
+ ComPtr colorFrameSource;
+ ERROR_CHECK( kinect->get_ColorFrameSource( &colorFrameSource ) );
+ ERROR_CHECK( colorFrameSource->OpenReader( &colorFrameReader ) );
+
+ // Retrieve Color Description
+ ComPtr colorFrameDescription;
+ ERROR_CHECK( colorFrameSource->CreateFrameDescription( ColorImageFormat::ColorImageFormat_Bgra, &colorFrameDescription ) );
+ ERROR_CHECK( colorFrameDescription->get_Width( &colorWidth ) ); // 1920
+ ERROR_CHECK( colorFrameDescription->get_Height( &colorHeight ) ); // 1080
+ ERROR_CHECK( colorFrameDescription->get_BytesPerPixel( &colorBytesPerPixel ) ); // 4
+
+ // Allocation Color Buffer
+ colorBuffer.resize( colorWidth * colorHeight * colorBytesPerPixel );
+}
+
+// Initialize Body
+inline void Kinect::initializeBody()
+{
+ // Open Body Reader
+ ComPtr bodyFrameSource;
+ ERROR_CHECK( kinect->get_BodyFrameSource( &bodyFrameSource ) );
+ ERROR_CHECK( bodyFrameSource->OpenReader( &bodyFrameReader ) );
+
+ // Initialize Body Buffer
+ Concurrency::parallel_for_each( bodies.begin(), bodies.end(), []( IBody*& body ){
+ SafeRelease( body );
+ } );
+}
+
+// Initialize Face
+inline void Kinect::initializeFace()
+{
+ // Set Face Features to Enable
+ const DWORD features =
+ FaceFrameFeatures::FaceFrameFeatures_BoundingBoxInColorSpace
+ | FaceFrameFeatures::FaceFrameFeatures_PointsInColorSpace
+ | FaceFrameFeatures::FaceFrameFeatures_RotationOrientation
+ | FaceFrameFeatures::FaceFrameFeatures_Happy
+ | FaceFrameFeatures::FaceFrameFeatures_RightEyeClosed
+ | FaceFrameFeatures::FaceFrameFeatures_LeftEyeClosed
+ | FaceFrameFeatures::FaceFrameFeatures_MouthOpen
+ | FaceFrameFeatures::FaceFrameFeatures_MouthMoved
+ | FaceFrameFeatures::FaceFrameFeatures_LookingAway
+ | FaceFrameFeatures::FaceFrameFeatures_Glasses
+ | FaceFrameFeatures::FaceFrameFeatures_FaceEngagement;
+
+ Concurrency::parallel_for( 0, BODY_COUNT, [&]( const int count ){
+ // Create Face Sources
+ ComPtr faceFrameSource;
+ ERROR_CHECK( CreateFaceFrameSource( kinect.Get(), 0, features, &faceFrameSource ) );
+
+ // Open Face Readers
+ ERROR_CHECK( faceFrameSource->OpenReader( &faceFrameReader[count] ) );
+ } );
+
+ // Color Table for Visualization
+ colors[0] = cv::Vec3b( 255, 0, 0 ); // Blue
+ colors[1] = cv::Vec3b( 0, 255, 0 ); // Green
+ colors[2] = cv::Vec3b( 0, 0, 255 ); // Red
+ colors[3] = cv::Vec3b( 255, 255, 0 ); // Cyan
+ colors[4] = cv::Vec3b( 255, 0, 255 ); // Magenta
+ colors[5] = cv::Vec3b( 0, 255, 255 ); // Yellow
+
+ // Face Property Label Text Table for Display
+ labels[0] = "Happy";
+ labels[1] = "Engaged";
+ labels[2] = "WearingGlasses";
+ labels[3] = "LeftEyeClosed";
+ labels[4] = "RightEyeClosed";
+ labels[5] = "MouthOpen";
+ labels[6] = "MouthMoved";
+ labels[7] = "LookingAway";
+}
+
+// Finalize
+void Kinect::finalize()
+{
+ cv::destroyAllWindows();
+
+ // Release Body Buffer
+ Concurrency::parallel_for_each( bodies.begin(), bodies.end(), []( IBody*& body ){
+ SafeRelease( body );
+ } );
+
+ // Close Sensor
+ if( kinect != nullptr ){
+ kinect->Close();
+ }
+}
+
+// Update Data
+void Kinect::update()
+{
+ // Update Color
+ updateColor();
+
+ // Update Body
+ updateBody();
+
+ // Update Face
+ updateFace();
+}
+
+// Update Color
+inline void Kinect::updateColor()
+{
+ // Retrieve Color Frame
+ ComPtr colorFrame;
+ const HRESULT ret = colorFrameReader->AcquireLatestFrame( &colorFrame );
+ if( FAILED( ret ) ){
+ return;
+ }
+
+ // Convert Format ( YUY2 -> BGRA )
+ ERROR_CHECK( colorFrame->CopyConvertedFrameDataToArray( static_cast( colorBuffer.size() ), &colorBuffer[0], ColorImageFormat::ColorImageFormat_Bgra ) );
+}
+
+// Update Body
+inline void Kinect::updateBody()
+{
+ // Retrieve Body Frame
+ ComPtr bodyFrame;
+ const HRESULT ret = bodyFrameReader->AcquireLatestFrame( &bodyFrame );
+ if( FAILED( ret ) ){
+ return;
+ }
+
+ // Release Previous Bodies
+ Concurrency::parallel_for_each( bodies.begin(), bodies.end(), []( IBody*& body ){
+ SafeRelease( body );
+ } );
+
+ // Retrieve Body Data
+ ERROR_CHECK( bodyFrame->GetAndRefreshBodyData( static_cast( bodies.size() ), &bodies[0] ) );
+ Concurrency::parallel_for( 0, BODY_COUNT, [&]( const int count ){
+ const ComPtr body = bodies[count];
+ BOOLEAN tracked;
+ ERROR_CHECK( body->get_IsTracked( &tracked ) );
+ if( !tracked ){
+ return;
+ }
+
+ // Retrieve Tracking ID
+ UINT64 trackingId;
+ ERROR_CHECK( body->get_TrackingId( &trackingId ) );
+
+ // Registration Tracking ID
+ ComPtr faceFrameSource;
+ ERROR_CHECK( faceFrameReader[count]->get_FaceFrameSource( &faceFrameSource ) );
+ ERROR_CHECK( faceFrameSource->put_TrackingId( trackingId ) );
+ } );
+}
+
+// Update Face
+inline void Kinect::updateFace()
+{
+ // ReSet Results
+ results.fill( nullptr );
+
+ Concurrency::parallel_for( 0, BODY_COUNT, [&]( const int count ){
+ // Retrieve Face Frame
+ ComPtr faceFrame;
+ const HRESULT ret = faceFrameReader[count]->AcquireLatestFrame( &faceFrame );
+ if( FAILED( ret ) ){
+ return;
+ }
+
+ // Check Tracking ID is Valid
+ BOOLEAN tracked;
+ ERROR_CHECK( faceFrame->get_IsTrackingIdValid( &tracked ) );
+ if( !tracked ){
+ return;
+ }
+
+ // Release Previous Face Result and Retrieve Face Result
+ ERROR_CHECK( faceFrame->get_FaceFrameResult( &results[count] ) );
+ } );
+}
+
+// Draw Data
+void Kinect::draw()
+{
+ // Draw Color
+ drawColor();
+
+ // Draw Face
+ drawFace();
+}
+
+// Draw Color
+inline void Kinect::drawColor()
+{
+ // Create cv::Mat from Color Buffer
+ colorMat = cv::Mat( colorHeight, colorWidth, CV_8UC4, &colorBuffer[0] );
+}
+
+// Draw Face
+inline void Kinect::drawFace()
+{
+ if( colorMat.empty() ){
+ return;
+ }
+
+ Concurrency::parallel_for( 0, BODY_COUNT, [&]( const int count ){
+ const ComPtr