static void Main(string[] args)
        {
            Console.WriteLine("This program applies one of the filters to the image.");
            Console.WriteLine("List of available filters: gray, median, gauss, sobelx, sobely, sobelxy.\n");

            if (args.Length != 3)
            {
                Console.WriteLine("Incorrect number of command line arguments");
                Console.WriteLine("Correct format: <program.exe> <input.bmp> <filtername> <output.bmp>");
                return;
            }

            BitMapReading input;

            try
            {
                input = new BitMapReading(args[0]);
            }
            catch (Exception)
            {
                Console.WriteLine("The input file could not be opened");
                return;
            }

            if (!ChooseFilter.ApplyFilter(input, args[1].ToUpper(), args[2]))
            {
                Console.WriteLine("Unknown filter selected");
                Console.WriteLine("List of available filters: gray, median, gauss, sobelx, sobely, sobelxy");
            }
        }
        public void GrayFilterTest()
        {
            BitMapReading input = new BitMapReading("../../../images/input.bmp");

            ChooseFilter.ApplyFilter(input, "GRAY", "../../../images/testgray.bmp");
            var file1 = new BitMapReading("../../../images/truegray.bmp");
            var file2 = new BitMapReading("../../../images/testgray.bmp");

            Assert.IsTrue(file1 == file2);
        }
        public void MedianFilterTest()
        {
            BitMapReading input = new BitMapReading("../../../images/input.bmp");

            ChooseFilter.ApplyFilter(input, "MEDIAN", "../../../images/testmedian.bmp");
            var file1 = new BitMapReading("../../../images/truemedian.bmp");
            var file2 = new BitMapReading("../../../images/testmedian.bmp");

            Assert.IsTrue(file1 == file2);
        }
        public void SobelYFilterTest()
        {
            BitMapReading input = new BitMapReading("../../../images/input.bmp");

            ChooseFilter.ApplyFilter(input, "SOBELY", "../../../images/testsobely.bmp");
            var file1 = new BitMapReading("../../../images/truesobely.bmp");
            var file2 = new BitMapReading("../../../images/testsobely.bmp");

            Assert.IsTrue(file1 == file2);
        }
Exemplo n.º 5
0
        public IEnumerable <Call> GetCalls(ChooseFilter f1)
        {
            List <Call> l    = new List <Call>();
            Call        call = new Call();

            call.Company = "company";
            call.Date    = DateTime.Now.ToString("yyyy-MM-dd");
            call.Stage   = "first";
            call.id      = 3;
            if (call.Company == f1.company)
            {
                l.Add(call);
            }
            call         = new Call();
            call.Company = "company2";
            call.Date    = DateTime.Now.ToString("yyyy-MM-dd");
            call.Stage   = "second";
            call.id      = 4;
            if (call.Company == f1.company)
            {
                l.Add(call);
            }
            call         = new Call();
            call.Company = "company2";
            call.Date    = DateTime.Now.ToString("yyyy-MM-dd");
            call.Stage   = "third";
            call.id      = 4;
            if (call.Company == f1.company)
            {
                l.Add(call);
            }
            call         = new Call();
            call.Company = "company";
            call.Date    = DateTime.Now.ToString("yyyy-MM-dd");
            call.Stage   = "for";
            call.id      = 4;
            if (call.Company == f1.company)
            {
                l.Add(call);
            }
            return(l);
        }