Ejemplo n.º 1
0
        public void MergePatches(UnmanagedImage backImage, UnmanagedImage[] patchData, Rectangle[] patchBounds)
        {
            if (patchData.Length != patchBounds.Length)
            {
                throw new ArgumentException($"{nameof(patchData)} and {patchBounds} not in the same length");
            }

            for (var i = 0; i < patchData.Length; i++)
            {
                backImage.Draw(patchData[i], patchBounds[i].X, patchBounds[i].Y);
            }
        }
Ejemplo n.º 2
0
        private void DoApply(UnmanagedImage image, UnmanagedImage output)
        {
            var fimg = Fourier.FFT2(image);

            if (Width != fimg.Width ||
                Height != fimg.Height)
            {
                throw new DimensionMismatchException();
            }

            fimg.C0.MultiplyWith(C0);
            fimg.C1.MultiplyWith(C1);
            fimg.C2.MultiplyWith(C2);
            output.Draw(fimg.InverseFFT2(false));
        }