halcon初识Halcon四(halcon图像相关的算子)

dev_close_window ()
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
*读取图像
read_image (Image, 'C:/Users/24771/Pictures/Saved Pictures/1.jpg')
*计算图像的通道数
count_channels (Image, Num)
disp_message (WindowHandle, '拆分后图像的通道数为'+Num, 'window', 12, 12, 'black', 'true')
*循环读取每个通道的图像
for Index := 1 to Num by 1
    *获取多通道图像中指定通道的图像
    access_channel (Image, channel, Index)
endfor

*分解通道
decompose3 (Image, Image1, Image2, Image3)
*RGB通道转HSV通道
trans_from_rgb (Image1, Image2, Image3, ImageResult1, ImageResult2, ImageResult3, 'hsv')
*合并通道
compose2 (Image3, Image2, MultiChannelImage)
compose3 (Image1, Image2,Image3, MultiChannelImage2)
*向图像附加通道
append_channel (MultiChannelImage, Image1, ImageExtended)

*******************************图像相关的算子介绍*************
dev_open_window (0, 0, 512, 512, 'black', WindowHandle1)

*创建灰度值为零的图像
gen_image_const (Image8, 'int8', 512, 512)
*计算图像尺寸
get_image_size (Image, Width, Height)
*指定图像像素为同一灰度值
gen_image_proto (Image, ImageCleared1, 0)
gen_image_proto (Image, ImageCleared3, 255)
*得到图像的定义域
get_domain (Image, Domain)
*裁剪图像得到新图像
crop_domain (Image, ImagePart)
*获取图像像素的灰度值
get_grayval (ImagePart, 100, 100, Grayval)
*设置图像像素点的灰度值
set_grayval (ImagePart, 100, 100, Grayval)

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值