|
@@ -26,8 +26,8 @@ namespace bbiwarg
|
|
|
private InputFrame currentInputFrame;
|
|
|
private int imageWidth;
|
|
|
private int imageHeight;
|
|
|
- private int currentFrame;
|
|
|
- private int lastFrame;
|
|
|
+ private int currentFrameID;
|
|
|
+ private int lastFrameID;
|
|
|
|
|
|
private DepthImage depthImage;
|
|
|
private EdgeImage edgeImage;
|
|
@@ -49,8 +49,8 @@ namespace bbiwarg
|
|
|
this.inputProvider = inputProvider;
|
|
|
this.imageWidth = inputProvider.ImageWidth;
|
|
|
this.imageHeight = inputProvider.ImageHeight;
|
|
|
- this.currentFrame = inputProvider.CurrentFrame;
|
|
|
- this.lastFrame = this.currentFrame - 1;
|
|
|
+ this.currentFrameID = inputProvider.CurrentFrameID;
|
|
|
+ this.lastFrameID = this.currentFrameID - 1;
|
|
|
|
|
|
initializeConsistentObjects();
|
|
|
}
|
|
@@ -100,25 +100,28 @@ namespace bbiwarg
|
|
|
{
|
|
|
Timer.start("updateFrame");
|
|
|
|
|
|
- beforeUpdateFrame();
|
|
|
+ if (currentFrameID != inputProvider.CurrentFrameID)
|
|
|
+ {
|
|
|
+ beforeUpdateFrame();
|
|
|
|
|
|
- if (lastFrame-currentFrame > 20)
|
|
|
- resetConsistentObjects();
|
|
|
+ if (lastFrameID - currentFrameID > 20)
|
|
|
+ resetConsistentObjects();
|
|
|
|
|
|
- createConfidenceImage();
|
|
|
- createDepthImage();
|
|
|
- createEdgeImage();
|
|
|
+ createConfidenceImage();
|
|
|
+ createDepthImage();
|
|
|
+ createEdgeImage();
|
|
|
|
|
|
- detectFingers();
|
|
|
- trackFingers();
|
|
|
+ detectFingers();
|
|
|
+ trackFingers();
|
|
|
|
|
|
- detectHands();
|
|
|
- detectPalm();
|
|
|
+ detectHands();
|
|
|
+ detectPalm();
|
|
|
|
|
|
- detectTouchEvents();
|
|
|
- trackTouchEvents();
|
|
|
+ detectTouchEvents();
|
|
|
+ trackTouchEvents();
|
|
|
|
|
|
- afterUpdateFrame();
|
|
|
+ afterUpdateFrame();
|
|
|
+ }
|
|
|
|
|
|
Timer.stop("updateFrame");
|
|
|
}
|
|
@@ -127,13 +130,11 @@ namespace bbiwarg
|
|
|
{
|
|
|
Timer.start("beforeUpdateFrame");
|
|
|
|
|
|
- Timer.start("getInputFrame");
|
|
|
- currentInputFrame = inputProvider.getInputFrame();
|
|
|
- Timer.stop("getInputFrame");
|
|
|
+ currentInputFrame = inputProvider.CurrentFrame;
|
|
|
|
|
|
- lastFrame = currentFrame;
|
|
|
- currentFrame = currentInputFrame.FrameNumber;
|
|
|
- Logger.CurrentFrame = currentFrame;
|
|
|
+ lastFrameID = currentFrameID;
|
|
|
+ currentFrameID = currentInputFrame.FrameID;
|
|
|
+ Logger.CurrentFrame = currentFrameID;
|
|
|
|
|
|
if (Constants.TuioEnabled)
|
|
|
tuioCommunicator.initFrame();
|