Example #1
0
 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;
 }
Example #2
0
        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;
        }
Example #3
0
 public MeanFilter(IConvolutionAccumulator <T> accumulator, double[,] filterMatrix, NullInfillMode nullInfillMode) : base(accumulator, filterMatrix, nullInfillMode)
 {
 }
Example #4
0
 public WeightedMeanFilter(IConvolutionAccumulator <T> accumulator,
                           ConvolutionMaskSize contextSize, double centerWeight, NullInfillMode nullInfillMode)
     : base(accumulator, CreateFilter(contextSize, centerWeight), nullInfillMode)
 {
 }
Example #5
0
 public MeanFilter(IConvolutionAccumulator <T> accumulator, ConvolutionMaskSize contextSize, NullInfillMode nullInfillMode) : base(accumulator, CreateFilter(contextSize, 1), nullInfillMode)
 {
 }