matlab图像处理实例
1个回答
2013-07-09
展开全部
小波融合实例:clc;clear all;close all;
%%读取两幅图像
X1=imread('rice.png');
X2=imread('cameraman.tif');
if ndims(X1)==3
X3=rgb2gray(X1);
else
X3=X1;
end
if ndims(X2)==3
X4=rgb2gray(X2);
else
X4=X2;
end
subplot(221)
[m,n]=size(X3);
imshow(X3);
subplot(222)
imshow(X4);
X3=double(X3);
X4=double(X4);
%%进行小波变换
[C1,L1]=wavedec2(X3,2,'sym4');
[C2,L2]=wavedec2(X4,2,'sym4');
%%融合
C=(C1+C2)*0.5;
X=waverec2(C,L1,'sym4');
X=uint8(X);
subplot(224)
imshow(X);
%%读取两幅图像
X1=imread('rice.png');
X2=imread('cameraman.tif');
if ndims(X1)==3
X3=rgb2gray(X1);
else
X3=X1;
end
if ndims(X2)==3
X4=rgb2gray(X2);
else
X4=X2;
end
subplot(221)
[m,n]=size(X3);
imshow(X3);
subplot(222)
imshow(X4);
X3=double(X3);
X4=double(X4);
%%进行小波变换
[C1,L1]=wavedec2(X3,2,'sym4');
[C2,L2]=wavedec2(X4,2,'sym4');
%%融合
C=(C1+C2)*0.5;
X=waverec2(C,L1,'sym4');
X=uint8(X);
subplot(224)
imshow(X);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |