Browse Source

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

Daniel Kauth 11 years ago
parent
commit
3ca515a2a6
2 changed files with 203 additions and 202 deletions
  1. 128 128
      bbiwarg/Test/OutputTest.cs
  2. 75 74
      bbiwarg/bbiwarg.csproj

+ 128 - 128
bbiwarg/Test/OutputTest.cs

@@ -1,132 +1,132 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Drawing;
-using OpenTK;
-using OpenTK.Graphics.OpenGL;
-using MathNet.Numerics.LinearAlgebra.Single;
-
-using bbiwarg.DataSource;
-
-namespace bbiwarg.Test
-{
-    class OutputTest : GameWindow
-    {
-        IVideoDataSource source;
-
-        static void Main(string[] args)
-        {
-            OutputTest demo = new OutputTest();
-            demo.initSource();
-            demo.Run(30);
-        }
-
-
-        public void initSource()
-        {
-            source = new IIsuDataSource("..\\..\\videos\\1.skv");
-            source.init();
-            source.start();
-
-        }
-
-        protected override void OnLoad(EventArgs e)
-        {
-            base.OnLoad(e);
-            Title = "OutputTest";
-            GL.ClearColor(Color.Black);
-        }
-
-        protected override void OnRenderFrame(FrameEventArgs e)
-        {
-            base.OnRenderFrame(e);
-
-            bool isActive = source.isActive();
-            if (isActive)
-            {
-                source.updateFrame();
-            }
-
-            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
-            Matrix4 modelview = Matrix4.LookAt(Vector3.Zero, -Vector3.UnitZ, Vector3.UnitY);
-            GL.MatrixMode(MatrixMode.Modelview);
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using OpenTK;
+using OpenTK.Graphics.OpenGL;
+using MathNet.Numerics.LinearAlgebra.Single;
+
+using bbiwarg.DataSource;
+
+namespace bbiwarg.Test
+{
+    class OutputTest : GameWindow
+    {
+        IVideoDataSource source;
+
+        static void Main(string[] args)
+        {
+            OutputTest demo = new OutputTest();
+            demo.initSource();
+            demo.Run(30);
+        }
+
+
+        public void initSource()
+        {
+            source = new IIsuDataSource("..\\..\\videos\\1.skv");
+            source.init();
+            source.start();
+
+        }
+
+        protected override void OnLoad(EventArgs e)
+        {
+            base.OnLoad(e);
+            Title = "OutputTest";
+            GL.ClearColor(Color.Black);
+        }
+
+        protected override void OnRenderFrame(FrameEventArgs e)
+        {
+            base.OnRenderFrame(e);
+
+            bool isActive = source.isActive();
+            if (isActive)
+            {
+                source.updateFrame();
+            }
+
+            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
+            Matrix4 modelview = Matrix4.LookAt(Vector3.Zero, -Vector3.UnitZ, Vector3.UnitY);
+            GL.MatrixMode(MatrixMode.Modelview);
             GL.LoadMatrix(ref modelview);
 
-            GL.Color3(1.0f,1.0f,1.0f);
-            
-            DepthImage depthImage = source.getDepthImage();
-            ConfidenceImage confidenceImage = source.getConfidenceImage();
-            int width = depthImage.getWidth();
-            int height = depthImage.getHeight();
-
-            for (int x = 0; x < width-1; x++) {
-                for (int y = 0; y < height-1; y++)
-                {
-                    short confidence = confidenceImage.getConfidence(x,y);
-
-                    if(confidence > 100) {
-                        short depth = depthImage.getDepth(x, y);
-
-
-                        int relX = x - width / 2;
-                        int relY = height/2 - y;
-
-                        GL.Begin(BeginMode.Polygon);
-                        GL.Vertex3(relX-0.5f, relY+0.5f, -depth);
-                        GL.Vertex3(relX+0.5f, relY+0.5f, -depth);
-                        GL.Vertex3(relX+0.5f, relY-0.5f, -depth);
-                        GL.Vertex3(relX-0.5f, relY-0.5f, -depth);
-                        GL.End();
-                    }
-                }
+            GL.Color3(1.0f,1.0f,1.0f);
+            
+            DepthImage depthImage = source.getDepthImage();
+            ConfidenceImage confidenceImage = source.getConfidenceImage();
+            int width = depthImage.getWidth();
+            int height = depthImage.getHeight();
+
+            for (int x = 0; x < width-1; x++) {
+                for (int y = 0; y < height-1; y++)
+                {
+                    short confidence = confidenceImage.getConfidence(x,y);
+
+                    if(confidence > 100) {
+                        short depth = depthImage.getDepth(x, y);
+
+
+                        int relX = x - width / 2;
+                        int relY = height/2 - y;
+
+                        GL.Begin(BeginMode.Polygon);
+                        GL.Vertex3(relX-0.5f, relY+0.5f, -depth);
+                        GL.Vertex3(relX+0.5f, relY+0.5f, -depth);
+                        GL.Vertex3(relX+0.5f, relY-0.5f, -depth);
+                        GL.Vertex3(relX-0.5f, relY-0.5f, -depth);
+                        GL.End();
+                    }
+                }
             }
 
-            //Triangle triangle = new Triangle(new DenseVector(new float[] { 0.0f, 0.0f, -100.0f }), new DenseVector(new float[] { 100.0f, 0.0f, -100.0f }), new DenseVector(new float[] { 0.0f, 100.0f, -100.0f }));
-
-            /*
-            GL.Begin(BeginMode.Triangles);
-            GL.Vertex3(0.0f, 0.0f, -4.0f);
-            GL.Vertex3(2.0f, 0.0f, -4.0f);
-            GL.Vertex3(0.0f, 1.0f, -4.0f);
-            GL.End();
-            */
-            SwapBuffers();
-
-            if(isActive) {
-                source.releaseFrame();
-            }
-
-
-            /*
-            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
-
-            Matrix4 modelview = Matrix4.LookAt(Vector3.Zero, Vector3.UnitZ, Vector3.UnitY);
-            GL.MatrixMode(MatrixMode.Modelview);
-            GL.LoadMatrix(ref modelview);
-
-            // triangle
-            GL.Begin(BeginMode.Triangles);
-
-            float x = palmPosition.Value._X;
-            float y = palmPosition.Value._Y;
-            float z = palmPosition.Value._Z;
-
-            GL.Vertex3(-1.0f + x, -1.0f + z, 4.0f - 10 * y);
-            GL.Vertex3(1.0f, -1.0f, 4.0f);
-            GL.Vertex3(0.0f, 1.0f, 4.0f);
-            GL.End();
-
-            SwapBuffers();*/
-        }
-
-        protected override void OnResize(EventArgs e)
-        {
-            base.OnResize(e);
-            GL.Viewport(ClientRectangle.X, ClientRectangle.Y, ClientRectangle.Width, ClientRectangle.Height);
-            Matrix4 projection = Matrix4.CreatePerspectiveFieldOfView((float)Math.PI / 4, Width / (float)Height, 1.0f, 3000.0f);
-            GL.MatrixMode(MatrixMode.Projection);
-            GL.LoadMatrix(ref projection);
-        }
-    }
-}
+            //Triangle triangle = new Triangle(new DenseVector(new float[] { 0.0f, 0.0f, -100.0f }), new DenseVector(new float[] { 100.0f, 0.0f, -100.0f }), new DenseVector(new float[] { 0.0f, 100.0f, -100.0f }));
+
+            /*
+            GL.Begin(BeginMode.Triangles);
+            GL.Vertex3(0.0f, 0.0f, -4.0f);
+            GL.Vertex3(2.0f, 0.0f, -4.0f);
+            GL.Vertex3(0.0f, 1.0f, -4.0f);
+            GL.End();
+            */
+            SwapBuffers();
+
+            if(isActive) {
+                source.releaseFrame();
+            }
+
+
+            /*
+            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
+
+            Matrix4 modelview = Matrix4.LookAt(Vector3.Zero, Vector3.UnitZ, Vector3.UnitY);
+            GL.MatrixMode(MatrixMode.Modelview);
+            GL.LoadMatrix(ref modelview);
+
+            // triangle
+            GL.Begin(BeginMode.Triangles);
+
+            float x = palmPosition.Value._X;
+            float y = palmPosition.Value._Y;
+            float z = palmPosition.Value._Z;
+
+            GL.Vertex3(-1.0f + x, -1.0f + z, 4.0f - 10 * y);
+            GL.Vertex3(1.0f, -1.0f, 4.0f);
+            GL.Vertex3(0.0f, 1.0f, 4.0f);
+            GL.End();
+
+            SwapBuffers();*/
+        }
+
+        protected override void OnResize(EventArgs e)
+        {
+            base.OnResize(e);
+            GL.Viewport(ClientRectangle.X, ClientRectangle.Y, ClientRectangle.Width, ClientRectangle.Height);
+            Matrix4 projection = Matrix4.CreatePerspectiveFieldOfView((float)Math.PI / 4, Width / (float)Height, 1.0f, 3000.0f);
+            GL.MatrixMode(MatrixMode.Projection);
+            GL.LoadMatrix(ref projection);
+        }
+    }
+}

+ 75 - 74
bbiwarg/bbiwarg.csproj

@@ -1,81 +1,82 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProjectGuid>{12271049-82D6-436D-A51E-E6614C8E9C50}</ProjectGuid>
-    <OutputType>Exe</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>bbiwarg</RootNamespace>
-    <AssemblyName>bbiwarg</AssemblyName>
-    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
-    <FileAlignment>512</FileAlignment>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <PlatformTarget>AnyCPU</PlatformTarget>
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <PlatformTarget>AnyCPU</PlatformTarget>
-    <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup>
-    <StartupObject>bbiwarg.Test.TestDataSource</StartupObject>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="iisuNet, Version=3.0.0.0, Culture=neutral, processorArchitecture=x86">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>lib\iisuNet.dll</HintPath>
-    </Reference>
-    <Reference Include="MathNet.Numerics">
-      <HintPath>lib\MathNet.Numerics.dll</HintPath>
-    </Reference>
-    <Reference Include="OpenTK, Version=1.1.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>lib\OpenTK.dll</HintPath>
-    </Reference>
-    <Reference Include="System" />
-    <Reference Include="System.Core" />
-    <Reference Include="System.Drawing" />
-    <Reference Include="System.Xml.Linq" />
-    <Reference Include="System.Data.DataSetExtensions" />
-    <Reference Include="Microsoft.CSharp" />
-    <Reference Include="System.Data" />
-    <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="DataSource\Color4.cs" />
-    <Compile Include="DataSource\ColorImage.cs" />
-    <Compile Include="DataSource\ConfidenceImage.cs" />
-    <Compile Include="DataSource\DepthImage.cs" />
-    <Compile Include="DataSource\IisuDataSource.cs" />
-    <Compile Include="DataSource\IVideoDataSource.cs" />
-    <Compile Include="DataSource\VertexArray.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="Test\OutputTest.cs" />
-    <Compile Include="Test\TestDataSource.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="App.config" />
-  </ItemGroup>
-  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{12271049-82D6-436D-A51E-E6614C8E9C50}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>bbiwarg</RootNamespace>
+    <AssemblyName>bbiwarg</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup>
+    <StartupObject>bbiwarg.Test.TestDataSource</StartupObject>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="iisuNet, Version=3.0.0.0, Culture=neutral, processorArchitecture=x86">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>lib\iisuNet.dll</HintPath>
+    </Reference>
+    <Reference Include="MathNet.Numerics">
+      <HintPath>lib\MathNet.Numerics.dll</HintPath>
+    </Reference>
+    <Reference Include="OpenTK, Version=1.1.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>lib\OpenTK.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="DataSource\Color4.cs" />
+    <Compile Include="DataSource\ColorImage.cs" />
+    <Compile Include="DataSource\ConfidenceImage.cs" />
+    <Compile Include="DataSource\DepthImage.cs" />
+    <Compile Include="DataSource\IisuDataSource.cs" />
+    <Compile Include="DataSource\IVideoDataSource.cs" />
+    <Compile Include="DataSource\VertexArray.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Test\OutputTest.cs" />
+    <Compile Include="Test\TestDataSource.cs" />
+    <Compile Include="Test\Triangle.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
        Other similar extension points exist, see Microsoft.Common.targets.
   <Target Name="BeforeBuild">
   </Target>
   <Target Name="AfterBuild">
   </Target>
-  -->
+  -->
 </Project>