Ejemplo n.º 1
0
        public void PreclisionTest1()
        {
            DateTime      dt1   = DateTime.UtcNow;
            double        count = 0;
            List <double> temp  = new List <double>();
            List <double> temp2 = new List <double>();

            for (double i = -1; i < 1; i++)
            {
                for (int l = 1; l < 4; l++)
                {
                    var for_test = TestImageGenerator.GetTestPair(1000, 2000, Math.PI / 2 * i, l);

                    for_test.Item1.CalculatePhaseImage();
                    DateTime dt2 = DateTime.UtcNow;
                    Unwrapping.Unwrap(for_test.Item1.Image);
                    //for_test.Item1.Unwrap();
                    double time = DateTime.UtcNow.Subtract(dt2).TotalSeconds;
                    temp.Add(time);
                    ImageSource.subtract_min(for_test.Item1.Image);
                    ImageSource.subtract_min(for_test.Item2);
                    double[,] difference = ImageSource.diff(for_test.Item1.Image, for_test.Item2);
                    var    q    = ImageSource.GetNoZero(difference, 2);
                    double res1 = ImageSource.std(for_test.Item1.Image, for_test.Item2);
                    Assert.IsTrue(res1 < Math.PI / 100);
                    count++;
                }
            }
            double res2 = temp.Sum() / temp.Count();
            double res  = count / DateTime.UtcNow.Subtract(dt1).TotalSeconds;
        }
Ejemplo n.º 2
0
        public void FFT2_test1()
        {
            var tuple = TestImageGenerator.GetTestPair(1024, 1024, 4);

            Complex[,] test_image = Complex.CreateComplexArray(tuple.Item1.images[0]);
            FourierTransform.FFT2(test_image, FourierTransform.Direction.Forward);
            Complex[,] reserv = (Complex[, ])test_image.Clone();
            FourierTransform.FFT2(test_image, FourierTransform.Direction.Backward);
            double[,] inverse_result = Complex.CreateDoubleArray(test_image);
            double std = ImageSource.std(tuple.Item1.images[0], inverse_result);

            Assert.IsTrue(std < ImageSource.mean(tuple.Item1.images[0]) / 1000);
        }
Ejemplo n.º 3
0
        public void FFT2_test2()
        {
            var tuple = TestImageGenerator.GetTestPair(1024, 2048, 4);

            //DateTime dt1 = DateTime.UtcNow;
            Complex[,] test_image = Complex.CreateComplexArray(tuple.Item1.images[0]);
            DateTime dt1 = DateTime.UtcNow;

            FourierTransform.FFT2(test_image, FourierTransform.Direction.Forward);
            Complex[,] reserv = (Complex[, ])test_image.Clone();
            FourierTransform.FFT2(test_image, FourierTransform.Direction.Backward);
            double[,] inverse_result = Complex.CreateDoubleArray(test_image);
            double resss = dt1.Subtract(DateTime.UtcNow).TotalSeconds;

            double std = ImageSource.std(tuple.Item1.images[0], inverse_result);

            Assert.IsTrue(std < ImageSource.mean(tuple.Item1.images[0]) / 1000);
        }