コード例 #1
0
        private Bitmap getThreeFrameDifference(Bitmap frame)
        {
            if (lastFrame == null || lastButOneFrame == null)
            {
                return null;
            }

            Difference filterPrevious = new Difference(lastButOneFrame);
            Bitmap differenceBitmapPrevious = filterPrevious.Apply(lastFrame);

            Difference filterNext = new Difference(lastFrame);
            Bitmap differenceBitmapNext = filterNext.Apply(frame);

            Intersect intersectionFilter = new Intersect(differenceBitmapPrevious);
            Bitmap threeFrameDifferenceBitmap = intersectionFilter.Apply(differenceBitmapNext);

            return threeFrameDifferenceBitmap;
        }