Merge branch 'develop' into user/wensi/calibration_info

This commit is contained in:
Vincent Wen 2019-02-26 22:01:49 -08:00 коммит произвёл GitHub
Родитель d087797ff0 619ff2b3cc
Коммит d785f61d83
126 изменённых файлов: 1230 добавлений и 148 удалений

Просмотреть файл

@ -5,9 +5,6 @@ add_subdirectory(calibration)
add_subdirectory(enumerate)
add_subdirectory(fastpointcloud)
add_subdirectory(k4arecorder)
add_subdirectory(k4aviewer)
add_subdirectory(k4afastcapture_streaming)
add_subdirectory(k4afastcapture_trigger)
add_subdirectory(opencv_compatibility)
add_subdirectory(snipits)
add_subdirectory(streaming)

61
examples/Examples.sln Normal file
Просмотреть файл

@ -0,0 +1,61 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.168
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "enumerate", "enumerate\enumerate.vcxproj", "{62BBF31D-B1EB-439C-8C2E-47B129640B7B}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fastpointcloud", "fastpointcloud\fastpointcloud.vcxproj", "{30154D6B-3205-45DC-A1AA-287B37337179}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "k4arecorder", "k4arecorder\k4arecorder.vcxproj", "{92A1A302-5530-4944-869B-F8F4B1E4B1E4}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "streaming", "streaming\streaming.vcxproj", "{369B1FB5-256C-4B6E-8BDC-94F5A3B337A1}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "transformation", "transformation\transformation.vcxproj", "{5F1CF02B-67F7-4E5C-8CA3-EB059EAD450B}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "undistort", "undistort\undistort.vcxproj", "{2A3EC17F-FED3-4C9B-AFE2-78B16BD87981}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opencv_compatibility", "opencv_compatibility\opencv_compatibility.vcxproj", "{4AFBA7D8-1AAA-4D97-90B9-43FAE4C26D47}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{62BBF31D-B1EB-439C-8C2E-47B129640B7B}.Debug|x64.ActiveCfg = Debug|x64
{62BBF31D-B1EB-439C-8C2E-47B129640B7B}.Debug|x64.Build.0 = Debug|x64
{62BBF31D-B1EB-439C-8C2E-47B129640B7B}.Release|x64.ActiveCfg = Release|x64
{62BBF31D-B1EB-439C-8C2E-47B129640B7B}.Release|x64.Build.0 = Release|x64
{30154D6B-3205-45DC-A1AA-287B37337179}.Debug|x64.ActiveCfg = Debug|x64
{30154D6B-3205-45DC-A1AA-287B37337179}.Debug|x64.Build.0 = Debug|x64
{30154D6B-3205-45DC-A1AA-287B37337179}.Release|x64.ActiveCfg = Release|x64
{30154D6B-3205-45DC-A1AA-287B37337179}.Release|x64.Build.0 = Release|x64
{92A1A302-5530-4944-869B-F8F4B1E4B1E4}.Debug|x64.ActiveCfg = Debug|x64
{92A1A302-5530-4944-869B-F8F4B1E4B1E4}.Debug|x64.Build.0 = Debug|x64
{92A1A302-5530-4944-869B-F8F4B1E4B1E4}.Release|x64.ActiveCfg = Release|x64
{92A1A302-5530-4944-869B-F8F4B1E4B1E4}.Release|x64.Build.0 = Release|x64
{369B1FB5-256C-4B6E-8BDC-94F5A3B337A1}.Debug|x64.ActiveCfg = Debug|x64
{369B1FB5-256C-4B6E-8BDC-94F5A3B337A1}.Debug|x64.Build.0 = Debug|x64
{369B1FB5-256C-4B6E-8BDC-94F5A3B337A1}.Release|x64.ActiveCfg = Release|x64
{369B1FB5-256C-4B6E-8BDC-94F5A3B337A1}.Release|x64.Build.0 = Release|x64
{5F1CF02B-67F7-4E5C-8CA3-EB059EAD450B}.Debug|x64.ActiveCfg = Debug|x64
{5F1CF02B-67F7-4E5C-8CA3-EB059EAD450B}.Debug|x64.Build.0 = Debug|x64
{5F1CF02B-67F7-4E5C-8CA3-EB059EAD450B}.Release|x64.ActiveCfg = Release|x64
{5F1CF02B-67F7-4E5C-8CA3-EB059EAD450B}.Release|x64.Build.0 = Release|x64
{2A3EC17F-FED3-4C9B-AFE2-78B16BD87981}.Debug|x64.ActiveCfg = Debug|x64
{2A3EC17F-FED3-4C9B-AFE2-78B16BD87981}.Debug|x64.Build.0 = Debug|x64
{2A3EC17F-FED3-4C9B-AFE2-78B16BD87981}.Release|x64.ActiveCfg = Release|x64
{2A3EC17F-FED3-4C9B-AFE2-78B16BD87981}.Release|x64.Build.0 = Release|x64
{4AFBA7D8-1AAA-4D97-90B9-43FAE4C26D47}.Debug|x64.ActiveCfg = Debug|x64
{4AFBA7D8-1AAA-4D97-90B9-43FAE4C26D47}.Debug|x64.Build.0 = Debug|x64
{4AFBA7D8-1AAA-4D97-90B9-43FAE4C26D47}.Release|x64.ActiveCfg = Release|x64
{4AFBA7D8-1AAA-4D97-90B9-43FAE4C26D47}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7E9C9592-7A28-46EE-AFFB-BD148338895C}
EndGlobalSection
EndGlobal

Просмотреть файл

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{62BBF31D-B1EB-439C-8C2E-47B129640B7B}</ProjectGuid>
<RootNamespace>enumerate</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<LibraryPath>$(ProgramW6432)\Azure Kinect SDK\sdk\amd64\$(Configuration)\lib;$(LibraryPath)</LibraryPath>
<IncludePath>$(ProgramW6432)\Azure Kinect SDK\sdk\include;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<AdditionalDependencies>k4a.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>k4a.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="main.c" />
</ItemGroup>
<ItemGroup>
<None Include="readme.md" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<Target Name="CopyFiles" AfterTargets="Build">
<ItemGroup>
<AzureKinectBinaries Include="$(ProgramW6432)\Azure Kinect SDK\sdk\amd64\$(Configuration)\bin\**\*" />
</ItemGroup>
<Copy SourceFiles="@(AzureKinectBinaries)" DestinationFolder="$(OutputPath)" SkipUnchangedFiles="true" />
</Target>
</Project>

Просмотреть файл

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{30154D6B-3205-45DC-A1AA-287B37337179}</ProjectGuid>
<RootNamespace>fastpointcloud</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<LibraryPath>$(ProgramW6432)\Azure Kinect SDK\sdk\amd64\$(Configuration)\lib;$(LibraryPath)</LibraryPath>
<IncludePath>$(ProgramW6432)\Azure Kinect SDK\sdk\include;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<AdditionalDependencies>k4a.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>k4a.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="main.cpp" />
</ItemGroup>
<ItemGroup>
<None Include="README.md" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<Target Name="CopyFiles" AfterTargets="Build">
<ItemGroup>
<AzureKinectBinaries Include="$(ProgramW6432)\Azure Kinect SDK\sdk\amd64\$(Configuration)\bin\**\*" />
</ItemGroup>
<Copy SourceFiles="@(AzureKinectBinaries)" DestinationFolder="$(OutputPath)" SkipUnchangedFiles="true" />
</Target>
</Project>

Просмотреть файл

@ -0,0 +1,88 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{92A1A302-5530-4944-869B-F8F4B1E4B1E4}</ProjectGuid>
<RootNamespace>k4afastcapture_streaming</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<LibraryPath>$(ProgramW6432)\Azure Kinect SDK\sdk\amd64\$(Configuration)\lib;$(LibraryPath)</LibraryPath>
<IncludePath>$(ProgramW6432)\Azure Kinect SDK\sdk\include;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<AdditionalDependencies>k4a.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>k4a.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="k4afastcapture.cpp" />
<ClCompile Include="main.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<Target Name="CopyFiles" AfterTargets="Build">
<ItemGroup>
<AzureKinectBinaries Include="$(ProgramW6432)\Azure Kinect SDK\sdk\amd64\$(Configuration)\bin\**\*" />
</ItemGroup>
<Copy SourceFiles="@(AzureKinectBinaries)" DestinationFolder="$(OutputPath)" SkipUnchangedFiles="true" />
</Target>
</Project>

Просмотреть файл

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{92A1A302-5530-4944-869B-F8F4B1E4B1E4}</ProjectGuid>
<RootNamespace>k4arecorder</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<LibraryPath>$(ProgramW6432)\Azure Kinect SDK\sdk\amd64\$(Configuration)\lib;$(LibraryPath)</LibraryPath>
<IncludePath>$(ProgramW6432)\Azure Kinect SDK\sdk\include;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<AdditionalDependencies>k4a.lib;k4arecord.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>k4a.lib;k4arecord.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="recorder.cpp" />
<ClCompile Include="main.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="cmdparser.h" />
<ClInclude Include="recorder.h" />
</ItemGroup>
<ItemGroup>
<None Include="README.md" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<Target Name="CopyFiles" AfterTargets="Build">
<ItemGroup>
<AzureKinectBinaries Include="$(ProgramW6432)\Azure Kinect SDK\sdk\amd64\$(Configuration)\bin\**\*" />
</ItemGroup>
<Copy SourceFiles="@(AzureKinectBinaries)" DestinationFolder="$(OutputPath)" SkipUnchangedFiles="true" />
</Target>
</Project>

Просмотреть файл

@ -9,7 +9,27 @@
#include <k4a/k4a.h>
#include <k4arecord/record.h>
#include <k4ainternal/common.h>
inline static uint32_t k4a_convert_fps_to_uint(k4a_fps_t fps)
{
uint32_t fps_int;
switch (fps)
{
case K4A_FRAMES_PER_SECOND_5:
fps_int = 5;
break;
case K4A_FRAMES_PER_SECOND_15:
fps_int = 15;
break;
case K4A_FRAMES_PER_SECOND_30:
fps_int = 30;
break;
default:
fps_int = 0;
break;
}
return fps_int;
}
// call k4a_device_close on every failed CHECK
#define CHECK(x, device) \

Просмотреть файл

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{4AFBA7D8-1AAA-4D97-90B9-43FAE4C26D47}</ProjectGuid>
<RootNamespace>opencv_compatibility</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<LibraryPath>$(ProgramW6432)\Azure Kinect SDK\sdk\amd64\$(Configuration)\lib;$(LibraryPath)</LibraryPath>
<IncludePath>$(ProgramW6432)\Azure Kinect SDK\sdk\include;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<AdditionalDependencies>k4a.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>k4a.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="main.cpp" />
</ItemGroup>
<ItemGroup>
<None Include="README.md" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<Target Name="CopyFiles" AfterTargets="Build">
<ItemGroup>
<AzureKinectBinaries Include="$(ProgramW6432)\Azure Kinect SDK\sdk\amd64\$(Configuration)\bin\**\*" />
</ItemGroup>
<Copy SourceFiles="@(AzureKinectBinaries)" DestinationFolder="$(OutputPath)" SkipUnchangedFiles="true" />
</Target>
</Project>

Просмотреть файл

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{369B1FB5-256C-4B6E-8BDC-94F5A3B337A1}</ProjectGuid>
<RootNamespace>streaming</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<LibraryPath>$(ProgramW6432)\Azure Kinect SDK\sdk\amd64\$(Configuration)\lib;$(LibraryPath)</LibraryPath>
<IncludePath>$(ProgramW6432)\Azure Kinect SDK\sdk\include;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<AdditionalDependencies>k4a.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>k4a.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="main.c" />
</ItemGroup>
<ItemGroup>
<None Include="readme.md" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<Target Name="CopyFiles" AfterTargets="Build">
<ItemGroup>
<AzureKinectBinaries Include="$(ProgramW6432)\Azure Kinect SDK\sdk\amd64\$(Configuration)\bin\**\*" />
</ItemGroup>
<Copy SourceFiles="@(AzureKinectBinaries)" DestinationFolder="$(OutputPath)" SkipUnchangedFiles="true" />
</Target>
</Project>

Просмотреть файл

@ -10,19 +10,29 @@ static bool point_cloud_color_to_depth(k4a_transformation_t transformation_handl
const k4a_image_t color_image,
std::string file_name)
{
int depth_image_width_pixels = k4a_image_get_width_pixels(depth_image);
int depth_image_height_pixels = k4a_image_get_height_pixels(depth_image);
k4a_image_t transformed_color_image = NULL;
k4a_image_create(K4A_IMAGE_FORMAT_COLOR_BGRA32,
k4a_image_get_width_pixels(depth_image),
k4a_image_get_height_pixels(depth_image),
k4a_image_get_width_pixels(depth_image) * 4 * (int)sizeof(uint8_t),
&transformed_color_image);
if (K4A_RESULT_SUCCEEDED != k4a_image_create(K4A_IMAGE_FORMAT_COLOR_BGRA32,
depth_image_width_pixels,
depth_image_height_pixels,
depth_image_width_pixels * 4 * (int)sizeof(uint8_t),
&transformed_color_image))
{
printf("Failed to create transformed color image\n");
return false;
}
k4a_image_t point_cloud_image = NULL;
k4a_image_create(K4A_IMAGE_FORMAT_CUSTOM,
k4a_image_get_width_pixels(depth_image),
k4a_image_get_height_pixels(depth_image),
k4a_image_get_width_pixels(depth_image) * 3 * (int)sizeof(int16_t),
&point_cloud_image);
if (K4A_RESULT_SUCCEEDED != k4a_image_create(K4A_IMAGE_FORMAT_CUSTOM,
depth_image_width_pixels,
depth_image_height_pixels,
depth_image_width_pixels * 3 * (int)sizeof(int16_t),
&point_cloud_image))
{
printf("Failed to create point cloud image\n");
return false;
}
if (K4A_RESULT_SUCCEEDED != k4a_transformation_color_image_to_depth_camera(transformation_handle,
depth_image,
@ -56,19 +66,29 @@ static bool point_cloud_depth_to_color(k4a_transformation_t transformation_handl
std::string file_name)
{
// transform color image into depth camera geometry
int color_image_width_pixels = k4a_image_get_width_pixels(color_image);
int color_image_height_pixels = k4a_image_get_height_pixels(color_image);
k4a_image_t transformed_depth_image = NULL;
k4a_image_create(K4A_IMAGE_FORMAT_DEPTH16,
k4a_image_get_width_pixels(color_image),
k4a_image_get_height_pixels(color_image),
k4a_image_get_width_pixels(color_image) * (int)sizeof(uint16_t),
&transformed_depth_image);
if (K4A_RESULT_SUCCEEDED != k4a_image_create(K4A_IMAGE_FORMAT_DEPTH16,
color_image_width_pixels,
color_image_height_pixels,
color_image_width_pixels * (int)sizeof(uint16_t),
&transformed_depth_image))
{
printf("Failed to create transformed depth image\n");
return false;
}
k4a_image_t point_cloud_image = NULL;
k4a_image_create(K4A_IMAGE_FORMAT_CUSTOM,
k4a_image_get_width_pixels(color_image),
k4a_image_get_height_pixels(color_image),
k4a_image_get_width_pixels(color_image) * 3 * (int)sizeof(int16_t),
&point_cloud_image);
if (K4A_RESULT_SUCCEEDED != k4a_image_create(K4A_IMAGE_FORMAT_CUSTOM,
color_image_width_pixels,
color_image_height_pixels,
color_image_width_pixels * 3 * (int)sizeof(int16_t),
&point_cloud_image))
{
printf("Failed to create point cloud image\n");
return false;
}
if (K4A_RESULT_SUCCEEDED !=
k4a_transformation_depth_image_to_color_camera(transformation_handle, depth_image, transformed_depth_image))

Просмотреть файл

@ -0,0 +1,92 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{5F1CF02B-67F7-4E5C-8CA3-EB059EAD450B}</ProjectGuid>
<RootNamespace>transformation</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<LibraryPath>$(ProgramW6432)\Azure Kinect SDK\sdk\amd64\$(Configuration)\lib;$(LibraryPath)</LibraryPath>
<IncludePath>$(ProgramW6432)\Azure Kinect SDK\sdk\include;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<AdditionalDependencies>k4a.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>k4a.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="main.cpp" />
<ClCompile Include="transformation_helpers.cpp" />
</ItemGroup>
<ItemGroup>
<None Include="README.md" />
<None Include="transformation_helpers.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<Target Name="CopyFiles" AfterTargets="Build">
<ItemGroup>
<AzureKinectBinaries Include="$(ProgramW6432)\Azure Kinect SDK\sdk\amd64\$(Configuration)\bin\**\*" />
</ItemGroup>
<Copy SourceFiles="@(AzureKinectBinaries)" DestinationFolder="$(OutputPath)" SkipUnchangedFiles="true" />
</Target>
</Project>

Просмотреть файл

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{2A3EC17F-FED3-4C9B-AFE2-78B16BD87981}</ProjectGuid>
<RootNamespace>undistort</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<LibraryPath>$(ProgramW6432)\Azure Kinect SDK\sdk\amd64\$(Configuration)\lib;$(LibraryPath)</LibraryPath>
<IncludePath>$(ProgramW6432)\Azure Kinect SDK\sdk\include;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<AdditionalDependencies>k4a.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>k4a.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="main.cpp" />
</ItemGroup>
<ItemGroup>
<None Include="README.md" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<Target Name="CopyFiles" AfterTargets="Build">
<ItemGroup>
<AzureKinectBinaries Include="$(ProgramW6432)\Azure Kinect SDK\sdk\amd64\$(Configuration)\bin\**\*" />
</ItemGroup>
<Copy SourceFiles="@(AzureKinectBinaries)" DestinationFolder="$(OutputPath)" SkipUnchangedFiles="true" />
</Target>
</Project>

Просмотреть файл

@ -950,10 +950,13 @@ k4a_result_t k4a_transformation_depth_image_to_color_camera(k4a_transformation_t
k4a_transformation_image_descriptor_t transformed_depth_image_descriptor = k4a_image_get_descriptor(
transformed_depth_image);
uint8_t *depth_image_buffer = k4a_image_get_buffer(depth_image);
uint8_t *transformed_depth_image_buffer = k4a_image_get_buffer(transformed_depth_image);
return TRACE_CALL(transformation_depth_image_to_color_camera(transformation_handle,
k4a_image_get_buffer(depth_image),
depth_image_buffer,
&depth_image_descriptor,
k4a_image_get_buffer(transformed_depth_image),
transformed_depth_image_buffer,
&transformed_depth_image_descriptor));
}
@ -976,12 +979,16 @@ k4a_result_t k4a_transformation_color_image_to_depth_camera(k4a_transformation_t
return K4A_RESULT_FAILED;
}
uint8_t *depth_image_buffer = k4a_image_get_buffer(depth_image);
uint8_t *color_image_buffer = k4a_image_get_buffer(color_image);
uint8_t *transformed_color_image_buffer = k4a_image_get_buffer(transformed_color_image);
return TRACE_CALL(transformation_color_image_to_depth_camera(transformation_handle,
k4a_image_get_buffer(depth_image),
depth_image_buffer,
&depth_image_descriptor,
k4a_image_get_buffer(color_image),
color_image_buffer,
&color_image_descriptor,
k4a_image_get_buffer(transformed_color_image),
transformed_color_image_buffer,
&transformed_color_image_descriptor));
}
@ -993,11 +1000,14 @@ k4a_result_t k4a_transformation_depth_image_to_point_cloud(k4a_transformation_t
k4a_transformation_image_descriptor_t depth_image_descriptor = k4a_image_get_descriptor(depth_image);
k4a_transformation_image_descriptor_t xyz_image_descriptor = k4a_image_get_descriptor(xyz_image);
uint8_t *depth_image_buffer = k4a_image_get_buffer(depth_image);
uint8_t *xyz_image_buffer = k4a_image_get_buffer(xyz_image);
return TRACE_CALL(transformation_depth_image_to_point_cloud(transformation_handle,
k4a_image_get_buffer(depth_image),
depth_image_buffer,
&depth_image_descriptor,
camera,
k4a_image_get_buffer(xyz_image),
xyz_image_buffer,
&xyz_image_descriptor));
}

Просмотреть файл

@ -17,6 +17,18 @@ static k4a_result_t transformation_project_internal(const k4a_calibration_camera
camera_calibration->intrinsics.type == K4A_CALIBRATION_LENS_DISTORTION_MODEL_BROWN_CONRADY) &&
camera_calibration->intrinsics.parameter_count >= 14)))
{
LOG_ERROR("Unexpected camera calibration model type %d, should either be "
"K4A_CALIBRATION_LENS_DISTORTION_MODEL_RATIONAL_6KT (%d) or "
"K4A_CALIBRATION_LENS_DISTORTION_MODEL_BROWN_CONRADY (%d).",
camera_calibration->intrinsics.type,
K4A_CALIBRATION_LENS_DISTORTION_MODEL_RATIONAL_6KT,
K4A_CALIBRATION_LENS_DISTORTION_MODEL_BROWN_CONRADY);
if (camera_calibration->intrinsics.type == K4A_CALIBRATION_LENS_DISTORTION_MODEL_BROWN_CONRADY)
{
LOG_ERROR("Unexpected parameter count %d, should be %d.",
camera_calibration->intrinsics.parameter_count,
14);
}
return K4A_RESULT_FAILED;
}
@ -40,6 +52,9 @@ static k4a_result_t transformation_project_internal(const k4a_calibration_camera
if (K4A_FAILED(K4A_RESULT_FROM_BOOL(fx > 0.f && fy > 0.f)))
{
LOG_ERROR("Expect both fx and fy are larger than 0, actual values are fx: %lf, fy: %lf.",
(double)fx,
(double)fy);
return K4A_RESULT_FAILED;
}
@ -158,7 +173,7 @@ static k4a_result_t transformation_iterative_unproject(const k4a_calibration_cam
float p[2];
float J[2 * 2];
if (K4A_FAILED(transformation_project_internal(camera_calibration, xy, p, valid, J)))
if (K4A_FAILED(TRACE_CALL(transformation_project_internal(camera_calibration, xy, p, valid, J))))
{
return K4A_RESULT_FAILED;
}
@ -211,6 +226,18 @@ static k4a_result_t transformation_unproject_internal(const k4a_calibration_came
camera_calibration->intrinsics.type == K4A_CALIBRATION_LENS_DISTORTION_MODEL_BROWN_CONRADY) &&
camera_calibration->intrinsics.parameter_count >= 14)))
{
LOG_ERROR("Unexpected camera calibration model type %d, should either be "
"K4A_CALIBRATION_LENS_DISTORTION_MODEL_RATIONAL_6KT (%d) or "
"K4A_CALIBRATION_LENS_DISTORTION_MODEL_BROWN_CONRADY (%d).",
camera_calibration->intrinsics.type,
K4A_CALIBRATION_LENS_DISTORTION_MODEL_RATIONAL_6KT,
K4A_CALIBRATION_LENS_DISTORTION_MODEL_BROWN_CONRADY);
if (camera_calibration->intrinsics.type == K4A_CALIBRATION_LENS_DISTORTION_MODEL_BROWN_CONRADY)
{
LOG_ERROR("Unexpected parameter count %d, should be %d.",
camera_calibration->intrinsics.parameter_count,
14);
}
return K4A_RESULT_FAILED;
}
@ -233,6 +260,9 @@ static k4a_result_t transformation_unproject_internal(const k4a_calibration_came
if (K4A_FAILED(K4A_RESULT_FROM_BOOL(fx > 0.f && fy > 0.f)))
{
LOG_ERROR("Expect both fx and fy are larger than 0, actual values are fx: %lf, fy: %lf.",
(double)fx,
(double)fy);
return K4A_RESULT_FAILED;
}
@ -289,7 +319,7 @@ k4a_result_t transformation_unproject(const k4a_calibration_camera_t *camera_cal
return K4A_RESULT_SUCCEEDED;
}
if (K4A_FAILED(transformation_unproject_internal(camera_calibration, point2d, point3d, valid)))
if (K4A_FAILED(TRACE_CALL(transformation_unproject_internal(camera_calibration, point2d, point3d, valid))))
{
return K4A_RESULT_FAILED;
}
@ -318,7 +348,7 @@ k4a_result_t transformation_project(const k4a_calibration_camera_t *camera_calib
xy[0] = point3d[0] / point3d[2];
xy[1] = point3d[1] / point3d[2];
if (K4A_FAILED(transformation_project_internal(camera_calibration, xy, point2d, valid, 0)))
if (K4A_FAILED(TRACE_CALL(transformation_project_internal(camera_calibration, xy, point2d, valid, 0))))
{
return K4A_RESULT_FAILED;
}

Просмотреть файл

@ -15,6 +15,12 @@ transformation_get_mode_specific_camera_calibration(const k4a_calibration_camera
mode_info->output_image_resolution[0] > 0 &&
mode_info->output_image_resolution[1] > 0)))
{
LOG_ERROR("Expect calibration image binned resolution and output image resolution are larger than 0, actual "
"values are calibration_image_binned_resolution: (%d,%d), output_image_resolution: (%d,%d).",
mode_info->calibration_image_binned_resolution[0],
mode_info->calibration_image_binned_resolution[1],
mode_info->output_image_resolution[0],
mode_info->output_image_resolution[1]);
return K4A_RESULT_FAILED;
}
@ -65,6 +71,11 @@ transformation_get_mode_specific_depth_camera_calibration(const k4a_calibration_
if (K4A_FAILED(K4A_RESULT_FROM_BOOL(raw_camera_calibration->resolution_width == 1024 &&
raw_camera_calibration->resolution_height == 1024)))
{
LOG_ERROR("Unexpected raw camera calibration resolution (%d,%d), should be (%d,%d).",
raw_camera_calibration->resolution_width,
raw_camera_calibration->resolution_height,
1024,
1024);
return K4A_RESULT_FAILED;
}
@ -73,35 +84,39 @@ transformation_get_mode_specific_depth_camera_calibration(const k4a_calibration_
case K4A_DEPTH_MODE_NFOV_2X2BINNED:
{
k4a_camera_calibration_mode_info_t mode_info = { { 512, 512 }, { 96, 90 }, { 320, 288 } };
return transformation_get_mode_specific_camera_calibration(raw_camera_calibration,
&mode_info,
mode_specific_camera_calibration,
/* pixelized_zero_centered_output = */ true);
return TRACE_CALL(
transformation_get_mode_specific_camera_calibration(raw_camera_calibration,
&mode_info,
mode_specific_camera_calibration,
/* pixelized_zero_centered_output = */ true));
}
case K4A_DEPTH_MODE_NFOV_UNBINNED:
{
k4a_camera_calibration_mode_info_t mode_info = { { 1024, 1024 }, { 192, 180 }, { 640, 576 } };
return transformation_get_mode_specific_camera_calibration(raw_camera_calibration,
&mode_info,
mode_specific_camera_calibration,
/* pixelized_zero_centered_output = */ true);
return TRACE_CALL(
transformation_get_mode_specific_camera_calibration(raw_camera_calibration,
&mode_info,
mode_specific_camera_calibration,
/* pixelized_zero_centered_output = */ true));
}
case K4A_DEPTH_MODE_WFOV_2X2BINNED:
{
k4a_camera_calibration_mode_info_t mode_info = { { 512, 512 }, { 0, 0 }, { 512, 512 } };
return transformation_get_mode_specific_camera_calibration(raw_camera_calibration,
&mode_info,
mode_specific_camera_calibration,
/* pixelized_zero_centered_output = */ true);
return TRACE_CALL(
transformation_get_mode_specific_camera_calibration(raw_camera_calibration,
&mode_info,
mode_specific_camera_calibration,
/* pixelized_zero_centered_output = */ true));
}
case K4A_DEPTH_MODE_WFOV_UNBINNED:
case K4A_DEPTH_MODE_PASSIVE_IR:
{
k4a_camera_calibration_mode_info_t mode_info = { { 1024, 1024 }, { 0, 0 }, { 1024, 1024 } };
return transformation_get_mode_specific_camera_calibration(raw_camera_calibration,
&mode_info,
mode_specific_camera_calibration,
/* pixelized_zero_centered_output = */ true);
return TRACE_CALL(
transformation_get_mode_specific_camera_calibration(raw_camera_calibration,
&mode_info,
mode_specific_camera_calibration,
/* pixelized_zero_centered_output = */ true));
}
default:
{
@ -121,11 +136,11 @@ transformation_get_mode_specific_color_camera_calibration(const k4a_calibration_
// unitized and 0-cornered. It will be converted to pixelized and 0-centered in a subsequent call to
// transformation_get_mode_specific_camera_calibration().
k4a_camera_calibration_mode_info_t mode_info = { { 4096, 2304 }, { 0, -384 }, { 4096, 3072 } };
if (K4A_FAILED(
if (K4A_FAILED(TRACE_CALL(
transformation_get_mode_specific_camera_calibration(raw_camera_calibration,
&mode_info,
mode_specific_camera_calibration,
/* pixelized_zero_centered_output = */ false)))
/* pixelized_zero_centered_output = */ false))))
{
return K4A_RESULT_FAILED;
}
@ -136,6 +151,9 @@ transformation_get_mode_specific_color_camera_calibration(const k4a_calibration_
}
else
{
LOG_ERROR("Unexpected aspect ratio %d:%d, should either be 16:9 or 4:3.",
raw_camera_calibration->resolution_width,
raw_camera_calibration->resolution_height);
return K4A_RESULT_FAILED;
}
@ -144,53 +162,60 @@ transformation_get_mode_specific_color_camera_calibration(const k4a_calibration_
case K4A_COLOR_RESOLUTION_720P:
{
k4a_camera_calibration_mode_info_t mode_info = { { 1280, 960 }, { 0, 120 }, { 1280, 720 } };
return transformation_get_mode_specific_camera_calibration(mode_specific_camera_calibration,
&mode_info,
mode_specific_camera_calibration,
/* pixelized_zero_centered_output = */ true);
return TRACE_CALL(
transformation_get_mode_specific_camera_calibration(mode_specific_camera_calibration,
&mode_info,
mode_specific_camera_calibration,
/* pixelized_zero_centered_output = */ true));
}
case K4A_COLOR_RESOLUTION_1080P:
{
k4a_camera_calibration_mode_info_t mode_info = { { 1920, 1440 }, { 0, 180 }, { 1920, 1080 } };
return transformation_get_mode_specific_camera_calibration(mode_specific_camera_calibration,
&mode_info,
mode_specific_camera_calibration,
/* pixelized_zero_centered_output = */ true);
return TRACE_CALL(
transformation_get_mode_specific_camera_calibration(mode_specific_camera_calibration,
&mode_info,
mode_specific_camera_calibration,
/* pixelized_zero_centered_output = */ true));
}
case K4A_COLOR_RESOLUTION_1440P:
{
k4a_camera_calibration_mode_info_t mode_info = { { 2560, 1920 }, { 0, 240 }, { 2560, 1440 } };
return transformation_get_mode_specific_camera_calibration(mode_specific_camera_calibration,
&mode_info,
mode_specific_camera_calibration,
/* pixelized_zero_centered_output = */ true);
return TRACE_CALL(
transformation_get_mode_specific_camera_calibration(mode_specific_camera_calibration,
&mode_info,
mode_specific_camera_calibration,
/* pixelized_zero_centered_output = */ true));
}
case K4A_COLOR_RESOLUTION_1536P:
{
k4a_camera_calibration_mode_info_t mode_info = { { 2048, 1536 }, { 0, 0 }, { 2048, 1536 } };
return transformation_get_mode_specific_camera_calibration(mode_specific_camera_calibration,
&mode_info,
mode_specific_camera_calibration,
/* pixelized_zero_centered_output = */ true);
return TRACE_CALL(
transformation_get_mode_specific_camera_calibration(mode_specific_camera_calibration,
&mode_info,
mode_specific_camera_calibration,
/* pixelized_zero_centered_output = */ true));
}
case K4A_COLOR_RESOLUTION_2160P:
{
k4a_camera_calibration_mode_info_t mode_info = { { 3840, 2880 }, { 0, 360 }, { 3840, 2160 } };
return transformation_get_mode_specific_camera_calibration(mode_specific_camera_calibration,
&mode_info,
mode_specific_camera_calibration,
/* pixelized_zero_centered_output = */ true);
return TRACE_CALL(
transformation_get_mode_specific_camera_calibration(mode_specific_camera_calibration,
&mode_info,
mode_specific_camera_calibration,
/* pixelized_zero_centered_output = */ true));
}
case K4A_COLOR_RESOLUTION_3072P:
{
k4a_camera_calibration_mode_info_t mode_info = { { 4096, 3072 }, { 0, 0 }, { 4096, 3072 } };
return transformation_get_mode_specific_camera_calibration(mode_specific_camera_calibration,
&mode_info,
mode_specific_camera_calibration,
/* pixelized_zero_centered_output = */ true);
return TRACE_CALL(
transformation_get_mode_specific_camera_calibration(mode_specific_camera_calibration,
&mode_info,
mode_specific_camera_calibration,
/* pixelized_zero_centered_output = */ true));
}
default:
{
LOG_ERROR("Unexpected color resolution type %d.", color_resolution);
return K4A_RESULT_FAILED;
}
}

Просмотреть файл

@ -60,6 +60,14 @@ static bool transformation_compare_image_descriptors(const k4a_transformation_im
descriptor1->height_pixels != descriptor2->height_pixels ||
descriptor1->stride_bytes != descriptor2->stride_bytes)
{
LOG_ERROR("Unexpected image descriptor. Expect width_pixels: %d, height_pixels: %d, stride_bytes: %d. "
"Actual width_pixels: %d, height_pixels: %d, stride_bytes: %d.",
descriptor1->width_pixels,
descriptor1->height_pixels,
descriptor1->stride_bytes,
descriptor2->width_pixels,
descriptor2->height_pixels,
descriptor2->stride_bytes);
return false;
}
return true;
@ -430,6 +438,10 @@ k4a_buffer_result_t transformation_depth_image_to_color_camera_internal(
{
if (transformed_depth_image_descriptor == 0 || calibration == 0)
{
if (calibration == 0)
{
LOG_ERROR("Calibration is null.", 0);
}
return K4A_BUFFER_RESULT_FAILED;
}
@ -446,12 +458,33 @@ k4a_buffer_result_t transformation_depth_image_to_color_camera_internal(
memcpy(transformed_depth_image_descriptor,
&expected_transformed_depth_image_descriptor,
sizeof(k4a_transformation_image_descriptor_t));
if (transformed_depth_image_data == 0)
{
LOG_ERROR("Transformed depth image data is null.", 0);
}
else
{
LOG_ERROR("Unexpected transformed depth image descriptor, see details above.", 0);
}
return K4A_BUFFER_RESULT_TOO_SMALL;
}
if (xy_tables_depth_camera == 0 || depth_image_data == 0 || depth_image_descriptor == 0 ||
transformed_depth_image_data == 0)
{
if (xy_tables_depth_camera == 0)
{
LOG_ERROR("Depth camera xy table is null.", 0);
}
if (depth_image_data == 0)
{
LOG_ERROR("Depth image data is null.", 0);
}
if (transformed_depth_image_data == 0)
{
LOG_ERROR("Transformed depth image data is null.", 0);
}
return K4A_BUFFER_RESULT_FAILED;
}
@ -463,6 +496,7 @@ k4a_buffer_result_t transformation_depth_image_to_color_camera_internal(
if (transformation_compare_image_descriptors(depth_image_descriptor, &expected_depth_image_descriptor) == false)
{
LOG_ERROR("Unexpected depth image descriptor, see details above.", 0);
return K4A_BUFFER_RESULT_FAILED;
}
@ -477,7 +511,7 @@ k4a_buffer_result_t transformation_depth_image_to_color_camera_internal(
context.transformed_image = transformation_init_output_image(transformed_depth_image_descriptor,
transformed_depth_image_data);
if (K4A_FAILED(transformation_depth_to_color(&context)))
if (K4A_FAILED(TRACE_CALL(transformation_depth_to_color(&context))))
{
return K4A_BUFFER_RESULT_FAILED;
}
@ -588,6 +622,10 @@ k4a_buffer_result_t transformation_color_image_to_depth_camera_internal(
{
if (transformed_color_image_descriptor == 0 || calibration == 0)
{
if (calibration == 0)
{
LOG_ERROR("Calibration is null.", 0);
}
return K4A_BUFFER_RESULT_FAILED;
}
@ -604,12 +642,37 @@ k4a_buffer_result_t transformation_color_image_to_depth_camera_internal(
memcpy(transformed_color_image_descriptor,
&expected_transformed_color_image_descriptor,
sizeof(k4a_transformation_image_descriptor_t));
if (transformed_color_image_data == 0)
{
LOG_ERROR("Transformed color image data is null.", 0);
}
else
{
LOG_ERROR("Unexpected transformed color image descriptor, see details above.", 0);
}
return K4A_BUFFER_RESULT_TOO_SMALL;
}
if (xy_tables_depth_camera == 0 || depth_image_data == 0 || depth_image_descriptor == 0 || color_image_data == 0 ||
color_image_descriptor == 0 || transformed_color_image_data == 0)
{
if (xy_tables_depth_camera == 0)
{
LOG_ERROR("Depth camera xy table is null.", 0);
}
if (depth_image_data == 0)
{
LOG_ERROR("Depth image data is null.", 0);
}
if (color_image_data == 0)
{
LOG_ERROR("Color image data is null.", 0);
}
if (transformed_color_image_data == 0)
{
LOG_ERROR("Transformed color image data is null.", 0);
}
return K4A_BUFFER_RESULT_FAILED;
}
@ -621,6 +684,7 @@ k4a_buffer_result_t transformation_color_image_to_depth_camera_internal(
if (transformation_compare_image_descriptors(depth_image_descriptor, &expected_depth_image_descriptor) == false)
{
LOG_ERROR("Unexpected depth image descriptor, see details above.", 0);
return K4A_BUFFER_RESULT_FAILED;
}
@ -632,6 +696,7 @@ k4a_buffer_result_t transformation_color_image_to_depth_camera_internal(
if (transformation_compare_image_descriptors(color_image_descriptor, &expected_color_image_descriptor) == false)
{
LOG_ERROR("Unexpected color image descriptor, see details above.", 0);
return K4A_BUFFER_RESULT_FAILED;
}
@ -676,11 +741,24 @@ transformation_depth_image_to_point_cloud_internal(k4a_transformation_xy_tables_
transformation_compare_image_descriptors(xyz_image_descriptor, &expected_xyz_image_descriptor) == false)
{
memcpy(xyz_image_descriptor, &expected_xyz_image_descriptor, sizeof(k4a_transformation_image_descriptor_t));
if (xyz_image_data == 0)
{
LOG_ERROR("XYZ image data is null.", 0);
}
else
{
LOG_ERROR("Unexpected XYZ image descriptor, see details above.", 0);
}
return K4A_BUFFER_RESULT_TOO_SMALL;
}
if (depth_image_data == 0 || depth_image_descriptor == 0)
{
if (depth_image_data == 0)
{
LOG_ERROR("Depth image data is null.", 0);
}
return K4A_BUFFER_RESULT_FAILED;
}
@ -691,6 +769,7 @@ transformation_depth_image_to_point_cloud_internal(k4a_transformation_xy_tables_
if (transformation_compare_image_descriptors(depth_image_descriptor, &expected_depth_image_descriptor) == false)
{
LOG_ERROR("Unexpected depth image descriptor, see details above.", 0);
return K4A_BUFFER_RESULT_FAILED;
}

Просмотреть файл

@ -22,6 +22,7 @@ k4a_result_t transformation_get_mode_specific_calibration(const k4a_calibration_
if (K4A_FAILED(
K4A_RESULT_FROM_BOOL(color_resolution != K4A_COLOR_RESOLUTION_OFF || depth_mode != K4A_DEPTH_MODE_OFF)))
{
LOG_ERROR("Expect color or depth camera is running.", 0);
return K4A_RESULT_FAILED;
}
@ -74,14 +75,17 @@ static k4a_result_t transformation_possible(const k4a_calibration_t *camera_cali
{
if (camera >= K4A_CALIBRATION_TYPE_NUM || camera <= K4A_CALIBRATION_TYPE_UNKNOWN)
{
LOG_ERROR("Unexpected camera calibration type %d.", camera);
return K4A_RESULT_FAILED;
}
if (camera == K4A_CALIBRATION_TYPE_DEPTH && camera_calibration->depth_mode == K4A_DEPTH_MODE_OFF)
{
LOG_ERROR("Expect depth camera is running to perform transformation.", 0);
return K4A_RESULT_FAILED;
}
if (camera == K4A_CALIBRATION_TYPE_COLOR && camera_calibration->color_resolution == K4A_COLOR_RESOLUTION_OFF)
{
LOG_ERROR("Expect color camera is running to perform transformation.", 0);
return K4A_RESULT_FAILED;
}
return K4A_RESULT_SUCCEEDED;
@ -147,6 +151,11 @@ k4a_result_t transformation_2d_to_3d(const k4a_calibration_t *calibration,
}
else
{
LOG_ERROR("Unexpected source camera calibration type %d, should either be K4A_CALIBRATION_TYPE_DEPTH (%d) or "
"K4A_CALIBRATION_TYPE_COLOR (%d).",
source_camera,
K4A_CALIBRATION_TYPE_DEPTH,
K4A_CALIBRATION_TYPE_COLOR);
return K4A_RESULT_FAILED; // unproject only supported for depth and color cameras
}
@ -201,6 +210,11 @@ k4a_result_t transformation_3d_to_2d(const k4a_calibration_t *calibration,
}
else
{
LOG_ERROR("Unexpected target camera calibration type %d, should either be K4A_CALIBRATION_TYPE_DEPTH (%d) or "
"K4A_CALIBRATION_TYPE_COLOR (%d).",
target_camera,
K4A_CALIBRATION_TYPE_DEPTH,
K4A_CALIBRATION_TYPE_COLOR);
return K4A_RESULT_FAILED; // project only supported for depth and color cameras
}
}
@ -258,6 +272,11 @@ static k4a_buffer_result_t transformation_init_xy_tables(const k4a_calibration_t
height = calibration->color_camera_calibration.resolution_height;
break;
default:
LOG_ERROR("Unexpected camera calibration type %d, should either be K4A_CALIBRATION_TYPE_DEPTH (%d) or "
"K4A_CALIBRATION_TYPE_COLOR (%d).",
camera,
K4A_CALIBRATION_TYPE_DEPTH,
K4A_CALIBRATION_TYPE_COLOR);
return K4A_BUFFER_RESULT_FAILED;
}
@ -271,6 +290,7 @@ static k4a_buffer_result_t transformation_init_xy_tables(const k4a_calibration_t
{
if (K4A_FAILED(K4A_RESULT_FROM_BOOL(*data_size >= 2 * table_size)))
{
LOG_ERROR("Unexpected xy table size %d, should be larger or equal than %d.", *data_size, 2 * table_size);
return K4A_BUFFER_RESULT_FAILED;
}
@ -288,7 +308,8 @@ static k4a_buffer_result_t transformation_init_xy_tables(const k4a_calibration_t
for (int x = 0; x < width; x++, idx++)
{
point2d[0] = (float)x;
if (K4A_FAILED(transformation_2d_to_3d(calibration, point2d, 1.f, camera, camera, point3d, &valid)))
if (K4A_FAILED(TRACE_CALL(
transformation_2d_to_3d(calibration, point2d, 1.f, camera, camera, point3d, &valid))))
{
return K4A_BUFFER_RESULT_FAILED;
}
@ -318,7 +339,7 @@ static k4a_result_t transformation_allocate_xy_tables(const k4a_calibration_t *c
*buffer = 0;
size_t xy_tables_data_size = 0;
if (K4A_BUFFER_RESULT_TOO_SMALL !=
transformation_init_xy_tables(calibration, camera, *buffer, &xy_tables_data_size, xy_tables))
TRACE_BUFFER_CALL(transformation_init_xy_tables(calibration, camera, *buffer, &xy_tables_data_size, xy_tables)))
{
return K4A_RESULT_FAILED;
}
@ -326,7 +347,7 @@ static k4a_result_t transformation_allocate_xy_tables(const k4a_calibration_t *c
*buffer = malloc(xy_tables_data_size * sizeof(float));
if (K4A_BUFFER_RESULT_SUCCEEDED !=
transformation_init_xy_tables(calibration, camera, *buffer, &xy_tables_data_size, xy_tables))
TRACE_BUFFER_CALL(transformation_init_xy_tables(calibration, camera, *buffer, &xy_tables_data_size, xy_tables)))
{
return K4A_RESULT_FAILED;
}
@ -445,7 +466,7 @@ transformation_depth_image_to_color_camera(k4a_transformation_t transformation_h
if (!transformation_context->enable_depth_color_transform)
{
LOG_ERROR("Require both depth camera and color camera are opened to transform depth image to color camera.", 0);
LOG_ERROR("Expect both depth camera and color camera are running to transform depth image to color camera.", 0);
return K4A_RESULT_FAILED;
}
@ -485,12 +506,13 @@ transformation_depth_image_to_color_camera(k4a_transformation_t transformation_h
else
{
if (K4A_BUFFER_RESULT_SUCCEEDED !=
transformation_depth_image_to_color_camera_internal(&transformation_context->calibration,
&transformation_context->depth_camera_xy_tables,
depth_image_data,
depth_image_descriptor,
transformed_depth_image_data,
transformed_depth_image_descriptor))
TRACE_BUFFER_CALL(
transformation_depth_image_to_color_camera_internal(&transformation_context->calibration,
&transformation_context->depth_camera_xy_tables,
depth_image_data,
depth_image_descriptor,
transformed_depth_image_data,
transformed_depth_image_descriptor)))
{
return K4A_RESULT_FAILED;
}
@ -512,7 +534,7 @@ transformation_color_image_to_depth_camera(k4a_transformation_t transformation_h
if (!transformation_context->enable_depth_color_transform)
{
LOG_ERROR("Require both depth camera and color camera are opened to transform color image to depth camera.", 0);
LOG_ERROR("Expect both depth camera and color camera are running to transform color image to depth camera.", 0);
return K4A_RESULT_FAILED;
}
@ -553,14 +575,15 @@ transformation_color_image_to_depth_camera(k4a_transformation_t transformation_h
else
{
if (K4A_BUFFER_RESULT_SUCCEEDED !=
transformation_color_image_to_depth_camera_internal(&transformation_context->calibration,
&transformation_context->depth_camera_xy_tables,
depth_image_data,
depth_image_descriptor,
color_image_data,
color_image_descriptor,
transformed_color_image_data,
transformed_color_image_descriptor))
TRACE_BUFFER_CALL(
transformation_color_image_to_depth_camera_internal(&transformation_context->calibration,
&transformation_context->depth_camera_xy_tables,
depth_image_data,
depth_image_descriptor,
color_image_data,
color_image_descriptor,
transformed_color_image_data,
transformed_color_image_descriptor)))
{
return K4A_RESULT_FAILED;
}
@ -590,14 +613,17 @@ transformation_depth_image_to_point_cloud(k4a_transformation_t transformation_ha
}
else
{
LOG_ERROR("Unexpected camera calibration type %d, should either be K4A_CALIBRATION_TYPE_DEPTH (%d) or "
"K4A_CALIBRATION_TYPE_COLOR (%d).",
camera,
K4A_CALIBRATION_TYPE_DEPTH,
K4A_CALIBRATION_TYPE_COLOR);
return K4A_RESULT_FAILED;
}
if (K4A_BUFFER_RESULT_SUCCEEDED != transformation_depth_image_to_point_cloud_internal(xy_tables,
depth_image_data,
depth_image_descriptor,
xyz_image_data,
xyz_image_descriptor))
if (K4A_BUFFER_RESULT_SUCCEEDED !=
TRACE_BUFFER_CALL(transformation_depth_image_to_point_cloud_internal(
xy_tables, depth_image_data, depth_image_descriptor, xyz_image_data, xyz_image_descriptor)))
{
return K4A_RESULT_FAILED;
}

Просмотреть файл

@ -6,6 +6,7 @@ add_executable(transformation_ut transformation.cpp)
target_link_libraries(transformation_ut PRIVATE
azure::aziotsharedutil
gtest::gtest
k4ainternal::image
k4ainternal::transformation
k4ainternal::utcommon
k4a::k4a)

Просмотреть файл

@ -8,6 +8,7 @@
#include <k4a/k4a.h>
#include <k4ainternal/transformation.h>
#include <k4ainternal/common.h>
#include <k4ainternal/image.h>
using namespace testing;
@ -83,6 +84,15 @@ protected:
ASSERT_EQ_FLT(A[2], B[2]) \
}
static k4a_transformation_image_descriptor_t image_get_descriptor(const k4a_image_t image)
{
k4a_transformation_image_descriptor_t descriptor;
descriptor.width_pixels = image_get_width_pixels(image);
descriptor.height_pixels = image_get_height_pixels(image);
descriptor.stride_bytes = image_get_stride_bytes(image);
return descriptor;
}
TEST_F(transformation_ut, transformation_3d_to_3d)
{
float dummy[3] = { 0.f, 0.f, 0.f };
@ -310,50 +320,90 @@ TEST_F(transformation_ut, transformation_create_depth_only)
k4a_calibration_get_from_raw(g_test_json, sizeof(g_test_json), depth_mode, color_resolution, &calibration);
ASSERT_EQ(result, K4A_RESULT_SUCCEEDED);
k4a_transformation_t transformation = k4a_transformation_create(&calibration);
ASSERT_NE(transformation, (k4a_transformation_t)NULL);
k4a_transformation_t transformation_handle = transformation_create(&calibration, true);
ASSERT_NE(transformation_handle, (k4a_transformation_t)NULL);
int depth_image_width_pixels = 640;
int depth_image_height_pixels = 576;
k4a_image_t depth_image = NULL;
k4a_image_create(K4A_IMAGE_FORMAT_DEPTH16, 640, 576, 640 * 1 * (int)sizeof(uint16_t), &depth_image);
ASSERT_EQ(image_create(K4A_IMAGE_FORMAT_DEPTH16,
depth_image_width_pixels,
depth_image_height_pixels,
depth_image_width_pixels * 1 * (int)sizeof(uint16_t),
&depth_image),
K4A_WAIT_RESULT_SUCCEEDED);
int color_image_width_pixels = 1920;
int color_image_height_pixels = 1080;
k4a_image_t color_image = NULL;
k4a_image_create(K4A_IMAGE_FORMAT_DEPTH16, 1920, 1080, 1920 * 4 * (int)sizeof(uint8_t), &color_image);
ASSERT_EQ(image_create(K4A_IMAGE_FORMAT_DEPTH16,
color_image_width_pixels,
color_image_height_pixels,
color_image_width_pixels * 4 * (int)sizeof(uint8_t),
&color_image),
K4A_WAIT_RESULT_SUCCEEDED);
k4a_image_t transformed_color_image = NULL;
k4a_image_create(K4A_IMAGE_FORMAT_COLOR_BGRA32,
k4a_image_get_width_pixels(depth_image),
k4a_image_get_height_pixels(depth_image),
k4a_image_get_width_pixels(depth_image) * 4 * (int)sizeof(uint8_t),
&transformed_color_image);
ASSERT_EQ(image_create(K4A_IMAGE_FORMAT_COLOR_BGRA32,
depth_image_width_pixels,
depth_image_height_pixels,
depth_image_width_pixels * 4 * (int)sizeof(uint8_t),
&transformed_color_image),
K4A_WAIT_RESULT_SUCCEEDED);
k4a_image_t transformed_depth_image = NULL;
k4a_image_create(K4A_IMAGE_FORMAT_DEPTH16,
k4a_image_get_width_pixels(color_image),
k4a_image_get_height_pixels(color_image),
k4a_image_get_width_pixels(color_image) * 1 * (int)sizeof(uint16_t),
&transformed_depth_image);
ASSERT_EQ(image_create(K4A_IMAGE_FORMAT_DEPTH16,
color_image_width_pixels,
color_image_height_pixels,
color_image_width_pixels * 1 * (int)sizeof(uint16_t),
&transformed_depth_image),
K4A_WAIT_RESULT_SUCCEEDED);
ASSERT_NE(k4a_transformation_color_image_to_depth_camera(transformation,
depth_image,
color_image,
transformed_color_image),
k4a_transformation_image_descriptor_t depth_image_descriptor = image_get_descriptor(depth_image);
k4a_transformation_image_descriptor_t color_image_descriptor = image_get_descriptor(color_image);
k4a_transformation_image_descriptor_t transformed_color_image_descriptor = image_get_descriptor(
transformed_color_image);
uint8_t *depth_image_buffer = image_get_buffer(depth_image);
uint8_t *color_image_buffer = image_get_buffer(color_image);
uint8_t *transformed_color_image_buffer = image_get_buffer(transformed_color_image);
ASSERT_NE(transformation_color_image_to_depth_camera(transformation_handle,
depth_image_buffer,
&depth_image_descriptor,
color_image_buffer,
&color_image_descriptor,
transformed_color_image_buffer,
&transformed_color_image_descriptor),
K4A_RESULT_SUCCEEDED);
ASSERT_NE(k4a_transformation_depth_image_to_color_camera(transformation, depth_image, transformed_depth_image),
k4a_transformation_image_descriptor_t transformed_depth_image_descriptor = image_get_descriptor(
transformed_depth_image);
uint8_t *transformed_depth_image_buffer = image_get_buffer(transformed_depth_image);
ASSERT_NE(transformation_depth_image_to_color_camera(transformation_handle,
depth_image_buffer,
&depth_image_descriptor,
transformed_depth_image_buffer,
&transformed_depth_image_descriptor),
K4A_RESULT_SUCCEEDED);
k4a_image_t point_cloud_image = NULL;
k4a_image_create(K4A_IMAGE_FORMAT_CUSTOM,
k4a_image_get_width_pixels(depth_image),
k4a_image_get_height_pixels(depth_image),
k4a_image_get_width_pixels(depth_image) * 3 * (int)sizeof(int16_t),
&point_cloud_image);
ASSERT_EQ(image_create(K4A_IMAGE_FORMAT_CUSTOM,
depth_image_width_pixels,
depth_image_height_pixels,
depth_image_width_pixels * 3 * (int)sizeof(int16_t),
&point_cloud_image),
K4A_WAIT_RESULT_SUCCEEDED);
ASSERT_EQ(k4a_transformation_depth_image_to_point_cloud(transformation,
depth_image,
K4A_CALIBRATION_TYPE_DEPTH,
point_cloud_image),
k4a_transformation_image_descriptor_t point_cloud_image_descriptor = image_get_descriptor(point_cloud_image);
uint8_t *point_cloud_image_buffer = image_get_buffer(point_cloud_image);
ASSERT_EQ(transformation_depth_image_to_point_cloud(transformation_handle,
depth_image_buffer,
&depth_image_descriptor,
K4A_CALIBRATION_TYPE_DEPTH,
point_cloud_image_buffer,
&point_cloud_image_descriptor),
K4A_RESULT_SUCCEEDED);
transformation_destroy(transformation_handle);
}
TEST_F(transformation_ut, transformation_create_color_only)
@ -366,40 +416,75 @@ TEST_F(transformation_ut, transformation_create_color_only)
k4a_calibration_get_from_raw(g_test_json, sizeof(g_test_json), depth_mode, color_resolution, &calibration);
ASSERT_EQ(result, K4A_RESULT_SUCCEEDED);
k4a_transformation_t transformation = k4a_transformation_create(&calibration);
ASSERT_NE(transformation, (k4a_transformation_t)NULL);
k4a_transformation_t transformation_handle = transformation_create(&calibration, true);
ASSERT_NE(transformation_handle, (k4a_transformation_t)NULL);
int depth_image_width_pixels = 640;
int depth_image_height_pixels = 576;
k4a_image_t depth_image = NULL;
k4a_image_create(K4A_IMAGE_FORMAT_DEPTH16, 640, 576, 640 * 1 * (int)sizeof(uint16_t), &depth_image);
ASSERT_EQ(image_create(K4A_IMAGE_FORMAT_DEPTH16,
depth_image_width_pixels,
depth_image_height_pixels,
depth_image_width_pixels * 1 * (int)sizeof(uint16_t),
&depth_image),
K4A_WAIT_RESULT_SUCCEEDED);
int color_image_width_pixels = 1920;
int color_image_height_pixels = 1080;
k4a_image_t color_image = NULL;
k4a_image_create(K4A_IMAGE_FORMAT_DEPTH16, 1920, 1080, 1920 * 4 * (int)sizeof(uint8_t), &color_image);
ASSERT_EQ(image_create(K4A_IMAGE_FORMAT_DEPTH16,
color_image_width_pixels,
color_image_height_pixels,
color_image_width_pixels * 4 * (int)sizeof(uint8_t),
&color_image),
K4A_WAIT_RESULT_SUCCEEDED);
k4a_image_t transformed_color_image = NULL;
k4a_image_create(K4A_IMAGE_FORMAT_COLOR_BGRA32,
k4a_image_get_width_pixels(depth_image),
k4a_image_get_height_pixels(depth_image),
k4a_image_get_width_pixels(depth_image) * 4 * (int)sizeof(uint8_t),
&transformed_color_image);
ASSERT_EQ(image_create(K4A_IMAGE_FORMAT_COLOR_BGRA32,
depth_image_width_pixels,
depth_image_height_pixels,
depth_image_width_pixels * 4 * (int)sizeof(uint8_t),
&transformed_color_image),
K4A_WAIT_RESULT_SUCCEEDED);
k4a_image_t transformed_depth_image = NULL;
k4a_image_create(K4A_IMAGE_FORMAT_DEPTH16,
k4a_image_get_width_pixels(color_image),
k4a_image_get_height_pixels(color_image),
k4a_image_get_width_pixels(color_image) * 1 * (int)sizeof(uint16_t),
&transformed_depth_image);
ASSERT_EQ(image_create(K4A_IMAGE_FORMAT_DEPTH16,
color_image_width_pixels,
color_image_height_pixels,
color_image_width_pixels * 1 * (int)sizeof(uint16_t),
&transformed_depth_image),
K4A_WAIT_RESULT_SUCCEEDED);
ASSERT_NE(k4a_transformation_color_image_to_depth_camera(transformation,
depth_image,
color_image,
transformed_color_image),
k4a_transformation_image_descriptor_t depth_image_descriptor = image_get_descriptor(depth_image);
k4a_transformation_image_descriptor_t color_image_descriptor = image_get_descriptor(color_image);
k4a_transformation_image_descriptor_t transformed_color_image_descriptor = image_get_descriptor(
transformed_color_image);
uint8_t *depth_image_buffer = image_get_buffer(depth_image);
uint8_t *color_image_buffer = image_get_buffer(color_image);
uint8_t *transformed_color_image_buffer = image_get_buffer(transformed_color_image);
ASSERT_NE(transformation_color_image_to_depth_camera(transformation_handle,
depth_image_buffer,
&depth_image_descriptor,
color_image_buffer,
&color_image_descriptor,
transformed_color_image_buffer,
&transformed_color_image_descriptor),
K4A_RESULT_SUCCEEDED);
ASSERT_NE(k4a_transformation_depth_image_to_color_camera(transformation, depth_image, transformed_depth_image),
k4a_transformation_image_descriptor_t transformed_depth_image_descriptor = image_get_descriptor(
transformed_depth_image);
uint8_t *transformed_depth_image_buffer = image_get_buffer(transformed_depth_image);
ASSERT_NE(transformation_depth_image_to_color_camera(transformation_handle,
depth_image_buffer,
&depth_image_descriptor,
transformed_depth_image_buffer,
&transformed_depth_image_descriptor),
K4A_RESULT_SUCCEEDED);
ASSERT_EQ(calibration.depth_camera_calibration.resolution_width, 0);
ASSERT_EQ(calibration.depth_camera_calibration.resolution_width, 0);
transformation_destroy(transformation_handle);
}
int main(int argc, char **argv)

Просмотреть файл

@ -2,4 +2,7 @@
# Licensed under the MIT License.
add_subdirectory(deversion)
add_subdirectory(k4aviewer)
add_subdirectory(k4afastcapture_streaming)
add_subdirectory(k4afastcapture_trigger)
add_subdirectory(updater)

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше