Depth data is store in ordered, from top left to bottom right. We calculate the index of the center point of the frame according to the width and height. Then get the value of it.
int middleIndex = (frame.getHeight() + 1) * frame.getWidth() / 2;
printf("Distance is %5d mm\n", pDepth[middleIndex]);