|
@@ -42,6 +42,7 @@ namespace bbiwarg
|
|
|
|
|
|
private DepthImage depthImage;
|
|
private DepthImage depthImage;
|
|
private EdgeImage edgeImage;
|
|
private EdgeImage edgeImage;
|
|
|
|
+ private ConfidenceImage confidenceImage;
|
|
|
|
|
|
private FingerDetector fingerDetector;
|
|
private FingerDetector fingerDetector;
|
|
private HandDetector handDetector;
|
|
private HandDetector handDetector;
|
|
@@ -133,20 +134,25 @@ namespace bbiwarg
|
|
|
|
|
|
//create output images
|
|
//create output images
|
|
Timer.start("createOutputImages");
|
|
Timer.start("createOutputImages");
|
|
- int numImages = 5;
|
|
|
|
- OutputImages = new OutputImage[numImages];
|
|
|
|
- for (int i = 0; i < numImages; i++) {
|
|
|
|
|
|
+ OutputImages = new OutputImage[Constants.OutputNumImages];
|
|
|
|
+ for (int i = 0; i < Constants.OutputNumImages; i++) {
|
|
OutputImages[i] = new OutputImage(Width, Height);
|
|
OutputImages[i] = new OutputImage(Width, Height);
|
|
|
|
|
|
}
|
|
}
|
|
Timer.stop("createOutputImages");
|
|
Timer.stop("createOutputImages");
|
|
|
|
|
|
|
|
+ //create confidenceImage
|
|
|
|
+ Timer.start("createConfidenceImage");
|
|
|
|
+ Image<Gray, Int16> rawConfidenceImage = new Image<Gray, Int16>(Width, Height, Width * 2, inputFrame.RawConfidenceData);
|
|
|
|
+ confidenceImage = new ConfidenceImage(rawConfidenceImage);
|
|
|
|
+ Timer.stop("createConfidenceImage");
|
|
|
|
+
|
|
//create depthImage
|
|
//create depthImage
|
|
Timer.start("createDepthImage");
|
|
Timer.start("createDepthImage");
|
|
- Image<Gray, Int16> image = new Image<Gray, Int16>(Width, Height, Width * 2, inputFrame.RawDepthData);
|
|
|
|
- depthImage = new DepthImage(image, OutputImages[0]);
|
|
|
|
- Image<Gray, byte> tmpDepth = (depthImage.MaxDepth - depthImage.MinDepth) - depthImage.Image;
|
|
|
|
- OutputImages[0].Image[0] = OutputImages[0].Image[1] = OutputImages[0].Image[2] = tmpDepth;
|
|
|
|
|
|
+ Image<Gray, Int16> rawDepthImage = new Image<Gray, Int16>(Width, Height, Width * 2, inputFrame.RawDepthData);
|
|
|
|
+ rawDepthImage = rawDepthImage.Or((1 - confidenceImage.Mask).Convert<Gray, Int16>().Mul(Int16.MaxValue));
|
|
|
|
+ depthImage = new DepthImage(rawDepthImage);
|
|
|
|
+ OutputImages[0].Image[0] = OutputImages[0].Image[1] = OutputImages[0].Image[2] = (depthImage.MaxDepth - depthImage.MinDepth) - depthImage.Image;
|
|
Timer.stop("createDepthImage");
|
|
Timer.stop("createDepthImage");
|
|
|
|
|
|
// create edge image
|
|
// create edge image
|
|
@@ -208,13 +214,13 @@ namespace bbiwarg
|
|
}
|
|
}
|
|
|
|
|
|
// add borders
|
|
// add borders
|
|
- for (int i = 0; i < numImages; i++)
|
|
|
|
|
|
+ for (int i = 0; i < Constants.OutputNumImages; i++)
|
|
{
|
|
{
|
|
OutputImages[i].drawRectangle(0, 0, Width - 1, Height - 1, Color.White);
|
|
OutputImages[i].drawRectangle(0, 0, Width - 1, Height - 1, Color.White);
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- OutputImages = new OutputImage[] {OutputImages[0], OutputImages[1], OutputImages[2], OutputImages[3], OutputImages[4]};
|
|
|
|
|
|
+ //OutputImages = new OutputImage[] {OutputImages[0], OutputImages[1], OutputImages[2], OutputImages[3], OutputImages[4]};
|
|
|
|
|
|
//palmDetector.i1, palmDetector.i2, palmDetector.i3, palmDetector.i5, palmDetector.i6, palmDetector.i7, palmDetector.i8, palmDetector.i9};
|
|
//palmDetector.i1, palmDetector.i2, palmDetector.i3, palmDetector.i5, palmDetector.i6, palmDetector.i7, palmDetector.i8, palmDetector.i9};
|
|
|
|
|