在Halcon官方文档中,我们可以找到多个用于XLD和Region之间转换的算子。其中,gen_region_contour_xld是一个常用的将XLD转换为Region的算子。 3. 确定转换所需的参数和步骤 使用gen_region_contour_xld算子将XLD转换为Region时,需要指定以下参数: Contour:输入的XLD轮廓。 Region:输出的Region区域。 Mode:指定生成Region的...
gen_region_contour_xld (ClosedContours, Region2, 'filled') 二、region转xld 方法1:gen_contour_region_xld (SelectedRegions, Contours, 'border') 拟合部分边缘提取和轮廓分割之间会用到,因为轮廓分割需输入xld轮廓,而用boundary提取区域边缘输出的是区域(region),所以需要转换。 方法2:先将区域转换骨架,然后再...
Halcon对象之间的相互转换,一般可以转化为"gen_目标对象_原对象"形式,如gen_region_contour_xld(根据xld创建一个区域region);再如gen_contour_region_xld(根据region创建一个xld轮廓) 2.1 gen_region_contour_xld(Contour : Region : Mode : ) 根据轮廓xld创建一个区域region read_image(Image,'lena') draw_xld...
Halcon对象之间的相互转换,一般可以转化为"gen_目标对象_原对象"形式,如gen_region_contour_xld(根据xld创建一个区域region);再如gen_contour_region_xld(根据region创建一个xld轮廓) 2.1 gen_region_contour_xld(Contour : Region : Mode : ) 根据轮廓xld创建一个区域region read_image(Image,'lena') draw_xld...
法一:可将xld转成区域,然后求区域的方向 gen_region_contour_xld (LineContours, RegionLines, 'filled') orientation_region (RegionLines, Phi) 法二:直接求xld轮廓方向 orientation_xld(XLD : : : Phi) 法三:通过求椭圆长半轴、短半轴的方式求xld轮廓(精度较高,但是方向有时会找不准) ...
三 图型变量XLD(eXtended Line Descriptions) XLD代表亚像素级别的轮廓或者多边形 threshold_sub_pix(inputimage, output,requirement) gen_contour_region_xld(inputRegion,output,...) XLD的选择操作(select_shape_xld/selet_contours_xld): select_shape_xld(XLDFeatures,Operation,Min,Max:) ...
halcon中将xld轮廓或者region区域绘制在图像上并保存,1)单通道图像的绘制draw_circle(WindowHandle,Row,Column,Radius)gen_circle(Circle,Row,Column,Radius)paint_region(Circle,Image,ImageR,0,'fill')pa
二、Region、XLD、Polygon之间的互相转换 1、Region像素坐标值的存储方式 根据如下代码生成一个矩形区域,并获取该区域内所有像素的坐标值,根据结果可以看出,Region内像素坐标值是根据行程编码的规则存储的。 gen_rectangle1 (ROI_0, 100, 100, 300, 300) ...
*提取xld gen_contour_region_xld (Regions, Contours, 'border') 这样就有了轮廓,但是我们有时候需要的可能不是xld而是region; 3.用xld转成区域Region *将xld转成region gen_region_contour_xld (Contours, Region, 'margin') 以下是原图、效果图和代码: ...