public TreeDataSmoother( IConvolutionTools <TV> convolutionTools, ConvolutionMaskSize contextSize, IConvolutionAccumulator <TV> accumulator, Func <IConvolutionAccumulator <TV>, ConvolutionMaskSize, IConvolver <TV> > convolverFactory) { _convolutionTools = convolutionTools ?? throw new ArgumentException("ConvolutionTools is null", nameof(convolutionTools)); _contextSize = contextSize; _accumulator = accumulator; _convolverFactory = convolverFactory; }
public FilterConvolver(IConvolutionAccumulator <T> accumulator, double[,] filterMatrix, NullInfillMode nullInfillMode) : base(accumulator) { _infillNullValuesOnly = nullInfillMode == NullInfillMode.InfillNullValuesOnly; _updateNullValues = nullInfillMode == NullInfillMode.InfillNullValuesOnly || _infillNullValuesOnly; FilterMatrix = filterMatrix; var majorDim = FilterMatrix.GetLength(0); var minorDim = FilterMatrix.GetLength(1); if (majorDim != minorDim) { throw new ArgumentException($"Major dimension ({majorDim}) and minor dimension ({minorDim}) of filterMatrix must be the same"); } ContextSize = (ConvolutionMaskSize)majorDim; }
public MeanFilter(IConvolutionAccumulator <T> accumulator, double[,] filterMatrix, NullInfillMode nullInfillMode) : base(accumulator, filterMatrix, nullInfillMode) { }
public WeightedMeanFilter(IConvolutionAccumulator <T> accumulator, ConvolutionMaskSize contextSize, double centerWeight, NullInfillMode nullInfillMode) : base(accumulator, CreateFilter(contextSize, centerWeight), nullInfillMode) { }
public MeanFilter(IConvolutionAccumulator <T> accumulator, ConvolutionMaskSize contextSize, NullInfillMode nullInfillMode) : base(accumulator, CreateFilter(contextSize, 1), nullInfillMode) { }