Attaching custom depth map to an image

Hi,

I am trying to attach a custom depth map as explained in this post:

https://developer.apple.com/documentation/avfoundation/avdepthdata/creating_auxiliary_depth_data_manually?language=objc

I converted the grayscale image to an NSData object and set in the

kCGImageAuxiliaryDataInfoData Dictionary and i can save it successfully. But when i try to read it back its returns an invalid depth map.

Note: the image is a single channel grayscale image which i extracted from a dual camera device. I now want to apply it to any image, just like DepthCam app on ios does. It allows the user to attach a depth map to any image from the roll and saves it as portrait mode supported image.


Has any one been able to add a custom depth map successfully to an image?

Replies

Faced with the same issue, please share the solution if you have found it.