Log filter.
Simple log image filter. Applies the System.Math.Log(double) function for each pixel in the image, clipping values as needed. The resultant image can be converted back using the Exponential filter.
Inheritance: BaseInPlaceFilter
Exemplo n.º 1
0
        public void ApplyTest()
        {
            Bitmap input = Properties.Resources.lena_color;

            Logarithm log = new Logarithm();
            Bitmap output = log.Apply(input);

            Exponential exp = new Exponential();
            Bitmap reconstruction = exp.Apply(output);

            //ImageBox.Show("input", input);
            //ImageBox.Show("output", output);
            //ImageBox.Show("reconstruction", reconstruction);
        }
Exemplo n.º 2
0
        public void ProcessImageTest()
        {
            double[,] diag = Matrix.Magic(5);

            Bitmap input;
            new MatrixToImage(0, 100).Convert(diag, out input);

            Logarithm log = new Logarithm();
            Bitmap output = log.Apply(input);

            Exponential exp = new Exponential();
            Bitmap reconstruction = exp.Apply(output);


            double[,] actual;
            new ImageToMatrix(0, 100).Convert(reconstruction, out actual);
            
            double[,] expected = diag;

            Assert.IsTrue(expected.IsEqual(actual, 1.5));
        }