SLR_Kinect_PC пре 10 година
родитељ
комит
2aaedcd561
2 измењених фајлова са 8 додато и 1 уклоњено
  1. BIN
      bbiwarg.v12.suo
  2. 8 1
      bbiwarg/Images/DepthImage.cs

+ 8 - 1
bbiwarg/Images/DepthImage.cs

@@ -78,7 +78,14 @@ namespace BBIWARG.Images
         /// <returns>the depth at the position</returns>
         public Int16 getDepthAt(int x, int y)
         {
-            return (Int16)(MinDepth + Image.Data[y, x, 0]);
+            try
+            {
+                return (Int16)(MinDepth + Image.Data[y, x, 0]);
+            }
+            catch (IndexOutOfRangeException e)
+            {
+                return (Int16)(MinDepth + Image.Data[0, 0, 0]);
+            }
         }
 
         /// <summary>