Ejemplo n.º 1
0
        public void TestDecodeDoesNotFail()
        {
            var decoder = new PanasonicRW2Decoder();

            var file = new FileStream(@"..\..\P1350577.RW2", FileMode.Open, FileAccess.Read);
            var exif=decoder.DecodeExif(file);
            decoder.DecodeMap(file, exif);
        }
Ejemplo n.º 2
0
        public void TestDecodeDoesNotFail()
        {
            var decoder = new PanasonicRW2Decoder();

            var file = new FileStream(@"..\..\P1350577.RW2", FileMode.Open, FileAccess.Read);
            var exif = decoder.DecodeExif(file);

            decoder.DecodeMap(file, exif);
        }
        public void NotFail()
        {
            var decoder = new PanasonicRW2Decoder();

            var file = new FileStream(@"..\..\..\PanasonicRW2.Tests\P1350577.RW2", FileMode.Open, FileAccess.Read);
            var exif = decoder.DecodeExif(file);
            var raw = decoder.DecodeMap(file, exif);

            var debayer = new AverageBGGRDemosaic();

            var stopwatch = Stopwatch.StartNew();
            const int maxIter = 3;
            var res = debayer.CreateResultMap(raw);
            for (var iter = 0; iter < maxIter; iter++)
                debayer.ProcessMap(raw, res);
            stopwatch.Stop();

            Console.WriteLine("AverageBGGRDebayer: " + stopwatch.ElapsedMilliseconds / 3 + "ms");
        }
Ejemplo n.º 4
0
        public void FullProcessWithAutoAdjustTest()
        {
            var       stopwatch = Stopwatch.StartNew();
            const int maxIter   = 5;

            for (var iter = 0; iter < maxIter; iter++)
            {
                var stream = new FileStream(@"..\..\..\PanasonicRW2.Tests\P1350577.RW2", FileMode.Open,
                                            FileAccess.Read);
                var debayer = new AverageBGGRDemosaic();

                var white = new WhiteBalanceFilter();
                //white.AutoAdjust(color16Image);
                var gamma = new GammaFilter();


                var light = new LightFilter();
                //light.AutoAdjust(color16Image);

                var compressor = new VectorBGRACompressorFilter();
                var filters    = new IFilter[]
                {
                    debayer,
                    //white,
                    gamma,
                    light,
                    compressor
                };

                var decoder = new PanasonicRW2Decoder();
                var exif    = decoder.DecodeExif(stream);

                var processor = new ImageProcessor(decoder.DecodeMap(stream, exif), filters);

                processor.Invoke();
            }
            stopwatch.Stop();
            Console.WriteLine("FullProcessWithAutoAdjust: " + stopwatch.ElapsedMilliseconds / maxIter + "ms");

            //Before Curve - Release 3756ms
            //After Curve - Release 1900ms
            //2015 Vector3 - Release 1305ms
        }
Ejemplo n.º 5
0
        public void NotFail()
        {
            var decoder = new PanasonicRW2Decoder();

            var file = new FileStream(@"..\..\..\PanasonicRW2.Tests\P1350577.RW2", FileMode.Open, FileAccess.Read);
            var exif = decoder.DecodeExif(file);
            var raw  = decoder.DecodeMap(file, exif);

            var debayer = new AverageBGGRDemosaic();

            var       stopwatch = Stopwatch.StartNew();
            const int maxIter   = 3;
            var       res       = debayer.CreateResultMap(raw);

            for (var iter = 0; iter < maxIter; iter++)
            {
                debayer.ProcessMap(raw, res);
            }
            stopwatch.Stop();

            Console.WriteLine("AverageBGGRDebayer: " + stopwatch.ElapsedMilliseconds / 3 + "ms");
        }
Ejemplo n.º 6
0
        public void FullProcessP1460461Test()
        {
            var       stopwatch = Stopwatch.StartNew();
            const int maxIter   = 1;

            for (var iter = 0; iter < maxIter; iter++)
            {
                var stream = new FileStream(@"..\..\..\PanasonicRW2.Tests\P1460461.RW2", FileMode.Open,
                                            FileAccess.Read);
                var decoder = new PanasonicRW2Decoder();
                var exif    = decoder.DecodeExif(stream);
                var raw     = decoder.DecodeMap(stream, exif);
                var debayer = new AverageBGGRDemosaic();

                var white = new WhiteBalanceFilter();
                //white.AutoAdjust(color16Image);
                var gamma = new GammaFilter();


                var light = new LightFilter();
                //light.AutoAdjust(color16Image);

                var compressor = new VectorBGRACompressorFilter();
                var pipeline   = new FiltersPipeline(new IFilter[]
                {
                    debayer,
                    white,
                    gamma,
                    light,
                    compressor
                });
                pipeline.ProcessFilters(raw);
            }
            stopwatch.Stop();
            Console.WriteLine("FullProcess: " + stopwatch.ElapsedMilliseconds / maxIter + "ms");

            //Before Curve - Release 3756ms
            //After Curve - Release 1900ms
        }
Ejemplo n.º 7
0
        public void FullProcessTest()
        {
            var stopwatch = Stopwatch.StartNew();
            const int maxIter = 5;
            for (var iter = 0; iter < maxIter; iter++)
            {
                var stream = new FileStream(@"..\..\..\PanasonicRW2.Tests\P1350577.RW2", FileMode.Open,
                    FileAccess.Read);
                var decoder = new PanasonicRW2Decoder();
                var exif = decoder.DecodeExif(stream);
                var raw = decoder.DecodeMap(stream, exif);
                var debayer = new AverageBGGRDemosaic();
                var white = new WhiteBalanceFilter();
                //white.AutoAdjust(color16Image);
                var gamma = new GammaFilter();

                var light = new LightFilter();
                //light.AutoAdjust(color16Image);

                var compressor = new VectorBGRACompressorFilter();
                var pipeline = new FiltersPipeline(new IFilter[]
                {
                    debayer,
                    white,
                    gamma,
                    light,
                    compressor
                });
                pipeline.ProcessFilters(raw);
            }
            stopwatch.Stop();
            Console.WriteLine("FullProcess: " + stopwatch.ElapsedMilliseconds / maxIter + "ms");

            //Before Curve - Release 3756ms
            //After Curve - Release 1900ms
            //2015 - 409ms
        }