コード例 #1
0
 internal void SetParaImage(ExecuteBuffer test)
 {
     if (this.read_ImageName.Items.Count == 0)
     {
         foreach (string keyc in test.imageBuffer.Keys)
         {
             if (keyc.Contains(".img"))
             {
                 read_ImageName.Items.Add(keyc.Substring(0, keyc.Length - 4));
             }
         }
     }
     else
     {
         int m = 0;
         foreach (string keyc in test.imageBuffer.Keys)
         {
             for (int i = 0; i < read_ImageName.Items.Count; i++)
             {
                 if (keyc == (read_ImageName.Items[i].ToString() + ".img"))
                 {
                     break;
                 }
                 m = i;
                 if (m == read_ImageName.Items.Count - 1 && keyc.Contains(".img"))
                 {
                     read_ImageName.Items.Add(keyc.Substring(0, keyc.Length - 4));
                 }
             }
         }
     }
 }
コード例 #2
0
ファイル: SmoothTest.cs プロジェクト: edy8888/Machineview
 internal void SetParaRegion(ExecuteBuffer test)
 {
     if (this.smooth_imageMeanout.Items.Count == 0)
     {
         foreach (string keyc in test.imageBuffer.Keys)
         {
             if (keyc.Contains(".img"))
             {
                 smooth_imageMeanout.Items.Add(keyc);
             }
         }
     }
     else
     {
         int m = 0;
         foreach (string keyc in test.imageBuffer.Keys)
         {
             for (int i = 0; i < smooth_imageMeanout.Items.Count; i++)
             {
                 if (keyc == (smooth_imageMeanout.Items[i].ToString() + ".img"))
                 {
                     break;
                 }
                 m = i;
                 if (m == smooth_imageMeanout.Items.Count - 1 && keyc.Contains(".img"))
                 {
                     smooth_imageMeanout.Items.Add(keyc.Substring(0, keyc.Length - 4));
                 }
             }
         }
     }
 }
コード例 #3
0
 public SourceManage(SourceBuffer sb, INIOperation source, ExecuteBuffer executeBuffer)
 {
     InitializeComponent();
     _sb        = sb;
     _source    = source;
     _excBuffer = executeBuffer;
 }
コード例 #4
0
 internal void SetParaRegion(ExecuteBuffer test)
 {
     if (this.mor_regionout.Items.Count == 0)
     {
         foreach (string keyc in test.imageBuffer.Keys)
         {
             mor_regionout.Items.Add(keyc);
         }
     }
     else
     {
         int m = 0;
         foreach (string keyc in test.imageBuffer.Keys)
         {
             for (int i = 0; i < mor_regionout.Items.Count; i++)
             {
                 if (keyc == mor_regionout.Items[i].ToString())
                 {
                     break;
                 }
                 m = i;
                 if (m == mor_regionout.Items.Count - 1)
                 {
                     mor_regionout.Items.Add(keyc);
                 }
             }
         }
     }
 }
コード例 #5
0
        public void Run_Mor(ExecuteBuffer _executeBuffer, out ExecuteBuffer outexecutebuffer)
        {
            outexecutebuffer = _executeBuffer;
            HObject regionOutresult;

            if (this.comboBox1.SelectedIndex == 0)
            {
                HOperatorSet.Opening(_executeBuffer.imageBuffer[this.mor_region.Text.ToString()], _executeBuffer.imageBuffer[this.mor_structElement.Text.ToString()], out regionOutresult);
            }
            else if (this.comboBox1.SelectedIndex == 1)
            {
                HOperatorSet.Closing(_executeBuffer.imageBuffer[this.mor_region.Text.ToString()], _executeBuffer.imageBuffer[this.mor_structElement.Text.ToString()], out regionOutresult);
            }
            else if (this.comboBox1.SelectedIndex == 2)
            {
                HOperatorSet.Erosion1(_executeBuffer.imageBuffer[this.mor_region.Text.ToString()], _executeBuffer.imageBuffer[this.mor_structElement.Text.ToString()], out regionOutresult, Convert.ToInt32(this.txt_iterations.Text.ToString()));
            }
            else
            {
                HOperatorSet.Dilation1(_executeBuffer.imageBuffer[this.mor_region.Text.ToString()], _executeBuffer.imageBuffer[this.mor_structElement.Text.ToString()], out regionOutresult, Convert.ToInt32(this.txt_iterations.Text.ToString()));
            }

            if (_executeBuffer.imageBuffer[this.mor_regionout.Text.ToString()] != null)
            {
                if (_executeBuffer.imageBuffer[this.mor_regionout.Text.ToString()].IsInitialized())
                {
                    _executeBuffer.imageBuffer[this.mor_regionout.Text.ToString()].Dispose();
                }
            }
            _executeBuffer.imageBuffer[this.mor_regionout.Text.ToString()] = regionOutresult;
            outexecutebuffer = _executeBuffer;
        }
コード例 #6
0
ファイル: ReadBarcode.cs プロジェクト: edy8888/Machineview
        public bool Run_Region(ExecuteBuffer _executeBuffer, out 字符串GVName_halcon outResult, HWndCtrl hWndCtrl)
        {
            //   outexecutebuffer = _executeBuffer;

            HObject outImage;

            outResult = new 字符串GVName_halcon();
            HOperatorSet.GenEmptyObj(out outImage);
            if (!_executeBuffer.imageBuffer.ContainsKey(this.cbb_image.SelectedItem.ToString() + ".img"))
            {
                MessageBox.Show("感兴趣区域:无法找到输入图像");
                return(false);
            }
            if (_executeBuffer.imageBuffer[this.cbb_image.SelectedItem.ToString() + ".img"] == null)
            {
                MessageBox.Show("感兴趣区域:无法找到输入图像");
                return(false);
            }
            HTuple  DataCodeHandle, DecodedDataStrings;
            HObject SymbolXLDs;

            HOperatorSet.GenEmptyObj(out SymbolXLDs);

            HOperatorSet.CreateBarCodeModel(new HTuple(), new HTuple(), out DataCodeHandle);
            HOperatorSet.FindBarCode(_executeBuffer.imageBuffer[this.cbb_image.SelectedItem.ToString() + ".img"], out SymbolXLDs, DataCodeHandle, this.comboBox_type.SelectedItem.ToString(), out DecodedDataStrings);
            outResult.字符串 = DecodedDataStrings;
            hWndCtrl.changeGraphicSettings(GraphicsContext.GC_COLOR, "green");
            hWndCtrl.addIconicVar(SymbolXLDs);
            hWndCtrl.repaint();
            return(true);
        }
コード例 #7
0
ファイル: FindGreyModel.cs プロジェクト: edy8888/Machineview
        internal void SetParaImage(ExecuteBuffer test)
        {
            int defaultnumber = 0;
            int get_number    = 0;

            if (this.Model_image.Items.Count == 0)
            {
                foreach (string keyc in test.imageBuffer.Keys)
                {
                    if (keyc.Contains(".img"))
                    {
                        Model_image.Items.Add(keyc.Substring(0, keyc.Length - 4));
                        if (keyc.Contains("image"))
                        {
                            get_number = Convert.ToInt32(keyc.Substring(5, keyc.Length - 9));

                            if (get_number > defaultnumber)
                            {
                                Model_image.Text = keyc.Substring(0, keyc.Length - 4);
                                defaultnumber    = get_number;
                            }
                        }
                    }
                }
            }
            else
            {
                int m = 0;
                if (Model_image.SelectedItem != null)
                {
                    if (!test.imageBuffer.ContainsKey(Model_image.SelectedItem.ToString() + ".img"))
                    {
                        Model_image.Items.Remove(Model_image.SelectedItem.ToString());
                    }
                }
                for (int i = 0; i < Model_image.Items.Count; i++)
                {
                    if (!test.imageBuffer.ContainsKey(Model_image.Items[i].ToString() + ".img"))
                    {
                        Model_image.Items.Remove(Model_image.Items[i].ToString());
                    }
                }

                foreach (string keyc in test.imageBuffer.Keys)
                {
                    for (int i = 0; i < Model_image.Items.Count; i++)
                    {
                        if (keyc == (Model_image.Items[i].ToString() + ".img"))
                        {
                            break;
                        }
                        m = i;
                        if (m == Model_image.Items.Count - 1 && keyc.Contains(".img"))
                        {
                            Model_image.Items.Add(keyc.Substring(0, keyc.Length - 4));
                        }
                    }
                }
            }
        }
コード例 #8
0
        public bool NinePointCalMake(SourceBuffer _sourceBuffer, ExecuteBuffer _executeBuffer, out SourceBuffer outsourcebuffer, out ExecuteBuffer outexecutebuffer)
        {
            outsourcebuffer  = _sourceBuffer;
            outexecutebuffer = _executeBuffer;



            return(true);
        }
コード例 #9
0
        internal void SetNewParaImage(ExecuteBuffer test, ComboBox x1)
        {
            int defaultnumber = 0;
            int get_number    = 0;

            if (x1.Items.Count == 0)
            {
                foreach (string keyc in test.imageBuffer.Keys)
                {
                    if (keyc.Contains(".img"))
                    {
                        x1.Items.Add(keyc.Substring(0, keyc.Length - 4));
                        if (keyc.Contains("image"))
                        {
                            get_number = Convert.ToInt32(keyc.Substring(5, keyc.Length - 9));

                            if (get_number > defaultnumber)
                            {
                                x1.Text       = keyc.Substring(0, keyc.Length - 4);
                                defaultnumber = get_number;
                            }
                        }
                    }

                    //     if (keyc.Contains("image1"))
                    //    Threshold_image.Text = keyc;
                }
            }
            else
            {
                int m = 0;

                if (x1.SelectedItem != null)
                {
                    if (!test.imageBuffer.ContainsKey(x1.SelectedItem.ToString() + ".img"))
                    {
                        x1.Items.Remove(x1.SelectedItem.ToString() + ".img");
                    }
                }
                foreach (string keyc in test.imageBuffer.Keys)
                {
                    for (int i = 0; i < x1.Items.Count; i++)
                    {
                        if (keyc == (x1.Items[i].ToString() + ".img"))
                        {
                            break;
                        }
                        m = i;
                        if (m == x1.Items.Count - 1 && keyc.Contains(".img"))
                        {
                            x1.Items.Add(keyc.Substring(0, keyc.Length - 4));
                        }
                    }
                }
            }
        }
コード例 #10
0
ファイル: FocusPoint.cs プロジェクト: edy8888/Machineview
        public bool Run_transform(ExecuteBuffer _executeBuffer, 模板GVName_halcon Model_result, Dictionary <int, PointName> Point_temp_result, out Dictionary <int, PointName> Point_out_result, out string result_info)
        {
            HTuple x, y;
            HTuple modelangle = 0, modelregionangle = 0;

            result_info = "";
            HTuple output_x = 0, output_y = 0;

            Point_out_result = Point_temp_result;
            if (!_executeBuffer.imageBuffer.ContainsKey(this.cbb_image.SelectedItem.ToString() + ".img"))
            {
                MessageBox.Show("二值化处理: 输入图像1已经不存在,请重置设置输入图像");
                result_info = " 二值化处理: 输入图像1已经不存在,请重置设置输入图像";
                return(false);
            }
            if (_executeBuffer.imageBuffer[this.cbb_image.SelectedItem.ToString() + ".img"] == null)
            {
                MessageBox.Show("二值化处理: image1参数为空或者未赋值");
                result_info = " 二值化处理: 输入图像1已经不存在,请重置设置输入图像";
                return(false);
            }
            HObject EdgeAmplitude, EdgeAmplitude1, region, BinImage, ImageResult3, ImageResult4;
            HTuple  Min, Max, Range, Width, Height, Value, Deviation;

            HOperatorSet.GenEmptyObj(out EdgeAmplitude);
            HOperatorSet.GenEmptyObj(out EdgeAmplitude1);
            HOperatorSet.GenEmptyObj(out region);
            HOperatorSet.GenEmptyObj(out BinImage);
            HOperatorSet.GetImageSize(_executeBuffer.imageBuffer[this.cbb_image.SelectedItem.ToString() + ".img"], out Width, out Height);
            HOperatorSet.SobelAmp(_executeBuffer.imageBuffer[this.cbb_image.SelectedItem.ToString() + ".img"], out EdgeAmplitude, "sum_sqrt", 3);
            HOperatorSet.MinMaxGray(EdgeAmplitude, EdgeAmplitude, 0, out Min, out Max, out Range);
            HOperatorSet.Threshold(EdgeAmplitude, out region, 50, 255);
            HOperatorSet.RegionToBin(region, out BinImage, 1, 0, Width, Height);
            HOperatorSet.MultImage(BinImage, BinImage, out ImageResult3, 1, 0);
            HOperatorSet.MultImage(ImageResult3, ImageResult3, out ImageResult4, 1, 0);
            HOperatorSet.Intensity(ImageResult4, ImageResult4, out Value, out Deviation);
            x_get = Value;
            y_get = Deviation;
            int out_number_list = Convert.ToInt32(this.tb_outnumber.Text.ToString());

            if (Point_temp_result.ContainsKey(out_number_list))
            {
                Point_temp_result[out_number_list].点X = x_get;
                Point_temp_result[out_number_list].点Y = y_get;
            }
            else
            {
                Point_temp_result.Add(out_number_list, new PointName(output_x, output_y));
            }

            Point_out_result = Point_temp_result;


            this.label_show.Text = "x 偏移:" + x_get.ToString() + "\n" + "y偏移是:" + y_get.ToString();
            return(true);
        }
コード例 #11
0
 public MakeCalibration(ExecuteBuffer buffer, bool addbuffer)
 {
     InitializeComponent();
     if (addbuffer)
     {
         if (buffer != null)
         {
             SetParaImage(buffer);
         }
     }
 }
コード例 #12
0
 public ReadPictureControl(ExecuteBuffer buffer, bool addbuffer)
 {
     InitializeComponent();
     if (addbuffer)
     {
         if (buffer != null)
         {
             SetParaImage(buffer);
         }
     }
 }
コード例 #13
0
 public PuzzlePicture(ExecuteBuffer buffer, bool addbuffer)
 {
     InitializeComponent();
     if (addbuffer)
     {
         if (buffer != null)
         {
             SetParaImage(buffer);
             //   SetParaImage(buffer);
         }
     }
 }
コード例 #14
0
 public GeneralMorphology(ExecuteBuffer buffer, bool addbuffer)
 {
     InitializeComponent();
     if (addbuffer)
     {
         if (buffer != null)
         {
             SetParaImage(buffer);
             SetParaImage(buffer);
         }
     }
 }
コード例 #15
0
 internal void SetParaImage(ExecuteBuffer test)
 {
     SetNewParaImage(test, Input_image1);
     SetNewParaImage(test, Input_image2);
     SetNewParaImage(test, Input_image3);
     SetNewParaImage(test, Input_image4);
     SetNewParaImage(test, Input_image5);
     SetNewParaImage(test, Input_image6);
     SetNewParaImage(test, Input_image7);
     SetNewParaImage(test, Input_image8);
     SetNewParaImage(test, Input_image9);
 }
コード例 #16
0
        public RegionInterest(ExecuteBuffer buffer, bool addbuffer)
        {
            InitializeComponent();

            if (addbuffer)
            {
                if (buffer != null)
                {
                    SetParaImage(buffer);
                    //  SetParaImage(buffer);
                }
            }
        }
コード例 #17
0
ファイル: PointShow.cs プロジェクト: edy8888/Machineview
        public PointShow(ExecuteBuffer buffer, bool addbuffer)
        {
            InitializeComponent();
            if (addbuffer)
            {
                if (buffer != null)
                {
                    SetParaImage(buffer);
                }
            }

            this.cbb_Inputsource.SelectedIndex = 0;
        }
コード例 #18
0
ファイル: FindLine.cs プロジェクト: edy8888/Machineview
        public bool RunThresholdTest_new(ExecuteBuffer _executeBuffer, out ExecuteBuffer outexecutebuffer, out string result_info)
        {
            outexecutebuffer = _executeBuffer;
            result_info      = "";
            HObject region;
            HObject outimagename;

            HOperatorSet.GenEmptyObj(out region);
            HOperatorSet.GenEmptyObj(out outimagename);

            result_info = " 二值化处理: 完成";
            return(true);
        }
コード例 #19
0
        public bool Run_Region(ExecuteBuffer _executeBuffer, out ExecuteBuffer outexecutebuffer)
        {
            outexecutebuffer = _executeBuffer;
            HObject inRegion;
            HObject outRegion;
            HObject outImage;

            HOperatorSet.GenEmptyObj(out outImage);
            if (!_executeBuffer.imageBuffer.ContainsKey(this.cbb_image.SelectedItem.ToString() + ".img"))
            {
                MessageBox.Show("感兴趣区域:无法找到输入图像");
                return(false);
            }
            if (!_executeBuffer.imageBuffer.ContainsKey(this.cbb_regions.SelectedItem.ToString() + ".region"))
            {
                MessageBox.Show("感兴趣区域: 无法找到输入区域");
                return(false);
            }
            if (!_executeBuffer.imageBuffer.ContainsKey(this.cbb_outregion.Text.ToString() + ".img"))
            {
                MessageBox.Show("感兴趣区域: 无法找到输出图像,请先确认");
                return(false);
            }
            if (_executeBuffer.imageBuffer[this.cbb_regions.SelectedItem.ToString() + ".region"] == null)
            {
                MessageBox.Show("感兴趣区域: 无法找到感兴趣区域,请先确认");
                return(false);
            }



            if (this.checkBox_chong.Checked)
            {
                HOperatorSet.PaintRegion(_executeBuffer.imageBuffer[this.cbb_regions.SelectedItem.ToString() + ".region"], _executeBuffer.imageBuffer[this.cbb_image.SelectedItem.ToString() + ".img"], out outImage, Convert.ToDouble(this.textBox_chong.Text), "fill");
                _executeBuffer.imageBuffer[this.cbb_outregion.Text.ToString() + ".img"] = outImage;;
            }
            else
            {
                HOperatorSet.ReduceDomain(_executeBuffer.imageBuffer[this.cbb_image.SelectedItem.ToString() + ".img"], _executeBuffer.imageBuffer[this.cbb_regions.SelectedItem.ToString() + ".region"], out outRegion);

                if (_executeBuffer.imageBuffer[this.cbb_outregion.Text.ToString() + ".img"] != null)
                {
                    if (_executeBuffer.imageBuffer[this.cbb_outregion.Text.ToString() + ".img"].IsInitialized())
                    {
                        _executeBuffer.imageBuffer[this.cbb_outregion.Text.ToString() + ".img"].Dispose();
                    }
                }
                _executeBuffer.imageBuffer[this.cbb_outregion.Text.ToString() + ".img"] = outRegion;
            }
            return(true);
        }
コード例 #20
0
ファイル: ReadBarcode.cs プロジェクト: edy8888/Machineview
        public ReadBarcode(ExecuteBuffer buffer, bool addbuffer)
        {
            InitializeComponent();

            if (addbuffer)
            {
                if (buffer != null)
                {
                    SetParaImage(buffer);
                    //  SetParaImage(buffer);
                }
            }
            this.comboBox_type.SelectedIndex = 0;
        }
コード例 #21
0
ファイル: FindGreyModel.cs プロジェクト: edy8888/Machineview
        public FindGreyModel(ExecuteBuffer buffer, bool addbuffer)
        {
            InitializeComponent();

            model_subPixel.SelectedIndex = 0;
            if (addbuffer)
            {
                if (buffer != null)
                {
                    SetParawindow(buffer);
                    SetParaImage(buffer);
                }
            }
        }
コード例 #22
0
        public RegionProcess(ExecuteBuffer buffer, bool addbuffer)
        {
            InitializeComponent();

            if (addbuffer)
            {
                if (buffer != null)
                {
                    SetParaImage(buffer);
                    SetParaImage(buffer);
                }
            }
            this.cbb_features.SelectedIndex  = 0;
            this.cbb_operation.SelectedIndex = 0;
        }
コード例 #23
0
 public FindCircle(ExecuteBuffer buffer, bool addbuffer)
 {
     InitializeComponent();
     if (addbuffer)
     {
         if (buffer != null)
         {
             SetParaImage(buffer);
             SetParaImage(buffer);
         }
     }
     this.cbb_measure_select.SelectedIndex = 0;
     this.cbb_transition.SelectedIndex     = 0;
     this.cbb_source1.SelectedIndex        = 0;
 }
コード例 #24
0
ファイル: SmoothTest.cs プロジェクト: edy8888/Machineview
 public SmoothTest(ExecuteBuffer buffer, bool addbuffer)
 {
     InitializeComponent();
     Panel_show();
     if (addbuffer)
     {
         if (buffer != null)
         {
             SetParaImage(buffer);
         }
     }
     smooth_typemedian.SelectedIndex = 0;
     smooth_margin.SelectedIndex     = 0;
     txt_sizegauss.SelectedIndex     = 0;
 }
コード例 #25
0
ファイル: FocusPoint.cs プロジェクト: edy8888/Machineview
        public FocusPoint(ExecuteBuffer buffer, bool addbuffer)
        {
            InitializeComponent();

            if (addbuffer)
            {
                if (buffer != null)
                {
                    SetParaImage(buffer);
                    //  SetParaImage(buffer);
                }
            }


            // this.panel_inno2.Visible = false;
        }
コード例 #26
0
 public FindScaledShapeModel(ExecuteBuffer buffer, bool addbuffer)
 {
     InitializeComponent();
     panel_参数设置1.Visible          = false;
     panel_参数设置2.Visible          = false;
     panel_参数设置3.Visible          = false;
     model_subPixel.SelectedIndex = 0;
     if (addbuffer)
     {
         if (buffer != null)
         {
             SetParawindow(buffer);
             SetParaImage(buffer);
         }
     }
 }
コード例 #27
0
        public LineLine(ExecuteBuffer buffer, bool addbuffer)
        {
            InitializeComponent();
            if (addbuffer)
            {
                if (buffer != null)
                {
                    SetParaImage(buffer);
                }
            }

            this.cbb_Inputsource.SelectedIndex  = 0;
            this.cbb_inputsource2.SelectedIndex = 0;
            this.panel_inno1.Visible            = true;
            // this.panel_inno2.Visible = false;
        }
コード例 #28
0
ファイル: Transformation.cs プロジェクト: edy8888/Machineview
 public Transformation(ExecuteBuffer buffer, bool addbuffer)
 {
     InitializeComponent();
     if (addbuffer)
     {
         if (buffer != null)
         {
             SetParaImage(buffer);
         }
     }
     this.cbb_TransType.SelectedIndex   = 0;
     this.cbb_Inputsource.SelectedIndex = 0;
     panel_input.Visible     = false;
     panel_outnumber.Visible = false;
     panel_inpnumber.Visible = false;
 }
コード例 #29
0
ファイル: BinaryPro.cs プロジェクト: edy8888/Machineview
 public BinaryPro(ExecuteBuffer buffer, bool addbuffer)
 {
     InitializeComponent();
     if (addbuffer)
     {
         if (buffer != null)
         {
             SetParaImage(buffer);
             //   SetParaImage(buffer);
         }
     }
     this.cbb_features.SelectedIndex  = 0;
     this.cbb_operation.SelectedIndex = 0;
     this.panel_参数设置2.Visible         = false;
     this.panel_参数设置3.Visible         = false;
 }
コード例 #30
0
ファイル: RoiMake.cs プロジェクト: edy8888/Machineview
        public RoiMake(ExecuteBuffer buffer, bool addbuffer)
        {
            InitializeComponent();
            if (addbuffer)
            {
                if (buffer != null)
                {
                    SetParaImage(buffer);
                    //  SetParaImage(buffer);
                }
            }

            panel_rectangle2.Visible     = false;
            panel_circle.Visible         = true;
            this.cbb_angle.SelectedIndex = 0;
            this.cbb_point.SelectedIndex = 0;
            this.panel_circle.Visible    = true;
        }