I'm using the front-facing camera on an iPhone X to capture depth data (using the IR true depth camera).
I'm able to quite easily extract the depthData from the photo that I take, but that data appears to be limited to 8-bit values per data point, even though I believe I am asking for 32-bit precision. See below:
func photoOutput(_ output: AVCapturePhotoOutput, didFinishProcessingPhoto photo: AVCapturePhoto, error: Error?) {
let depthData = photo.depthData
if (depthData != nil) {
print("got some depth data")
let depthData = (depthData?.converting(toDepthDataType: kCVPixelFormatType_DepthFloat32))
}
}
The depthData object in the snippet above contains only 8-bit values. Is there greater precision available from the AVDepthData?