public ushort GetDepthForPixel(int x, int y) { if (sensorData != null && sensorData.depthImage != null) { int index = y * sensorData.depthImageWidth + x; if (index >= 0 && index < sensorData.depthImage.Length) { return sensorData.depthImage[index]; } } return 0; }