10.29halcon

read_image (Image, 'D:/photo/4.png')
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
dev_display (Image)
stop ()
* count_channels (Image, Channels)//计数通道
* for Index := 1 to Channels by 1
*     access_channel (Image, Image1, Index)
* endfor
* decompose3 (Image, Image11, Image2, Image3)//分离三通道

* dev_display (Image11)
* dev_display (Image2)
* dev_display (Image3)

* compose2 (Image11, Image2, MultiChannelImage)//组合两通道
MinGray := 0
MaxGray:=60

threshold (Image, Region, MinGray, MaxGray)//阈值分割

dev_display (Region)
stop ()

connection (Region, ConnectedRegions)
dev_display (ConnectedRegions)

助手-》打开新的image acquisition-》实时取流/非实时

自己学习特征直方图-------有很多特征  可以自行研究

read_image (Image, 'D:/data/上传到B站/《机器视觉案例》/案例原图/第四章/4-2.png')
get_image_size (Image, Width, Height)
dev_open_window (0, 0, Width, Height, 'black', WindowHandle)
dev_display (Image)
rgb1_to_gray (Image, GrayImage)
threshold (GrayImage, Region, 128, 255)
area_center (Region, Area, Row, Column)
hom_mat2d_identity (HomMat2DIdentity)//单位矩阵
*平移
hom_mat2d_translate (HomMat2DIdentity, Height/2-Row,Width/2-Column,  HomMat2DTranslate)
affine_trans_image (Image, ImageAffineTrans, HomMat2DTranslate, 'constant', 'false')
*旋转
hom_mat2d_rotate (HomMat2DIdentity, 3.14/2, Height/2, Width/2, HomMat2DRotate)
affine_trans_image (ImageAffineTrans, ImageAffineTrans1, HomMat2DRotate, 'constant', 'false')
*缩放
hom_mat2d_scale (HomMat2DIdentity, 2, 2, Height/2, Width/2, HomMat2DScale)
affine_trans_image (ImageAffineTrans1, ImageAffineTrans2, HomMat2DScale, 'constant', 'false')


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值