Accord.Imaging.IntegralImage2.IntegralImage2 C# (CSharp) Method

IntegralImage2() protected method

Constructs a new Integral image of the given size.
protected IntegralImage2 ( int width, int height, bool computeTilted ) : System
width int
height int
computeTilted bool
return System
        protected IntegralImage2(int width, int height, bool computeTilted)
        {
            this.width = width;
            this.height = height;

            this.nWidth = width + 1;
            this.nHeight = height + 1;

            this.tWidth = width + 2;
            this.tHeight = height + 2;

            this.nSumImage = new long[nHeight, nWidth];
            this.nSumHandle = GCHandle.Alloc(nSumImage, GCHandleType.Pinned);
            this.nSum = (long*)nSumHandle.AddrOfPinnedObject().ToPointer();

            this.sSumImage = new long[nHeight, nWidth];
            this.sSumHandle = GCHandle.Alloc(sSumImage, GCHandleType.Pinned);
            this.sSum = (long*)sSumHandle.AddrOfPinnedObject().ToPointer();

            if (computeTilted)
            {
                this.tSumImage = new long[tHeight, tWidth];
                this.tSumHandle = GCHandle.Alloc(tSumImage, GCHandleType.Pinned);
                this.tSum = (long*)tSumHandle.AddrOfPinnedObject().ToPointer();
            }
        }