public bool Update(ShortImage depth) { // compute the raw valid pixels for this frame ByteImage maskCur = Mask1(depth); // initialize the acc image if we need to if (mFrameIter == 0) { mAcc32.Add(depth); mCount16.Add(maskCur); mMask.Copy(maskCur); mFrameIter++; return(mFrameIter >= mNumFrames); } // compute the pixels that don't differ from previous values ByteImage diffMask = DiffMask(depth, mAcc32, mFrameIter, mValidDelta * 1000.0f); // update the rolling depthMask mMask.And(maskCur); mMask.And(diffMask); mCount16.Add(maskCur); mAcc32.Add(depth); mFrameIter++; maskCur.Dispose(); diffMask.Dispose(); return(mFrameIter >= mNumFrames); }