I have successfully saved image data from avcapturephoto using
if let filedata = photo.fileDataRepresentation() ,
let path = documentDirectoryPath()?.appendingPathComponent("item.data") {
try? filedata.write(to: path)
}
for reading the image, I can use this
let url = Bundle.main.url(forResource: "item", withExtension: "data")!
let fileDataRepresentation = try Data(contentsOf: url as URL)
let uiImage = UIImage(data:fileDataRepresentation)
How can I read the saved depth data? will it be in AVDepthData format?
AVDepthData(something: Data) // how to do this?