(Selected) orientation_region (Selected, Phi) *返回区域的方向 *参数1:区域 *参数2:与x轴的夹角,其实就是elliptic_axis算子中的Phi *获取过滤后区域的面积,中心的行坐标,列坐标 area_center (Selected, Area, Row, Column) *设置输出对象的线宽为3 dev_set_line_width (3) *设置区域的填充方式 dev_set...
5Halcon的orientation_region()函数,用于计算区域的方位信息 函数原型:orientation_region(Regions:::Phi) 功能: 该算子基于算子elliptic_axis,测试区域的方位,包括轮廓中的点(以最大距离到区域重心)。如果该点的列坐标小于重心的列坐标,角度将使用Pi表示。如果多个区域进行计算,输出结果也是一一对应输入区域。 参数列表...
水平方向为角度0的方向,区域的方向一般是指长轴与水平方向的夹角(注意:gen_ellipse和elliptic_axis并不是可逆操作,通过gen_ellipse得到的椭圆区域,再用elliptic_axis计算会有误差,不是特别理解) 2)orientation_region() 计算区域的方向(-π<=θ<π) 计算方法同elliptic_axis ,当轮胎上与重心最大距离的点,横坐标在...
也就是外接矩形的角度。 disp_cross (WindowID, RowCenterRegion, ColumnCenterRegion, 15, 0) disp_arrow (WindowID, RowCenterRegion, ColumnCenterRegion, RowCenterRegion - 60 * sin(OrientationRegion), ColumnCenterRegion + 60 * cos(OrientationRegion), 2)显示十字叉、箭头。 1. 2. 三、边缘提取算子...
orientation_region (Selected, Phi) *返回区域的方向 *参数1:区域 *参数2:与x轴的夹角,其实就是elliptic_axis算子中的Phi *获取过滤后区域的面积,中心的行坐标,列坐标 area_center (Selected, Area, Row, Column) *设置输出对象的线宽为3 dev_set_line_width (3) ...
orientation_region(Regions : : : Phi) DescriptionThe operator orientation_region calculates the orientation of the region. The operator is based on elliptic_axis. In addition the point on the contour with maximal distance to the center of gravity is calculated. If, in the rotated coordinate ...
#4.图像矫正orientation_region(RegionTrans,Phi)*将区域等效成一个圆,计算区域的方向area_center(RegionTrans,Area,Row,Column)*测量区域的面积和中心位置vector_angle_to_rigid(Row,Column,Phi,Row,Column,Phi,HomMat2D)*根据给定的点对应关系和角度,计算刚性仿射变换(旋转和平移)affine_trans_image(Image,ImageAffi...
dev_clear_window () dev_get_window (WindowHandle) read_image (Image, 'E:/NetProjects/测试项目/Halcon/素材/chepai1.jpg') area_center (Image, Area, Row, Column) orientation_region (Image, Phi) vector_angle_to_rigid (Row, Column, Phi, Row, Column, rad(-180), HomMat2D) affine_trans...
orientation_region (Blister, Phi) 可以看到是负的 获得区域的中心坐标 area_center (Blister, Area1, Row, Column) 利用 起始中心点坐标和角度 到 目标中心点坐标和角度 生成 仿射矩阵 vector_angle_to_rigid (Row, Column, Phi, Row, Column, 0, HomMat2D) ...
orientation_xld(XLD : : : Phi) 角度计算方式:计算原理同算子orientation_region。需要注意的是输入的contours 或 polygons不能自相交,如果他们不是闭合轮廓,那么在计算过程中会自动闭合,由此可能会产生自相交,从而导致最终的计算结果不准确。如果输入的轮廓存在自相交,可用orientation_points_xld算子代替。