Example #1
0
        /// <summary>
        /// Paints all objects from the ROIList into the HALCON window
        /// </summary>
        /// <param name="window">HALCON window</param>
        public void paintData(HalconDotNet.HWindow window, HWindowControl windowCtrl)
        {
            window.SetDraw("margin");
            window.SetLineWidth(1);

            if (ROIList.Count > 0)
            {
                //
                //window.SetColor(inactiveCol);

                window.SetDraw("margin");

                for (int i = 0; i < ROIList.Count; i++)
                {
                    window.SetColor(((ROI)ROIList[i]).Color);
                    window.SetLineStyle(((ROI)ROIList[i]).flagLineStyle);
                    ((ROI)ROIList[i]).draw(window, Convert.ToInt32(viewController.ImgCol2 - viewController.ImgCol1), Convert.ToInt32(viewController.ImgRow2 - viewController.ImgRow1));
                }

                if (activeROIidx != -1)
                {
                    window.SetColor(activeCol);
                    window.SetLineStyle(((ROI)ROIList[activeROIidx]).flagLineStyle);
                    ((ROI)ROIList[activeROIidx]).draw(window, Convert.ToInt32(viewController.ImgCol2 - viewController.ImgCol1), Convert.ToInt32(viewController.ImgRow2 - viewController.ImgRow1));

                    window.SetColor(activeHdlCol);
                    ((ROI)ROIList[activeROIidx]).displayActive(window, Convert.ToInt32(viewController.ImgCol2 - viewController.ImgCol1), Convert.ToInt32(viewController.ImgRow2 - viewController.ImgRow1));
                }
            }
        }
Example #2
0
 public ViewWindow(HWindowControl window)
 {
     this._hWndControl   = new Model.HWndCtrl(window);
     this._roiController = new Model.ROIController();
     this._hWndControl.setROIController(this._roiController);
     this._hWndControl.setViewState(Model.HWndCtrl.MODE_VIEW_NONE);
 }
Example #3
0
        /// <summary>
        /// Recalculates the shape of the ROI instance. Translation is
        /// performed at the active handle of the ROI object
        /// for the image coordinate (x,y)
        /// </summary>
        /// <param name="newX">x mouse coordinate</param>
        /// <param name="newY">y mouse coordinate</param>
        public override void moveByHandle(double newX, double newY, HWindowControl window)
        {
            double vX, vY, x = 0, y = 0;

            switch (activeHandleIdx)
            {
            case 0:
            case 1:
            case 2:
            case 3:

                tmp = hom2D.HomMat2dInvert();
                x   = tmp.AffineTransPoint2d(newX, newY, out y);

                length2 = Math.Abs(y);
                length1 = Math.Abs(x);

                checkForRange(x, y);
                window.Cursor = System.Windows.Forms.Cursors.Hand;
                break;

            case 4:
                midC          = newX;
                midR          = newY;
                window.Cursor = System.Windows.Forms.Cursors.SizeAll;
                break;

            case 5:
                vY            = newY - rows[4].D;
                vX            = newX - cols[4].D;
                phi           = Math.Atan2(vY, vX);
                window.Cursor = System.Windows.Forms.Cursors.Hand;
                break;

            case 7:
            case 9:
                tmp = hom2D.HomMat2dInvert();
                x   = tmp.AffineTransPoint2d(newX, newY, out y);



                length2 = Math.Abs(y);

                checkForRange(x, y);
                window.Cursor = System.Windows.Forms.Cursors.Hand;
                break;

            case 6:
            case 8:
                tmp = hom2D.HomMat2dInvert();
                x   = tmp.AffineTransPoint2d(newX, newY, out y);


                length1 = Math.Abs(x);
                checkForRange(x, y);
                window.Cursor = System.Windows.Forms.Cursors.Hand;
                break;
            }
            updateHandlePos();
        }        //end of method
Example #4
0
 public void AddDisplayControl(HWindowControl ctrl)
 {
     if (ctrl != null && !DisplayControl.Contains(ctrl))
     {
         DisplayControl.Add(ctrl);
     }
 }
Example #5
0
        public CameraViews()
        {
            InitializeComponent();

            hWindControl1           = new HWindowControl();
            windowsFormsHost1.Child = hWindControl1;
        }
Example #6
0
 /// <summary>
 /// <para>******************</para>
 /// Watch Gray Level (灰階
 /// <para>******************</para>
 /// </summary>
 /// <param name="viewPort"></param>
 private void setWatchGrayLevel(HWindowControl viewPort, HWndCtrl viewController)
 {
     if (viewPort != null)
     {
         viewPort.HMouseMove += (sender, e) =>
         {
             if (viewController == null)
             {
                 return;
             }
             var currImage = viewController.GetLastHImage();
             if (currImage != null)
             {
                 var row = (int)Math.Round(e.Y, 0);
                 var col = (int)Math.Round(e.X, 0);
                 try
                 {
                     HTuple width, height, grayval;
                     currImage.GetImageSize(out width, out height);
                     var mouseInImage = (row <= height.I && col <= width.I && row >= 0 && col >= 0);
                     if (mouseInImage)
                     {
                         HOperatorSet.GetGrayval(currImage, row, col, out grayval);
                         var dispText = grayval.I.ToString();
                         SetStatus(SystemStatusType.GrayLevel, dispText);
                     }
                 }
                 catch (Exception ex)
                 {
                     AddMessage(ex.Message);
                 }
             }
         };
     }
 }
Example #7
0
        /// <summary>
        /// Initializes the image dimension, mouse delegation, and the
        /// graphical context setup of the instance.
        /// </summary>
        /// <param name="view"> HALCON window </param>
        protected internal HWndCtrl(HWindowControl view)
        {
            viewPort     = view;
            stateView    = MODE_VIEW_NONE;
            windowWidth  = viewPort.Size.Width;
            windowHeight = viewPort.Size.Height;

            zoomAddOn   = Math.Pow(0.9, 5);
            zoomWndSize = 150;

            /*default*/
            CompRangeX = new int[] { 0, 100 };
            CompRangeY = new int[] { 0, 100 };

            prevCompX = prevCompY = 0;

            dispROI = MODE_INCLUDE_ROI;            //1;

            viewPort.HMouseUp    += new hvppleDotNet.HMouseEventHandler(this.mouseUp);
            viewPort.HMouseDown  += new hvppleDotNet.HMouseEventHandler(this.mouseDown);
            viewPort.HMouseWheel += new hvppleDotNet.HMouseEventHandler(this.HMouseWheel);
            viewPort.HMouseMove  += new hvppleDotNet.HMouseEventHandler(this.mouseMoved);

            // graphical stack
            HObjImageList = new ArrayList(20);
            mGC           = new GraphicsContext();
        }
        /// <summary>
        ///初始化控件image,和_halconWindow,及窗口设置的颜色
        /// </summary>
        /// <returns></returns>
        public bool init()
        {
            bool ok = false;

            exit_Image           = false;
            this._yunXingBiaoZhi = false;

            _halconWindow1  = hWindowControl1.HalconWindow;
            _hWindowControl = hWindowControl1;

            RepaintingROI += repaintingROI;

            _halconWindow1.SetColor("green");
            _halconWindow1.SetDraw("margin");

            HOperatorSet.GenEmptyObj(out _ho_Image);
            _ho_Image.Dispose();

            _roiControl = new ROIControl();
            _roiStatus  = ROIStatus.NoChioceROI;

            hWindowControl1.HMouseDown  += this.hWindowControl1_HMouseDown;
            hWindowControl1.HMouseMove  += this.hWindowControl1_HMouseMove;
            hWindowControl1.HMouseWheel += this.hWindowControl1_HMouseWheel;

            ok = true;
            return(ok);
        }
Example #9
0
        /// <summary>
        /// 初始化halcon窗口控制器
        /// </summary>
        /// <param name="hWindowControl_">传入要控制的窗口</param>
        internal HWinCtl(HWindowControl hWindowControl_)
        {
            _hWindowControl = hWindowControl_;
            _roiControl     = new ROIControl();

            hWindowControl_.HMouseDown += mouseDown;
        }
Example #10
0
        public EditHalconFormBase(bool showResult)
        {
            InitializeComponent();
            this.StartPosition = FormStartPosition.CenterScreen;
            hWindow            = new HWindowControl();
            hWindow.Dock       = DockStyle.Fill;
            this.tabCurrent.Controls.Clear();
            this.tabCurrent.Controls.Add(hWindow);

            mView = new HWndCtrl(this.hWindow);
            mView.changeGraphicSettings(GraphicsContext.GC_LINESTYLE, new HTuple());

            createModelWindowMode = Color.RoyalBlue;
            trainModelWindowMode  = Color.Chartreuse;

            roiController              = new ROIController();
            roiController.ROISelected += RoiController_ROISelected;
            roiController.setROISign(ROIController.MODE_ROI_POS);

            mView.NotifyIconObserver       = new IconicDelegate(UpdateViewData);
            roiController.NotifyRCObserver = new IconicDelegate(UpdateViewData);

            mView.useROIController(roiController);
            mView.setViewState(HWndCtrl.MODE_VIEW_ZOOM_MOVE);

            halconEditable = this as IHalconEditable;

            this.nudSettlingTime.Maximum = 1000;

            this.btnStop.Visible     = showResult;
            this.btnIgnore.Visible   = showResult;
            this.chxFixedROI.Checked = showResult;
        }
Example #11
0
        /// <summary>
        /// Recalculates the shape of the ROI. Translation is
        /// performed at the active handle of the ROI object
        /// for the image coordinate (x,y)
        /// </summary>
        public override void moveByHandle(double newX, double newY, HWindowControl window)
        {
            HTuple distance;
            double shiftX, shiftY;

            switch (activeHandleIdx)
            {
            case 0:     // handle at circle border

                row1 = newY;
                col1 = newX;
                HOperatorSet.DistancePp(new HTuple(row1), new HTuple(col1),
                                        new HTuple(midR), new HTuple(midC),
                                        out distance);

                radius        = distance[0].D;
                window.Cursor = System.Windows.Forms.Cursors.Hand;
                break;

            case 1:     // midpoint

                shiftY = midR - newY;
                shiftX = midC - newX;

                midR = newY;
                midC = newX;

                row1         -= shiftY;
                col1         -= shiftX;
                window.Cursor = System.Windows.Forms.Cursors.SizeAll;
                break;
            }
        }
Example #12
0
 public ViewWindow(HWindowControl window, Label location_point)
 {
     this._hWndControl   = new ViewROI.HWndCtrl(window, location_point);
     this._roiController = new ViewROI.ROIController();
     this._hWndControl.setROIController(this._roiController);
     this._hWndControl.setViewState(ViewROI.HWndCtrl.MODE_VIEW_NONE);
 }
        public void PreprocessDlClassifierImagesForTrain(HWindowControl hv_HWindowControl, HTuple hv_Pretrained_DlClassifierName)
        {
            this.hv_HWindowControl = hv_HWindowControl;
            this.hv_WindowHandle   = this.hv_HWindowControl.HalconWindow;
            this.hv_Pretrained_DlClassifierName = hv_Pretrained_DlClassifierName;


            hv_ImageFiles.Dispose(); hv_GroundTruthLabels.Dispose(); hv_LabelsIndices.Dispose(); hv_UniqueClasses.Dispose();

            //读取训练数据集,图像Lable为图像所在目录名
            read_dl_classifier_data_set(path_Train_Images, "last_folder", out hv_ImageFiles, out hv_GroundTruthLabels, out hv_LabelsIndices, out hv_UniqueClasses);

            //Create the directories for writing the preprocessed images.
            CreatePreprocessedImagesFolder();

            //Prepare the new image names.
            HTuple hv_BaseNames = new HTuple(); HTuple hv_Extensions = new HTuple(); HTuple hv_Directories = new HTuple();

            hv_BaseNames.Dispose(); hv_Extensions.Dispose(); hv_Directories.Dispose();
            parse_filename(hv_ImageFiles, out hv_BaseNames, out hv_Extensions, out hv_Directories);

            hv_ObjectFilesOut.Dispose();
            using (HDevDisposeHelper dh = new HDevDisposeHelper())
            {
                hv_ObjectFilesOut = (((path_Preprocessed_Images + "/") + hv_GroundTruthLabels) + "/") + hv_BaseNames;
            }
            //
            System.Threading.ThreadStart ts = new System.Threading.ThreadStart(ImagePreprocessThreading);
            this._PreprocessThread = new System.Threading.Thread(ts);
            this._PreprocessThread.IsBackground = true;//设置线程为后台线程
            this._PreprocessThread.Start();
        }
Example #14
0
        /// <summary>
        /// Initializes the image dimension, mouse delegation, and the
        /// graphical context setup of the instance.
        /// </summary>
        /// <param name="view"> HALCON window </param>
        protected internal HWndCtrl(HWindowControl view)
        {
            viewPort     = view;
            stateView    = MODE_VIEW_NONE;
            windowWidth  = viewPort.Size.Width;
            windowHeight = viewPort.Size.Height;

            zoomWndFactor = (double)imageWidth / viewPort.Width;
            zoomAddOn     = Math.Pow(0.9, 5);
            zoomWndSize   = 150;

            /*default*/
            CompRangeX = new int[] { 0, 100 };
            CompRangeY = new int[] { 0, 100 };

            prevCompX = prevCompY = 0;

            dispROI = MODE_INCLUDE_ROI;//1;

            viewPort.HMouseUp    += new HalconDotNet.HMouseEventHandler(this.mouseUp);
            viewPort.HMouseDown  += new HalconDotNet.HMouseEventHandler(this.mouseDown);
            viewPort.HMouseWheel += new HalconDotNet.HMouseEventHandler(this.HMouseWheel);
            viewPort.HMouseMove  += new HalconDotNet.HMouseEventHandler(this.mouseMoved);

            addInfoDelegate    = new FuncDelegate(dummyV);
            NotifyIconObserver = new IconicDelegate(dummy);

            // graphical stack
            HObjImageList      = new ArrayList(20);
            mGC                = new GraphicsContext();
            mGC.gcNotification = new GCDelegate(exceptionGC);
        }
Example #15
0
 /// <summary>
 /// 显示图像
 /// </summary>
 private void DisplayImage(HWindowControl hCtrl, IHalImage image)
 {
     if (hCtrl.InvokeRequired)
     {
         DisplayImageCallBack a = new DisplayImageCallBack(DisplayImage);
         hCtrl.Invoke(a, hCtrl, image);
         return;
     }
     else
     {
         if (System.Environment.TickCount - ticketNum > 33)
         {
             ticketNum = System.Environment.TickCount;
             try
             {
                 HSystem.SetSystem("flush_graphic", "false");
                 //hCtrl.HalconWindow.ClearWindow();
                 //if (image.Width != hCtrl.ImagePart.Width)
                 //    SetImagePart(hCtrl,0, 0, image.Height, image.Width);
                 hCtrl.HalconWindow.DispObj(image.SourceImage);
                 HSystem.SetSystem("flush_graphic", "true");
             }
             catch (Exception ex)
             {
                 Console.WriteLine(ex.ToString());
             }
         }
     }
 }
        /// <summary>
        /// Initializes the image dimension, mouse delegation, and the
        /// graphical context setup of the instance.
        /// </summary>
        /// <param name="view"> HALCON window </param>
        public HWndCtrl(HWindowControl view)
        {
            viewPort     = view;
            stateView    = MODE_VIEW_NONE;
            windowWidth  = viewPort.Size.Width;
            windowHeight = viewPort.Size.Height;

            // initialize the image part to window size
            initializeDisplayImagePart();
            resetImagePart(widthImagePart, heightImagePart);


            if (widthImagePart > 0)
            {
                zoomWndFactor = (double)widthImagePart / viewPort.Width;
            }
            else
            {
                zoomWndFactor = 1;
            }

            zoomAddOn   = Math.Pow(0.9, 5);
            zoomWndSize = 150;

            /*Set the boundaries and steps for changes for the GUI elements*/
            /*default*/
            CompRangeX = new int[] { 0, 100 };
            CompRangeY = new int[] { 0, 100 };

            prevCompX = prevCompY = 0;
            initValX  = initValY = 0;

            /* Initialize the values for value range, step for
             * some GUI elements */
            setGUICompRangeX(CompRangeX, prevCompX);
            setGUICompRangeY(CompRangeY, prevCompY);

            //displayMode = MODE_VIEW_NONE;

            dispROI = MODE_INCLUDE_ROI;//1;

            viewPort.HMouseUp    += new HalconDotNet.HMouseEventHandler(this.mouseUp);
            viewPort.HMouseDown  += new HalconDotNet.HMouseEventHandler(this.mouseDown);
            viewPort.HMouseMove  += new HalconDotNet.HMouseEventHandler(this.mouseMoved);
            viewPort.HMouseWheel += new HalconDotNet.HMouseEventHandler(this.mouseWheel);

            addInfoDelegate    = new FuncDelegate(dummyV);
            NotifyIconObserver = new IconicDelegate(dummy);

            // graphical stack
            HObjList           = new ArrayList(20);
            mGC                = new GraphicsContext();
            mGC.gcNotification = new GCDelegate(exceptionGC);

            // set the variable bufferWindow to null for repaint-Method
            bufferWindow = null;
        }
Example #17
0
 public HalconVision(String name, Panel parentPnl, HWindowControl myHalconWin)
 {
     Name = name;
     //myInterface = new HalconInterface(name, parentPnl, this, myHalconWin);
     BaslerCam = new BaslerCamera();//BaslerGigeCameraMgr.Inistance();
     //myImage = new HObject();
     myImage = new HImage();
     BaslerCam.ImageReadyEvent += new BaslerCamera.ImageReadyEventHandler(OnImageReadyEventCallback);
 }
Example #18
0
 /// <summary>
 /// 根据提供的图像的信息调整图像显示(左上角和右下角坐标)
 /// </summary>
 /// <param name="r1">左上角Y坐标</param>
 /// <param name="c1">左上角x坐标</param>
 /// <param name="r2">右下角Y坐标</param>
 /// <param name="c2">右下角x坐标</param>
 private void SetImagePart(HWindowControl hCtrl, int r1, int c1, int r2, int c2)
 {
     System.Drawing.Rectangle rect = hCtrl.ImagePart;
     rect.X          = c1;
     rect.Y          = r1;
     rect.Height     = r2;
     rect.Width      = c2;
     hCtrl.ImagePart = rect;
 }
Example #19
0
 public void HalconInit(HWindowControl WindowControl, out HTuple hWindowHandle)
 {
     HOperatorSet.SetSystem("width", 3000);
     HOperatorSet.SetSystem("height", 3000);
     hWindowHandle = WindowControl.HalconWindow; //图形窗口句柄,用于显示
     HOperatorSet.SetDraw(hWindowHandle, "margin");
     HOperatorSet.SetColor(hWindowHandle, "red");
     HOperatorSet.SetColored(hWindowHandle, 12);
 }
Example #20
0
 /// <summary>
 /// 图片适应大小显示在窗体
 /// </summary>
 /// <param name="hw_Ctrl">halcon窗体控件</param>
 public void DispImageFit(HWindowControl hw_Ctrl)
 {
     try
     {
         this.viewWindow.resetWindowImage();
     }
     catch (Exception)
     {
     }
 }
Example #21
0
 /// <summary>
 /// <para>*****************</para>
 /// Watch Coordniate (座標)
 /// <para>*****************</para>
 /// </summary>
 /// <param name="viewPort"></param>
 private void setWatchCoordinate(HWindowControl viewPort)
 {
     if (viewPort != null)
     {
         viewPort.HMouseMove += (sender, e) =>
         {
             var coordinateText = String.Format("{0}, {1}", Math.Round(e.X, 2), Math.Round(e.Y, 2));
             SetStatus(SystemStatusType.Coordinate, coordinateText);
         };
     }
 }
        internal static void KeepAspectRatio(HWindowControl hWindowControl, HObject image)
        {
            HTuple width, height;

            HOperatorSet.GetImageSize(image, out width, out height);
            //image.GetImageSize(out width, out height);

            Rectangle result = KeepRatioZoomRectangle(hWindowControl.ClientRectangle, width[0].I, height[0].I);

            if (result != hWindowControl.ImagePart)
            {
                hWindowControl.ImagePart = result;
            }
        }
Example #23
0
        /// <summary>
        /// here do selecShape both for imageThresholded and imageCropped
        /// for imageCropped is only for display on the screen, bigger and clear to check for user
        /// </summary>
        /// <param name="WindowControl"></param>
        /// <param name="image_C"></param>
        /// <param name="Region_T"></param>
        /// <param name="Region_C"></param>
        /// <param name="hWindowHandle"></param>
        /// <param name="min"></param>
        /// <param name="max"></param>
        /// <param name="SRegion_T"></param>
        /// <param name="SRegion_C"></param>
        public void selectShape(HWindowControl WindowControl, ref HObject image_C, ref HObject Region_T, ref HObject Region_C, HTuple hWindowHandle, HTuple min,
                                HTuple max, out HObject SRegion_T, out HObject SRegion_C)
        {
            WindowControl.Focus();

            if (!m_tools.ObjectValided(Region_T))
            {
                SRegion_T = null;
                SRegion_C = null;
                return;
            }
            try
            {
                HOperatorSet.GenEmptyObj(out connectRegion_T);  //initialize variable connectRegion_T (imageThresholded)
                HOperatorSet.GenEmptyObj(out connectRegion_C);  //initialize variable connectRegion_C (imageCropped)
                HOperatorSet.Connection(Region_T, out connectRegion_T);
                HOperatorSet.Connection(Region_C, out connectRegion_C);

                //Graphics set for display
                HOperatorSet.SetDraw(hWindowHandle, "fill");
                HOperatorSet.SetColor(hWindowHandle, "green");

                //ReduceImage
                HOperatorSet.GenEmptyObj(out SRegion_T);       //initialize variable SRegion_T
                HOperatorSet.GenEmptyObj(out SRegion_C);       //initialize variable SRegion_C
                SRegion_T.Dispose();
                SRegion_C.Dispose();
                HOperatorSet.SelectShape(connectRegion_T, out SRegion_T, "area", "and", min, max);
                HOperatorSet.SelectShape(connectRegion_C, out SRegion_C, "area", "and", min, max);

                //Union segmented regions
                HOperatorSet.Union1(SRegion_T, out SRegion_T);
                HOperatorSet.Union1(SRegion_C, out SRegion_C);

                //Refresh window; Select_shape region for imageCropped
                m_tools.Imgshow(image_C, hWindowHandle, image_C);
                HOperatorSet.DispObj(SRegion_C, hWindowHandle);

                //Release;
                connectRegion_T.Dispose();
                connectRegion_C.Dispose();
            }
            catch
            {
                SRegion_T = null;
                SRegion_C = null;
                return;
            }
        }
Example #24
0
        public void DrawRectangel(HWindowControl WindowControl, HObject Image, HTuple hWindowHandle, ref HObject Region, ref HObject ImageReduced, ref HObject ImageCroped)
        {
            WindowControl.Focus();
            if (!ObjectValided(Image))
            {
                MessageBox.Show("Image Invalid");
                return;
            }

            try
            {
                HOperatorSet.GenEmptyObj(out ImageCroped);
                HOperatorSet.GenEmptyObj(out ImageReduced);     //初始化图像变量ImageReduced
                HOperatorSet.GenEmptyObj(out Region);           //初始化图像变量Region

                HTuple Row1, Col1, Row2, Col2;                  //初始化参数变量

                //提示信息
                disp_message(hWindowHandle, "Draw ROI,click right mouse to confirm", "window", 20, 20, "red", "true");

                //draw_rectangle1
                HOperatorSet.DrawRectangle1(hWindowHandle, out Row1, out Col1, out Row2, out Col2);

                //gen_rectangle1
                Region.Dispose();
                HOperatorSet.GenRectangle1(out Region, Row1, Col1, Row2, Col2);

                //reduce_domain
                ImageReduced.Dispose();
                ImageCroped.Dispose();
                HOperatorSet.ReduceDomain(Image, Region, out ImageReduced);
                HOperatorSet.CropDomain(ImageReduced, out ImageCroped);   //裁剪图片

                //显示
                HOperatorSet.DispObj(Image, hWindowHandle);
                HOperatorSet.DispObj(Region, hWindowHandle);

                disp_message(hWindowHandle, "Draw ROI complete", "window", 20, 20, "blue", "true");

                //生命周期释放
                //Region.Dispose();
                //ImageReduced.Dispose();
                //ImageCroped.Dispose();
            }
            catch
            {
            }
        }
Example #25
0
        public HalconInterface(String name, Panel parentPnl, HalconVision halVis, HWindowControl myHalconWin)
        {
            InitializeComponent();
            ModuleNameLbl.Text = name;
            this.Parent        = parentPnl;
            myHalcon           = halVis;
            m_lockShowpicture  = new object();
            HalconWin          = myHalconWin;
            hWndCtrl           = new HWndCtrl(HalconWin);
            hWndCtrl.setViewState(HWndCtrl.MODE_VIEW_NONE);
            hWndCtrl.repaint();
            myHalcon.OnImageReadyFunction += OnImgReady;

            CaliXLbl.Text = myHalcon.CaliValue.X.ToString("F3");
            CaliYLbl.Text = myHalcon.CaliValue.Y.ToString("F3");
        }
Example #26
0
        public static void dispImage(HWindowControl hWC, HObject HImage)
        {
            HTuple hv_Width = null, hv_Height = null, hv_picWHRatio = null;
            HTuple hv_winWHRatio = null, hv_dispWidth = new HTuple();
            HTuple hv_dispHeight = new HTuple();
            // Initialize local and output iconic variables

            HTuple hv_winWidth = hWC.Width; HTuple hv_winHeight = hWC.Height;

            HOperatorSet.SetSystem("int_zooming", "true");
            HOperatorSet.GetImageSize(HImage, out hv_Width, out hv_Height);
            hv_picWHRatio = (1.0 * hv_Width) / hv_Height;
            hv_winWHRatio = (1.0 * hv_winWidth) / hv_winHeight;
            if (new HTuple(hv_Width.TupleGreater(hv_winWidth)).TupleOr(new HTuple(hv_Height.TupleGreater(
                                                                                      hv_winHeight))) != 0)
            {
                //如果图片宽高比 大于 窗口宽高比
                //则宽度方向顶格
                if (new HTuple(hv_picWHRatio.TupleGreaterEqual(hv_winWHRatio)) != 0)
                {
                    hv_dispWidth  = hv_Width.Clone();
                    hv_dispHeight = hv_Width / hv_winWHRatio;
                    HOperatorSet.SetPart(hWC.HalconWindow, 0, 0, hv_dispHeight, hv_dispWidth);
                    HOperatorSet.DispObj(HImage, hWC.HalconWindow);
                }

                //如果图片宽高比 小于 窗口宽高比
                //则高度方向顶格
                if (new HTuple(hv_picWHRatio.TupleLess(hv_winWHRatio)) == 0)
                {
                    return;
                }
                hv_dispWidth  = hv_Height * hv_winWHRatio;
                hv_dispHeight = hv_Height.Clone();
                HOperatorSet.SetPart(hWC.HalconWindow, 0, 0, hv_dispHeight, hv_dispWidth);
                HOperatorSet.DispObj(HImage, hWC.HalconWindow);
            }
            else
            {
                //如果图片的长和宽都小于窗口,则以图片的原真实尺寸显示
                HOperatorSet.SetPart(hWC.HalconWindow, 0, 0, hv_winWidth, hv_winHeight);
                HOperatorSet.DispObj(HImage, hWC.HalconWindow);
            }

            return;
            ////////////////////////////////////////////////////////////////////////////test-end
        }
Example #27
0
        public void DialationCircle(HWindowControl WindowControl, ref HObject Image, ref HObject Region, ref HTuple Radius, HTuple hWindowHandle, out HObject RegionDilation)
        {
            try
            {
                HOperatorSet.GenEmptyObj(out RegionDilation);
                HOperatorSet.DilationCircle(Region, out RegionDilation, Radius);

                HOperatorSet.SetDraw(hWindowHandle, "fill");
                HOperatorSet.ClearWindow(hWindowHandle);   //刷新窗体
                RegionFitWindow(Image, hWindowHandle, RegionDilation);
            }
            catch
            {
                RegionDilation = null;
                return;
            }
        }
Example #28
0
        /// <summary>
        /// 获取点击鼠标的坐标
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        public void GetMbuttonSubPix(out double x, out double y)
        {
            x = 0;
            y = 0;
            bool   IsSuc = true;
            HTuple mrow = 0, mcol = 0, mbutton;

            try{
                HWindowControl MyWindow = viewController.GetWindow();
                HOperatorSet.GetMbuttonSubPix(MyWindow.HalconWindow, out mrow, out mcol, out mbutton);
                x = mcol.D;
                y = mrow.D;
            }
            catch {
                IsSuc = false;
            }
        }
Example #29
0
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            try
            {
                //OpeneVision初始化
                try
                {
                    //MatrixDecode m_decode = new MatrixDecode();
                    //EMatrixCodeReader EMatrixCodeReader1 = new EMatrixCodeReader(); //条码解析初始化
                    //EMatcher EMatch1 = new EMatcher(); //形状匹配初始化
                    //EPatternFinder EPatternFinder1 = new EPatternFinder(); //形状查找初始化
                }
                catch (Exception ex)
                {
                    MessageBox.Show("OpeneVision初始化失败:" + ex.Message);
                }
                #region //HALCON初始化

                try
                {
                    HObject ho_Image, ho_SymbolXLDs;
                    HOperatorSet.GenEmptyObj(out ho_Image);
                    HOperatorSet.GenEmptyObj(out ho_SymbolXLDs);
                    HTuple hv_DataCodeHandle, hv_ResultHandles, hv_DecodedDataStrings;
                    HTuple train = "train";
                    HTuple all   = "all";
                    HOperatorSet.CreateDataCode2dModel("Data Matrix ECC 200", new HTuple(), new HTuple(), out hv_DataCodeHandle);
                    HOperatorSet.FindDataCode2d(ho_Image, out ho_SymbolXLDs, hv_DataCodeHandle, train, all, out hv_ResultHandles, out hv_DecodedDataStrings);
                    HalconDotNet.HWindowControl hWindowControl_Player = new HWindowControl();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("HALCON 初始化失败:" + ex.Message);
                }

                #endregion
                this.Invoke((EventHandler) delegate
                {
                    mainform = new MainForm();
                });
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
 /// <summary>
 /// 在主界面显示
 /// </summary>
 /// <param name="screenIdx"></param>
 /// <param name="hObj"></param>
 public void DisplayObject(HWindowControl hWindow, HObject hObj)
 {
     if (hObj != null && hWindow != null)
     {
         try
         {
             HTuple hv_r1, hv_w1;
             HOperatorSet.GetImageSize(hObj, out hv_r1, out hv_w1);
             HOperatorSet.SetPart(hWindow.HalconWindow, 0, 0, hv_w1, hv_r1);
             HOperatorSet.SetColor(hWindow.HalconWindow, "red");
             HOperatorSet.DispObj(hObj, hWindow.HalconWindow);
         }
         catch (HalconDotNet.HalconException hex)
         {
             Console.WriteLine("Error:" + hex.GetErrorMessage());
         }
     }
 }
 /// <summary>
 /// 初始化狀態列事件
 /// </summary>
 /// <param name="viewPort"></param>
 /// <param name="viewController"></param>
 public bool Init(HWindowControl viewPort, HWndCtrl viewController, GrabImageWorkingMan camera)
 {
     bool success = true;
     try
     {
         setMessageStore();
         setWatchCoordinate(viewPort);
         setWachtZoomChanged(viewController);
         setWatchOperationModeChange(viewController);
         setWatchGrayLevel(viewPort, viewController);
         setWatchCameraStatus(camera);
     }
     catch (Exception ex)
     {
         success = false;
         Hanbo.Log.LogManager.Error("UC_StatusStrip Error");
         Hanbo.Log.LogManager.Error(ex);
     }
     return success;
 }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.viewPort = new HalconDotNet.HWindowControl();
     this.tabControl = new System.Windows.Forms.TabControl();
     this.tabPageEdges = new System.Windows.Forms.TabPage();
     this.groupBox6 = new System.Windows.Forms.GroupBox();
     this.ShowROIcheckBox = new System.Windows.Forms.CheckBox();
     this.UseROIWidthCheckBox = new System.Windows.Forms.CheckBox();
     this.UseShadowsCheckBox = new System.Windows.Forms.CheckBox();
     this.ShowRegionCheckBox = new System.Windows.Forms.CheckBox();
     this.label6 = new System.Windows.Forms.Label();
     this.LineWidthDown = new System.Windows.Forms.NumericUpDown();
     this.label5 = new System.Windows.Forms.Label();
     this.EdgeLengthUpDown = new System.Windows.Forms.NumericUpDown();
     this.label4 = new System.Windows.Forms.Label();
     this.label3 = new System.Windows.Forms.Label();
     this.EdgeColorComboBox = new System.Windows.Forms.ComboBox();
     this.RegionColorComboBox = new System.Windows.Forms.ComboBox();
     this.groupBox5 = new System.Windows.Forms.GroupBox();
     this.label2 = new System.Windows.Forms.Label();
     this.label1 = new System.Windows.Forms.Label();
     this.PositionComboBox = new System.Windows.Forms.ComboBox();
     this.TransitionComboBox = new System.Windows.Forms.ComboBox();
     this.EdgeToPaircheckBox = new System.Windows.Forms.CheckBox();
     this.groupBox4 = new System.Windows.Forms.GroupBox();
     this.ResetROIWidthButton = new System.Windows.Forms.Button();
     this.ResetSmoothingButton = new System.Windows.Forms.Button();
     this.ResetMinEdgAmplButton = new System.Windows.Forms.Button();
     this.ROIWidthTrackBar = new System.Windows.Forms.TrackBar();
     this.SmoothingTrackBar = new System.Windows.Forms.TrackBar();
     this.MinEdgAmplTrackBar = new System.Windows.Forms.TrackBar();
     this.label10 = new System.Windows.Forms.Label();
     this.label9 = new System.Windows.Forms.Label();
     this.label8 = new System.Windows.Forms.Label();
     this.label7 = new System.Windows.Forms.Label();
     this.MinEdgAmplUpDown = new System.Windows.Forms.NumericUpDown();
     this.SmoothingUpDown = new System.Windows.Forms.NumericUpDown();
     this.InterpolationComboBox = new System.Windows.Forms.ComboBox();
     this.ROIWidthUpDown = new System.Windows.Forms.NumericUpDown();
     this.tabPageResults = new System.Windows.Forms.TabPage();
     this.label15 = new System.Windows.Forms.Label();
     this.ActiveROIListBox = new System.Windows.Forms.ListBox();
     this.EdgeResultListView = new System.Windows.Forms.ListView();
     this.groupBox8 = new System.Windows.Forms.GroupBox();
     this.UnitPanel = new System.Windows.Forms.Panel();
     this.label14 = new System.Windows.Forms.Label();
     this.UnitComboBox = new System.Windows.Forms.ComboBox();
     this.CalibPoseTextBox = new System.Windows.Forms.TextBox();
     this.CalibCamTextBox = new System.Windows.Forms.TextBox();
     this.LoadPoseButton = new System.Windows.Forms.Button();
     this.LoadCalibButton = new System.Windows.Forms.Button();
     this.TransWCoordCheckBox = new System.Windows.Forms.CheckBox();
     this.groupBox7 = new System.Windows.Forms.GroupBox();
     this.DistanceCheckBox = new System.Windows.Forms.CheckBox();
     this.AmplitudeCheckBox = new System.Windows.Forms.CheckBox();
     this.PairWidthCheckBox = new System.Windows.Forms.CheckBox();
     this.PositionCheckBox = new System.Windows.Forms.CheckBox();
     this.tabPageLineProfile = new System.Windows.Forms.TabPage();
     this.label20 = new System.Windows.Forms.Label();
     this.CSScaleComboBox = new System.Windows.Forms.ComboBox();
     this.panelAxis = new System.Windows.Forms.Panel();
     this.groupBox9 = new System.Windows.Forms.GroupBox();
     this.labelDeviation = new System.Windows.Forms.Label();
     this.labelMean = new System.Windows.Forms.Label();
     this.labelRange = new System.Windows.Forms.Label();
     this.labelPeak = new System.Windows.Forms.Label();
     this.label24 = new System.Windows.Forms.Label();
     this.label25 = new System.Windows.Forms.Label();
     this.labelRangeX = new System.Windows.Forms.Label();
     this.labelPeakX = new System.Windows.Forms.Label();
     this.label23 = new System.Windows.Forms.Label();
     this.label22 = new System.Windows.Forms.Label();
     this.label19 = new System.Windows.Forms.Label();
     this.label18 = new System.Windows.Forms.Label();
     this.label17 = new System.Windows.Forms.Label();
     this.label16 = new System.Windows.Forms.Label();
     this.groupBox2 = new System.Windows.Forms.GroupBox();
     this.CircArcButton = new System.Windows.Forms.Button();
     this.LineButton = new System.Windows.Forms.Button();
     this.DeleteActRoiButton = new System.Windows.Forms.Button();
     this.ResetROIButton = new System.Windows.Forms.Button();
     this.LoadImgButton = new System.Windows.Forms.Button();
     this.groupBox1 = new System.Windows.Forms.GroupBox();
     this.ResetViewButton = new System.Windows.Forms.Button();
     this.MagnifyButton = new System.Windows.Forms.RadioButton();
     this.ZoomButton = new System.Windows.Forms.RadioButton();
     this.MoveButton = new System.Windows.Forms.RadioButton();
     this.NoneButton = new System.Windows.Forms.RadioButton();
     this.openImageFileDialog = new System.Windows.Forms.OpenFileDialog();
     this.StatusLabel = new System.Windows.Forms.Label();
     this.openCamparFileDialog = new System.Windows.Forms.OpenFileDialog();
     this.groupBox3 = new System.Windows.Forms.GroupBox();
     this.tabControl.SuspendLayout();
     this.tabPageEdges.SuspendLayout();
     this.groupBox6.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.LineWidthDown)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.EdgeLengthUpDown)).BeginInit();
     this.groupBox5.SuspendLayout();
     this.groupBox4.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.ROIWidthTrackBar)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.SmoothingTrackBar)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.MinEdgAmplTrackBar)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.MinEdgAmplUpDown)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.SmoothingUpDown)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.ROIWidthUpDown)).BeginInit();
     this.tabPageResults.SuspendLayout();
     this.groupBox8.SuspendLayout();
     this.UnitPanel.SuspendLayout();
     this.groupBox7.SuspendLayout();
     this.tabPageLineProfile.SuspendLayout();
     this.groupBox9.SuspendLayout();
     this.groupBox2.SuspendLayout();
     this.groupBox1.SuspendLayout();
     this.groupBox3.SuspendLayout();
     this.SuspendLayout();
     //
     // viewPort
     //
     this.viewPort.BackColor = System.Drawing.Color.Black;
     this.viewPort.BorderColor = System.Drawing.Color.Black;
     this.viewPort.ImagePart = new System.Drawing.Rectangle(0, 0, 640, 480);
     this.viewPort.Location = new System.Drawing.Point(8, 51);
     this.viewPort.Name = "viewPort";
     this.viewPort.Size = new System.Drawing.Size(632, 474);
     this.viewPort.TabIndex = 0;
     this.viewPort.WindowSize = new System.Drawing.Size(632, 474);
     //
     // tabControl
     //
     this.tabControl.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                              this.tabPageEdges,
                                                                              this.tabPageResults,
                                                                              this.tabPageLineProfile});
     this.tabControl.Location = new System.Drawing.Point(652, 12);
     this.tabControl.Name = "tabControl";
     this.tabControl.SelectedIndex = 0;
     this.tabControl.Size = new System.Drawing.Size(358, 516);
     this.tabControl.TabIndex = 1;
     this.tabControl.SelectedIndexChanged += new System.EventHandler(this.tabControl_SelectedIndexChanged);
     //
     // tabPageEdges
     //
     this.tabPageEdges.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                                this.groupBox6,
                                                                                this.groupBox5,
                                                                                this.groupBox4});
     this.tabPageEdges.Location = new System.Drawing.Point(4, 22);
     this.tabPageEdges.Name = "tabPageEdges";
     this.tabPageEdges.Size = new System.Drawing.Size(350, 490);
     this.tabPageEdges.TabIndex = 1;
     this.tabPageEdges.Text = "  Edges  ";
     //
     // groupBox6
     //
     this.groupBox6.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                             this.ShowROIcheckBox,
                                                                             this.UseROIWidthCheckBox,
                                                                             this.UseShadowsCheckBox,
                                                                             this.ShowRegionCheckBox,
                                                                             this.label6,
                                                                             this.LineWidthDown,
                                                                             this.label5,
                                                                             this.EdgeLengthUpDown,
                                                                             this.label4,
                                                                             this.label3,
                                                                             this.EdgeColorComboBox,
                                                                             this.RegionColorComboBox});
     this.groupBox6.Location = new System.Drawing.Point(8, 320);
     this.groupBox6.Name = "groupBox6";
     this.groupBox6.Size = new System.Drawing.Size(336, 160);
     this.groupBox6.TabIndex = 3;
     this.groupBox6.TabStop = false;
     this.groupBox6.Text = "Display Parameters";
     //
     // ShowROIcheckBox
     //
     this.ShowROIcheckBox.Location = new System.Drawing.Point(216, 128);
     this.ShowROIcheckBox.Name = "ShowROIcheckBox";
     this.ShowROIcheckBox.TabIndex = 11;
     this.ShowROIcheckBox.Text = "  Show ROIs";
     this.ShowROIcheckBox.CheckedChanged += new System.EventHandler(this.ShowROIcheckBox_CheckedChanged);
     //
     // UseROIWidthCheckBox
     //
     this.UseROIWidthCheckBox.Location = new System.Drawing.Point(216, 96);
     this.UseROIWidthCheckBox.Name = "UseROIWidthCheckBox";
     this.UseROIWidthCheckBox.TabIndex = 10;
     this.UseROIWidthCheckBox.Text = "Use ROI Width";
     this.UseROIWidthCheckBox.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     this.UseROIWidthCheckBox.CheckedChanged += new System.EventHandler(this.UseROIWidthCheckBox_CheckedChanged);
     //
     // UseShadowsCheckBox
     //
     this.UseShadowsCheckBox.Location = new System.Drawing.Point(216, 64);
     this.UseShadowsCheckBox.Name = "UseShadowsCheckBox";
     this.UseShadowsCheckBox.Size = new System.Drawing.Size(96, 24);
     this.UseShadowsCheckBox.TabIndex = 9;
     this.UseShadowsCheckBox.Text = "Use Shadows";
     this.UseShadowsCheckBox.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     this.UseShadowsCheckBox.CheckedChanged += new System.EventHandler(this.UseShadowsCheckBox_CheckedChanged);
     //
     // ShowRegionCheckBox
     //
     this.ShowRegionCheckBox.Location = new System.Drawing.Point(216, 32);
     this.ShowRegionCheckBox.Name = "ShowRegionCheckBox";
     this.ShowRegionCheckBox.Size = new System.Drawing.Size(96, 24);
     this.ShowRegionCheckBox.TabIndex = 8;
     this.ShowRegionCheckBox.Text = "Show Region";
     this.ShowRegionCheckBox.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     this.ShowRegionCheckBox.CheckedChanged += new System.EventHandler(this.ShowRegionCheckBox_CheckedChanged);
     //
     // label6
     //
     this.label6.Location = new System.Drawing.Point(8, 128);
     this.label6.Name = "label6";
     this.label6.Size = new System.Drawing.Size(72, 24);
     this.label6.TabIndex = 7;
     this.label6.Text = "Line Width";
     this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // LineWidthDown
     //
     this.LineWidthDown.Location = new System.Drawing.Point(88, 128);
     this.LineWidthDown.Maximum = new System.Decimal(new int[] {
                                                                   9,
                                                                   0,
                                                                   0,
                                                                   0});
     this.LineWidthDown.Minimum = new System.Decimal(new int[] {
                                                                   1,
                                                                   0,
                                                                   0,
                                                                   0});
     this.LineWidthDown.Name = "LineWidthDown";
     this.LineWidthDown.Size = new System.Drawing.Size(112, 20);
     this.LineWidthDown.TabIndex = 6;
     this.LineWidthDown.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
     this.LineWidthDown.Value = new System.Decimal(new int[] {
                                                                 1,
                                                                 0,
                                                                 0,
                                                                 0});
     this.LineWidthDown.ValueChanged += new System.EventHandler(this.LineWidthDown_ValueChanged);
     //
     // label5
     //
     this.label5.Location = new System.Drawing.Point(8, 96);
     this.label5.Name = "label5";
     this.label5.Size = new System.Drawing.Size(72, 24);
     this.label5.TabIndex = 5;
     this.label5.Text = "Edge Length";
     this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // EdgeLengthUpDown
     //
     this.EdgeLengthUpDown.Location = new System.Drawing.Point(88, 96);
     this.EdgeLengthUpDown.Minimum = new System.Decimal(new int[] {
                                                                      1,
                                                                      0,
                                                                      0,
                                                                      0});
     this.EdgeLengthUpDown.Name = "EdgeLengthUpDown";
     this.EdgeLengthUpDown.Size = new System.Drawing.Size(112, 20);
     this.EdgeLengthUpDown.TabIndex = 4;
     this.EdgeLengthUpDown.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
     this.EdgeLengthUpDown.Value = new System.Decimal(new int[] {
                                                                    1,
                                                                    0,
                                                                    0,
                                                                    0});
     this.EdgeLengthUpDown.ValueChanged += new System.EventHandler(this.EdgeLengthUpDown_ValueChanged);
     //
     // label4
     //
     this.label4.Location = new System.Drawing.Point(8, 64);
     this.label4.Name = "label4";
     this.label4.Size = new System.Drawing.Size(72, 24);
     this.label4.TabIndex = 3;
     this.label4.Text = "Edge Color";
     this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // label3
     //
     this.label3.Location = new System.Drawing.Point(8, 32);
     this.label3.Name = "label3";
     this.label3.Size = new System.Drawing.Size(72, 24);
     this.label3.TabIndex = 2;
     this.label3.Text = "Region Color";
     this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // EdgeColorComboBox
     //
     this.EdgeColorComboBox.Items.AddRange(new object[] {
                                                            "green",
                                                            "red",
                                                            "blue",
                                                            "black",
                                                            "white",
                                                            "yellow",
                                                            "magenta",
                                                            "cyan",
                                                            "gray"});
     this.EdgeColorComboBox.Location = new System.Drawing.Point(88, 64);
     this.EdgeColorComboBox.Name = "EdgeColorComboBox";
     this.EdgeColorComboBox.Size = new System.Drawing.Size(112, 21);
     this.EdgeColorComboBox.TabIndex = 1;
     this.EdgeColorComboBox.Text = "EdgeColor";
     this.EdgeColorComboBox.SelectedIndexChanged += new System.EventHandler(this.EdgeColorComboBox_SelectedIndexChanged);
     //
     // RegionColorComboBox
     //
     this.RegionColorComboBox.Items.AddRange(new object[] {
                                                              "green",
                                                              "red",
                                                              "blue",
                                                              "black",
                                                              "white",
                                                              "yellow",
                                                              "magenta",
                                                              "cyan",
                                                              "gray"});
     this.RegionColorComboBox.Location = new System.Drawing.Point(88, 32);
     this.RegionColorComboBox.Name = "RegionColorComboBox";
     this.RegionColorComboBox.Size = new System.Drawing.Size(112, 21);
     this.RegionColorComboBox.TabIndex = 0;
     this.RegionColorComboBox.Text = "RegionColor";
     this.RegionColorComboBox.SelectedIndexChanged += new System.EventHandler(this.RegionColorComboBox_SelectedIndexChanged);
     //
     // groupBox5
     //
     this.groupBox5.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                             this.label2,
                                                                             this.label1,
                                                                             this.PositionComboBox,
                                                                             this.TransitionComboBox,
                                                                             this.EdgeToPaircheckBox});
     this.groupBox5.Location = new System.Drawing.Point(8, 188);
     this.groupBox5.Name = "groupBox5";
     this.groupBox5.Size = new System.Drawing.Size(336, 120);
     this.groupBox5.TabIndex = 2;
     this.groupBox5.TabStop = false;
     this.groupBox5.Text = "Edge Selection";
     //
     // label2
     //
     this.label2.Location = new System.Drawing.Point(8, 88);
     this.label2.Name = "label2";
     this.label2.Size = new System.Drawing.Size(64, 24);
     this.label2.TabIndex = 5;
     this.label2.Text = "Position";
     this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // label1
     //
     this.label1.Location = new System.Drawing.Point(8, 56);
     this.label1.Name = "label1";
     this.label1.Size = new System.Drawing.Size(64, 24);
     this.label1.TabIndex = 4;
     this.label1.Text = "Transition";
     this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // PositionComboBox
     //
     this.PositionComboBox.Items.AddRange(new object[] {
                                                           "all",
                                                           "first",
                                                           "last"});
     this.PositionComboBox.Location = new System.Drawing.Point(88, 88);
     this.PositionComboBox.Name = "PositionComboBox";
     this.PositionComboBox.Size = new System.Drawing.Size(160, 21);
     this.PositionComboBox.TabIndex = 3;
     this.PositionComboBox.Text = "Position";
     this.PositionComboBox.SelectedIndexChanged += new System.EventHandler(this.PositionComboBox_SelectedIndexChanged);
     //
     // TransitionComboBox
     //
     this.TransitionComboBox.Items.AddRange(new object[] {
                                                             "all",
                                                             "positive",
                                                             "negative"});
     this.TransitionComboBox.Location = new System.Drawing.Point(88, 56);
     this.TransitionComboBox.Name = "TransitionComboBox";
     this.TransitionComboBox.Size = new System.Drawing.Size(160, 21);
     this.TransitionComboBox.TabIndex = 2;
     this.TransitionComboBox.Text = "Transition";
     this.TransitionComboBox.SelectedIndexChanged += new System.EventHandler(this.TransitionComboBox_SelectedIndexChanged);
     //
     // EdgeToPaircheckBox
     //
     this.EdgeToPaircheckBox.Location = new System.Drawing.Point(88, 24);
     this.EdgeToPaircheckBox.Name = "EdgeToPaircheckBox";
     this.EdgeToPaircheckBox.Size = new System.Drawing.Size(144, 24);
     this.EdgeToPaircheckBox.TabIndex = 1;
     this.EdgeToPaircheckBox.Text = "Group Edges to Pairs";
     this.EdgeToPaircheckBox.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     this.EdgeToPaircheckBox.CheckedChanged += new System.EventHandler(this.EdgeToPaircheckBox_CheckedChanged);
     //
     // groupBox4
     //
     this.groupBox4.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                             this.ResetROIWidthButton,
                                                                             this.ResetSmoothingButton,
                                                                             this.ResetMinEdgAmplButton,
                                                                             this.ROIWidthTrackBar,
                                                                             this.SmoothingTrackBar,
                                                                             this.MinEdgAmplTrackBar,
                                                                             this.label10,
                                                                             this.label9,
                                                                             this.label8,
                                                                             this.label7,
                                                                             this.MinEdgAmplUpDown,
                                                                             this.SmoothingUpDown,
                                                                             this.InterpolationComboBox,
                                                                             this.ROIWidthUpDown});
     this.groupBox4.Location = new System.Drawing.Point(8, 16);
     this.groupBox4.Name = "groupBox4";
     this.groupBox4.Size = new System.Drawing.Size(336, 160);
     this.groupBox4.TabIndex = 1;
     this.groupBox4.TabStop = false;
     this.groupBox4.Text = "Edge Extraction";
     //
     // ResetROIWidthButton
     //
     this.ResetROIWidthButton.Location = new System.Drawing.Point(280, 88);
     this.ResetROIWidthButton.Name = "ResetROIWidthButton";
     this.ResetROIWidthButton.Size = new System.Drawing.Size(48, 24);
     this.ResetROIWidthButton.TabIndex = 14;
     this.ResetROIWidthButton.Text = "Reset";
     this.ResetROIWidthButton.Click += new System.EventHandler(this.ResetROIWidthButton_Click);
     //
     // ResetSmoothingButton
     //
     this.ResetSmoothingButton.Location = new System.Drawing.Point(280, 56);
     this.ResetSmoothingButton.Name = "ResetSmoothingButton";
     this.ResetSmoothingButton.Size = new System.Drawing.Size(48, 24);
     this.ResetSmoothingButton.TabIndex = 13;
     this.ResetSmoothingButton.Text = "Reset";
     this.ResetSmoothingButton.Click += new System.EventHandler(this.ResetSmoothingButton_Click);
     //
     // ResetMinEdgAmplButton
     //
     this.ResetMinEdgAmplButton.Location = new System.Drawing.Point(280, 24);
     this.ResetMinEdgAmplButton.Name = "ResetMinEdgAmplButton";
     this.ResetMinEdgAmplButton.Size = new System.Drawing.Size(48, 24);
     this.ResetMinEdgAmplButton.TabIndex = 12;
     this.ResetMinEdgAmplButton.Text = "Reset";
     this.ResetMinEdgAmplButton.Click += new System.EventHandler(this.ResetMinEdgAmplButton_Click);
     //
     // ROIWidthTrackBar
     //
     this.ROIWidthTrackBar.Location = new System.Drawing.Point(136, 86);
     this.ROIWidthTrackBar.Maximum = 255;
     this.ROIWidthTrackBar.Minimum = 1;
     this.ROIWidthTrackBar.Name = "ROIWidthTrackBar";
     this.ROIWidthTrackBar.Size = new System.Drawing.Size(144, 42);
     this.ROIWidthTrackBar.TabIndex = 11;
     this.ROIWidthTrackBar.TickFrequency = 10;
     this.ROIWidthTrackBar.TickStyle = System.Windows.Forms.TickStyle.None;
     this.ROIWidthTrackBar.Value = 1;
     this.ROIWidthTrackBar.Scroll += new System.EventHandler(this.ROIWidthTrackBar_Scroll);
     //
     // SmoothingTrackBar
     //
     this.SmoothingTrackBar.Location = new System.Drawing.Point(136, 54);
     this.SmoothingTrackBar.Maximum = 250;
     this.SmoothingTrackBar.Minimum = 4;
     this.SmoothingTrackBar.Name = "SmoothingTrackBar";
     this.SmoothingTrackBar.Size = new System.Drawing.Size(144, 42);
     this.SmoothingTrackBar.TabIndex = 10;
     this.SmoothingTrackBar.TickFrequency = 10;
     this.SmoothingTrackBar.TickStyle = System.Windows.Forms.TickStyle.None;
     this.SmoothingTrackBar.Value = 4;
     this.SmoothingTrackBar.Scroll += new System.EventHandler(this.SmoothingTrackBar_Scroll);
     //
     // MinEdgAmplTrackBar
     //
     this.MinEdgAmplTrackBar.Location = new System.Drawing.Point(136, 20);
     this.MinEdgAmplTrackBar.Maximum = 255;
     this.MinEdgAmplTrackBar.Minimum = 1;
     this.MinEdgAmplTrackBar.Name = "MinEdgAmplTrackBar";
     this.MinEdgAmplTrackBar.Size = new System.Drawing.Size(144, 42);
     this.MinEdgAmplTrackBar.TabIndex = 9;
     this.MinEdgAmplTrackBar.TickFrequency = 10;
     this.MinEdgAmplTrackBar.TickStyle = System.Windows.Forms.TickStyle.None;
     this.MinEdgAmplTrackBar.Value = 1;
     this.MinEdgAmplTrackBar.Scroll += new System.EventHandler(this.MinEdgAmplTrackBar_Scroll);
     //
     // label10
     //
     this.label10.Location = new System.Drawing.Point(8, 88);
     this.label10.Name = "label10";
     this.label10.Size = new System.Drawing.Size(80, 24);
     this.label10.TabIndex = 8;
     this.label10.Text = "ROI Width";
     this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // label9
     //
     this.label9.Location = new System.Drawing.Point(8, 56);
     this.label9.Name = "label9";
     this.label9.Size = new System.Drawing.Size(80, 24);
     this.label9.TabIndex = 7;
     this.label9.Text = "Smoothing*10";
     this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // label8
     //
     this.label8.Location = new System.Drawing.Point(6, 119);
     this.label8.Name = "label8";
     this.label8.Size = new System.Drawing.Size(72, 37);
     this.label8.TabIndex = 6;
     this.label8.Text = "Interpolation Method";
     this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // label7
     //
     this.label7.Location = new System.Drawing.Point(8, 24);
     this.label7.Name = "label7";
     this.label7.Size = new System.Drawing.Size(80, 24);
     this.label7.TabIndex = 5;
     this.label7.Text = "Min.EdgeAmpl";
     this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // MinEdgAmplUpDown
     //
     this.MinEdgAmplUpDown.Location = new System.Drawing.Point(88, 24);
     this.MinEdgAmplUpDown.Maximum = new System.Decimal(new int[] {
                                                                      255,
                                                                      0,
                                                                      0,
                                                                      0});
     this.MinEdgAmplUpDown.Minimum = new System.Decimal(new int[] {
                                                                      1,
                                                                      0,
                                                                      0,
                                                                      0});
     this.MinEdgAmplUpDown.Name = "MinEdgAmplUpDown";
     this.MinEdgAmplUpDown.Size = new System.Drawing.Size(48, 20);
     this.MinEdgAmplUpDown.TabIndex = 3;
     this.MinEdgAmplUpDown.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
     this.MinEdgAmplUpDown.Value = new System.Decimal(new int[] {
                                                                    1,
                                                                    0,
                                                                    0,
                                                                    0});
     this.MinEdgAmplUpDown.ValueChanged += new System.EventHandler(this.MinEdgAmplUpDown_ValueChanged);
     //
     // SmoothingUpDown
     //
     this.SmoothingUpDown.Location = new System.Drawing.Point(88, 56);
     this.SmoothingUpDown.Maximum = new System.Decimal(new int[] {
                                                                     250,
                                                                     0,
                                                                     0,
                                                                     0});
     this.SmoothingUpDown.Minimum = new System.Decimal(new int[] {
                                                                     4,
                                                                     0,
                                                                     0,
                                                                     0});
     this.SmoothingUpDown.Name = "SmoothingUpDown";
     this.SmoothingUpDown.Size = new System.Drawing.Size(48, 20);
     this.SmoothingUpDown.TabIndex = 2;
     this.SmoothingUpDown.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
     this.SmoothingUpDown.Value = new System.Decimal(new int[] {
                                                                   4,
                                                                   0,
                                                                   0,
                                                                   0});
     this.SmoothingUpDown.ValueChanged += new System.EventHandler(this.SmoothingUpDown_ValueChanged);
     //
     // InterpolationComboBox
     //
     this.InterpolationComboBox.Items.AddRange(new object[] {
                                                                "nearest_neighbor",
                                                                "bilinear",
                                                                "bicubic"});
     this.InterpolationComboBox.Location = new System.Drawing.Point(88, 128);
     this.InterpolationComboBox.Name = "InterpolationComboBox";
     this.InterpolationComboBox.Size = new System.Drawing.Size(160, 21);
     this.InterpolationComboBox.TabIndex = 1;
     this.InterpolationComboBox.Text = "Interpolation";
     this.InterpolationComboBox.SelectedIndexChanged += new System.EventHandler(this.InterpolationComboBox_SelectedIndexChanged);
     //
     // ROIWidthUpDown
     //
     this.ROIWidthUpDown.Location = new System.Drawing.Point(88, 88);
     this.ROIWidthUpDown.Maximum = new System.Decimal(new int[] {
                                                                    255,
                                                                    0,
                                                                    0,
                                                                    0});
     this.ROIWidthUpDown.Minimum = new System.Decimal(new int[] {
                                                                    1,
                                                                    0,
                                                                    0,
                                                                    0});
     this.ROIWidthUpDown.Name = "ROIWidthUpDown";
     this.ROIWidthUpDown.Size = new System.Drawing.Size(48, 20);
     this.ROIWidthUpDown.TabIndex = 0;
     this.ROIWidthUpDown.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
     this.ROIWidthUpDown.Value = new System.Decimal(new int[] {
                                                                  1,
                                                                  0,
                                                                  0,
                                                                  0});
     this.ROIWidthUpDown.ValueChanged += new System.EventHandler(this.ROIWidthUpDown_ValueChanged);
     //
     // tabPageResults
     //
     this.tabPageResults.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                                  this.label15,
                                                                                  this.ActiveROIListBox,
                                                                                  this.EdgeResultListView,
                                                                                  this.groupBox8,
                                                                                  this.groupBox7});
     this.tabPageResults.Location = new System.Drawing.Point(4, 22);
     this.tabPageResults.Name = "tabPageResults";
     this.tabPageResults.Size = new System.Drawing.Size(350, 490);
     this.tabPageResults.TabIndex = 2;
     this.tabPageResults.Text = "  Results  ";
     //
     // label15
     //
     this.label15.Location = new System.Drawing.Point(40, 192);
     this.label15.Name = "label15";
     this.label15.RightToLeft = System.Windows.Forms.RightToLeft.No;
     this.label15.Size = new System.Drawing.Size(72, 24);
     this.label15.TabIndex = 16;
     this.label15.Text = "Active ROI";
     this.label15.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // ActiveROIListBox
     //
     this.ActiveROIListBox.Location = new System.Drawing.Point(114, 192);
     this.ActiveROIListBox.Name = "ActiveROIListBox";
     this.ActiveROIListBox.Size = new System.Drawing.Size(230, 82);
     this.ActiveROIListBox.TabIndex = 15;
     this.ActiveROIListBox.SelectedIndexChanged += new System.EventHandler(this.ActiveROIListBox_SelectedIndexChanged);
     //
     // EdgeResultListView
     //
     this.EdgeResultListView.AutoArrange = false;
     this.EdgeResultListView.FullRowSelect = true;
     this.EdgeResultListView.GridLines = true;
     this.EdgeResultListView.Location = new System.Drawing.Point(10, 290);
     this.EdgeResultListView.Name = "EdgeResultListView";
     this.EdgeResultListView.Size = new System.Drawing.Size(334, 190);
     this.EdgeResultListView.TabIndex = 14;
     this.EdgeResultListView.View = System.Windows.Forms.View.Details;
     //
     // groupBox8
     //
     this.groupBox8.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                             this.UnitPanel,
                                                                             this.CalibPoseTextBox,
                                                                             this.CalibCamTextBox,
                                                                             this.LoadPoseButton,
                                                                             this.LoadCalibButton,
                                                                             this.TransWCoordCheckBox});
     this.groupBox8.Location = new System.Drawing.Point(8, 72);
     this.groupBox8.Name = "groupBox8";
     this.groupBox8.Size = new System.Drawing.Size(336, 108);
     this.groupBox8.TabIndex = 12;
     this.groupBox8.TabStop = false;
     this.groupBox8.Text = "Feature Processing";
     //
     // UnitPanel
     //
     this.UnitPanel.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                             this.label14,
                                                                             this.UnitComboBox});
     this.UnitPanel.Location = new System.Drawing.Point(216, 16);
     this.UnitPanel.Name = "UnitPanel";
     this.UnitPanel.Size = new System.Drawing.Size(112, 32);
     this.UnitPanel.TabIndex = 16;
     //
     // label14
     //
     this.label14.Location = new System.Drawing.Point(8, 8);
     this.label14.Name = "label14";
     this.label14.Size = new System.Drawing.Size(40, 24);
     this.label14.TabIndex = 4;
     this.label14.Text = "Unit";
     this.label14.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // UnitComboBox
     //
     this.UnitComboBox.Items.AddRange(new object[] {
                                                       "m",
                                                       "cm",
                                                       "mm",
                                                       "µm"});
     this.UnitComboBox.Location = new System.Drawing.Point(56, 8);
     this.UnitComboBox.Name = "UnitComboBox";
     this.UnitComboBox.Size = new System.Drawing.Size(56, 21);
     this.UnitComboBox.TabIndex = 3;
     this.UnitComboBox.Text = "unit";
     this.UnitComboBox.SelectedIndexChanged += new System.EventHandler(this.UnitComboBox_SelectedIndexChanged);
     //
     // CalibPoseTextBox
     //
     this.CalibPoseTextBox.Location = new System.Drawing.Point(120, 78);
     this.CalibPoseTextBox.Name = "CalibPoseTextBox";
     this.CalibPoseTextBox.ReadOnly = true;
     this.CalibPoseTextBox.Size = new System.Drawing.Size(208, 20);
     this.CalibPoseTextBox.TabIndex = 15;
     this.CalibPoseTextBox.Text = " *.dat";
     //
     // CalibCamTextBox
     //
     this.CalibCamTextBox.Location = new System.Drawing.Point(120, 56);
     this.CalibCamTextBox.Name = "CalibCamTextBox";
     this.CalibCamTextBox.ReadOnly = true;
     this.CalibCamTextBox.Size = new System.Drawing.Size(208, 20);
     this.CalibCamTextBox.TabIndex = 14;
     this.CalibCamTextBox.Text = " *.cal";
     //
     // LoadPoseButton
     //
     this.LoadPoseButton.Location = new System.Drawing.Point(16, 78);
     this.LoadPoseButton.Name = "LoadPoseButton";
     this.LoadPoseButton.Size = new System.Drawing.Size(88, 20);
     this.LoadPoseButton.TabIndex = 13;
     this.LoadPoseButton.Text = "  Load Pose";
     this.LoadPoseButton.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     this.LoadPoseButton.Click += new System.EventHandler(this.LoadCamParamButton_Click);
     //
     // LoadCalibButton
     //
     this.LoadCalibButton.Location = new System.Drawing.Point(16, 56);
     this.LoadCalibButton.Name = "LoadCalibButton";
     this.LoadCalibButton.Size = new System.Drawing.Size(88, 20);
     this.LoadCalibButton.TabIndex = 12;
     this.LoadCalibButton.Text = "  Load CamPar";
     this.LoadCalibButton.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     this.LoadCalibButton.Click += new System.EventHandler(this.LoadCamParamButton_Click);
     //
     // TransWCoordCheckBox
     //
     this.TransWCoordCheckBox.Location = new System.Drawing.Point(16, 24);
     this.TransWCoordCheckBox.Name = "TransWCoordCheckBox";
     this.TransWCoordCheckBox.Size = new System.Drawing.Size(195, 24);
     this.TransWCoordCheckBox.TabIndex = 0;
     this.TransWCoordCheckBox.Text = "Transform into World Coordinates";
     this.TransWCoordCheckBox.CheckedChanged += new System.EventHandler(this.TransWCoordCheckBox_CheckedChanged);
     //
     // groupBox7
     //
     this.groupBox7.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                             this.DistanceCheckBox,
                                                                             this.AmplitudeCheckBox,
                                                                             this.PairWidthCheckBox,
                                                                             this.PositionCheckBox});
     this.groupBox7.Location = new System.Drawing.Point(8, 16);
     this.groupBox7.Name = "groupBox7";
     this.groupBox7.Size = new System.Drawing.Size(336, 48);
     this.groupBox7.TabIndex = 11;
     this.groupBox7.TabStop = false;
     this.groupBox7.Text = "Feature Selection";
     //
     // DistanceCheckBox
     //
     this.DistanceCheckBox.Location = new System.Drawing.Point(172, 19);
     this.DistanceCheckBox.Name = "DistanceCheckBox";
     this.DistanceCheckBox.Size = new System.Drawing.Size(72, 24);
     this.DistanceCheckBox.TabIndex = 3;
     this.DistanceCheckBox.Text = "Distance";
     this.DistanceCheckBox.CheckedChanged += new System.EventHandler(this.DistanceCheckBox_CheckedChanged);
     //
     // AmplitudeCheckBox
     //
     this.AmplitudeCheckBox.Location = new System.Drawing.Point(90, 19);
     this.AmplitudeCheckBox.Name = "AmplitudeCheckBox";
     this.AmplitudeCheckBox.Size = new System.Drawing.Size(80, 24);
     this.AmplitudeCheckBox.TabIndex = 2;
     this.AmplitudeCheckBox.Text = "Amplitude";
     this.AmplitudeCheckBox.CheckedChanged += new System.EventHandler(this.AmplitudeCheckBox_CheckedChanged);
     //
     // PairWidthCheckBox
     //
     this.PairWidthCheckBox.Enabled = false;
     this.PairWidthCheckBox.Location = new System.Drawing.Point(250, 19);
     this.PairWidthCheckBox.Name = "PairWidthCheckBox";
     this.PairWidthCheckBox.Size = new System.Drawing.Size(80, 24);
     this.PairWidthCheckBox.TabIndex = 1;
     this.PairWidthCheckBox.Text = "Pair Width";
     this.PairWidthCheckBox.CheckedChanged += new System.EventHandler(this.PairWidthCheckBox_CheckedChanged);
     //
     // PositionCheckBox
     //
     this.PositionCheckBox.Location = new System.Drawing.Point(16, 19);
     this.PositionCheckBox.Name = "PositionCheckBox";
     this.PositionCheckBox.Size = new System.Drawing.Size(64, 24);
     this.PositionCheckBox.TabIndex = 0;
     this.PositionCheckBox.Text = "Position";
     this.PositionCheckBox.CheckedChanged += new System.EventHandler(this.PositionCheckBox_CheckedChanged);
     //
     // tabPageLineProfile
     //
     this.tabPageLineProfile.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                                      this.label20,
                                                                                      this.CSScaleComboBox,
                                                                                      this.panelAxis,
                                                                                      this.groupBox9});
     this.tabPageLineProfile.Location = new System.Drawing.Point(4, 22);
     this.tabPageLineProfile.Name = "tabPageLineProfile";
     this.tabPageLineProfile.Size = new System.Drawing.Size(350, 490);
     this.tabPageLineProfile.TabIndex = 3;
     this.tabPageLineProfile.Text = " LineProfile ";
     //
     // label20
     //
     this.label20.Location = new System.Drawing.Point(160, 40);
     this.label20.Name = "label20";
     this.label20.Size = new System.Drawing.Size(80, 24);
     this.label20.TabIndex = 6;
     this.label20.Text = "Y-axis scale:";
     this.label20.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // CSScaleComboBox
     //
     this.CSScaleComboBox.Items.AddRange(new object[] {
                                                          "Adaptive",
                                                          "Increasing",
                                                          "Fixed"});
     this.CSScaleComboBox.Location = new System.Drawing.Point(248, 40);
     this.CSScaleComboBox.Name = "CSScaleComboBox";
     this.CSScaleComboBox.Size = new System.Drawing.Size(96, 21);
     this.CSScaleComboBox.TabIndex = 5;
     this.CSScaleComboBox.Text = "Scale Y-Axis";
     this.CSScaleComboBox.SelectedIndexChanged += new System.EventHandler(this.CSScaleComboBox_SelectedIndexChanged);
     //
     // panelAxis
     //
     this.panelAxis.Location = new System.Drawing.Point(8, 88);
     this.panelAxis.Name = "panelAxis";
     this.panelAxis.Size = new System.Drawing.Size(336, 232);
     this.panelAxis.TabIndex = 4;
     //
     // groupBox9
     //
     this.groupBox9.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                             this.labelDeviation,
                                                                             this.labelMean,
                                                                             this.labelRange,
                                                                             this.labelPeak,
                                                                             this.label24,
                                                                             this.label25,
                                                                             this.labelRangeX,
                                                                             this.labelPeakX,
                                                                             this.label23,
                                                                             this.label22,
                                                                             this.label19,
                                                                             this.label18,
                                                                             this.label17,
                                                                             this.label16});
     this.groupBox9.Location = new System.Drawing.Point(8, 344);
     this.groupBox9.Name = "groupBox9";
     this.groupBox9.Size = new System.Drawing.Size(336, 112);
     this.groupBox9.TabIndex = 2;
     this.groupBox9.TabStop = false;
     this.groupBox9.Text = "Statistics";
     //
     // labelDeviation
     //
     this.labelDeviation.Location = new System.Drawing.Point(224, 88);
     this.labelDeviation.Name = "labelDeviation";
     this.labelDeviation.Size = new System.Drawing.Size(72, 16);
     this.labelDeviation.TabIndex = 18;
     this.labelDeviation.Text = "0";
     this.labelDeviation.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // labelMean
     //
     this.labelMean.Location = new System.Drawing.Point(224, 72);
     this.labelMean.Name = "labelMean";
     this.labelMean.Size = new System.Drawing.Size(72, 16);
     this.labelMean.TabIndex = 17;
     this.labelMean.Text = "0";
     this.labelMean.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // labelRange
     //
     this.labelRange.Location = new System.Drawing.Point(224, 56);
     this.labelRange.Name = "labelRange";
     this.labelRange.Size = new System.Drawing.Size(96, 16);
     this.labelRange.TabIndex = 15;
     this.labelRange.Text = "0 ... 0";
     this.labelRange.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // labelPeak
     //
     this.labelPeak.Location = new System.Drawing.Point(224, 40);
     this.labelPeak.Name = "labelPeak";
     this.labelPeak.Size = new System.Drawing.Size(72, 16);
     this.labelPeak.TabIndex = 14;
     this.labelPeak.Text = "0";
     this.labelPeak.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // label24
     //
     this.label24.Location = new System.Drawing.Point(128, 88);
     this.label24.Name = "label24";
     this.label24.Size = new System.Drawing.Size(72, 16);
     this.label24.TabIndex = 13;
     this.label24.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // label25
     //
     this.label25.Location = new System.Drawing.Point(128, 72);
     this.label25.Name = "label25";
     this.label25.Size = new System.Drawing.Size(72, 16);
     this.label25.TabIndex = 12;
     this.label25.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // labelRangeX
     //
     this.labelRangeX.Location = new System.Drawing.Point(128, 56);
     this.labelRangeX.Name = "labelRangeX";
     this.labelRangeX.Size = new System.Drawing.Size(72, 16);
     this.labelRangeX.TabIndex = 9;
     this.labelRangeX.Text = "0 ... 0";
     this.labelRangeX.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // labelPeakX
     //
     this.labelPeakX.Location = new System.Drawing.Point(128, 40);
     this.labelPeakX.Name = "labelPeakX";
     this.labelPeakX.Size = new System.Drawing.Size(72, 16);
     this.labelPeakX.TabIndex = 8;
     this.labelPeakX.Text = "0";
     this.labelPeakX.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // label23
     //
     this.label23.Location = new System.Drawing.Point(16, 88);
     this.label23.Name = "label23";
     this.label23.Size = new System.Drawing.Size(88, 16);
     this.label23.TabIndex = 7;
     this.label23.Text = "Deviation:";
     this.label23.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // label22
     //
     this.label22.Location = new System.Drawing.Point(16, 72);
     this.label22.Name = "label22";
     this.label22.Size = new System.Drawing.Size(88, 16);
     this.label22.TabIndex = 6;
     this.label22.Text = "Mean:";
     this.label22.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // label19
     //
     this.label19.Location = new System.Drawing.Point(16, 56);
     this.label19.Name = "label19";
     this.label19.Size = new System.Drawing.Size(88, 16);
     this.label19.TabIndex = 3;
     this.label19.Text = "Range:";
     this.label19.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // label18
     //
     this.label18.Location = new System.Drawing.Point(16, 40);
     this.label18.Name = "label18";
     this.label18.Size = new System.Drawing.Size(88, 16);
     this.label18.TabIndex = 2;
     this.label18.Text = "Peak:";
     this.label18.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // label17
     //
     this.label17.Location = new System.Drawing.Point(224, 16);
     this.label17.Name = "label17";
     this.label17.Size = new System.Drawing.Size(88, 16);
     this.label17.TabIndex = 1;
     this.label17.Text = "Gray Values";
     this.label17.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // label16
     //
     this.label16.Location = new System.Drawing.Point(128, 16);
     this.label16.Name = "label16";
     this.label16.Size = new System.Drawing.Size(88, 16);
     this.label16.TabIndex = 0;
     this.label16.Text = "x-Value";
     this.label16.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // groupBox2
     //
     this.groupBox2.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                             this.CircArcButton,
                                                                             this.LineButton,
                                                                             this.DeleteActRoiButton,
                                                                             this.ResetROIButton});
     this.groupBox2.Location = new System.Drawing.Point(8, 528);
     this.groupBox2.Name = "groupBox2";
     this.groupBox2.Size = new System.Drawing.Size(512, 48);
     this.groupBox2.TabIndex = 3;
     this.groupBox2.TabStop = false;
     this.groupBox2.Text = "ROIs";
     //
     // CircArcButton
     //
     this.CircArcButton.Location = new System.Drawing.Point(128, 16);
     this.CircArcButton.Name = "CircArcButton";
     this.CircArcButton.Size = new System.Drawing.Size(108, 24);
     this.CircArcButton.TabIndex = 10;
     this.CircArcButton.Text = "Create Circular Arc";
     this.CircArcButton.Click += new System.EventHandler(this.CircArcButton_Click);
     //
     // LineButton
     //
     this.LineButton.Location = new System.Drawing.Point(16, 16);
     this.LineButton.Name = "LineButton";
     this.LineButton.Size = new System.Drawing.Size(100, 24);
     this.LineButton.TabIndex = 1;
     this.LineButton.Text = "Create Line";
     this.LineButton.Click += new System.EventHandler(this.LineButton_Click);
     //
     // DeleteActRoiButton
     //
     this.DeleteActRoiButton.Location = new System.Drawing.Point(304, 16);
     this.DeleteActRoiButton.Name = "DeleteActRoiButton";
     this.DeleteActRoiButton.Size = new System.Drawing.Size(96, 24);
     this.DeleteActRoiButton.TabIndex = 2;
     this.DeleteActRoiButton.Text = "Delete";
     this.DeleteActRoiButton.Click += new System.EventHandler(this.DeleteActRoiButton_Click);
     //
     // ResetROIButton
     //
     this.ResetROIButton.Location = new System.Drawing.Point(408, 16);
     this.ResetROIButton.Name = "ResetROIButton";
     this.ResetROIButton.Size = new System.Drawing.Size(88, 24);
     this.ResetROIButton.TabIndex = 3;
     this.ResetROIButton.Text = "Delete All";
     this.ResetROIButton.Click += new System.EventHandler(this.ResetROIButton_Click);
     //
     // LoadImgButton
     //
     this.LoadImgButton.Location = new System.Drawing.Point(56, 12);
     this.LoadImgButton.Name = "LoadImgButton";
     this.LoadImgButton.Size = new System.Drawing.Size(112, 26);
     this.LoadImgButton.TabIndex = 4;
     this.LoadImgButton.Text = "Load ...";
     this.LoadImgButton.Click += new System.EventHandler(this.LoadImgButton_Click);
     //
     // groupBox1
     //
     this.groupBox1.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                             this.ResetViewButton,
                                                                             this.MagnifyButton,
                                                                             this.ZoomButton,
                                                                             this.MoveButton,
                                                                             this.NoneButton});
     this.groupBox1.Location = new System.Drawing.Point(199, 0);
     this.groupBox1.Name = "groupBox1";
     this.groupBox1.Size = new System.Drawing.Size(441, 45);
     this.groupBox1.TabIndex = 8;
     this.groupBox1.TabStop = false;
     this.groupBox1.Text = "View Interaction";
     //
     // ResetViewButton
     //
     this.ResetViewButton.Location = new System.Drawing.Point(336, 12);
     this.ResetViewButton.Name = "ResetViewButton";
     this.ResetViewButton.Size = new System.Drawing.Size(92, 26);
     this.ResetViewButton.TabIndex = 10;
     this.ResetViewButton.Text = "Reset ";
     this.ResetViewButton.Click += new System.EventHandler(this.ResetViewButton_Click);
     //
     // MagnifyButton
     //
     this.MagnifyButton.Location = new System.Drawing.Point(248, 19);
     this.MagnifyButton.Name = "MagnifyButton";
     this.MagnifyButton.Size = new System.Drawing.Size(64, 16);
     this.MagnifyButton.TabIndex = 4;
     this.MagnifyButton.Text = "magnify";
     this.MagnifyButton.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     this.MagnifyButton.CheckedChanged += new System.EventHandler(this.MagnifyButton_CheckedChanged);
     //
     // ZoomButton
     //
     this.ZoomButton.Location = new System.Drawing.Point(182, 19);
     this.ZoomButton.Name = "ZoomButton";
     this.ZoomButton.Size = new System.Drawing.Size(56, 16);
     this.ZoomButton.TabIndex = 2;
     this.ZoomButton.Text = "zoom";
     this.ZoomButton.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     this.ZoomButton.CheckedChanged += new System.EventHandler(this.ZoomButton_CheckedChanged);
     //
     // MoveButton
     //
     this.MoveButton.Location = new System.Drawing.Point(104, 19);
     this.MoveButton.Name = "MoveButton";
     this.MoveButton.Size = new System.Drawing.Size(56, 16);
     this.MoveButton.TabIndex = 1;
     this.MoveButton.Text = "move";
     this.MoveButton.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     this.MoveButton.CheckedChanged += new System.EventHandler(this.MoveButton_CheckedChanged);
     //
     // NoneButton
     //
     this.NoneButton.Checked = true;
     this.NoneButton.Location = new System.Drawing.Point(24, 19);
     this.NoneButton.Name = "NoneButton";
     this.NoneButton.Size = new System.Drawing.Size(56, 16);
     this.NoneButton.TabIndex = 0;
     this.NoneButton.TabStop = true;
     this.NoneButton.Text = "none";
     this.NoneButton.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     this.NoneButton.CheckedChanged += new System.EventHandler(this.NoneButton_CheckedChanged);
     //
     // openImageFileDialog
     //
     this.openImageFileDialog.Filter = "png (*.png)|*.png|tiff (*.tif)|*.tif|jpeg (*.jpg)| *.jpg|all files (*.*)|*.*";
     this.openImageFileDialog.RestoreDirectory = true;
     //
     // StatusLabel
     //
     this.StatusLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
     this.StatusLabel.Location = new System.Drawing.Point(652, 536);
     this.StatusLabel.Name = "StatusLabel";
     this.StatusLabel.Size = new System.Drawing.Size(356, 32);
     this.StatusLabel.TabIndex = 9;
     this.StatusLabel.Text = "Status";
     this.StatusLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // openCamparFileDialog
     //
     this.openCamparFileDialog.Filter = "camera parameters (*.cal)|*.cal|camera parameters (*.dat)|*dat|all files (*.*)|*." +
         "*";
     //
     // groupBox3
     //
     this.groupBox3.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                             this.LoadImgButton});
     this.groupBox3.Location = new System.Drawing.Point(8, 0);
     this.groupBox3.Name = "groupBox3";
     this.groupBox3.Size = new System.Drawing.Size(176, 45);
     this.groupBox3.TabIndex = 11;
     this.groupBox3.TabStop = false;
     this.groupBox3.Text = "Image";
     //
     // MeasureForm
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize = new System.Drawing.Size(1014, 583);
     this.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                   this.groupBox3,
                                                                   this.StatusLabel,
                                                                   this.groupBox1,
                                                                   this.groupBox2,
                                                                   this.tabControl,
                                                                   this.viewPort});
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
     this.MaximizeBox = false;
     this.Name = "MeasureForm";
     this.Text = "Measure Assistant";
     this.Load += new System.EventHandler(this.MeasureForm_Load);
     this.tabControl.ResumeLayout(false);
     this.tabPageEdges.ResumeLayout(false);
     this.groupBox6.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.LineWidthDown)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.EdgeLengthUpDown)).EndInit();
     this.groupBox5.ResumeLayout(false);
     this.groupBox4.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.ROIWidthTrackBar)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.SmoothingTrackBar)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.MinEdgAmplTrackBar)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.MinEdgAmplUpDown)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.SmoothingUpDown)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.ROIWidthUpDown)).EndInit();
     this.tabPageResults.ResumeLayout(false);
     this.groupBox8.ResumeLayout(false);
     this.UnitPanel.ResumeLayout(false);
     this.groupBox7.ResumeLayout(false);
     this.tabPageLineProfile.ResumeLayout(false);
     this.groupBox9.ResumeLayout(false);
     this.groupBox2.ResumeLayout(false);
     this.groupBox1.ResumeLayout(false);
     this.groupBox3.ResumeLayout(false);
     this.ResumeLayout(false);
 }
 /// <summary>
 /// <para>*****************</para>
 /// Watch Coordniate (座標)
 /// <para>*****************</para>
 /// </summary>
 /// <param name="viewPort"></param>
 private void setWatchCoordinate(HWindowControl viewPort)
 {
     if (viewPort != null)
     {
         viewPort.HMouseMove += (sender, e) =>
         {
             var coordinateText = String.Format("{0}, {1}", Math.Round(e.X, 2), Math.Round(e.Y, 2));
             SetStatus(SystemStatusType.Coordinate, coordinateText);
         };
     }
 }
        /// <summary>
        /// <para>******************</para>
        /// Watch Gray Level (灰階
        /// <para>******************</para>
        /// </summary>
        /// <param name="viewPort"></param>
        private void setWatchGrayLevel(HWindowControl viewPort, HWndCtrl viewController)
        {
            if (viewPort != null)
            {
                viewPort.HMouseMove += (sender, e) =>
                {
                    if (viewController == null) return;
                    var currImage = viewController.GetLastHImage();
                    if (currImage != null)
                    {
                        var row = (int)Math.Round(e.Y, 0);
                        var col = (int)Math.Round(e.X, 0);
                        try
                        {
                            HTuple width, height, grayval;
                            currImage.GetImageSize(out width, out height);
                            var mouseInImage = (row <= height.I && col <= width.I && row >= 0 && col >= 0);
                            if (mouseInImage)
                            {
                                HOperatorSet.GetGrayval(currImage, row, col, out grayval);
                                var dispText = grayval.I.ToString();
                                SetStatus(SystemStatusType.GrayLevel, dispText);
                            }
                        }
                        catch (Exception ex)
                        {
                            AddMessage(ex.Message);
                        }
                    }

                };
            }
        }
 /********************************************************************/
 /*  Required method for Designer support - do not modify
     the contents of this method with the code editor.
 /********************************************************************/
 private void InitializeComponent()
 {
     this.viewPort = new HalconDotNet.HWindowControl();
     this.groupBox1 = new System.Windows.Forms.GroupBox();
     this.CircArcButton = new System.Windows.Forms.Button();
     this.LineButton = new System.Windows.Forms.Button();
     this.CircleButton = new System.Windows.Forms.Button();
     this.DelActROIButton = new System.Windows.Forms.Button();
     this.Rect2Button = new System.Windows.Forms.Button();
     this.Rect1Button = new System.Windows.Forms.Button();
     this.ResetButton = new System.Windows.Forms.Button();
     this.groupBox2 = new System.Windows.Forms.GroupBox();
     this.radioButtonNone = new System.Windows.Forms.RadioButton();
     this.radioButtonZoom = new System.Windows.Forms.RadioButton();
     this.radioButtonMove = new System.Windows.Forms.RadioButton();
     this.ExitApplButton = new System.Windows.Forms.Button();
     this.groupBox1.SuspendLayout();
     this.groupBox2.SuspendLayout();
     this.SuspendLayout();
     //
     // viewPort
     //
     this.viewPort.BackColor = System.Drawing.Color.Black;
     this.viewPort.BorderColor = System.Drawing.Color.Black;
     this.viewPort.ImagePart = new System.Drawing.Rectangle(0, 0, 640, 480);
     this.viewPort.Location = new System.Drawing.Point(40, 40);
     this.viewPort.Name = "viewPort";
     this.viewPort.Size = new System.Drawing.Size(640, 480);
     this.viewPort.TabIndex = 0;
     this.viewPort.WindowSize = new System.Drawing.Size(640, 480);
     //
     // groupBox1
     //
     this.groupBox1.BackColor = System.Drawing.SystemColors.Control;
     this.groupBox1.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                             this.CircArcButton,
                                                                             this.LineButton,
                                                                             this.CircleButton,
                                                                             this.DelActROIButton,
                                                                             this.Rect2Button,
                                                                             this.Rect1Button});
     this.groupBox1.Location = new System.Drawing.Point(720, 184);
     this.groupBox1.Name = "groupBox1";
     this.groupBox1.Size = new System.Drawing.Size(128, 240);
     this.groupBox1.TabIndex = 1;
     this.groupBox1.TabStop = false;
     this.groupBox1.Text = "Create ROI";
     //
     // CircArcButton
     //
     this.CircArcButton.Location = new System.Drawing.Point(24, 120);
     this.CircArcButton.Name = "CircArcButton";
     this.CircArcButton.Size = new System.Drawing.Size(80, 32);
     this.CircArcButton.TabIndex = 10;
     this.CircArcButton.Text = "Circular Arc";
     this.CircArcButton.Click += new System.EventHandler(this.CircArcButton_Click);
     //
     // LineButton
     //
     this.LineButton.Location = new System.Drawing.Point(24, 152);
     this.LineButton.Name = "LineButton";
     this.LineButton.Size = new System.Drawing.Size(80, 32);
     this.LineButton.TabIndex = 9;
     this.LineButton.Text = "Line";
     this.LineButton.Click += new System.EventHandler(this.LineButton_Click);
     //
     // CircleButton
     //
     this.CircleButton.Location = new System.Drawing.Point(24, 88);
     this.CircleButton.Name = "CircleButton";
     this.CircleButton.Size = new System.Drawing.Size(80, 32);
     this.CircleButton.TabIndex = 8;
     this.CircleButton.Text = "Circle";
     this.CircleButton.Click += new System.EventHandler(this.CircleButton_Click);
     //
     // DelActROIButton
     //
     this.DelActROIButton.Location = new System.Drawing.Point(24, 200);
     this.DelActROIButton.Name = "DelActROIButton";
     this.DelActROIButton.Size = new System.Drawing.Size(80, 32);
     this.DelActROIButton.TabIndex = 7;
     this.DelActROIButton.Text = "Delete Active ROI";
     this.DelActROIButton.Click += new System.EventHandler(this.DelActROIButton_Click);
     //
     // Rect2Button
     //
     this.Rect2Button.Location = new System.Drawing.Point(24, 56);
     this.Rect2Button.Name = "Rect2Button";
     this.Rect2Button.Size = new System.Drawing.Size(80, 32);
     this.Rect2Button.TabIndex = 1;
     this.Rect2Button.Text = "Rectangle2";
     this.Rect2Button.Click += new System.EventHandler(this.Rect2Button_Click);
     //
     // Rect1Button
     //
     this.Rect1Button.Location = new System.Drawing.Point(24, 24);
     this.Rect1Button.Name = "Rect1Button";
     this.Rect1Button.Size = new System.Drawing.Size(80, 32);
     this.Rect1Button.TabIndex = 0;
     this.Rect1Button.Text = "Rectangle1";
     this.Rect1Button.Click += new System.EventHandler(this.Rect1Button_Click);
     //
     // ResetButton
     //
     this.ResetButton.Location = new System.Drawing.Point(744, 440);
     this.ResetButton.Name = "ResetButton";
     this.ResetButton.Size = new System.Drawing.Size(80, 40);
     this.ResetButton.TabIndex = 6;
     this.ResetButton.Text = "Reset All";
     this.ResetButton.Click += new System.EventHandler(this.resetButton_Click);
     //
     // groupBox2
     //
     this.groupBox2.BackColor = System.Drawing.SystemColors.Control;
     this.groupBox2.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                             this.radioButtonNone,
                                                                             this.radioButtonZoom,
                                                                             this.radioButtonMove});
     this.groupBox2.Location = new System.Drawing.Point(720, 40);
     this.groupBox2.Name = "groupBox2";
     this.groupBox2.Size = new System.Drawing.Size(128, 136);
     this.groupBox2.TabIndex = 5;
     this.groupBox2.TabStop = false;
     this.groupBox2.Text = "View Interaction";
     //
     // radioButtonNone
     //
     this.radioButtonNone.Checked = true;
     this.radioButtonNone.Location = new System.Drawing.Point(24, 104);
     this.radioButtonNone.Name = "radioButtonNone";
     this.radioButtonNone.Size = new System.Drawing.Size(80, 16);
     this.radioButtonNone.TabIndex = 2;
     this.radioButtonNone.TabStop = true;
     this.radioButtonNone.Text = "none";
     this.radioButtonNone.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     this.radioButtonNone.CheckedChanged += new System.EventHandler(this.noneButton_Click);
     //
     // radioButtonZoom
     //
     this.radioButtonZoom.Location = new System.Drawing.Point(24, 64);
     this.radioButtonZoom.Name = "radioButtonZoom";
     this.radioButtonZoom.Size = new System.Drawing.Size(80, 24);
     this.radioButtonZoom.TabIndex = 1;
     this.radioButtonZoom.Text = "zoom";
     this.radioButtonZoom.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     this.radioButtonZoom.CheckedChanged += new System.EventHandler(this.zoomButton_Click);
     //
     // radioButtonMove
     //
     this.radioButtonMove.Location = new System.Drawing.Point(24, 24);
     this.radioButtonMove.Name = "radioButtonMove";
     this.radioButtonMove.Size = new System.Drawing.Size(80, 24);
     this.radioButtonMove.TabIndex = 0;
     this.radioButtonMove.Text = "move";
     this.radioButtonMove.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     this.radioButtonMove.CheckedChanged += new System.EventHandler(this.moveButton_Click);
     //
     // ExitApplButton
     //
     this.ExitApplButton.Location = new System.Drawing.Point(744, 480);
     this.ExitApplButton.Name = "ExitApplButton";
     this.ExitApplButton.Size = new System.Drawing.Size(80, 40);
     this.ExitApplButton.TabIndex = 6;
     this.ExitApplButton.Text = "Exit Application";
     this.ExitApplButton.Click += new System.EventHandler(this.ExitApplButton_Click);
     //
     // InteractiveForm
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize = new System.Drawing.Size(872, 573);
     this.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                   this.ExitApplButton,
                                                                   this.groupBox2,
                                                                   this.groupBox1,
                                                                   this.viewPort,
                                                                   this.ResetButton});
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
     this.MaximizeBox = false;
     this.Name = "InteractiveForm";
     this.Text = "Interactive ROI";
     this.Load += new System.EventHandler(this.InteractiveForm_Load);
     this.groupBox1.ResumeLayout(false);
     this.groupBox2.ResumeLayout(false);
     this.ResumeLayout(false);
 }
Example #36
0
        /// <summary> 
        /// Initializes the image dimension, mouse delegation, and the 
        /// graphical context setup of the instance.
        /// </summary>
        /// <param name="view"> HALCON window </param>
        public HWndCtrl(HWindowControl view)
        {
            _viewPort = view;
            _stateView = MODE_VIEW_NONE;
            windowWidth = _viewPort.Size.Width;
            windowHeight = _viewPort.Size.Height;

            zoomWndFactor = (double)imageWidth / _viewPort.Width;
            zoomAddOn = Math.Pow(0.9, 5);
            zoomWndSize = 150;

            /*default*/
            CompRangeX = new int[] { 0, 100 };
            CompRangeY = new int[] { 0, 100 };

            prevCompX = prevCompY = 0;

            _dispROI = MODE_INCLUDE_ROI;//1;

            _viewPort.HMouseUp += new HalconDotNet.HMouseEventHandler(this.mouseUp);
            _viewPort.HMouseDown += new HalconDotNet.HMouseEventHandler(this.mouseDown);
            _viewPort.HMouseMove += new HalconDotNet.HMouseEventHandler(this.mouseMoved);

            addInfoDelegate = new FuncDelegate(dummyV);
            NotifyIconObserver = new IconicDelegate(dummy);

            // graphical stack
            HObjList = new ArrayList(20);
            mGC = new GraphicsContext();
            mGC.gcNotification = new GCDelegate(exceptionGC);
        }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.viewPort = new HalconDotNet.HWindowControl();
     this.groupBoxViewFunction = new System.Windows.Forms.GroupBox();
     this.NoneButton = new System.Windows.Forms.RadioButton();
     this.ZoomButton = new System.Windows.Forms.RadioButton();
     this.MoveButton = new System.Windows.Forms.RadioButton();
     this.IconiclistBox = new System.Windows.Forms.ListBox();
     this.ColorComboBox = new System.Windows.Forms.ComboBox();
     this.LineWidthComboBox = new System.Windows.Forms.ComboBox();
     this.DrawModeComboBox = new System.Windows.Forms.ComboBox();
     this.ResetButton = new System.Windows.Forms.Button();
     this.ClearWindButton = new System.Windows.Forms.Button();
     this.IconicDisplayStack = new System.Windows.Forms.ListBox();
     this.label1 = new System.Windows.Forms.Label();
     this.label2 = new System.Windows.Forms.Label();
     this.label3 = new System.Windows.Forms.Label();
     this.label4 = new System.Windows.Forms.Label();
     this.StackCountLabel = new System.Windows.Forms.Label();
     this.label5 = new System.Windows.Forms.Label();
     this.label6 = new System.Windows.Forms.Label();
     this.groupBoxViewFunction.SuspendLayout();
     this.SuspendLayout();
     //
     // viewPort
     //
     this.viewPort.BackColor = System.Drawing.Color.Black;
     this.viewPort.BorderColor = System.Drawing.Color.Black;
     this.viewPort.ImagePart = new System.Drawing.Rectangle(0, 0, 640, 480);
     this.viewPort.Location = new System.Drawing.Point(24, 80);
     this.viewPort.Name = "viewPort";
     this.viewPort.Size = new System.Drawing.Size(616, 424);
     this.viewPort.TabIndex = 0;
     this.viewPort.WindowSize = new System.Drawing.Size(616, 424);
     //
     // groupBoxViewFunction
     //
     this.groupBoxViewFunction.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                                        this.NoneButton,
                                                                                        this.ZoomButton,
                                                                                        this.MoveButton});
     this.groupBoxViewFunction.Location = new System.Drawing.Point(376, 16);
     this.groupBoxViewFunction.Name = "groupBoxViewFunction";
     this.groupBoxViewFunction.Size = new System.Drawing.Size(264, 48);
     this.groupBoxViewFunction.TabIndex = 1;
     this.groupBoxViewFunction.TabStop = false;
     this.groupBoxViewFunction.Text = "View Interaction";
     //
     // NoneButton
     //
     this.NoneButton.Checked = true;
     this.NoneButton.Location = new System.Drawing.Point(24, 16);
     this.NoneButton.Name = "NoneButton";
     this.NoneButton.Size = new System.Drawing.Size(72, 24);
     this.NoneButton.TabIndex = 2;
     this.NoneButton.TabStop = true;
     this.NoneButton.Text = "none";
     this.NoneButton.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     this.NoneButton.CheckedChanged += new System.EventHandler(this.NoneButton_CheckedChanged);
     //
     // ZoomButton
     //
     this.ZoomButton.Location = new System.Drawing.Point(176, 16);
     this.ZoomButton.Name = "ZoomButton";
     this.ZoomButton.Size = new System.Drawing.Size(72, 24);
     this.ZoomButton.TabIndex = 1;
     this.ZoomButton.Text = "zoom";
     this.ZoomButton.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     this.ZoomButton.CheckedChanged += new System.EventHandler(this.ZoomButton_CheckedChanged);
     //
     // MoveButton
     //
     this.MoveButton.Location = new System.Drawing.Point(104, 16);
     this.MoveButton.Name = "MoveButton";
     this.MoveButton.Size = new System.Drawing.Size(64, 24);
     this.MoveButton.TabIndex = 0;
     this.MoveButton.Text = "move ";
     this.MoveButton.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     this.MoveButton.CheckedChanged += new System.EventHandler(this.MoveButton_CheckedChanged);
     //
     // IconiclistBox
     //
     this.IconiclistBox.Enabled = false;
     this.IconiclistBox.Location = new System.Drawing.Point(192, 544);
     this.IconiclistBox.Name = "IconiclistBox";
     this.IconiclistBox.Size = new System.Drawing.Size(144, 95);
     this.IconiclistBox.TabIndex = 2;
     this.IconiclistBox.DoubleClick += new System.EventHandler(this.IconiclistBox_DoubleClick);
     //
     // ColorComboBox
     //
     this.ColorComboBox.Items.AddRange(new object[] {
                                                        "red",
                                                        "yellow",
                                                        "green",
                                                        "blue",
                                                        "colored3",
                                                        "colored6",
                                                        "colored12"});
     this.ColorComboBox.Location = new System.Drawing.Point(86, 544);
     this.ColorComboBox.Name = "ColorComboBox";
     this.ColorComboBox.Size = new System.Drawing.Size(96, 21);
     this.ColorComboBox.TabIndex = 3;
     this.ColorComboBox.Text = "colored3";
     this.ColorComboBox.SelectedIndexChanged += new System.EventHandler(this.ColorComboBox_SelectedIndexChanged);
     //
     // LineWidthComboBox
     //
     this.LineWidthComboBox.Items.AddRange(new object[] {
                                                            "1",
                                                            "2",
                                                            "3",
                                                            "4",
                                                            "5",
                                                            "6",
                                                            "7",
                                                            "8",
                                                            "9",
                                                            "10"});
     this.LineWidthComboBox.Location = new System.Drawing.Point(86, 580);
     this.LineWidthComboBox.Name = "LineWidthComboBox";
     this.LineWidthComboBox.Size = new System.Drawing.Size(96, 21);
     this.LineWidthComboBox.TabIndex = 4;
     this.LineWidthComboBox.Text = "Linewidth";
     this.LineWidthComboBox.SelectedIndexChanged += new System.EventHandler(this.LineWidthComboBox_SelectedIndexChanged);
     //
     // DrawModeComboBox
     //
     this.DrawModeComboBox.Items.AddRange(new object[] {
                                                           "fill",
                                                           "margin"});
     this.DrawModeComboBox.Location = new System.Drawing.Point(86, 616);
     this.DrawModeComboBox.Name = "DrawModeComboBox";
     this.DrawModeComboBox.Size = new System.Drawing.Size(96, 21);
     this.DrawModeComboBox.TabIndex = 5;
     this.DrawModeComboBox.Text = "Drawmode";
     this.DrawModeComboBox.SelectedIndexChanged += new System.EventHandler(this.DrawModeComboBox_SelectedIndexChanged);
     //
     // ResetButton
     //
     this.ResetButton.Location = new System.Drawing.Point(264, 24);
     this.ResetButton.Name = "ResetButton";
     this.ResetButton.Size = new System.Drawing.Size(88, 40);
     this.ResetButton.TabIndex = 7;
     this.ResetButton.Text = "Reset View";
     this.ResetButton.Click += new System.EventHandler(this.ResetButton_Click);
     //
     // ClearWindButton
     //
     this.ClearWindButton.Location = new System.Drawing.Point(24, 24);
     this.ClearWindButton.Name = "ClearWindButton";
     this.ClearWindButton.Size = new System.Drawing.Size(88, 40);
     this.ClearWindButton.TabIndex = 8;
     this.ClearWindButton.Text = "Clear Window";
     this.ClearWindButton.Click += new System.EventHandler(this.ClearWindButton_Click);
     //
     // IconicDisplayStack
     //
     this.IconicDisplayStack.BackColor = System.Drawing.SystemColors.InactiveBorder;
     this.IconicDisplayStack.ForeColor = System.Drawing.SystemColors.WindowText;
     this.IconicDisplayStack.HorizontalScrollbar = true;
     this.IconicDisplayStack.Location = new System.Drawing.Point(376, 544);
     this.IconicDisplayStack.Name = "IconicDisplayStack";
     this.IconicDisplayStack.SelectionMode = System.Windows.Forms.SelectionMode.None;
     this.IconicDisplayStack.Size = new System.Drawing.Size(264, 95);
     this.IconicDisplayStack.TabIndex = 9;
     //
     // label1
     //
     this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
     this.label1.Location = new System.Drawing.Point(376, 520);
     this.label1.Name = "label1";
     this.label1.Size = new System.Drawing.Size(120, 16);
     this.label1.TabIndex = 10;
     this.label1.Text = "Displayed iconics:";
     this.label1.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
     //
     // label2
     //
     this.label2.Location = new System.Drawing.Point(24, 544);
     this.label2.Name = "label2";
     this.label2.Size = new System.Drawing.Size(48, 24);
     this.label2.TabIndex = 12;
     this.label2.Text = "Color:";
     this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // label3
     //
     this.label3.Location = new System.Drawing.Point(24, 580);
     this.label3.Name = "label3";
     this.label3.Size = new System.Drawing.Size(56, 20);
     this.label3.TabIndex = 13;
     this.label3.Text = "Linewidth:";
     this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // label4
     //
     this.label4.Location = new System.Drawing.Point(24, 616);
     this.label4.Name = "label4";
     this.label4.Size = new System.Drawing.Size(64, 24);
     this.label4.TabIndex = 14;
     this.label4.Text = "Drawmode:";
     this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // StackCountLabel
     //
     this.StackCountLabel.Location = new System.Drawing.Point(480, 648);
     this.StackCountLabel.Name = "StackCountLabel";
     this.StackCountLabel.Size = new System.Drawing.Size(24, 16);
     this.StackCountLabel.TabIndex = 15;
     this.StackCountLabel.Text = "0";
     this.StackCountLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // label5
     //
     this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
     this.label5.Location = new System.Drawing.Point(192, 520);
     this.label5.Name = "label5";
     this.label5.Size = new System.Drawing.Size(120, 16);
     this.label5.TabIndex = 16;
     this.label5.Text = "List of iconics:";
     this.label5.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
     //
     // label6
     //
     this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
     this.label6.Location = new System.Drawing.Point(376, 648);
     this.label6.Name = "label6";
     this.label6.Size = new System.Drawing.Size(104, 16);
     this.label6.TabIndex = 17;
     this.label6.Text = "Current stack size:";
     this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // GraphicsStackForm
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize = new System.Drawing.Size(664, 685);
     this.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                   this.label6,
                                                                   this.label5,
                                                                   this.StackCountLabel,
                                                                   this.label3,
                                                                   this.label2,
                                                                   this.label1,
                                                                   this.IconicDisplayStack,
                                                                   this.ClearWindButton,
                                                                   this.ResetButton,
                                                                   this.DrawModeComboBox,
                                                                   this.LineWidthComboBox,
                                                                   this.ColorComboBox,
                                                                   this.IconiclistBox,
                                                                   this.groupBoxViewFunction,
                                                                   this.viewPort,
                                                                   this.label4});
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
     this.MaximizeBox = false;
     this.Name = "GraphicsStackForm";
     this.Text = "Graphic Stack";
     this.Load += new System.EventHandler(this.GraphicsStackForm_Load);
     this.groupBoxViewFunction.ResumeLayout(false);
     this.ResumeLayout(false);
 }
Example #38
0
        /// <summary> 
        /// Initializes the image dimension, mouse delegation, and the 
        /// graphical context setup of the instance.
        /// </summary>
        /// <param name="view"> HALCON window </param>
        public HWndCtrl(HWindowControl view)
        {
            viewPort = view;
              stateView = MODE_VIEW_NONE;
              windowWidth = viewPort.Size.Width;
              windowHeight = viewPort.Size.Height;

              // initialize the image part to window size
              initializeDisplayImagePart();
              resetImagePart(widthImagePart, heightImagePart);

              if (widthImagePart > 0)
            zoomWndFactor = (double)widthImagePart / viewPort.Width;
              else
            zoomWndFactor = 1;

              zoomAddOn = Math.Pow(0.9, 5);
              zoomWndSize = 150;

              /*Set the boundaries and steps for changes for the GUI elements*/
              /*default*/
              CompRangeX = new int[] { 0, 100 };
              CompRangeY = new int[] { 0, 100 };

              prevCompX = prevCompY = 0;
              initValX  = initValY  = 0;

              /* Initialize the values for value range, step for
               * some GUI elements */
              setGUICompRangeX(CompRangeX, prevCompX);
              setGUICompRangeY(CompRangeY, prevCompY);

              //displayMode = MODE_VIEW_NONE;

              dispROI = MODE_INCLUDE_ROI;//1;

              viewPort.HMouseUp += new HalconDotNet.HMouseEventHandler(this.mouseUp);
              viewPort.HMouseDown += new HalconDotNet.HMouseEventHandler(this.mouseDown);
              viewPort.HMouseMove += new HalconDotNet.HMouseEventHandler(this.mouseMoved);
              viewPort.HMouseWheel += new HalconDotNet.HMouseEventHandler(this.mouseWheel);

              addInfoDelegate = new FuncDelegate(dummyV);
              NotifyIconObserver = new IconicDelegate(dummy);

              // graphical stack
              HObjList = new ArrayList(20);
              mGC = new GraphicsContext();
              mGC.gcNotification = new GCDelegate(exceptionGC);

              // set the variable bufferWindow to null for repaint-Method
              bufferWindow = null;
        }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.viewPort = new HalconDotNet.HWindowControl();
     this.groupBox1 = new System.Windows.Forms.GroupBox();
     this.noneButton = new System.Windows.Forms.RadioButton();
     this.moveButton = new System.Windows.Forms.RadioButton();
     this.zoomButton = new System.Windows.Forms.RadioButton();
     this.resetButton = new System.Windows.Forms.Button();
     this.groupBox1.SuspendLayout();
     this.SuspendLayout();
     //
     // viewPort
     //
     this.viewPort.BackColor = System.Drawing.Color.Black;
     this.viewPort.BorderColor = System.Drawing.Color.Black;
     this.viewPort.ImagePart = new System.Drawing.Rectangle(0, 0, 640, 480);
     this.viewPort.Location = new System.Drawing.Point(48, 48);
     this.viewPort.Name = "viewPort";
     this.viewPort.Size = new System.Drawing.Size(600, 448);
     this.viewPort.TabIndex = 0;
     this.viewPort.WindowSize = new System.Drawing.Size(600, 448);
     //
     // groupBox1
     //
     this.groupBox1.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                             this.noneButton,
                                                                             this.moveButton,
                                                                             this.zoomButton});
     this.groupBox1.Location = new System.Drawing.Point(688, 360);
     this.groupBox1.Name = "groupBox1";
     this.groupBox1.Size = new System.Drawing.Size(144, 136);
     this.groupBox1.TabIndex = 1;
     this.groupBox1.TabStop = false;
     this.groupBox1.Text = " View Interaction ";
     //
     // noneButton
     //
     this.noneButton.Checked = true;
     this.noneButton.Location = new System.Drawing.Point(32, 96);
     this.noneButton.Name = "noneButton";
     this.noneButton.TabIndex = 2;
     this.noneButton.TabStop = true;
     this.noneButton.Text = "none";
     this.noneButton.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     this.noneButton.CheckedChanged += new System.EventHandler(this.noneButton_CheckedChanged);
     //
     // moveButton
     //
     this.moveButton.Location = new System.Drawing.Point(32, 64);
     this.moveButton.Name = "moveButton";
     this.moveButton.TabIndex = 1;
     this.moveButton.Text = "move";
     this.moveButton.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     this.moveButton.CheckedChanged += new System.EventHandler(this.moveButton_CheckedChanged);
     //
     // zoomButton
     //
     this.zoomButton.Location = new System.Drawing.Point(32, 32);
     this.zoomButton.Name = "zoomButton";
     this.zoomButton.TabIndex = 0;
     this.zoomButton.Text = "zoom";
     this.zoomButton.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     this.zoomButton.CheckedChanged += new System.EventHandler(this.zoomButton_CheckedChanged);
     //
     // resetButton
     //
     this.resetButton.Location = new System.Drawing.Point(688, 56);
     this.resetButton.Name = "resetButton";
     this.resetButton.Size = new System.Drawing.Size(144, 48);
     this.resetButton.TabIndex = 2;
     this.resetButton.Text = "Reset View";
     this.resetButton.Click += new System.EventHandler(this.resetButton_Click);
     //
     // SmartWindowForm
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize = new System.Drawing.Size(880, 557);
     this.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                   this.resetButton,
                                                                   this.groupBox1,
                                                                   this.viewPort});
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
     this.MaximizeBox = false;
     this.Name = "SmartWindowForm";
     this.Text = "SmartWindow";
     this.Load += new System.EventHandler(this.SmartWindowForm_Load);
     this.groupBox1.ResumeLayout(false);
     this.ResumeLayout(false);
 }