如何解决iOS14 ARDepthData 的分辨率是多少?
我正在尝试将 ARSession
和 ARCamera
捕获的深度数据可视化。我看到深度很好,除了平面物体(如显示器)的边缘,我希望渲染平面和背景之间有更清晰的过渡。
我观察到的是物体边缘的“磨损”,其中深度值发生了显着变化。 (创建自由浮动线,如下图所示)。我想删除自由浮动的线条。
这让我想问:
ARDepthData 的“真实”分辨率是多少(值的多少部分可以作为噪声安全地丢弃)?
在使用 ARDepthData 时如何避免舍入错误?
open class ARDepthData : NSObject {
/* A pixel buffer that contains per-pixel depth data (in meters). */
unowned(unsafe) open var depthMap: CVPixelBuffer { get }
}
这是我尝试裁剪值的方法,但这会扭曲图像其余部分的分辨率。
const float2 samplePoint = float2(x,y); //0.0 - 1.0 range
const float2 clippingMultiplier = float2(64,64);
const float2 clippedTextureCoordinate = (floor(texCoord * clippingMultiplier)) / clippingMultiplier; //attempt to clip fractional components
// What are the appropriate sampling filter parameters to reduce the error like in the screenshot?
constexpr sampler depthSampler(mip_filter::nearest,mag_filter::nearest,min_filter::nearest);
const auto depth = depthMap.sample(depthSampler,clippedTextureCoordinate).r;
//depth is used to calculate position
- 预期:一个尖锐的矩形
- 观察到:多股漂浮在空气中的深度值发生变化。
这是我从深度值中去除小数部分的尝试:
解决方法
对于前置真深度相机,AVDepthData 的最大深度分辨率为 w640 h480
。
ARDepthData 似乎具有类似的低分辨率:
depth: w256 h192
confidence: w256 h192
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。