Browse Source

corrected palmGrid

Alexander Hendrich 11 years ago
parent
commit
63f9797233
1 changed files with 21 additions and 1 deletions
  1. 21 1
      bbiwarg/Images/PalmImage.cs

+ 21 - 1
bbiwarg/Images/PalmImage.cs

@@ -51,6 +51,26 @@ namespace bbiwarg.Images
 
         public void drawGrid(Vector2D a, Vector2D b, Vector2D c, Vector2D d)
         {
+
+            int numRows = 4;
+            int numColumns = 3;
+
+            Vector2D relAB = (b - a) / numRows;
+            Vector2D relDC = (c - d) / numRows;
+            Vector2D relBC = (c - b) / numColumns;
+            Vector2D relAD = (d - a) / numColumns;
+
+            for (int i = 1; i < numRows; i++)
+            {
+                drawLine(new Emgu.CV.Structure.LineSegment2DF(a + i * relAB, d + i * relDC), PalmImageState.palmGrid);
+            }
+
+            for (int i = 1; i < numColumns; i++)
+            {
+                drawLine(new Emgu.CV.Structure.LineSegment2DF(a + i * relAD, b + i * relBC), PalmImageState.palmGrid);
+            }
+
+            /*
             int columnCount = 4;
             int rowCount = 3;
 
@@ -71,7 +91,7 @@ namespace bbiwarg.Images
                 Vector2D dci = d + (ab * ((float)i / rowCount));
                 drawLine(new LineSegment2DF(abi, dci), PalmImageState.palmGrid);
             }
-
+            */
         }
     }
 }