halcon图像拼接

read_image (Image, 'D:/Working/工程项目/多张图像拼接/1.0D-3.5HZ_C001H001S0001/1.tif')
dev_open_window_fit_image (Image, 0, 0, -1, -1, WindowHandle)
dev_display (Image)


get_image_size (Image, Width, Height)
get_image_type (Image, Type)
*截取部分图像
gen_rectangle1 (Rectangle, 416, 0, 416+30, Width)
reduce_domain (Image, Rectangle, ImageReduced)
*生成空白图像
gen_image_const (Image1, Type, Width, 5000)
gen_image_const (Image2, Type, Width, 5000)
gen_image_const (Image3, Type, Width, 5000)
compose3 (Image1, Image2, Image3, MultiChannelImage)
*绘制位置1
overpaint_gray (MultiChannelImage, ImageReduced)
*平移
hom_mat2d_identity (HomMat2DIdentity)
hom_mat2d_translate (HomMat2DIdentity, 300, 0, HomMat2DTranslate)
affine_trans_image (ImageReduced, ImageAffinTrans, HomMat2DTranslate, 'constant', 'true')
get_image_size (ImageAffinTrans, Width1, Height1)

affine_trans_region (Rectangle, RegionAffineTrans, HomMat2DTranslate, 'constant')
reduce_domain (ImageAffinTrans, RegionAffineTrans, ImageReduced1)
*绘制位置2
overpaint_gray (MultiChannelImage, ImageReduced1)
write_image (MultiChannelImage, 'tiff', 0, 'fuck1')
read_image (Image4, 'C:/Users/Administrator/Desktop/2020-04-21-13-15-42-750.tif')
count_channels (Image4, Channels)

  

posted @ 2020-04-22 13:21  黄晓魚  阅读(1412)  评论(0编辑  收藏  举报