Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            if (args.Length != 1)
            {
                return;
            }

            double phaseShift = double.Parse(args[0], CultureInfo.InvariantCulture);

            int    width        = 4096;
            int    height       = 1024;
            double percentNoise = 0;

            int    fringeCount  = 10;
            double minIntensity = 35;

            InterferogramInfo interferogramInfo = new InterferogramInfo(width, height, percentNoise, minIntensity);
            LinearFringeInterferogramCreator interferogramCreator = new LinearFringeInterferogramCreator(interferogramInfo, fringeCount);

            RealMatrix interferogramMatrix = interferogramCreator.CreateInterferogram(phaseShift);

            WriteableBitmap writeableBitmap =
                WriteableBitmapCreator.CreateGrayScaleWriteableBitmapFromMatrix(interferogramMatrix, OS.IntegerSystemDpiX, OS.IntegerSystemDpiY);

            MemoryWriter.Write <WriteableBitmap>(writeableBitmap, new WriteableBitmapSerialization());

            SynchronizationManager.SetSignal(HoloCommon.Synchronization.Events.Image.IMAGE_CREATED);
        }
Ejemplo n.º 2
0
        private void Form1_Shown(object sender, EventArgs e)
        {
            int    width        = 4096;
            int    height       = 2048;
            double percentNoise = 0;

            int    fringeCount  = 20;
            double minIntensity = 35;

            InterferogramInfo interferogramInfo = new InterferogramInfo(width, height, percentNoise, minIntensity);
            LinearFringeInterferogramCreator interferogramCreator = new LinearFringeInterferogramCreator(interferogramInfo, fringeCount);

            double     phaseShift          = 0;
            RealMatrix interferogramMatrix = interferogramCreator.CreateInterferogram(phaseShift);

            WriteableBitmap writeableBitmap =
                WriteableBitmapCreator.CreateGrayScaleWriteableBitmapFromMatrix(interferogramMatrix, OS.IntegerSystemDpiX, OS.IntegerSystemDpiY);

            MemoryWriter.Write <WriteableBitmap>(writeableBitmap, new WriteableBitmapSerialization());

            //ProcessManager.RunProcess(@"D:\Projects\HoloApplication\Modules\ImageViewer\ImageViewer\bin\Release\ImageViewer.exe", null, false);
            SynchronizationManager.SetSignal(HoloCommon.Synchronization.Events.Image.IMAGE_CREATED);
        }