public void Should_Detect_Slugs(float weight, float diameter)
        {
            // Arrange (see weight and diameter)
            // Act
            int actualCoin = CoinDetector.CoinValue(weight, diameter);

            // Assert
            Assert.Equal(0, actualCoin);
        }
        public void Should_Detect_A_Nickel()
        {
            // Arrange
            float weight   = 5.02f;
            float diameter = 21.1f;

            // Act
            int actualCoin = CoinDetector.CoinValue(weight, diameter);

            // Assert
            Assert.Equal(5, actualCoin);
        }
        public void Should_Detect_A_Quarter()
        {
            // Arrange
            float weight   = 5.67f;
            float diameter = 25.0f;

            // Act
            int actualCoin = CoinDetector.CoinValue(weight, diameter);

            // Assert
            Assert.Equal(25, actualCoin);
        }
        public void Should_Detect_A_Dime()
        {
            // Arrange
            float weight   = 2.25f;
            float diameter = 18.0f;

            // Act
            int actualCoin = CoinDetector.CoinValue(weight, diameter);

            // Assert
            Assert.Equal(10, actualCoin);
        }
Пример #5
0
        static void Main(string[] args)
        {
            string filePath     = @"C:/Users/arnal/Documents/coins.jpg";
            var    coinDetector = new CoinDetector(filePath);

            coinDetector.ImagePreprocessing();

            var numberClasses   = 60;
            var fileExt         = new string[] { ".png" };
            var dataSetFilePath = @"C:/Users/arnal/Downloads/coin_dataset";
            var predictImgPath  = dataSetFilePath + "/" + "class6_image1.png";

            var dataSet = new PreProcessing.DataSet(dataSetFilePath, fileExt, numberClasses, 0.2);

            dataSet.LoadDataSet();

            var cnn = new Cnn(dataSet);

            cnn.Train();
            //Console.WriteLine("Predicted: " + cnn.Predict(predictImgPath));

            Console.ReadLine();
        }