|
图像加权融合:
百度网盘链接:链接:
视频1:http://pan.baidu.com/s/1jHArMtg
视频2:http://pan.baidu.com/s/1sl5AaF7
具体链接在halcom.cn论坛,联系人QQ:3283892722
该论坛是一个学习交流平台,我会逐一的和大家分享学习。
欢迎大家录制视频,并提交给我,我来设置视频,你可在论坛进行打赏分享。
视频专用播放器:http://halcom.cn/forum.php?mod=viewthread&tid=258&extra=page%3D1
Halcon代码如下
- dev_update_off()
- list_image_files('C:/Users/ysw/Desktop/视频讲解/图像处理视频Halcon/图像加权融合/merge_images','default', [], ImageFiles)
- Width := 245
- Height := 205
- gen_empty_obj(EmptyObject)
- for i := 0 to |ImageFiles|-1 by 1
- read_image (Image,ImageFiles[i])
- count_channels(Image,Channels)
- if(Channels>1)
- rgb1_to_gray(Image,Image)
- endif
- zoom_image_size(Image,Image,Width,Height,'constant')
- concat_obj(Image, EmptyObject, EmptyObject)
- endfor
- copy_obj(EmptyObject,Image1,1,1)
- copy_obj(EmptyObject,Image2,2,1)
- copy_obj(EmptyObject,Image3,3,1)
- * get RF and CF
- tuple_gen_sequence(0,Width*Height-1,1,Sequence)
- tuple_mod(Sequence,Width,CF)
- tuple_div(Sequence,Width,RF)
- get_grayval(Image1,RF,CF,Grayval1)
- get_grayval(Image2,RF,CF,Grayval2)
- get_grayval(Image3,RF,CF,Grayval3)
- * 融合
- Grayval4 :=[]
- for i :=0 to Width*Height-1 by 1
- Grayval4[i] := (Grayval1[i]+Grayval2[i]+Grayval3[i])/3.0
- endfor
- gen_image_const(MergeImage,'real',Width,Height)
- set_grayval(MergeImage,RF,CF,Grayval4)
复制代码
|
|