public static double ApplyFilterOnOneCoord(double u, double v, double Du, double Dv, int CenterX, int CenterY, double Theta, int N) { double uStarDu = KassWitkinFunction.uStar(u, v, CenterX, CenterY, Theta) / Du; double vStarDv = KassWitkinFunction.vStar(u, v, CenterX, CenterY, Theta) / Dv; double arg = uStarDu + vStarDv; double div = Math.Sqrt(1 + Math.Pow(arg, 2 * N));; return(1 / div); }
public void Compute() { Kernel = new double[Width, Height]; for (int i = 0; i < Width; i++) { for (int j = 0; j < Height; j++) { Kernel[i, j] = (double)KassWitkinFunction.ApplyFilterOnOneCoord(i, j, Du, Dv, CenterX, CenterY, ThetaInRadian, N); //Data[i, j] = r.NextDouble(); } } string str = string.Empty; }