public OrcNumberSetting()
 {
     InitializeComponent();
     camera_sel.Items.Add("相机1");
     camera_sel.Items.Add("相机2");
     camera_sel.SelectedIndex = 0;
     camera         = Tools.camera[0];
     bloodparameter = Tools.booldcardinfo[0].bloodParameter;
     camera1.Source = camera.GetImageSoure();
     //UI更新
     timer          = new DispatcherTimer();
     timer.Interval = TimeSpan.FromMilliseconds(100);
     timer.Tick    += UpDataUI;
     timer.Start();
     UpDataParameter();
 }
Exemplo n.º 2
0
        private void UpDataUI(object sender, EventArgs e)
        {
            selector_red   = setvaluered.Value;
            selector_blue  = setvalueblue.Value;
            selector_green = setvaluegreen.Value;
            selector_gain  = setvaluegain.Value;

            label_setvaluegain.Content  = selector_gain;
            label_setvaluered.Content   = selector_red;
            label_setvalueblue.Content  = selector_blue;
            label_setvaluegreen.Content = selector_green;


            camera.SetBalanceRatio(BalanceWhiteChanelEnum.BALANCE_RATIO_SELECTOR_RED, selector_red);
            camera.SetBalanceRatio(BalanceWhiteChanelEnum.BALANCE_RATIO_SELECTOR_BLUE, selector_green);
            camera.SetBalanceRatio(BalanceWhiteChanelEnum.BALANCE_RATIO_SELECTOR_GREEN, selector_blue);
            camera.SetGain(selector_gain);
            camera.TakeImage(bloodparameter.onedcode_s3);
            camera1.Source = camera.GetImageSoure();
        }
        public LabelSetting()
        {
            InitializeComponent();
            camera_sel.Items.Add("相机1");
            camera_sel.Items.Add("相机2");
            camera_sel.SelectedIndex = 0;
            camera          = Tools.camera[0];
            bloodparameter  = Tools.booldcardinfo[0].bloodParameter;
            camera1.Source  = camera.GetImageSoure();
            camera_ration_w = camera.camera_img.Width / camera1.Width;
            camera_ration_h = camera.camera_img.Height / camera1.Height;
            //UI更新
            timer          = new DispatcherTimer();
            timer.Interval = TimeSpan.FromMilliseconds(100);
            timer.Tick    += UpDataUI;
            timer.Start();

            var img = camera.TakeImage(bloodparameter.onedcode_s3);

            camera1.Source = Tools.OpenCvImgToImageSoure(img);
            camera2.Source = Tools.OpenCvImgToImageSoure(img);

            UpDataParameter();
        }