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区域的图像

 

例程:

 

[c-sharp] view plain copy
 
  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)  

处理效果如下图所示:

 
 
原文地址:https://www.cnblogs.com/qqhfeng/p/7247785.html