数字图像处理与分析实验9-综合练习(一)-参考答案

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

实验9综合练习(一)实验目的:1.对需要进行处理的图像分析,正确运用所学的知识,采用正确的步骤,对图像进行各类处理,以得到令人满意的图像效果。实验内容:1.将bone_scan.jpg图像文件读入Matlab,按照以下步骤对其进行处理:a)用带对角线的Laplacian对其处理,以增强边缘。W1=[-1-1-1-18-1-1-1-1]b)用imadd函数叠加原始图像,可以看出边界增强了,但噪声增强了,应想法降低。c)对原图像进行Sobel滤波。(用fspecial生成)d)并用imfilter对(c)的结果进行5×5邻域平均,以减少噪声。e)用immultiply函数处理经(b)步骤和(d)步骤处理后的图像,噪声得以减少。f)最后用imadjust函数做幂次灰度变换,以增强dynamicrange。(多试几次,参考:γ取0.5)要求用imshow函数显示经每一步处理后的图像,比对效果。参考程序与处理结果======================================================================%Enhancingaimageofwholebodybonescanbycombiningvariousspatial%enhancementmethods,thestrategiesisasfollowing:%========================================================%1.UtilizetheLaplaciantohighlightfinedetail%2.Utilizethegradienttoenhanceprominentedges%3.CombineLaplacianandgradienttogetthedetail-enhancedandnoise-compressedimage%4.Increasethecontrastoflowgraylevelsbyusingagray-leveltransformation.%==========================================================%Theoriginalimagenamed'Fig0306(a)(bone-scan).tif'isunderthe%directory:J:\courseteaching\ҽѧͼÏñ´¦Àí\ʵÑé\ʾÀýͼÏñ%CopyrightbyHuangzhongchao,July16,2006clearall;closeall;f=imread('J:\courseteaching\ҽѧͼÏñ´¦Àí\ʵÑé\ʾÀýͼÏñ\Fig0306(a)(bone-scan).tif');f1=im2double(f);h1=fspecial('sobel');%ordirectlytypeh=[-1-2-1;000;121];g1=imfilter(f1,h1);subplot(121);imshow(f);title('theoriginalimage');%b1=mat2gray(g1);subplot(122);imshow(g1);title('theSobelgradient');h2=fspecial('average',5);%procducingaaverageingfilterg2=imfilter(g1,h2);figure(2);subplot(121);imshow(g2);title('thesmoothedgradientimage');h3=[-1-1-1;-18-1;-1-1-1];%Laplacianmaskg3=imfilter(f1,h3);%b2=mat2gray(g3);subplot(122);imshow(g3);title('theLaplacianimage');g4=g3+f1;figure(3);subplot(121);imshow(g4)title('sharpedimagebyaddinglaplacianfilteredandoriginalimage');g5=g4.*g2;subplot(122);imshow(g5);title('theproductofsmoothedgradientandLaplacianimage');g6=g5+f1;figure(4);subplot(121);imshow(g6);title('thesumofproductandoriginalimage');%constrastspreadingbypower-lawtransformationwithr=0.5andc=1;gamma=0.5;c=1;g7=c.*g6.^gamma;figure(4);subplot(122);imshow(g7);title('theendresultbycombiningthesharpingandgradientoperation');======================================================================运行结果参考:

1 / 5
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功