public void ProcessImageTest() { double[,] diag = Matrix.Magic(5); Bitmap input; new MatrixToImage().Convert(diag, out input); DifferenceOfGaussians gabor = new DifferenceOfGaussians(); // Apply the filter Bitmap output = gabor.Apply(input); double[,] actual; new ImageToMatrix().Convert(output, out actual); string str = actual.ToString(CSharpMatrixFormatProvider.InvariantCulture); double[,] expected = { { 0.00784313725490196, 0.0274509803921569, 0, 0, 0.00392156862745098 }, { 0.0196078431372549, 0, 0, 0.00392156862745098, 0.00392156862745098 }, { 0, 0, 0, 0.0156862745098039, 0.0156862745098039 }, { 0, 0, 0.0156862745098039, 0.0117647058823529, 0 }, { 0, 0.00784313725490196, 0.0196078431372549, 0, 0 } }; Assert.IsTrue(expected.IsEqual(actual, 1e-6)); }
public void ApplyTest1() { Bitmap image = Properties.Resources.lena512; var dog = new DifferenceOfGaussians(); Bitmap result = dog.Apply(image); // ImageBox.Show(result); Assert.IsNotNull(result); }