Reading depth from other than central pixel

Hello guys, I’m having some hard time trying to figure out how to read the depth of other pixel than the middle one. Do you guys know if that is even possible? If yes, could you help me out? I really appreciate your help.