halcon 1区域保存生成

read_image (Image, 'printer_chip/printer_chip_01')
get_image_size (Image, Width, Height)
dev_open_window (0, 0, Width/3, Height/3, 'black', WindowHandle)
dev_display (Image)

* 圆
draw_circle (WindowHandle, Row, Column, Radius)
gen_circle (Circle, Row, Column, Radius)

* 椭圆
draw_ellipse (WindowHandle, Row1, Column1, Phi, Radius1, Radius2)
gen_ellipse (Ellipse, Row1, Column1, Phi, Radius1, Radius2)

* 矩形
draw_rectangle1 (WindowHandle, Row11, Column11, Row2, Column2)
gen_rectangle1 (Rectangle, Row11, Column11, Row2, Column2)

* 矩形带方向
draw_rectangle2 (WindowHandle, Row3, Column3, Phi1, Length1, Length2)
gen_rectangle2 (Rectangle1, Row3, Column3, Phi1, Length1, Length2)

* 线条
draw_line (WindowHandle, Row12, Column12, Row21, Column21)
gen_region_line (RegionLines, Row12, Column12, Row21, Column21)

* 点
draw_point (WindowHandle, Row4, Column4)
gen_region_points (Region, Row4, Column4)

* 区域(任意形状)
draw_region (Region1, WindowHandle)

* 生成矩形
draw_rectangle2 (WindowHandle, Row5, Column5, Phi2, Length11, Length21)
gen_rectangle2 (Rectangle2, Row5, Column5, Phi2, Length11, Length21)
* 保存区域
write_region (Rectangle2, 'region.hobj')


* 读区域
read_region (RegionRoi, 'region.hobj')
skeleton (RegionRoi, Skeleton)

* 生成空的区域
gen_empty_region (EmptyRegion)

* 合并区域
concat_obj (EmptyRegion, RegionRoi, ObjectsConcat)
上一篇:Halcon 区域保存 区域测距 几何变换 仿射变换


下一篇:Halcon_识别DataMatrix二维码