资源描述:
《图像数字处理部分程序》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、.例3.1-----------------------------------------------------------------I=imread('');%模拟高斯噪声J=imnoise(I,'gaussian',0,0.02);将多个图画到一个平面上subplot(1,2,1),imshow(I);subplot(1,2,2),imshow(J);K=zeros(242,308);fori=1:100J=imnoise(I,'gaussian',0,0.02);J1=im2double(J);K=K+J1;endK=K/100;fig
2、ure;imshow(K);-..-----------------------------------------------------------------例3.2I=imread();J=imread();K=imsubtract(I,J);%实现两幅图片相减K1=255-K;figure;imshow(I);title('有噪声的图');figure;imshow(J);title('原图');figure;imshow(K1);title('提取的噪声');---------------------------------------
3、--------------------------例3.3I=imread();%读取一张图片J=immultiply(I,1.2);%将此图片乘以1.2K=immultiply(I,2);%将此图片乘以2subplot(1,3,1),imshow(I);-..subplot(1,3,2),imshow(J);subplot(1,3,3),imshow(K);-----------------------------------------------------------------例3.4moon=imread('');I=double(m
4、oon);J=I*0.43+90;K=I*0.1+90;L=I*0.01+90;moon2=uint8(J);moon3=uint8(K);moon4=uint8(L);J=imdivide(moon,moon2);K=imdivide(moon,moon3);L=imdivide(moon,moon4);subplot(2,2,1),imshow(moon);subplot(2,2,2),inshow(J,[]);subplot(2,2,3),imshow(K,[]);subplot(2,2,4),imshow(L,[]);-..--------
5、---------------------------------------------------------例3.5A=zeros(128);A(40:67,60:100)=1;figure(1);imshow(A);B=zeros(128);B(50:80,40:70)=1;figure(2);imshow(B);C=and(A,B);figure(3);imshow(C);D=or(A,B);figure(4);imshow(D);E=not(A);figure(5);imshow(E);-..----------------------
6、-------------------------------------------例3.6I=imread('');J=imrotate(i,60,'bilinear');K=imroatte(i,60,'bilinear','crop');subplot(1,3,1),imshow(I);subplot(1,3,2),imshow(J);subplot(1,3,3),imshow(K);-----------------------------------------------------------------例3.7I=imread('
7、');J1=imresize(I,10,'nearest');J2=imresize(I,10,'bilinear');J3=imresize(I,10,'bicubic');figureimshow(I);title('原图');-..figureimshow(J1);title('最近邻法');figureimshow(J2);title('双线性插值法');figureimshow(J3);title('三次内插法');--------------------------------------------------------------
8、---P54例4.2---------------------------------------------------