Пример #1
0
        private void HandleHotPixelDefinitionClick(MouseEventArgs e)
        {
            var    pixels = frmFullSizePreview.CurrFrame.GetPixelsArea(e.X, e.Y, 35);
            PSFFit fit    = new PSFFit(e.X, e.Y);

            fit.Fit(pixels);
            if (fit.IsSolved && fit.Certainty > 1 && fit.IMax > frmFullSizePreview.CurrFrame.MaxSignalValue / 2.0)
            {
                var sample = frmFullSizePreview.CurrFrame.GetPixelsArea((int)Math.Round(fit.XCenter), (int)Math.Round(fit.YCenter), 7);
                HotPixelCorrector.RegisterHotPixelSample(sample, frmFullSizePreview.CurrFrame.Pixelmap.MaxSignalValue);

                m_ExpectHotPixelDefinition = false;
                FrameAdjustmentsPreview.Instance.ExpectHotPixelClick(false, true);
                pnlHotPixelControls.Enabled = true;

                HotPixelCorrector.LocateHotPixels(frmFullSizePreview.CurrFrame, Math.Max(0, tbDepth.Value));

                FrameAdjustmentsPreview.Instance.Update();
            }
            else
            {
                MessageBox.Show(
                    ParentForm,
                    "The location you clicked doesn't appear to contain a hot pixel. Please try again.\r\n\r\nIf necessary adjust the brightness and contrast of the image first.",
                    "Tangra",
                    MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #2
0
        private void cbxUseHotPixelsCorrection_CheckedChanged(object sender, EventArgs e)
        {
            if (cbxUseHotPixelsCorrection.Checked)
            {
                HotPixelCorrector.Initialize();

                FrameAdjustmentsPreview.Instance.ExpectMaskAreaClick(false, false);
                FrameAdjustmentsPreview.Instance.ExpectHotPixelClick(true, true);

                MessageBox.Show(ParentForm,
                                "Please select an existing hot pixel by clicking on it.",
                                "Tangra",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);

                m_ExpectHotPixelDefinition = true;
            }
            else
            {
                m_ExpectHotPixelDefinition = false;
                FrameAdjustmentsPreview.Instance.ExpectHotPixelClick(false, false);

                HotPixelCorrector.Cleanup();
            }

            pnlHotPixelControls.Enabled = false;
        }
Пример #3
0
        void frmFullSizePreview_OnDrawOverlays(Graphics g)
        {
            if (cbxUseHotPixelsCorrection.Checked)
            {
                HotPixelCorrector.DrawOverlay(g, Math.Max(1, tbDepth.Value), cbxPlotPeakPixels.Checked);
            }

            if (cbxMaskContamination.Checked)
            {
                MaskAreaSelector.DrawOverlay(g);
            }
        }
Пример #4
0
        public void Initialize(IFrameStream videoStream, int currentFrameNo)
        {
            m_VideoStream        = videoStream;
            m_ReInterlacedStream = videoStream as ReInterlacingVideoStream;

            SetFilterMode();

            gbxInterlacedSettings.Enabled = m_ReInterlacedStream != null;
            rbReInterlaceNon.Checked      = true;

            HotPixelCorrector.ConfigurePreProcessing(false);
            tbDepth.Value = 20;
        }
Пример #5
0
        private void tbDepth_Scroll(object sender, EventArgs e)
        {
            int depth = tbDepth.Value;

            if (depth > 0)
            {
                lblDepthValue.Text = depth.ToString();

                HotPixelCorrector.LocateHotPixels(frmFullSizePreview.CurrFrame, depth);

                FrameAdjustmentsPreview.Instance.Update();
            }
        }
Пример #6
0
 internal void ApplyHotPixelSettings()
 {
     HotPixelCorrector.ConfigurePreProcessing(cbxUseHotPixelsCorrection.Checked);
 }