Attaching depth map manually

Hi, I have a problem when I want to attach my grayscale depth map image into the real image. The produced depth map doesn't have the cameraCalibration value which should responsible to align the depth data to the image. How do I align the depth map? I saw an article about it but it is not really detailed so I might be missing some process.

I tried to:

  1. convert my depth map into pixel buffer
  2. create image destination ref and add the image there.
  3. add the auxData (depth map dict)

This is the output:

There is some black space there and my RGB image colour changes

Attaching depth map manually
 
 
Q