private void Validate(int[,] horizontalMask, int[,] verticalMask) { ValidationUtils.IsFilterMask(horizontalMask); ValidationUtils.IsFilterMask(verticalMask); if (horizontalMask.GetLength(0) != verticalMask.GetLength(1)) { throw new ArgumentException("Horizontal and vertical mask have same sizes"); } }
public LinearFilter(double multiplier, int[,] kernel) { ValidationUtils.IsFilterMask(kernel); Size = kernel.GetLength(0); Range = Size / 2; Kernel = ArrayUtils.Flatten(kernel); KernelLength = Kernel.Length; Multiplier = multiplier; }