示例#1
0
        public void Creation_FailWithInvalidFilterDimension()
        {
            var    accumulator = new ConvolutionAccumulator_Float(CellPassConsts.NullHeight, ConvolutionMaskSize.Mask3X3);
            Action act         = () => _ = new FilterConvolver <float>(accumulator, new double[4, 4], NullInfillMode.NoInfill);

            act.Should().Throw <ArgumentException>().WithMessage("Context size must be positive odd number greater than 1");
        }
示例#2
0
        public void Creation_FailWithFilterDimensionMisMatch()
        {
            var    accumulator = new ConvolutionAccumulator_Float(CellPassConsts.NullHeight, ConvolutionMaskSize.Mask3X3);
            Action act         = () => _ = new FilterConvolver <float>(accumulator, new double[3, 4], NullInfillMode.NoInfill);

            act.Should().Throw <ArgumentException>().WithMessage("Major dimension (3) and minor dimension (4) of filterMatrix must be the same");
        }
示例#3
0
        public void FilterConvolverAssertsDimensionsMatch()
        {
            var accumulator = new ConvolutionAccumulator_Float(CellPassConsts.NullHeight, ConvolutionMaskSize.Mask3X3);
            var filter      = new FilterConvolver <float>(accumulator, new double[3, 3], NullInfillMode.NoInfill);
            var smoother    = new ConvolutionTools <float>();

            Action act = () => smoother.Convolve(new float[3, 3], new float[4, 4], filter);

            act.Should().Throw <ArgumentException>().WithMessage("Dimensions of source and destination data are not the same");
        }
示例#4
0
        public void Creation_Base()
        {
            var accumulator = new ConvolutionAccumulator_Float(CellPassConsts.NullHeight, ConvolutionMaskSize.Mask3X3);
            var filter      = new FilterConvolver <float>(accumulator, new double[3, 3], NullInfillMode.NoInfill);

            filter.Should().NotBeNull();

            filter.InfillNullValuesOnly.Should().BeFalse();
            filter.UpdateNullValues.Should().BeFalse();

            filter = new FilterConvolver <float>(accumulator, new double[3, 3], NullInfillMode.InfillNullValuesOnly);
            filter.InfillNullValuesOnly.Should().BeTrue();
            filter.UpdateNullValues.Should().BeTrue();
        }