Sfoglia il codice sorgente

Added scaling to depth image.

Daniel Kauth 11 anni fa
parent
commit
c51a85a520
1 ha cambiato i file con 1 aggiunte e 7 eliminazioni
  1. 1 7
      bbiwarg/Images/EdgeImage.cs

+ 1 - 7
bbiwarg/Images/EdgeImage.cs

@@ -20,13 +20,7 @@ namespace bbiwarg.Images
 
         public EdgeImage(DepthImage depthImage, OutputImage outputImage)
         {
-            Image<Gray, byte> dimg = depthImage.Image;
-            //rescale depthImage to [0,255] -> performance loss not worth (is already scaled to [0,200])
-            /*double[] min, max;
-            Point[] minLoc, maxLoc;
-            dimg.MinMax(out min, out max, out minLoc, out maxLoc);
-            double interval = max[0] - min[0];
-            dimg = dimg.Convert(delegate(byte d) {return (byte) ((d/interval)*255);});*/
+            Image<Gray, byte> dimg = depthImage.Image * (255.0f / (float)(depthImage.MaxDepth - depthImage.MinDepth));
             
             Image = dimg.Canny(100, 75, 3);