public void ProcessImageTest() { double[,] diag = Matrix.Magic(5); Bitmap input; new MatrixToImage().Convert(diag, out input); // Create a new Gabor filter GaborFilter gabor = new GaborFilter(); // Apply the filter Bitmap output = gabor.Apply(input); double[,] actual; new ImageToMatrix().Convert(output, out actual); double[,] expected = { { 0.192156862745098, 0.176470588235294, 0.254901960784314, 0.396078431372549, 0.529411764705882 }, { 0.16078431372549, 0.305882352941176, 0.494117647058824, 0.635294117647059, 0.654901960784314 }, { 0.407843137254902, 0.623529411764706, 0.737254901960784, 0.701960784313725, 0.564705882352941 }, { 0.752941176470588, 0.815686274509804, 0.713725490196078, 0.541176470588235, 0.403921568627451 }, { 0.847058823529412, 0.694117647058824, 0.505882352941176, 0.380392156862745, 0.329411764705882 } }; Assert.IsTrue(expected.IsEqual(actual, 1e-6)); }
public void GaborTest1() { Bitmap image = Properties.Resources.lena512; GaborFilter gabor = new GaborFilter(); Bitmap result = gabor.Apply(image); // ImageBox.Show(result); Assert.IsNotNull(result); }