Example #1
0
        public static Tuple <StepPhaseImage, double[, ]> GetTestPair(int Width, int Height, double MaxValue, double NumLines = 10)
        {
            double[,] matrix1 = ImageSource.GetSphere(Width, Height, 500, 500, 150, 250, 250, MaxValue);
            ImageSource.AddPlane(matrix1, Width, Height, NumLines);
            StepPhaseImage stepPhase = new StepPhaseImage(ImageSource.GetCos(matrix1, mult: 255));

            stepPhase.AddStep(ImageSource.GetCos(matrix1, Math.PI / 2, mult: 255));
            stepPhase.AddStep(ImageSource.GetCos(matrix1, Math.PI, mult: 255));
            stepPhase.AddStep(ImageSource.GetCos(matrix1, 3 * Math.PI / 2, mult: 255));
            return(Tuple.Create(stepPhase, matrix1));
        }
        private void AddImage(Mat image)
        {
            lock (locker)
            {
                if (settings.recordingType == SettingsContainer.RecordingType.Camera)
                {
                    BufferPhaseImage = new CameraImage(image)
                    {
                        MaxProcessingStep = settings.maxProcessingStep
                    };
                    BufferPhaseImage.Wavelength = this.settings.wavelength;
                    imageProcessor.PutImage(BufferPhaseImage);
                }
                else if (settings.recordingType == SettingsContainer.RecordingType.Hilbert)
                {
                    BufferPhaseImage = new HilbertPhaseImage(image)
                    {
                        MaxProcessingStep = settings.maxProcessingStep
                    };
                    BufferPhaseImage.Wavelength = this.settings.wavelength;
                    imageProcessor.PutImage(BufferPhaseImage);
                }
                else if (settings.recordingType == SettingsContainer.RecordingType.Step)
                {
                    StepPhaseImage stepPhaseImage = BufferPhaseImage as StepPhaseImage;

                    if (stepPhaseImage != null)
                    {
                        if (stepPhaseImage.StepNumber < settings.MaximumSteps)
                        {
                            stepPhaseImage.AddStep(image);
                        }
                        else
                        {
                            imageProcessor.PutImage(BufferPhaseImage);
                            BufferPhaseImage = new StepPhaseImage(image)
                            {
                                MaxProcessingStep = settings.maxProcessingStep
                            };;
                            BufferPhaseImage.Wavelength = this.settings.wavelength;
                        }
                    }
                    else
                    {
                        BufferPhaseImage = new StepPhaseImage(image)
                        {
                            MaxProcessingStep = settings.maxProcessingStep
                        };;
                        BufferPhaseImage.Wavelength = this.settings.wavelength;
                    }
                }
            }
        }
Example #3
0
 public static void AddImage(double[,] image)
 {
     lock (locker)
     {
         if (settings.recordingType == SettingsContainer.RecordingType.Step)
         {
             StepPhaseImage stepPhaseImage = BufferPhaseImage as StepPhaseImage;
             if (stepPhaseImage != null)
             {
                 if (stepPhaseImage.StepNumber < settings.MaximumSteps)
                 {
                     stepPhaseImage.AddStep(image);
                 }
                 else
                 {
                     phaseImages.Enqueue(BufferPhaseImage);
                     BufferPhaseImage = new StepPhaseImage(image)
                     {
                         MaxProcessingStep = settings.maxProcessingStep
                     };;
                 }
             }
             else
             {
                 BufferPhaseImage = new StepPhaseImage(image)
                 {
                     MaxProcessingStep = settings.maxProcessingStep
                 };;
             }
         }
         else if (settings.recordingType == SettingsContainer.RecordingType.Camera)
         {
             BufferPhaseImage = new CameraImage(image);
             phaseImages.Enqueue(BufferPhaseImage);
         }
         else if (settings.recordingType == SettingsContainer.RecordingType.Hilbert)
         {
             BufferPhaseImage = new HilbertPhaseImage(image);
             phaseImages.Enqueue(BufferPhaseImage);
         }
     }
 }