public void Detects_Reading_From_Meter_From_Different_Lightning(string imageName, string expectedResult)
        {
            var settings = new MeterReaderSettings
            {
                DarkSectors = true
            };
            var meterReader = new MeterReader(settings);
            var image       = GetImage("DifferentLighting", $"{imageName}.png");

            // Act
            var result = meterReader.Analyze(image);

            // Assert
            result.Result.Should().StartWith(expectedResult);
        }
        public void Detects_Reading_From_Meter_That_Has_Light_Number_Sectors(string imageName, string expectedResult)
        {
            var settings = new MeterReaderSettings
            {
                DarkSectors = false,
            };
            var meterReader = new MeterReader(settings);
            var image       = GetImage("LightSectors", $"{imageName}.PNG");

            // Act
            var result = meterReader.Analyze(image);

            // Assert
            result.Result.Should().StartWith(expectedResult);
        }
        public void Detects_Reading_From_Meter_That_Has_Segment_Separators_As_Black_Lines()
        {
            var settings = new MeterReaderSettings
            {
                DarkSectors     = false,
                FullPartSectors = 6,
                NumbersDetectionAdaptiveThresholdBlockSize = 35,
                NumbersDetectionAdaptiveThresholdC         = 40,
            };
            var meterReader = new MeterReader(settings);
            var image       = GetImage("MeterWithBlackSegmentSeparators", "1.PNG");

            // Act
            var result = meterReader.Analyze(image);

            // Assert
            result.Result.Should().Be("000010");
        }
Exemple #4
0
 protected override void SignalAction(MeterReader mr)
 {
     throw new NotImplementedException();
 }
 protected abstract void SignalAction(MeterReader mr);