diff --git a/openVulkanoCpp/AR/ArRecorder.cpp b/openVulkanoCpp/AR/ArRecorder.cpp index ab4f462..954b93a 100644 --- a/openVulkanoCpp/AR/ArRecorder.cpp +++ b/openVulkanoCpp/AR/ArRecorder.cpp @@ -160,9 +160,10 @@ namespace OpenVulkano::AR depthWriter->AddFile(fileName.c_str(), buffers); } + if (depthImg.confidence.resolution.x > 1 && depthImg.confidence.resolution.y > 1) { //BlockProfiler profile("Save AR Frame - Confi"); - PnmHeader confidenceHeader(static_cast(depthImg.confidence.resolution.x), static_cast(depthImg.confidence.resolution.y), false, 2); + PnmHeader confidenceHeader(depthImg.confidence.resolution.x, depthImg.confidence.resolution.y, false, 2); std::string header = confidenceHeader.ToString(); buffers[0].first = header.c_str(); buffers[0].second = header.size(); diff --git a/openVulkanoCpp/AR/Provider/ArKit/ArFrameArKit.mm b/openVulkanoCpp/AR/Provider/ArKit/ArFrameArKit.mm index a537725..7f439f1 100644 --- a/openVulkanoCpp/AR/Provider/ArKit/ArFrameArKit.mm +++ b/openVulkanoCpp/AR/Provider/ArKit/ArFrameArKit.mm @@ -137,6 +137,13 @@ namespace OpenVulkano::AR::ArKit m_depthImage.confidence.resolution = { 1, 1 }; } #endif + else + { + m_depthImage.depth.data = nullptr; + m_depthImage.depth.resolution = { 0, 0 }; + m_depthImage.confidence.data = nullptr; + m_depthImage.confidence.resolution = { 0, 0 }; + } m_depthImage.intrinsic = frameMetadata.intrinsic.GetForResolution(m_depthImage.depth.resolution); }