Halcon 学习之五:有关图像的定义域的函数
1、add_channels ( Regions, Image : GrayRegions : : )
将 Image 图像的灰度值赋给区域 Regions,得到 GrayRegions。
2、change_domain ( Image, NewDomain : ImageNew : : )
改变 Image 图像的定义域
3、full_domain ( Image : ImageFull : : )
扩张 Image 图像的定义域到最大。
4、get_domain ( Image : Domain : : )
得到 Image 图像的定义域
5、rectangle1_domain ( Image : ImageReduced : Row1, Column1, Row2,
Column2 : )
根据矩形坐标(Row1, Column1)、( Row2,Column2)得到区域视为 Image 图像的定义域。
6、reduce_domain ( Image, Region : ImageReduced : : )
得到图像 Image 相对于 Region 区域的图像
例程:
1 read_image (Image, 'G:/Halcon/机器视觉/images/brycecanyon1.png')
2 * 打开一个新的窗体
3 dev_open_window (0, 0, -1, -1, 'black', WindowHandle)
4 * 显示图像
5 dev_display (Image)
6 * 选出两个新的 Region
7 draw_region (region1, WindowHandle)
8 draw_region (region2, WindowHandle)
9 add_channels (region1, Image, image_region1)
10 change_domain (Image, region2, ImageNew)
11 full_domain (image_region1, ImageFull)
12 rectangle1_domain (ImageFull, ImageReduced, 100, 100, 300, 500)
13 get_domain (image_region1, Domain)
14 reduce_domain (Image, region2, ReducedImage)
处理效果如下图所示:
评论0