Bläddra i källkod

-added Color from UV Image

Anton 11 år sedan
förälder
incheckning
35ae46c6eb
1 ändrade filer med 17 tillägg och 13 borttagningar
  1. 17 13
      bbiwarg/Test/OutputTest.cs

+ 17 - 13
bbiwarg/Test/OutputTest.cs

@@ -38,7 +38,7 @@ namespace bbiwarg.Test
             {
                 for (int y = 0; y < height; y++)
                 {
-                    pixel.Add(new Pixel3D(x,y,width,height));
+                    pixel.Add(new Pixel3D(x, y, width, height));
                 }
             }
         }
@@ -65,31 +65,34 @@ namespace bbiwarg.Test
             GL.MatrixMode(MatrixMode.Modelview);
             GL.LoadMatrix(ref modelview);
 
-            GL.Color3(1.0f,1.0f,1.0f);
-            
+            GL.Color3(1.0f, 1.0f, 1.0f);
+
             DepthImage depthImage = source.getDepthImage();
             ConfidenceImage confidenceImage = source.getConfidenceImage();
-            int width = depthImage.getWidth();
-            int height = depthImage.getHeight();
+            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 = depthImage.getDepth(pixel[i].x, pixel[i].y);
+                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 palmVertex = source.getPalmPosition3D(1);
             Vector palmPixel = source.getPalmPosition2D(1);
-            Pixel3D palmPosition = new Pixel3D((int) palmPixel[0], (int) palmPixel[1], width, height);
-            palmPosition.depth = (short) (palmVertex[1] * 1000);
+            Pixel3D palmPosition = new Pixel3D((int)palmPixel[0], (int)palmPixel[1], width, height);
+            palmPosition.depth = (short)(palmVertex[1] * 1000);
             palmPosition.color = Color.Red;
             palmPosition.size = 3;
             palmPosition.draw();
             //Console.WriteLine(palmPosition.toString());
-            
-           
+
+            Console.WriteLine("Palm Position: x: " + (int)palmPixel[0] + " y: " + (int)palmPixel[1] + " 3DDepth: " + palmPosition.depth + " ImageDepth: " + imageData.getDepth((int)palmPixel[0], (int)palmPixel[1]));
 
             for (int i = 0; i < triangles.Count; i++)
             {
@@ -105,7 +108,8 @@ namespace bbiwarg.Test
             */
             SwapBuffers();
 
-            if(isActive) {
+            if (isActive)
+            {
                 source.releaseFrame();
             }
 
@@ -141,7 +145,7 @@ namespace bbiwarg.Test
             GL.LoadMatrix(ref projection);
         }
 
-        
+
 
         public void addSurface(Triangle triangle)
         {