Halcon學習之五:有關圖像的定義域的函數

来源:互联网 发布:图片欣赏软件 编辑:程序博客网 时间:2024/04/29 14:56
http://blog.csdn.net/xinrui_hhuc/article/details/6120785 

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)  

處理效果如下圖所示:

原创粉丝点击