diff --git a/K4AdotNet-Femto-64.png b/K4AdotNet-Femto-64.png new file mode 100644 index 0000000..1f01925 Binary files /dev/null and b/K4AdotNet-Femto-64.png differ diff --git a/K4AdotNet-Femto.ico b/K4AdotNet-Femto.ico new file mode 100644 index 0000000..99fe0d7 Binary files /dev/null and b/K4AdotNet-Femto.ico differ diff --git a/K4AdotNet.Samples.Wpf.BackgroundRemover/K4AdotNet.Samples.Wpf.BackgroundRemover.csproj b/K4AdotNet.Samples.Wpf.BackgroundRemover/K4AdotNet.Samples.Wpf.BackgroundRemover.csproj index e06ad95..df8370b 100644 --- a/K4AdotNet.Samples.Wpf.BackgroundRemover/K4AdotNet.Samples.Wpf.BackgroundRemover.csproj +++ b/K4AdotNet.Samples.Wpf.BackgroundRemover/K4AdotNet.Samples.Wpf.BackgroundRemover.csproj @@ -20,11 +20,18 @@ - + Always + + + + Always + + + \ No newline at end of file diff --git a/K4AdotNet.Samples.Wpf.BodyTracker/K4AdotNet.Samples.Wpf.BodyTracker.csproj b/K4AdotNet.Samples.Wpf.BodyTracker/K4AdotNet.Samples.Wpf.BodyTracker.csproj index fc60735..65b2ac1 100644 --- a/K4AdotNet.Samples.Wpf.BodyTracker/K4AdotNet.Samples.Wpf.BodyTracker.csproj +++ b/K4AdotNet.Samples.Wpf.BodyTracker/K4AdotNet.Samples.Wpf.BodyTracker.csproj @@ -20,11 +20,18 @@ - + Always + + + + Always + + + \ No newline at end of file diff --git a/K4AdotNet.Samples.Wpf.Viewer/K4AdotNet.Samples.Wpf.Viewer.csproj b/K4AdotNet.Samples.Wpf.Viewer/K4AdotNet.Samples.Wpf.Viewer.csproj index 74b1248..67ae5a7 100644 --- a/K4AdotNet.Samples.Wpf.Viewer/K4AdotNet.Samples.Wpf.Viewer.csproj +++ b/K4AdotNet.Samples.Wpf.Viewer/K4AdotNet.Samples.Wpf.Viewer.csproj @@ -20,11 +20,18 @@ - + Always + + + + Always + + + \ No newline at end of file diff --git a/K4AdotNet.sln b/K4AdotNet.sln index 6c4f4ef..d137d98 100644 --- a/K4AdotNet.sln +++ b/K4AdotNet.sln @@ -10,6 +10,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "0 - Solution Items", "0 - S .gitattributes = .gitattributes .gitignore = .gitignore K4AdotNet-64.png = K4AdotNet-64.png + K4AdotNet-Femto-64.png = K4AdotNet-Femto-64.png + K4AdotNet-Femto.ico = K4AdotNet-Femto.ico K4AdotNet.ico = K4AdotNet.ico LICENSE = LICENSE Product.props = Product.props diff --git a/K4AdotNet/K4AdotNet.csproj b/K4AdotNet/K4AdotNet.csproj index ce9c0e4..ff265e9 100644 --- a/K4AdotNet/K4AdotNet.csproj +++ b/K4AdotNet/K4AdotNet.csproj @@ -22,19 +22,19 @@ - + PreserveNewest False - + PreserveNewest False - + PreserveNewest False - + PreserveNewest False diff --git a/K4AdotNet/Sdk.cs b/K4AdotNet/Sdk.cs index ffa1e85..e96861c 100644 --- a/K4AdotNet/Sdk.cs +++ b/K4AdotNet/Sdk.cs @@ -13,6 +13,19 @@ namespace K4AdotNet /// Static class with common basic things for Sensor, Record and Body Tracking APIs like logging, initializing, loading of dependencies, etc. public static class Sdk { + /// Is underlying level the OrbbecSDK K4A Wrapper rather than original Kinect for Azure SDK? + /// + /// K4A.Net library can be compiled in version that supports Orbbec Femto depth sensors via Orbbec SDK K4A Wrapper. + /// There is no full compatibility between original Kinect for Azure SDK and OrbbecSDK-K4A-Wrapper. + /// To distinguish between them in client code, one can use this property. + /// + public static bool IsOrbbecSdkK4AWrapper +#if ORBBECSDK_K4A_WRAPPER + => true; +#else + => false; +#endif + #region Dependencies /// Name of main library (DLL) from Azure Kinect Sensor SDK. diff --git a/Product.props b/Product.props index ab1cc1e..7306238 100644 --- a/Product.props +++ b/Product.props @@ -1,7 +1,9 @@ - 1.4.14.0 - 1.4.14.0 - + 1.4.15.0 + 1.4.15.0 + + + ORBBECSDK_K4A_WRAPPER \ No newline at end of file diff --git a/README.md b/README.md index 549cb91..0bb3669 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ -**K4A.Net** — *Three-in-one* managed .NET library to work with [Azure Kinect](https://azure.microsoft.com/en-us/services/kinect-dk/) devices (also known as Kinect for Azure, K4A, Kinect v4). It consists of the following "components": +**K4A.Net** — *Three-in-one* managed .NET library to work with [Azure Kinect](https://azure.microsoft.com/en-us/services/kinect-dk/) depth sensors (also known as Kinect for Azure, K4A, Kinect v4). Also it can be used to work with [Orbbec Femto Bolt](https://www.orbbec.com/products/tof-camera/femto-bolt/) and [Mega](https://www.orbbec.com/products/tof-camera/femto-mega/) depth sensors via [Orbbec SDK K4A Wrapper](https://github.com/orbbec/OrbbecSDK-K4A-Wrapper). It consists of the following "components": 1. `Sensor API` — access to depth camera, RGB camera, accelerometer and gyroscope, plus device-calibration data and synchronization control * Corresponding namespace: `K4AdotNet.Sensor` * Corresponding native API: [`k4a.h`](https://github.com/bibigone/k4a.net/blob/master/externals/k4a/include/k4a/k4a.h) @@ -19,9 +19,9 @@ * Written fully on C# * CLS-compliant (can be used from any .Net-compatible language, including C#, F#, VB.Net) * Library **K4AdotNet** is compiled against **NET 6.0**, **.NET Standard 2.0** and **.NET Framework 4.6.1** target frameworks - * This makes it compatible with **.NET 5-7**, **.NET Core 2.0-3.1**, **.NET Framework 4.6.1** and later, **Unity 2018.1** and later, etc. + * This makes it compatible with **.NET 5-8**, **.NET Core 2.0-3.1**, **.NET Framework 4.6.1** and later, **Unity 2018.1** and later, etc. * See https://docs.microsoft.com/en-us/dotnet/standard/net-standard for details -* Clean API, which is close to C/C++ native API from [Azure Kinect Sensor SDK](https://docs.microsoft.com/en-us/azure/Kinect-dk/sensor-sdk-download) and [Azure Kinect Body Tracking SDK](https://docs.microsoft.com/en-us/azure/Kinect-dk/body-sdk-download). +* Clean API, which is close to C/C++ native API from [Azure Kinect Sensor SDK](https://docs.microsoft.com/en-us/azure/Kinect-dk/sensor-sdk-download) (or [Orbbec SDK K4A Wrapper](https://github.com/orbbec/OrbbecSDK-K4A-Wrapper)) and [Azure Kinect Body Tracking SDK](https://docs.microsoft.com/en-us/azure/Kinect-dk/body-sdk-download). * Plus useful helper methods, additional checks and meaningful exceptions. * Full feature set (all API provided by native SDKs are available in this C# wrapper) * Up-to-date with the latest versions of native SDKs @@ -37,7 +37,9 @@ * Unit-tested * Multi-platform (Windows, Linux) * But most of samples are written using WPF -* Available as NuGet package: https://www.nuget.org/packages/K4AdotNet +* Available as NuGet packages: + * Azure Kinect version: https://www.nuget.org/packages/K4AdotNet + * Orbbec Femto Bolt/Mega version: https://www.nuget.org/packages/K4AdotNet-Femto ## Dependencies @@ -94,3 +96,13 @@ See https://github.com/bibigone/k4a.net/releases * `K4AdotNet.Samples.Wpf.BodyTracker` — sample WPF application to demonstrate usage of Body Tracking API. * `K4AdotNet.Samples.Wpf.BackgroundRemover` — sample WPF application which implements the background removal effect for color picture with the help of depth data. * Instruction on building Unity sample can be found [here](https://github.com/bibigone/k4a.net/blob/master/K4AdotNet.Samples.Unity/readme.md). + +## Orbbec Femto Bolt/Mega support + + + +This library is compatible with [Orbbec Femto Bolt](https://www.orbbec.com/products/tof-camera/femto-bolt/) and [Mega](https://www.orbbec.com/products/tof-camera/femto-mega/) depth sensors. It is possible due to [Orbbec SDK K4A Wrapper](https://github.com/orbbec/OrbbecSDK-K4A-Wrapper) that implements the API of original native [K4A library](https://github.com/microsoft/Azure-Kinect-Sensor-SDK) via [Orbbec SDK](https://github.com/orbbec/OrbbecSDK). + +`ORBBECSDK_K4A_WRAPPER` constant must be defined to compile the Orbbec-compatible version of the library. See `Product.props` file for details. + +**Note.** There is no full compatibility between [Orbbec SDK K4A Wrapper](https://github.com/orbbec/OrbbecSDK-K4A-Wrapper) and original [K4A library](https://github.com/microsoft/Azure-Kinect-Sensor-SDK). Major differences between them are described [here](https://www.orbbec.com/documentation/comparison-with-azure-kinect-dk/). But actually there are much more inconsistencies. Check value of the `Sdk.IsOrbbecSdkK4AWrapper` property in client code to determine what version of library is in use. diff --git a/externals/OrbbecSDK-K4A-Wrapper/win_x64/OrbbecSDK.dll b/externals/OrbbecSDK-K4A-Wrapper/win-x64/OrbbecSDK.dll similarity index 100% rename from externals/OrbbecSDK-K4A-Wrapper/win_x64/OrbbecSDK.dll rename to externals/OrbbecSDK-K4A-Wrapper/win-x64/OrbbecSDK.dll diff --git a/externals/OrbbecSDK-K4A-Wrapper/win_x64/depthengine_2_0.dll b/externals/OrbbecSDK-K4A-Wrapper/win-x64/depthengine_2_0.dll similarity index 100% rename from externals/OrbbecSDK-K4A-Wrapper/win_x64/depthengine_2_0.dll rename to externals/OrbbecSDK-K4A-Wrapper/win-x64/depthengine_2_0.dll diff --git a/externals/OrbbecSDK-K4A-Wrapper/win_x64/k4a.dll b/externals/OrbbecSDK-K4A-Wrapper/win-x64/k4a.dll similarity index 100% rename from externals/OrbbecSDK-K4A-Wrapper/win_x64/k4a.dll rename to externals/OrbbecSDK-K4A-Wrapper/win-x64/k4a.dll diff --git a/externals/OrbbecSDK-K4A-Wrapper/win_x64/k4arecord.dll b/externals/OrbbecSDK-K4A-Wrapper/win-x64/k4arecord.dll similarity index 100% rename from externals/OrbbecSDK-K4A-Wrapper/win_x64/k4arecord.dll rename to externals/OrbbecSDK-K4A-Wrapper/win-x64/k4arecord.dll diff --git a/package/build-femto.cmd b/package/build-femto.cmd new file mode 100644 index 0000000..43ef233 --- /dev/null +++ b/package/build-femto.cmd @@ -0,0 +1,27 @@ +@ECHO OFF + +set MSBUILD_PATH="%ProgramFiles%\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MsBuild.exe" + +cd .. + +package\nuget.exe restore +IF %ERRORLEVEL% NEQ 0 GOTO ERROR + +%MSBUILD_PATH% K4AdotNet.sln /t:Clean /p:Configuration=Release /p:Platform="Any CPU" /p:Devices=Femto /v:m +IF %ERRORLEVEL% NEQ 0 GOTO ERROR + +%MSBUILD_PATH% K4AdotNet.sln /t:Rebuild /p:Configuration=Release /p:Platform="Any CPU" /p:Devices=Femto /v:m +IF %ERRORLEVEL% NEQ 0 GOTO ERROR + +cd package + +nuget.exe pack k4adotnet-femto.nuspec +IF %ERRORLEVEL% NEQ 0 GOTO ERROR + +echo DONE! +exit /B 0 + +:ERROR +echo FAIL! +pause +exit /B -1 diff --git a/package/k4adotnet-femto.nuspec b/package/k4adotnet-femto.nuspec new file mode 100644 index 0000000..11779ae --- /dev/null +++ b/package/k4adotnet-femto.nuspec @@ -0,0 +1,53 @@ + + + + K4AdotNet-Femto + 1.4.15 + bibigone,baSSiLL + + false + MIT + https://github.com/bibigone/k4a.net/blob/master/README.md + https://github.com/bibigone/k4a.net/raw/master/K4AdotNet-Femto-64.png + Version of K4A.Net (K4AdotNet) library that works with Orbbec Femto Bolt and Mega depth sensors via Orbbec SDK K4A Wrapper. It includes sensor API, recording and playback API, body tracking API. The API is exactly the same as in original K4A.Net (K4AdotNet) library. Compatible with .NET Standard 2.0 and .Net Framework 4.6.1 and later, .NET 6 and later. All required binaries from Orbbec SDK K4A Wrapper (win x64) are included. Samples (WPF, .NET Core and Unity) can be found in the source repository. + See https://github.com/bibigone/k4a.net/releases + Copyright (c) 2019-2024 + Orbbec Femto Bolt Mega Kinect Azure .NET K4A Depth Sensor Body Tracking BodyTracking SDK Wrapper + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/package/k4adotnet-femto.targets b/package/k4adotnet-femto.targets new file mode 100644 index 0000000..4b37ba9 --- /dev/null +++ b/package/k4adotnet-femto.targets @@ -0,0 +1,9 @@ + + + + %(FileName)%(Extension) + PreserveNewest + False + + + \ No newline at end of file diff --git a/package/k4adotnet.nuspec b/package/k4adotnet.nuspec index b1a2deb..b67ca61 100644 --- a/package/k4adotnet.nuspec +++ b/package/k4adotnet.nuspec @@ -2,16 +2,16 @@ K4AdotNet - 1.4.14 + 1.4.15 bibigone,baSSiLL false MIT https://github.com/bibigone/k4a.net/blob/master/README.md https://github.com/bibigone/k4a.net/raw/master/K4AdotNet-64.png - Three-in-one .NET library to work with Azure Kinect devices. It includes sensor API, recording and playback API, body tracking API. Compatible with .NET Standard 2.0 and .NET Framework 4.6.1 and later. All required binaries from Azure Kinect Sensor SDK (win x64) are included. Samples (WPF, .NET Core and Unity) can be found in the source repository. + Three-in-one .NET library to work with Azure Kinect depth sensors. It includes sensor API, recording and playback API, body tracking API. Compatible with .NET Standard 2.0 and .Net Framework 4.6.1 and later, .NET 6 and later. All required binaries from Azure Kinect Sensor SDK (win x64, x86) are included. Samples (WPF, .NET Core and Unity) can be found in the source repository. See https://github.com/bibigone/k4a.net/releases - Copyright (c) 2019-2023 + Copyright (c) 2019-2024 Kinect Azure .NET K4A Depth Sensor Body Tracking BodyTracking SDK