Exemplo n.º 1
0
        private void ThresholdLowTrackBar_ValueChanged(object sender, EventArgs e)
        {
            if (IsUpdateUI)
            {
                return;
            }

            TrackBar bar = (TrackBar)sender;

            switch (bar.Name)
            {
            case "ThresholdLowTrackBar":
                if (byte.TryParse(bar.Value.ToString(), out _cameraBasic.Tool.ThresholdLow))
                {
                    ThresholdLowLabel.Text = _cameraBasic.Tool.ThresholdLow.ToString();
                    FilterImageBox.Visible = true;
                }

                break;

            case "ThresholdHighTrackBar":
                if (byte.TryParse(bar.Value.ToString(), out _cameraBasic.Tool.ThresholdHigh))
                {
                    ThresholdHighLabel.Text = _cameraBasic.Tool.ThresholdHigh.ToString();
                    FilterImageBox.Visible  = true;
                }
                break;
            }

            if (FilterImageBox.Visible)
            {
                FilterImageBox.Image = _cameraBasic.Tool.DoBinary();
                FilterImageBox.Refresh();
            }
        }
Exemplo n.º 2
0
        private void ShowInspectMatBinary()
        {
            FilterImageBox.Visible = true;

            _cameraBasic.Tool.Inspect();

            FilterImageBox.Image = _cameraBasic.Tool.MatBinary;

            FilterImageBox.Refresh();
        }
Exemplo n.º 3
0
        private void ShowBinaryButton_Click(object sender, EventArgs e)
        {
            Refresh();
            FilterImageBox.Visible = !FilterImageBox.Visible;

            if (FilterImageBox.Visible)
            {
                FilterImageBox.Image = _cameraBasic.Tool.DoBinary();
            }

            FilterImageBox.Refresh();
        }
Exemplo n.º 4
0
        private void GrayFilterComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (IsUpdateUI)
            {
                return;
            }
            ComboBox cmbObj = (ComboBox)sender;

            _cameraBasic.Tool.FilterMode = (GrayFilter)cmbObj.SelectedIndex;

            FilterImageBox.Visible = true;

            FilterImageBox.Image = _cameraBasic.Tool.DoGray();

            FilterImageBox.Refresh();
        }