Exemplo n.º 1
0
 public void UpdateCurrImage(HObject img, St_VectorAngle TempFindVectorAngleIn, LocalPara LocalParaIn)
 {
     if (GrabedImg != null)
     {
         GrabedImg.Dispose();
     }
     HOperatorSet.CopyImage(img, out GrabedImg);
     TeachFindVectorAngle = TempFindVectorAngleIn;
     LocalPara0           = LocalParaIn;
 }
Exemplo n.º 2
0
 //LocalPara VisionParaIn,   St_BlobInspectParam1 blobInSpectParam, HWindow InHWindow, HObject ImgIn, Action<bool> drawRoiInHWindow
 public SubFrmRecheck(LocalPara VisionParaIn, St_InspectImageSetting setting, ViewControl viewIn, HObject ImgIn, Action <bool> drawRoiInHWindow)
 {
     InitializeComponent();
     TeachLocalPara      = VisionParaIn;
     InspectImageSetting = setting;
     if (ImgIn != null && ImgIn.IsInitialized())
     {
         GrabedImg = ImgIn;
     }
     myView             = viewIn;
     ActionIsDrawingRoi = drawRoiInHWindow;
 }
Exemplo n.º 3
0
 private void StartCaliBtn_Click(object sender, EventArgs e)
 {
     System.Threading.Tasks.Task.Factory.StartNew(new Action(() => {
         try {
             #region
             List <Point2Db> PixelPtList = new List <Point2Db>();//像素点的坐标集合
             LocalPara NowLocalPara      = TeachCaliPara.localPara;
             RectangleF RectFi           = new RectangleF();
             LocalManager MyLocal        = new LocalManager(); //定位类初始化
             LocalResult MyResult        = new LocalResult();
             Point2Db Pt         = new Point2Db();
             HObject CaliContour = new HObject();
             HOperatorSet.GenEmptyObj(out CaliContour);
             if (GrabedImg == null)
             {
                 MessageBox.Show(" 请先加载一张图片");
                 return;
             }
             for (int i = 0; i < TeachCaliPara.ListRectRegion.Count; i++)
             {
                 RectFi = TeachCaliPara.ListRectRegion[i];
                 TeachCaliPara.localPara.localSetting.SearchAreaX  = (int)RectFi.X;
                 TeachCaliPara.localPara.localSetting.SearchAreaY  = (int)RectFi.Y;
                 TeachCaliPara.localPara.localSetting.SearchWidth  = (int)RectFi.Width;
                 TeachCaliPara.localPara.localSetting.SearchHeight = (int)RectFi.Height;
                 MyLocal.SetLocalModel(TeachCaliPara.localPara.localSetting.localModel);
                 MyLocal.SetParam(GrabedImg, TeachCaliPara.localPara);
                 MyLocal.doLocal();
                 MyResult    = MyLocal.GetResult();
                 CaliContour = CaliContour.ConcatObj(MyResult.ShowContour);
                 //GetCaliMarkPts1(GrabedImg, MinGray, MaxGray, MarkR, out ContourU, out ListMarkCenterI);  //找出Mark点
                 HObject CenterContour = new HObject();
                 HOperatorSet.GenCrossContourXld(out CenterContour, MyResult.row, MyResult.col, 50, 0);  //生成找到的圆心轮廓
                 HOperatorSet.ConcatObj(CaliContour, CenterContour, out CaliContour);
                 Pt.Col = MyResult.col;
                 MyVisionBase.AdjImgRow(GrabedImg, ref MyResult.row);
                 Pt.Row = MyResult.row;
                 PixelPtList.Add(Pt);
                 view1.Refresh();
                 view1.AddViewImage(GrabedImg);
                 view1.AddViewObject(CaliContour);
                 view1.Repaint();
             }
             #endregion
             bool IsTrue = true;
             MyVisionBase.VectorToHomMat(PixelPtList, TeachCaliPara.ListPt2D, out TeachCaliPara.HomMat, out IsTrue);
         }
         catch
         { }
     }));
 }
Exemplo n.º 4
0
Arquivo: CaliParam.cs Projeto: Gz1d/Gz
 public CaliParam()
 {
     this.camLightPara   = new CameraLightPara();
     this.localPara      = new LocalPara();
     this.AngleRange     = 10.0;
     this.StartCaliPt    = new Point3Db();
     this.EndCaliPt      = new Point3Db();
     this.IsMoveX        = false;
     this.IsMoveY        = false;
     this.caliModel      = CaliModelEnum.HandEyeCali;
     this.HomMat         = new MyHomMat2D();
     this.ListRectRegion = new List <RectangleF>();
     this.ListPt2D       = new List <Point2Db>();
     this.cam            = CameraEnum.Cam0;
     this.describe       = "未定义";
     this.CoordiCam      = CoordiCamHandEyeMatEnum.Coordi0Cam0;
 }
Exemplo n.º 5
0
 private void FrmSubFrmFindLine_Load(object sender, EventArgs e)
 {
     if (LocalPara0 == null)
     {
         LocalPara0 = new LocalPara();
     }
     if (LocalPara0.localSetting.TeachCoordi == null)
     {
         LocalPara0.localSetting.TeachCoordi = CoordiEmum.Coordi0;
     }
     this.CoordiCbx.SelectedIndex          = (int)LocalPara0.localSetting.TeachCoordi;
     this.NumUpDn_offset_x_range.Value     = (decimal)LocalPara0.localSetting.Offset_x_range;
     this.NumUpDn_offset_y_range.Value     = (decimal)LocalPara0.localSetting.Offset_y_range;
     this.NumUpDn_offset_theta_range.Value = (decimal)LocalPara0.localSetting.Offset_theta_range;
     this.NumUpDn_Offset_x.Value           = (decimal)LocalPara0.localSetting.Offset_x;
     this.NumUpDn_Offset_y.Value           = (decimal)LocalPara0.localSetting.Offset_y;
     this.NumUpDn_Offset_thta.Value        = (decimal)LocalPara0.localSetting.Offset_theta;
     this.GrabPosTbx.Text = "X:" + LocalPara0.localSetting.GrabPosTeach.x.ToString("f2")
                            + "   Y:" + LocalPara0.localSetting.GrabPosTeach.y.ToString("f2")
                            + "   Theta:" + LocalPara0.localSetting.GrabPosTeach.angle.ToString("f2");
     this.CoordiCbx.SelectedIndexChanged += new System.EventHandler(this.CoordiCbx_SelectedIndexChanged);
 }
Exemplo n.º 6
0
        public void UpDatePara(LocalPara ParaIn)
        {
            LocalPara0 = ParaIn;
            if (LocalPara0 == null)
            {
                LocalPara0 = new LocalPara();
            }
            if (LocalPara0.localSetting.TeachCoordi == null)
            {
                LocalPara0.localSetting.TeachCoordi = CoordiEmum.Coordi0;
            }
            this.CoordiCbx.SelectedIndex = (int)LocalPara0.localSetting.TeachCoordi;

            NumUpDn_offset_x_range.Value     = (decimal)LocalPara0.localSetting.Offset_x_range;
            NumUpDn_offset_y_range.Value     = (decimal)LocalPara0.localSetting.Offset_y_range;
            NumUpDn_offset_theta_range.Value = (decimal)LocalPara0.localSetting.Offset_theta_range;
            NumUpDn_Offset_x.Value           = (decimal)LocalPara0.localSetting.Offset_x;
            NumUpDn_Offset_y.Value           = (decimal)LocalPara0.localSetting.Offset_y;
            NumUpDn_Offset_thta.Value        = (decimal)LocalPara0.localSetting.Offset_theta;
            GrabPosTbx.Text = "X:" + LocalPara0.localSetting.GrabPosTeach.x.ToString("f2")
                              + "   Y:" + LocalPara0.localSetting.GrabPosTeach.y.ToString("f2")
                              + "   Theta:" + LocalPara0.localSetting.GrabPosTeach.angle.ToString("f2");
        }
Exemplo n.º 7
0
Arquivo: LocalBase.cs Projeto: Gz1d/Gz
 public virtual void SetLocalPara(LocalPara LocalParaIn)
 {
     NowVisionPara = LocalParaIn;
 }
Exemplo n.º 8
0
Arquivo: LocalBase.cs Projeto: Gz1d/Gz
 public virtual void Set(HObject ImgIn, LocalPara LocalParaIn)
 {
     NowImg        = ImgIn;
     NowVisionPara = LocalParaIn;
 }
Exemplo n.º 9
0
 public FrmLocalParaTeach(LocalPara LocalParaIn)
 {
     InitializeComponent();
     TeachLocalPara = LocalParaIn;
 }
Exemplo n.º 10
0
 public void UpDatePara(LocalPara ParaIn)
 {
     LocalPara0 = ParaIn;
 }
Exemplo n.º 11
0
 public void SetLocalPara(LocalPara VisionParaIn)
 {
     MyLocal.SetLocalPara(VisionParaIn);
 }
Exemplo n.º 12
0
 /// <summary>
 /// 传入图片和检测参数
 /// </summary>
 /// <param name="ImgIn"></param>
 /// <param name="VisionParaIn"></param>
 public void SetParam(HObject ImgIn, LocalPara VisionParaIn)
 {
     MyLocal.Set(ImgIn, VisionParaIn);
 }
Exemplo n.º 13
0
 public void UpDatePara(LocalPara ParaIn)
 {
     TeachLoclPara = ParaIn;
 }