Jelajahi Sumber

Deleted unnecessary files.

Daniel Kauth 11 tahun lalu
induk
melakukan
41f4d61324

+ 52 - 52
bbiwarg/Test/Triangle.cs → bbiwarg/Graphics/Triangle.cs

@@ -1,52 +1,52 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Drawing;
-using OpenTK;
-using OpenTK.Graphics.OpenGL;
-using MathNet.Numerics.LinearAlgebra.Single;
-
-namespace bbiwarg.Test
-{
-    class Triangle
-    {
-        public Pixel3D a;
-        public Pixel3D b;
-        public Pixel3D c;
-        public Color color = Color.Red;
-
-        public Triangle(Pixel3D a, Pixel3D b, Pixel3D c)
-	    {
-            this.a = a;
-            this.b = b;
-            this.c = c;
-	    }
-
-        public void draw()
-        {
-            a.draw();
-            b.draw();
-            c.draw();
-
-            GL.Color3(color);
-
-            GL.Begin(BeginMode.Triangles);
-            GL.Vertex3(a.x, a.y, a.depth);
-            GL.Vertex3(b.x, b.y, b.depth);
-            GL.Vertex3(c.x, c.y, c.depth);
-            GL.End();
-        }
-
-        public void setPixel(Pixel3D a, Pixel3D b, Pixel3D c)
-        {
-            this.a = a;
-            this.b = b;
-            this.c = c;
-        }
-
-        
-
-    }
-}
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Drawing;
+using OpenTK;
+using OpenTK.Graphics.OpenGL;
+using MathNet.Numerics.LinearAlgebra.Single;
+
+namespace bbiwarg.Test
+{
+    class Triangle
+    {
+        public Pixel3D a;
+        public Pixel3D b;
+        public Pixel3D c;
+        public Color color = Color.Red;
+
+        public Triangle(Pixel3D a, Pixel3D b, Pixel3D c)
+	    {
+            this.a = a;
+            this.b = b;
+            this.c = c;
+	    }
+
+        public void draw()
+        {
+            a.draw();
+            b.draw();
+            c.draw();
+
+            GL.Color3(color);
+
+            GL.Begin(BeginMode.Triangles);
+            GL.Vertex3(a.x, a.y, a.depth);
+            GL.Vertex3(b.x, b.y, b.depth);
+            GL.Vertex3(c.x, c.y, c.depth);
+            GL.End();
+        }
+
+        public void setPixel(Pixel3D a, Pixel3D b, Pixel3D c)
+        {
+            this.a = a;
+            this.b = b;
+            this.c = c;
+        }
+
+        
+
+    }
+}

+ 0 - 52
bbiwarg/Main/TestDataSource.cs

@@ -1,52 +0,0 @@
-using System;
-using System.Drawing;
-using MathNet.Numerics.LinearAlgebra.Single;
-
-using bbiwarg.DataSource;
-
-namespace bbiwarg.Test
-{
-    class TestDataSource
-    {
-        static void Main(string[] args)
-        {
-            IVideoDataSource source = new IIsuDataSource("..\\..\\videos\\2.skv");
-
-            source.init();
-            source.start();
-
-            int i = 0;
-            int j = 0;
-            while (source.isActive())
-            {
-                source.updateFrame();
-
-                if ((i % 30) == 0)
-                {
-                    DataSource.DepthImage image = source.getDepthImage();
-
-                    Bitmap bm = new Bitmap(image.getWidth(), image.getHeight());
-                    for (int x = 0; x < image.getWidth(); ++x)
-                    {
-                        for (int y = 0; y < image.getHeight(); ++y)
-                        {
-                            int value = (int)(image.getDepth(x, y) / 1000.0 * 255.0) % 256;
-                            bm.SetPixel(x, y, Color.FromArgb(255, value, value, value));
-                        }
-                    }
-
-                    Vector palmPosition2D = source.getPalmPosition2D(1);
-
-                    bm.SetPixel((int)palmPosition2D[0], (int)palmPosition2D[1], Color.Yellow);
-
-                    bm.Save("test." + j + ".png");
-                    j++;
-                }
-
-                source.releaseFrame();
-                ++i;
-            }
-            source.stop();
-        }
-    }
-}

+ 0 - 130
bbiwarg/Test/OutputTest.cs

@@ -1,130 +0,0 @@
-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;
-        private List<Triangle> triangles = new List<Triangle>();
-        private List<Pixel3D> pixel = new List<Pixel3D>();
-
-        static void Main(string[] args)
-        {
-            OutputTest demo = new OutputTest();
-            demo.initSource();
-            demo.Run(30);
-        }
-
-
-        public void initSource()
-        {
-            source = new IIsuDataSource();//"..\\..\\videos\\10.skv");
-            source.init();
-            source.start();
-
-            int width = 320;
-            int height = 160;
-
-            for (int x = 0; x < width; x++)
-            {
-                for (int y = 0; y < height; y++)
-                {
-                    pixel.Add(new Pixel3D(x, y, width, height));
-                }
-            }
-        }
-
-        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();
-            ColorImage colorImage = source.getColorImage();
-            UVImage uvImage = source.getUVImage();
-            ImageData imageData = new ImageData(depthImage, confidenceImage, colorImage, uvImage);
-
-            int width = imageData.getWidth();
-            int height = imageData.getHeight();
-
-            for (int i = 0; i < pixel.Count; i++)
-            {
-                pixel[i].depth = imageData.getDepth(pixel[i].x, pixel[i].y);
-                pixel[i].color = imageData.getColor(pixel[i].x, pixel[i].y);
-                pixel[i].draw();
-            }
-
-
-            Vector palm = source.getPalmPosition2D(1);
-            Vector[] fingers = source.getFingerTipPositions2D(1);
-
-            Pixel3D palmPosition = new Pixel3D((int)palm[0], (int)palm[1], width, height);
-            Pixel3D finger1Position = new Pixel3D((int)fingers[0][0], (int)fingers[0][1], width, height);
-            palmPosition.depth = depthImage.getDepth((int)palm[0], (int)palm[1]);
-            palmPosition.color = Color.Red;
-            palmPosition.size = 3;
-            palmPosition.draw();
-            finger1Position.depth = depthImage.getDepth((int)fingers[0][0], (int)fingers[0][1]);
-            finger1Position.color = Color.Red;
-            finger1Position.size = 3;
-            finger1Position.draw();
-            
-            for (int i = 0; i < triangles.Count; i++)
-            {
-                triangles[i].draw();
-            }
-            SwapBuffers();
-
-            if (isActive)
-            {
-                source.releaseFrame();
-            }
-        }
-
-        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/8, Width / (float)Height, 1.0f, 3000.0f);
-            GL.MatrixMode(MatrixMode.Projection);
-            GL.LoadMatrix(ref projection);
-        }
-
-
-
-        public void addSurface(Triangle triangle)
-        {
-            triangles.Add(triangle);
-        }
-    }
-}

+ 0 - 52
bbiwarg/Test/Pixel3D.cs

@@ -1,52 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Drawing;
-using OpenTK;
-using OpenTK.Graphics.OpenGL;
-using MathNet.Numerics.LinearAlgebra.Single;
-
-namespace bbiwarg.Test
-{
-    class Pixel3D
-    {
-        public int x;
-        public int y;
-        public short depth = 100;
-        private int width;
-        private int height;
-        public Color color = Color.White;
-        public float size = 0.5f;
-
-        public Pixel3D(int x, int y, int width, int height){
-            this.x = x;
-            this.y = y;
-            this.width = width;
-            this.height = height;
-        }
-
-        public void draw(){
-             int relX = x - width / 2;
-             int relY = height/2 - y;
-
-
-             GL.Color4(color);
-
-             GL.Begin(BeginMode.Polygon);
-             GL.Vertex3(relX - size, relY + size, -depth);
-             GL.Vertex3(relX + size, relY + size, -depth);
-             GL.Vertex3(relX + size, relY - size, -depth);
-             GL.Vertex3(relX - size, relY - size, -depth);
-             GL.End();
-
-        }
-
-        public string toString()
-        {
-            return "x: " + x + "y: " + y + " depth: " + depth;
-        }
-
-    }
-}