综上所述,将XLD转换为Region在Halcon中是一个相对简单的过程,只需要使用gen_region_contour_xld函数即可。但是,在实际应用中,你可能需要根据具体情况对XLD进行预处理或后处理,以确保转换后的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...
一、区域(region)转轮廓(xld): 法一: 直接转换 gen_contour_region_xld (SelectedRegions, Contours, 'border') 应该场所:拟合部分边缘提取和轮廓分割之间会用到,因为轮廓分割需输入xld轮廓,而用boundary提取区域边缘输出的是区域(region),所以需要转换。 法二: 先将区域转换骨架,在提取骨架xld轮廓 skeleton (Regio...
一、区域(region)转轮廓(xld): 法一:直接转换 gen_contour_region_xld (SelectedRegions, Contours, 'border') 应该场所:拟合部分边缘提取和轮廓分割之间会用到,因为轮廓分割需输入xld轮廓,而用boundary提取区域边缘输出的是区域(region),所以需要转换。
一、区域(region)转轮廓(xld): 法一:直接转换 gen_contour_region_xld (SelectedRegions, Contours, 'border') 1. 应该场所:拟合部分边缘提取和轮廓分割之间会用到,因为轮廓分割需输入xld轮廓,而用boundary提取区域边缘输出的是区域(region),所以需要转换。
gen_polygons_xld (RegionCo, RegionPo, 'ramer', 2) 2.转换规律 Halcon对象之间的相互转换,一般可以转化为"gen_目标对象_原对象"形式,如gen_region_contour_xld(根据xld创建一个区域region);再如gen_contour_region_xld(根据region创建一个xld轮廓) ...
2.用区域生成亚像素xld *提取xld gen_contour_region_xld (Regions, Contours, 'border') 这样就有了轮廓,但是我们有时候需要的可能不是xld而是region; 3.用xld转成区域Region *将xld转成region gen_region_contour_xld (Contours, Region, 'margin') ...
二、Region、XLD、Polygon之间的互相转换 1、Region像素坐标值的存储方式 根据如下代码生成一个矩形区域,并获取该区域内所有像素的坐标值,根据结果可以看出,Region内像素坐标值是根据行程编码的规则存储的。 gen_rectangle1 (ROI_0, 100, 100, 300, 300) ...
1、使用Region为中介缩放XLD 1 gen_image_const (Image, 'byte', 8200, 4200) 2 set_system ('clip_region', 'false') 3 read_contour_xld_dxf (Contours,'01.dxf', [], [], DxfStatus) 4 *转为region 5gen_region_contour_xld (Contours, Region, 'margin')6 *缩放region ...