How to create depth Image for ObjectCapture sample

Hello,

Just as the topic, I am trying to generate the Auxiliary depth data from my greyscale depth image. I found this page: https://developer.apple.com/documentation/avfoundation/avdepthdata/creating_auxiliary_depth_data_manually

This is very good, but I used to develop unity app, for me it's a bit unclear and seems like there are a lots work has to be done before this step. So I was trying to get CVPixelBuffer from Image, I had lots of problem at this step, what frame should I use: CIImage? UIImage(this is not work for macos?) NSImage? or something else?

I also got the error msg: parsableCommand stuct does not conform to protocol 'Decodable' when I declare var pixelBuffer: CVPixelBuffer? I googled it they suggest init some stuff, but not sure what should I do exactly.

sorry I post so many questions, I was wondering is there any sample code or tutorial available somewhere?

Thank you

How to create depth Image for ObjectCapture sample
 
 
Q