The depth values can be obtained from
depth stream of the StereoDepth node. With it, you receive an array with each point distance in mm.
The example I've shared uses
disparity output, as it's better for visualizations
But you can add a
depth stream there too to obtain raw depth info.
The example erik shared uses
depth stream by default, so no change there is needed
So to get the Z coordinate of an X/Y point, you need to take the depth frame (
calc_spatials) and check what the depth value at X/Y index