SLR_Kinect_PC 9 years ago
parent
commit
2aaedcd561
2 changed files with 8 additions and 1 deletions
  1. BIN
      bbiwarg.v12.suo
  2. 8 1
      bbiwarg/Images/DepthImage.cs

BIN
bbiwarg.v12.suo


+ 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>