Depth image/disparity

What do i need to change in my code for the conversion ?