Ver código fonte

-palmDetection uses fingerTracker instead of fingerDetector (hopefully more stable now)
-rescaling before canny not worth the performance loss

Alexander Hendrich 11 anos atrás
pai
commit
8565d60503
2 arquivos alterados com 10 adições e 3 exclusões
  1. 9 2
      bbiwarg/Images/EdgeImage.cs
  2. 1 1
      bbiwarg/VideoHandle.cs

+ 9 - 2
bbiwarg/Images/EdgeImage.cs

@@ -20,8 +20,15 @@ namespace bbiwarg.Images
 
         public EdgeImage(DepthImage depthImage, OutputImage outputImage)
         {
-            // no more scaling to [0, 255]?
-            Image = depthImage.Image.Canny(100, 75, 3);
+            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 = dimg.Canny(150, 100, 3);
 
             // draw blue edges in outputImage
             outputImage.Image[2] = Image.ThresholdBinary(new Gray(0), new Gray(1)).Mul(255);

+ 1 - 1
bbiwarg/VideoHandle.cs

@@ -151,7 +151,7 @@ namespace bbiwarg
 
             //detect palm
             Timer.start("palmDetection");
-            palmDetector = new PalmDetector(depthImage, edgeImage, fingerDetector.Fingers, depthPalmTouchOutputImage);
+            palmDetector = new PalmDetector(depthImage, edgeImage, fingerTracker.TrackedFingers, depthPalmTouchOutputImage);
             if (sourceIsMovie() && getCurrentMovieFrame() == 0)
                 PalmDetector.resetFilter();
             Timer.stop("palmDetection");