多媒体图像处理多媒体期中设计报告.docVIP

  • 1
  • 0
  • 约1.75千字
  • 约 8页
  • 2020-08-30 发布于浙江
  • 举报

多媒体图像处理多媒体期中设计报告.doc

Combining Spatial Enhancement Methods Successful image enhancement is typically not achieved using a single operation Rather we combine a range of techniques in order to achieve a final result This example will focus on enhancing the bone scan to the right 源代码及实验截图 Laplacian filter of bone scan (a) I=imread(a.jpg); subplot(2,4,1); imshow(I); I1=im2double(I); %把图像unit格式转换成double格式 I2=reshape(I1,[679 1278]); %把图像的尺寸由679*426*3转换为679*1278 M1=[0,-1,0; %设置拉普拉斯的卷积核为M1 -1,2,-1; 0,-1,0]; I3=imfilter(I2,M1); %I3为拉普拉斯变换后的图片 subplot(2,4,2); imshow(I3); Sharpened version of bone scan achieved by subtracting (a) and (b) I4=I3+I2; %原图和经过拉普拉斯变换后的图像相加得到锐化图像 subplot(2,4,3); imshow(I4); Sobel filter of bone scan (a) 对原图像用Sobel梯度操作,设分量为 gx为[-1,-2,-1;0,0,0;1,2,1], gy为[-1,0,1;-2,0,2;-1,0,1]的模板。 subplot(2,4,4); hx=[-1,-2,-1;0,0,0;1,2,1]; %生产sobel垂直梯度模板 hy=[-1,0,1;-2,0,2;-1,0,1]; %生产sobel水平梯度模板 gradx=filter2(hx,I,same); gradx=abs(gradx); %计算图像的sobel垂直梯度 grady=filter2(hy,I,same); grady=abs(grady); %计算图像的sobel水平梯度 I5=gradx+grady; %得到图像的sobel梯度 imshow(I5,[]); Image (d) smoothed with a 5*5 averaging filte subplot(2,4,5); h1 = fspecial(average,5) ; I6 = imfilter(I5,h1); imshow(I6); The product of (c) and (e) which will be used as a mask subplot(2,4,6); I7=I4.*I6; imshow(I7); Sharpened image which is sum of (a) and (f) subplot(2,4,7); I8=I+I7; imshow(I8); Result of applying a power-law trans. to (g) 对图g进行幂率变换处理 subplot(2,4,8); gamma=0.5; c=1; I9=c.*I8.^gamma; imshow(I9); 利用拉普拉斯变换突出图像细节,利用梯度法突出其边缘,利用平滑过的梯度图像掩蔽拉普拉斯图像等方法处理图像,通过对比原始图像和混合图像增强方法后的图像,可以发现改善了原始图像的清晰度,增强其对比度,突出谷歌的细节及边缘等等。总的来说,比单一的图像增强方法,如直方图,效果更好。

文档评论(0)

1亿VIP精品文档

相关文档