Halcon学习之八:图像区域叠加与绘制

本文通过具体示例介绍如何使用HALCON进行图像处理,包括读取图像、绘制区域及对象、混合图像等操作,并展示了如何设定特定灰度值。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

overpaint_gray ( ImageDestination, ImageSource : : : )  将灰度值不相同区域用不同颜色绘制到ImageDestination中, ImageSource包含希望的灰度值图像

overpaint_region ( Image, Region : : Grayval, Type : ) 将Region以一个恒定的灰度值绘制到Image图像中

paint_gray ( ImageSource, ImageDestination : MixedImage : : ) 将ImageSource的图像绘制到ImageDestination中,形成MixedImage。

paint_region ( Region, Image : ImageResult : Grayval, Type : ) 将Region以一个恒定的灰度值绘制到Image图像中

paint_xld ( XLD, Image : ImageResult : Grayval : ) 将XLD以一个恒定的灰度值绘制到Image图像中

set_grayval ( Image : : Row, Column, Grayval : ) 设置Image图像中坐标为(Row,Column)的灰度值

 

程序:

 

 

[c-sharp]  view plain  copy
 
  1. read_image (Image, 'G:/Halcon/images/images/claudia.png')  
  2. gen_circle (Circle, 200, 200, 100.5)  
  3. reduce_domain (Image, Circle, ImageReduced)  
  4. gen_image_proto (Image, ImageCleared, 32)  
  5. overpaint_gray (ImageCleared, ImageReduced)  
  6. gen_image_const (Image1, 'byte', 512, 512)  
  7. overpaint_region (Image1, Circle, 255, 'fill')  
  8. /* Copy a circular part of the image  into the image : */  
  9. read_image (Image2, 'G:/Halcon/images/images/brycecanyon1.png')  
  10. paint_gray (ImageReduced, Image2, MixedImage)  
  11. /* Paint a rectangle into the image  */  
  12. read_image (Image3, 'G:/Halcon/images/images/pads.png')  
  13. gen_rectangle1 (Rectangle1, 30, 20, 100, 200)  
  14. paint_region (Rectangle1, Image3, ImageResult, 255, 'fill')  
  15. /* Paint colored xld objects into a gray image */  
  16. /* read and copy image to generate a three channel image */  
  17. copy_image (Image2, image0)  
  18. copy_image (Image2, image1)  
  19. compose3 (image0, Image2, image1, MultiChannelImage)  
  20. /* extract subpixel border */  
  21. threshold_sub_pix (MultiChannelImage, Border, 128)  
  22. /* select the circle and the arrows */  
  23. circle := Border[14]  
  24. arrow := Border[16]  
  25. ObjectsConcat := [circle,arrow]  
  26. /* paint a green circle and white arrows (to paint all 
  27. * * objects e.g. blue, pass [0,0,255] tuple for GrayVal) */  
  28. paint_xld (ObjectsConcat, MultiChannelImage, ImageResult1, [0,1,0,1,1,255])  

 

 

处理效果:

转载于:https://www.cnblogs.com/qqhfeng/p/7247807.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值