Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.vs/
*.user
CompiledShaders/
*.pdb
*.deps
*.cache
*.log
*.tlog
*FileListAbsolute.txt
*.obj
*.exe
*.ipdb
*.pch
*.iobj
20 changes: 12 additions & 8 deletions DepthSensingCUDA/DepthSensing.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 7.5.props" />
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 10.1.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
Expand All @@ -50,8 +50,8 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<ExecutablePath>$(DXSDK_DIR)Utilities\bin\x64;$(DXSDK_DIR)Utilities\bin\x86;$(ExecutablePath)</ExecutablePath>
<IncludePath>$(IncludePath);$(WindowsSDK_IncludePath);$(KINECTSDK10_DIR)\inc;$(KINECTSDK20_DIR)\inc;$(OPENNI2_INCLUDE64);$(DXSDK_DIR)Include;./Source/;./Include;./Include/Intel;./Include/cutil/inc;./Include/Uplink</IncludePath>
<LibraryPath>$(LibraryPath);$(DXSDK_DIR)Lib\x64;$(KINECTSDK10_DIR)\lib\amd64;$(CUDA_LIB_PATH);$(KINECTSDK20_DIR)\lib\x64;$(OPENNI2_LIB64);Libs</LibraryPath>
<IncludePath>$(IncludePath);$(WindowsSDK_IncludePath);$(KINECTSDK10_DIR)\inc;$(KINECTSDK20_DIR)\inc;$(OPENNI2_INCLUDE64);$(DXSDK_DIR)Include;./Source/;./Include;./Include/Intel;./Include/cutil/inc;./Include/Uplink;C:\Users\14109\Downloads\opencv\build\include</IncludePath>
<LibraryPath>$(LibraryPath);$(DXSDK_DIR)Lib\x64;$(KINECTSDK10_DIR)\lib\amd64;$(CUDA_LIB_PATH);$(KINECTSDK20_DIR)\lib\x64;$(OPENNI2_LIB64);Libs;C:\Users\14109\Downloads\opencv\build\x64\vc15\lib</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
Expand Down Expand Up @@ -103,12 +103,12 @@
<DisableSpecificWarnings>4819</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalDependencies>d3d11.lib;d3dcompiler.lib;d3dx11.lib;d3dx9.lib;dxerr.lib;dxguid.lib;winmm.lib;comctl32.lib;Shlwapi.lib;cudart.lib;cublas.lib;FreeImage.lib;zlib64.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>d3d11.lib;d3dcompiler.lib;d3dx11.lib;d3dx9.lib;dxerr.lib;dxguid.lib;winmm.lib;comctl32.lib;Shlwapi.lib;cudart.lib;cublas.lib;FreeImage.lib;zlib64.lib;opencv_world440.lib;opencv_world440d.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>../opencv/lib/;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>../opencv/lib/;C:\Users\14109\Downloads\opencv\build\x64\vc15\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
<Manifest>
<EnableDPIAwareness>true</EnableDPIAwareness>
Expand Down Expand Up @@ -203,6 +203,8 @@
<ClCompile Include="Source\RealSenseSensor.cpp" />
<ClCompile Include="Source\RGBDSensor.cpp" />
<ClCompile Include="Source\SensorDataReader.cpp" />
<ClCompile Include="Source\SensorDataReaderZhou.cpp" />
<ClCompile Include="Source\sensordatazhou.cpp" />
<ClCompile Include="Source\stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
Expand Down Expand Up @@ -269,6 +271,8 @@
<ClInclude Include="Source\Resource.h" />
<ClInclude Include="Source\RGBDSensor.h" />
<ClInclude Include="Source\SensorDataReader.h" />
<ClInclude Include="Source\SensorDataReaderZhou.h" />
<ClInclude Include="Source\sensordatazhou.h" />
<ClInclude Include="Source\stdafx.h" />
<ClInclude Include="Source\StdOutputLogger.h" />
<ClInclude Include="Source\StructureSensor.h" />
Expand Down Expand Up @@ -310,6 +314,6 @@
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 7.5.targets" />
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 10.1.targets" />
</ImportGroup>
</Project>
12 changes: 12 additions & 0 deletions DepthSensingCUDA/DepthSensing.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,12 @@
<ClCompile Include="Source\StructureSensor.cpp">
<Filter>Sensors</Filter>
</ClCompile>
<ClCompile Include="Source\sensordatazhou.cpp">
<Filter>Sensors</Filter>
</ClCompile>
<ClCompile Include="Source\SensorDataReaderZhou.cpp">
<Filter>Sensors</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Source\CameraParams.h" />
Expand Down Expand Up @@ -333,6 +339,12 @@
<ClInclude Include="Source\CUDATimer.h">
<Filter>CUDA</Filter>
</ClInclude>
<ClInclude Include="Source\sensordatazhou.h">
<Filter>Sensors</Filter>
</ClInclude>
<ClInclude Include="Source\SensorDataReaderZhou.h">
<Filter>Sensors</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="Shaders\QuadDrawer.hlsl">
Expand Down
13 changes: 12 additions & 1 deletion DepthSensingCUDA/Include/mLib/include/core-mesh/meshData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,18 @@ void MeshData<FloatType>::merge( const MeshData<FloatType>& other )
return;
}
if (isEmpty()) {
*this = other;

m_Vertices = std::move(other.m_Vertices);
m_Normals = std::move(other.m_Normals);
m_TextureCoords = std::move(other.m_TextureCoords);
m_Colors = std::move(other.m_Colors);
m_FaceIndicesVertices = std::move(other.m_FaceIndicesVertices);
m_FaceIndicesNormals = std::move(other.m_FaceIndicesNormals);
m_FaceIndicesTextureCoords = std::move(other.m_FaceIndicesTextureCoords);
m_FaceIndicesColors = std::move(other.m_FaceIndicesColors);
m_MaterialFile = std::move(other.m_MaterialFile);
m_MaterialIndices = std::move(other.m_MaterialIndices);
//*this = other;
return;
}

Expand Down
39 changes: 35 additions & 4 deletions DepthSensingCUDA/Source/DepthSensing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "DepthSensing.h"
#include "StructureSensor.h"
#include "SensorDataReader.h"
#include "SensorDataReaderZhou.h"

//--------------------------------------------------------------------------------------
// Global variables
Expand Down Expand Up @@ -119,7 +120,15 @@ RGBDSensor* getRGBDSensor()
g_sensor = new SensorDataReader;
return g_sensor;
#else
throw MLIB_EXCEPTION("Requires STRUCTURE_SENSOR macro");
throw MLIB_EXCEPTION("Requires SENSOR_DATA_READER macro");
#endif
}
if (GlobalAppState::get().s_sensorIdx == GlobalAppState::Sensor_SensorDataFileReader) {
#ifdef SENSOR_DATA_FILE_READER
g_sensor = new SensorDataReaderZhou(1, GlobalAppState::get().s_nVideoFrame, GlobalAppState::get().s_startFrame);
return g_sensor;
#else
throw MLIB_EXCEPTION("Requires SENSOR_DATA_FILE_READER macro");
#endif
}

Expand Down Expand Up @@ -652,7 +661,7 @@ void reconstruction()
{

//only if binary dump
if (GlobalAppState::get().s_sensorIdx == GlobalAppState::Sensor_BinaryDumpReader || GlobalAppState::get().s_sensorIdx == GlobalAppState::Sensor_SensorDataReader) {
if (GlobalAppState::get().s_sensorIdx == GlobalAppState::Sensor_BinaryDumpReader || GlobalAppState::get().s_sensorIdx == GlobalAppState::Sensor_SensorDataReader || GlobalAppState::get().s_sensorIdx == GlobalAppState::Sensor_SensorDataFileReader) {
unsigned int heapFreeCount = g_sceneRep->getHeapFreeCount();
std::cout << "[ frame " << g_RGBDAdapter.getFrameNumber() << " ] " << " [Free SDFBlocks " << heapFreeCount << " ] " << std::endl;
if (heapFreeCount < 5000) std::cout << "WARNING: Heap Free Count is low! if crash, increase s_hashNumSDFBlocks" << std::endl;
Expand Down Expand Up @@ -733,6 +742,28 @@ void reconstruction()
&& GlobalAppState::get().s_binaryDumpSensorUseTrajectoryOnlyInit) {
//deltaTransformEstimate = lastTransform.getInverse() * transformation; //simple case; not ideal in case of drift
//deltaTransformEstimate = g_RGBDAdapter.getRigidTransform(-1).getInverse() * transformation;

/*mat4f lastTransform = g_sceneRep->getLastRigidTransform();
mat4f deltaTransformEstimate = mat4f::identity();

transformation = g_cameraTracking->applyCT(
g_CudaDepthSensor.getCameraSpacePositionsFloat4(), g_CudaDepthSensor.getNormalMapFloat4(), g_CudaDepthSensor.getColorMapFilteredFloat4(),
//g_rayCast->getRayCastData().d_depth4Transformed, g_CudaDepthSensor.getNormalMapNoRefinementFloat4(), g_CudaDepthSensor.getColorMapFilteredFloat4(),
g_rayCast->getRayCastData().d_depth4, g_rayCast->getRayCastData().d_normals, g_rayCast->getRayCastData().d_colors,
lastTransform,
GlobalCameraTrackingState::getInstance().s_maxInnerIter, GlobalCameraTrackingState::getInstance().s_maxOuterIter,
GlobalCameraTrackingState::getInstance().s_distThres, GlobalCameraTrackingState::getInstance().s_normalThres,
100.0f, 3.0f,
deltaTransformEstimate,
GlobalCameraTrackingState::getInstance().s_residualEarlyOut,
g_RGBDAdapter.getDepthIntrinsics(), g_CudaDepthSensor.getDepthCameraData(),
NULL);

transformation = g_RGBDAdapter.getRigidTransform();
if (transformation[0] == -std::numeric_limits<float>::infinity()) {
std::cout << "INVALID FRAME" << std::endl;
return;
}*/
}

const bool useRGBDTracking = false; //Depth vs RGBD
Expand Down Expand Up @@ -846,9 +877,9 @@ void CALLBACK OnD3D11FrameRender( ID3D11Device* pd3dDevice, ID3D11DeviceContext*
pd3dImmediateContext->ClearRenderTargetView(pRTV, ClearColor);
pd3dImmediateContext->ClearDepthStencilView(pDSV, D3D11_CLEAR_DEPTH, 1.0f, 0);

#ifdef SENSOR_DATA_READER
#if defined(SENSOR_DATA_READER) || defined(SENSOR_DATA_FILE_READER)
//only if sensor data reader
if (GlobalAppState::get().s_sensorIdx == GlobalAppState::Sensor_SensorDataReader && GlobalAppState::get().s_playData) {
if ((GlobalAppState::get().s_sensorIdx == GlobalAppState::Sensor_SensorDataReader || GlobalAppState::get().s_sensorIdx == GlobalAppState::Sensor_SensorDataFileReader) && GlobalAppState::get().s_playData) {
SensorDataReader* sensor = (SensorDataReader*)getRGBDSensor();

if (sensor->getCurrFrame() >= sensor->getNumFrames()) {
Expand Down
1 change: 1 addition & 0 deletions DepthSensingCUDA/Source/DepthSensing.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include "CUDASceneRepChunkGrid.h"

#include <iomanip>
#pragma comment(lib, "legacy_stdio_definitions.lib")

#ifdef KINECT
#pragma comment(lib, "Kinect10.lib")
Expand Down
8 changes: 6 additions & 2 deletions DepthSensingCUDA/Source/GlobalAppState.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
//#define REAL_SENSE
//#define STRUCTURE_SENSOR
#define SENSOR_DATA_READER
#define SENSOR_DATA_FILE_READER

//#define OBJECT_SENSING

Expand Down Expand Up @@ -97,7 +98,9 @@
X(bool, s_reconstructionEnabled) \
X(bool, s_renderToFile) \
X(std::string, s_renderToFileDir) \
X(bool, s_offlineProcessing)
X(bool, s_offlineProcessing) \
X(int, s_nVideoFrame) \
X(int, s_startFrame)


#ifndef VAR_NAME
Expand All @@ -119,7 +122,8 @@ class GlobalAppState
Sensor_IntelSensor = 5,
Sensor_RealSense = 6,
Sensor_StructureSensor = 7,
Sensor_SensorDataReader = 8
Sensor_SensorDataReader = 8,
Sensor_SensorDataFileReader = 9
};

#define X(type, name) type name;
Expand Down
Loading