其他分享
首页 > 其他分享> > [原创]九点标定工具之机械手头部相机标定

[原创]九点标定工具之机械手头部相机标定

作者:互联网

1、机械手头部相机与龙门架头部相机的区别?

2、原理分析

image.png

3、详细步骤

4、源码

image.png

      private void updatePoiMatrix(Position pcbPoi,Position poi1, Position poi2,Position takePhotoPoi)
        {
            //更新对应的数组
            imagePoiList.Add(new Position() { X = (poi1.X + poi2.X) / 2, Y = (poi1.Y + poi2.Y) / 2 });
            //dstPoi- takePhotoPoi,获取takePhoto的J1与J2,
            System.Windows.Point p1=new System.Windows.Point();
            p1.X = pcbPoi.X - takePhotoPoi.X;
            p1.Y = pcbPoi.Y - takePhotoPoi.Y;
            var jAngles=this.currentRobot.GetJAngle();
            double angleJ = -jAngles[0] - jAngles[1];
            System.Windows.Point p2= MatrixHelper.GetRotatePoint(p1, angleJ, new System.Windows.Point() { X = 0, Y = 0 });

            Position newDstPoi = new Position();
            newDstPoi.X = p2.X;
            newDstPoi.Y = p2.Y;
            robotPoiList.Add(newDstPoi);
        }
        
         /// <summary>
        /// 逆时针旋转,获取旋转后的点位
        /// </summary>
        /// <param name="p1">待旋转的点</param>
        /// <param name="angle">旋转角度</param>
        /// <param name="center">旋转中心</param>
        /// <returns></returns>
        public static Point GetRotatePoint(Point p1, double angle, Point center)
        {
            //使用旋转矩阵求值
            RotateTransform rotateTransform = new RotateTransform(angle, center.X, center.Y);
            Point p = new Point(p1.X, p1.Y);
            System.Windows.Point p2 = rotateTransform.Transform(p);
            return p2;
        }

5. 后续计划[敬请期待],如需完整代码请微信联系

标签:p1,Point,九点,标定,旋转,相机,机械手,Position,龙门架
来源: https://www.cnblogs.com/Bonker/p/16517137.html