public void ChangesTheFontColorToBlack() { var colorFinder = new ColorFinder(); var img = new Bitmap(Images.PointsSmallImage); var blackBefore = colorFinder.FindFirstColorLocation(img, Color.FromArgb(0, 0, 0)); var fontColorBefore = colorFinder.FindFirstColorLocation(img, NMZColors.Font); var newImage = imageFilterer.FilterImage(img); var blackAfter = colorFinder.FindFirstColorLocation(img, Color.FromArgb(0, 0, 0)); var fontColorAfter = colorFinder.FindFirstColorLocation(img, NMZColors.Font); img.Dispose(); Assert.AreNotEqual(blackBefore, blackAfter); Assert.AreNotEqual(fontColorBefore, fontColorAfter); }
public void RemovesAllColorsExpectFontColor() { var img = new Bitmap(Images.PointsSmallImage); var expected = new List<Color> { Color.FromArgb(255, 255, 255), Color.FromArgb(0, 0, 0) }; var imgNoColor = imageFilterer.FilterImage(img); var actual = new ColorFinder().FindColors(img); Assert.AreEqual(expected.Count, actual.Count); foreach (var color in expected) { Assert.That(actual.Contains(color), "Color not found : " + color); } img.Dispose(); imgNoColor.Dispose(); }
public NMZPointsImageFinder() { ColorFinder = new ColorFinder(); }
public OpticalNumberRecognizer() { numberSignatureRecognizer = new NumberSignatureRecognizer(); finder = new ColorFinder(); listCleaner = new ListCleaner(); }
public void SetUp() { ColorFinder = new ColorFinder(); }