فهرست منبع

Merge branch 'master' of https://git.tk.informatik.tu-darmstadt.de/etri-smartspaces

Alexander Hendrich 11 سال پیش
والد
کامیت
e3c44ffdff
2فایلهای تغییر یافته به همراه22 افزوده شده و 3 حذف شده
  1. 4 0
      bbiwarg/Constants.cs
  2. 18 3
      bbiwarg/Graphics/TouchEventVisualizer.cs

+ 4 - 0
bbiwarg/Constants.cs

@@ -37,6 +37,10 @@ namespace bbiwarg
         // palm detection
         public static readonly float PalmMinDefectMidFingerLineDistance = 20; // defects with mid point ((start + end) / 2) closer than this to a finger line are removed 
     
+        //palm Grid
+        public static readonly int PalmGridRows = 4;
+        public static readonly int PalmGridColumns = 3;
+
         // output window
         public static readonly int NumImagesPerRow = 2;
         public static readonly float WindwoSizeFactor = 1f; // output window size is scaled by this factor (from necessary size for images)

+ 18 - 3
bbiwarg/Graphics/TouchEventVisualizer.cs

@@ -52,7 +52,7 @@ namespace bbiwarg.Graphics
                 currentFilter = new Kalman2DPositionFilter(e.RelativePalmPosition);
                 pos = e.RelativePalmPosition;
             }
-            else 
+            else
             {
                 pos = currentFilter.getCorrectedPosition(e.RelativePalmPosition);
             }
@@ -70,11 +70,26 @@ namespace bbiwarg.Graphics
 
         public void updateImage()
         {
-            OutputImage = new OutputImage(width, height);            
-            
+            OutputImage = new OutputImage(width, height);
+
             int size = Math.Min(width, height);
             OutputImage.drawRectangle(0, 0, size - 1, size - 1, Color.White);
 
+            int numRows = Constants.PalmGridRows;
+            int numColumns = Constants.PalmGridColumns;
+
+            for (int i = 1; i < numRows; i++)
+            {
+                int tmp = size / numRows * i;
+                OutputImage.drawLineSegment(new LineSegment2D(new Vector2D(0, tmp), new Vector2D(size - 2, tmp)), Constants.PalmGridColor);
+            }
+            for (int i = 1; i < numColumns; i++)
+            {
+                int tmp = size / numColumns * i;
+                OutputImage.drawLineSegment(new LineSegment2D(new Vector2D(tmp, 0), new Vector2D(tmp, size-2)), Constants.PalmGridColor);
+            }
+
+
             foreach (List<Vector2D> positions in touchPositions)
             {
                 for (int i = 1; i < positions.Count; ++i)