Bläddra i källkod

added Projection2DTo2D (not finished yet)

Alexander Hendrich 11 år sedan
förälder
incheckning
f831a298f0
3 ändrade filer med 41 tillägg och 2 borttagningar
  1. 4 2
      bbiwarg/Parameters.cs
  2. 32 0
      bbiwarg/Utility/Projection2DTo2D.cs
  3. 5 0
      bbiwarg/bbiwarg.csproj

+ 4 - 2
bbiwarg/Parameters.cs

@@ -40,8 +40,8 @@ namespace bbiwarg
         public static readonly bool GlassesWindowEnabled = true;
         public static readonly int GlassesWindowUpdateRate = 30;
         public static readonly int GlassesWindowRenderRate = 30;
-        public static readonly int GlassesWindowWidth = 1280;
-        public static readonly int GlassesWindowHeight = 720;
+        public static readonly int GlassesWindowWidth = 320;//1280;
+        public static readonly int GlassesWindowHeight = 240;//720;
         public static readonly String GlassesWindowTitle = "BBIWARG - GlassesOutput";
 
         // TUIO
@@ -194,6 +194,8 @@ namespace bbiwarg
         public static readonly Color HandThumbDefectPointColor = Color.Lime;
         public static readonly Color HandThumbDefectLineColor = Color.CornflowerBlue;
 
+        public static readonly Color CalibrationPointColor = Color.Yellow;
+
         static Parameters()
         {
             setImageParameters(320, 240);

+ 32 - 0
bbiwarg/Utility/Projection2DTo2D.cs

@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace bbiwarg.Utility
+{
+    class Projection2DTo2D
+    {
+        private int sourceWidth;
+        private int sourceHeight;
+        private int destinationWidth;
+        private int destinationHeight;
+        private Dictionary<Vector2D, Vector2D> calibrationPoints;
+
+        public bool IsCalibrated { get; private set; }
+
+        public Projection2DTo2D(int sourceWidth, int sourceHeight, int destinationWidth, int destinationHeight) {
+            this.sourceWidth = sourceWidth;
+            this.sourceHeight = sourceHeight;
+            this.destinationWidth = destinationWidth;
+            this.destinationHeight = destinationHeight;
+
+            IsCalibrated = false;
+            calibrationPoints = new Dictionary<Vector2D, Vector2D>();
+        }
+    }
+}
+
+
+

+ 5 - 0
bbiwarg/bbiwarg.csproj

@@ -56,6 +56,9 @@
       <SpecificVersion>False</SpecificVersion>
       <HintPath>lib\Emgu.CV.dll</HintPath>
     </Reference>
+    <Reference Include="Emgu.CV.UI">
+      <HintPath>..\..\Bachelor-Praktikum\dlls\Emgu.CV.UI.dll</HintPath>
+    </Reference>
     <Reference Include="Emgu.Util, Version=2.4.2.1777, Culture=neutral, PublicKeyToken=7281126722ab4438, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
       <HintPath>lib\Emgu.Util.dll</HintPath>
@@ -74,6 +77,7 @@
     <Reference Include="System" />
     <Reference Include="System.Core" />
     <Reference Include="System.Drawing" />
+    <Reference Include="System.Windows.Forms" />
     <Reference Include="System.Xml.Linq" />
     <Reference Include="System.Data.DataSetExtensions" />
     <Reference Include="Microsoft.CSharp" />
@@ -83,6 +87,7 @@
   <ItemGroup>
     <Compile Include="Input\InputHandling\FrameData.cs" />
     <Compile Include="Output\DebugOutput\DebugImages.cs" />
+    <Compile Include="Utility\Projection2DTo2D.cs" />
     <Compile Include="Output\GlassesOutput\GlassesWindow.cs" />
     <Compile Include="Parameters.cs" />
     <Compile Include="Output\DebugOutput\DebugWindow.cs" />