Halcon学习之八:图像区域叠加与绘制
Posted 挣脱生命的束缚...
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Halcon学习之八:图像区域叠加与绘制相关的知识,希望对你有一定的参考价值。
版权声明:本文为博主原创文章,未经博主允许不得转载。
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)的灰度值
程序:
- read_image (Image, ‘G:/Halcon/images/images/claudia.png‘)
- gen_circle (Circle, 200, 200, 100.5)
- reduce_domain (Image, Circle, ImageReduced)
- gen_image_proto (Image, ImageCleared, 32)
- overpaint_gray (ImageCleared, ImageReduced)
- gen_image_const (Image1, ‘byte‘, 512, 512)
- overpaint_region (Image1, Circle, 255, ‘fill‘)
- * /* Copy a circular part of the image into the image : */
- read_image (Image2, ‘G:/Halcon/images/images/brycecanyon1.png‘)
- paint_gray (ImageReduced, Image2, MixedImage)
- * /* Paint a rectangle into the image */
- read_image (Image3, ‘G:/Halcon/images/images/pads.png‘)
- gen_rectangle1 (Rectangle1, 30, 20, 100, 200)
- paint_region (Rectangle1, Image3, ImageResult, 255, ‘fill‘)
- * /* Paint colored xld objects into a gray image */
- * /* read and copy image to generate a three channel image */
- copy_image (Image2, image0)
- copy_image (Image2, image1)
- compose3 (image0, Image2, image1, MultiChannelImage)
- * /* extract subpixel border */
- threshold_sub_pix (MultiChannelImage, Border, 128)
- * /* select the circle and the arrows */
- circle := Border[14]
- arrow := Border[16]
- ObjectsConcat := [circle,arrow]
- * /* paint a green circle and white arrows (to paint all
- * * objects e.g. blue, pass [0,0,255] tuple for GrayVal) */
- paint_xld (ObjectsConcat, MultiChannelImage, ImageResult1, [0,1,0,1,1,255])
处理效果:
以上是关于Halcon学习之八:图像区域叠加与绘制的主要内容,如果未能解决你的问题,请参考以下文章