您好,欢迎访问三七文档
当前位置:首页 > 医学/心理学 > 医学现状与发展 > 数字图像处理实验报告
1目录实验一:数字图像的基本处理操作......................................................................................................21.1:实验目的.........................................................................................................................................21.2:实验任务和要求...............................................................................................................................21.3:实验步骤和结果...............................................................................................................................21.4:结果分析...........................................................................................................................................6实验二:图像的灰度变换和直方图变换..............................................................................................72.1:实验目的.........................................................................................................................................72.2:实验任务和要求...............................................................................................................................72.3:实验步骤和结果...............................................................................................................................72.4:结果分析.........................................................................................................................................11实验三:图像的平滑处理....................................................................................................................123.1:实验目的.......................................................................................................................................123.2:实验任务和要求.............................................................................................................................123.3:实验步骤和结果.............................................................................................................................123.4:结果分析.........................................................................................................................................16实验四:图像的锐化处理......................................................................................................................174.1:实验目的.......................................................................................................................................174.2:实验任务和要求.............................................................................................................................174.3:实验步骤和结果.............................................................................................................................174.4:结果分析.........................................................................................................................................192实验一:数字图像的基本处理操作1.1:实验目的1、熟悉并掌握MATLAB、PHOTOSHOP等工具的使用;2、实现图像的读取、显示、代数运算和简单变换。3、熟悉及掌握图像的傅里叶变换原理及性质,实现图像的傅里叶变换。1.2:实验任务和要求1.读入一幅RGB图像,变换为灰度图像和二值图像,并在同一个窗口内分成三个子窗口来分别显示RGB图像和灰度图像,注上文字标题。2.对两幅不同图像执行加、减、乘、除操作,在同一个窗口内分成五个子窗口来分别显示,注上文字标题。3.对一幅图像进行平移,显示原始图像与处理后图像,分别对其进行傅里叶变换,显示变换后结果,分析原图的傅里叶谱与平移后傅里叶频谱的对应关系。4.对一幅图像进行旋转,显示原始图像与处理后图像,分别对其进行傅里叶变换,显示变换后结果,分析原图的傅里叶谱与旋转后傅里叶频谱的对应关系。1.3:实验步骤和结果1.对实验任务1的实现代码如下:a=imread('d:\tp.jpg');i=rgb2gray(a);I=im2bw(a,0.5);subplot(1,3,1);imshow(a);title('原图像');subplot(1,3,2);imshow(i);title('灰度图像');subplot(1,3,3);imshow(I);title('二值图像');subplot(1,3,1);imshow(a);title('原图像');结果如图1.1所示:3图1.1原图及其灰度图像,二值图像2.对实验任务2的实现代码如下:a=imread('d:\tp.jpg');A=imresize(a,[800800]);b=imread('d:\tp2.jpg');B=imresize(b,[800800]);Z1=imadd(A,B);Z2=imsubtract(A,B);Z3=immultiply(A,B);Z4=imdivide(A,B);subplot(3,2,1);imshow(A);title('原图像A');subplot(3,2,2);imshow(B);title('原图像B');subplot(3,2,3);imshow(Z1);title('加法图像');subplot(3,2,4);imshow(Z2);title('减法图像');subplot(3,2,5);imshow(Z3);title('乘法图像');subplot(3,2,6);imshow(Z2);title('除法图像');结果如图1.2所示:43.对实验任务3的实现代码如下:s=imread('d:\tp3.jpg');i=rgb2gray(s);i=double(i);j=fft2(i);k=fftshift(j);%直流分量移到频谱中心I=log(abs(k));%对数变换m=fftshift(j);%直流分量移到频谱中心RR=real(m);%取傅里叶变换的实部II=imag(m);%取傅里叶变换的虚部A=sqrt(RR.^2+II.^2);A=(A-min(min(A)))/(max(max(A)))*255;b=circshift(s,[800450]);b=rgb2gray(b);b=double(b);c=fft2(b);e=fftshift(c);I=log(abs(e));f=fftshift(c);WW=real(f);ZZ=imag(f);B=sqrt(WW.^2+ZZ.^2);5B=(B-min(min(B)))/(max(max(B)))*255;subplot(2,2,1);imshow(s);title('原图像');subplot(2,2,2);imshow(uint8(b));title('平移图像');subplot(2,2,3);imshow(A);title('离散傅里叶变换频谱');subplot(2,2,4);imshow(B);title('平移图像离散傅里叶变换频谱');结果如图1.3所示:4.对实验任务4的实现代码如下:s=imread('d:\tp3.jpg');i=rgb2gray(s);i=double(i);j=fft2(i);k=fftshift(j);I=log(abs(k));m=fftshift(j);RR=real(m);II=imag(m);A=sqrt(RR.^2+II.^2);A=(A-min(min(A)))/(max(max(A)))*255;b=imrotate(s,-90);b=rgb2gray(b);b=double(b);c=fft2(b);6e=fftshift(c);I=log(abs(e));f=fftshift(c);WW=real(f);ZZ=imag(f);B=sqrt(WW.^2+ZZ.^2);B=(B-min(min(B)))/(max(max(B)))*255;subplot(2,2,1);imshow(s);title('原图像');subplot(2,2,2);imshow(uint8(b));title('平移图像');subplot(2,2,3);imshow(A);title('离散傅里叶频谱');subplot(2,2,4);imshow(B);title('平移图像离散傅里叶频谱');结果如图1.4所示:1.4:结果分析对MATL
本文标题:数字图像处理实验报告
链接地址:https://www.777doc.com/doc-2304184 .html