const Int32 N = 9; //, Nh = N / 2; float[,] MASK = new float[N, N]; int min = (int)Math.Ceiling((double)-N / (double)2); int max = (int)Math.Floor((double)N/ (double)2); float sigma = 1.4f; float s2 = sigma * sigma; float s4 = sigma * sigma * sigma * sigma; int xCount = 0; for(int x = min; x <= max; ++x) { int yCount = 0; for(int y = min; y <= max; ++y) { float val = (float)(-1.0f / (Math.PI * (s4))) * (1.0f - ((x * x + y * y) / (2.0f * (s2)))) * (float)Math.Exp((-(x * x + y * y) / (2.0f * (s2)))); MASK[xCount, yCount] = val; ++yCount; } ++xCount; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)