《Matlab图像处理实验指导书.docx》由会员分享,可在线阅读,更多相关《Matlab图像处理实验指导书.docx(28页珍藏版)》请在优知文库上搜索。
1、生命科学与技术学院Eg8telSmog(pcEesatog7.,MM*4fxM1W9110上教学HKKM1) HkMa9Nt4VfefA!.HfliaARnatk“”HN为S3A“九nmBtau*M1.k“,世OJtamuik低鼻.3a11WitWttA6(nrjM.J4IYlK.MHAUfiMZt.ftCK11U4lH.Vkl力加afrfMJAlfcF*Xz*,4Mll1ffWU1aWi*AM11m*mOHAHX三*.dlfiil冷03MlWtHfrn*So*4BfmftNRmt*r.Hiir;CR!l,KtJ0tHaeKM.aIMtMK-4.i*t电IIf)K能,“,.tihwWMMMAt
2、lMRtro,0,,力A”阴It,:力,AthKtftHBACX(t*./K8Wl9力.ttaHer)cn八9Ma*t*ucctf,MQ打。仇国MUlt4ttRM.W4ltitMn6WM0W*1UWaSX串a.6UME,.SaWiniW,*M*Efl“IMtNgjQiflNMVn”B匕*和力0m知SJt4t,-4*BMItkiMMU,”勺*391MliSWilUU三BWWUMJMltCT*W匕入外,Mlkf44WWV*tf*ll*hWP*MfclF32*。3,外RHMIBWtWT”“,3,rt,IlKUW*wVtt*kimM*F,MwrONMW4tIHt科OHG#aJ0*AQtff3WnMJW
3、,MMi*4VXyO中,必*3M,:yH!3,liMr*Fnrrxf、5aW:BV*naz*umvu4一mvosff*w三tsww-ia三Mi“iWttif9r3Nr“5l79SXIW*H0l;V但93*VV-Crtt!7kttUlrVVliMJaiNMiMKV4MkUWMH41rrWhMt*4lkMA*Mm*rthMMW3XltViC*1*FWRUW.。用:.RAIQM4C.*XkiM.a.ntiaa.“(umA4tsa.iiMinan*wiarwif)4tMHm.fctm.第utF.H、,en.tfM.11-A.awtM-a4QSDS,|*Qf*-,HCfl-.,-Em7MtXMHe%2M
4、*ACMiau*.nntuUDnHM4!.mtad0n(ncr;nR,5.mtW4AXtI0!M*“余炳QluRjnjM.:*ru.u.vwRntuntt4NKSiItlS*b4mb!1汽“tin.amu,?,料的这,.9t.*%月Ul火ItlW、公HMC*mK45KihHM,MW2cftnnriHMi!ritRn-umtsw)tMer;*uNjn*jM*.I1I三d.IWMMbMMMi.tMMtitnOMR*n史*smk,tt*AAcfvn.aMtt*Mi49fNHKMCl*C2FffrftMTHMrt3.4CTCW*?.MMWHBSMf74M.W收罐H,JMt*RHVMh4Wttrt4lt
5、HWJJI入器外UlMS,MffMVMiyBR.tUCW.B*IRllMrltdllWtRtlAttlRAt-AtfM.9三Rflt-411WG1nlll*tH0三.ItHN今M44*NtBrA.ft三d*KC-*XHl*d*1tnmlC4Ofc.M1tfUMIHMVMtat14*K.E*tWHA4.0*MIatfdt(7*w*TUBi6t-WHt-4,lc,*HM腾,*774i/VVi*%AB-rn,l*H7,.tl7RVJ.6*ft郑州上学Madab应用图像处理课程实验指导书电气工程学院生物医学工程系2006年11月试验一MalIab图像显示方法一、试睑目的1 .了解Mathb的基本功能及
6、操作方法2 .练习图像读写和显示函数的运用方法3 .驾驭Matlab支持的五类图像的显示方法二、试验内容1 .图像的读写A)图像读RGB=imread(ngc6543a.jpg);B)图像写先从一个.mat文件中栽入一根图像,然后利用图像写函数imwritc,创建一个bmp文件,并将图像存入其中.loadclownwhosimwrite(,map,clown.bmp)C)图像文件格式转换bitmap=imread(,clown.bmp,bmp);imwrite(bitmap,clown.png,png);2 .图像显示A)二进制图像的显示BWl=zeros(20,20);%创建仅包含0/1的双
7、精度图像BWI(2:2:18,2:2:18)=1;imshow(BWl,notruesize);whosBW2=uint8(BWl);figure,imshow(BW2,notruesize)BW3=BW2=0;%龙软标记汉为Onfigure,imshow(BW3,notruesize)whosBW=lmread(circles.tif);imshow(BW);figure,imshow(BW);figure,imshow(BW,10O;O01);B)灰度图像的显示I=imread(testpatl.tif);J=filter2(l2;-l-2zI);Imshow(I)figure,imsho
8、w(J,)O索引图像的显示loadclown%奘放一幅图像imwrite(,map,clown.bmp);%保存为bmp文件imshow(X)imshow(X,map)D)RGB图像的显示I=imread(flowers.tif);imshow(I)RGB=imread(ngc6543a.jpg,);figure,imshow(RGB)imshow(I(:,:,3)%显示第3个颜色重研E)多帧图像的显示mri=uint8(zeros(128,128,1,27);%27帧文件mri.tif初始化forframe=1:27mri(frame),map=imread(mri.tifzframe);%
9、读入每一帧endimshow(mri(:,:,:,3),map);%显示第3帧figure,imshow(mri(:,:,:,6),map);%显示笫6帧figure,imshow(mri(:,:,:,10),map);%显示第10帧figure,imshow(mri(:,:,:,20),map);%显示第20帧F)显示多幅图像l,mapl=imread(,forest.tif);2,map2=lmread(trees.tlf,);subplot(l,2,l),imshow(l,mapl)subplot(l,2,2),imshow(X2,map2)SIJbPlOt(1,2,1),SUbimag
10、e(Xl,mapl)subplot(l,2,2),subimage(X2,map2)三、思索题:1.图像显示时,若不带参数noruesize,显示效果如何?2 .如何显示RGB图像的某一个颜色重量?3 .如何显示多帧图像的全部帧?如何依据多帧图像创建电影片段?试验二图像运算一、试睑目的I.熟识图像点运算和代数运算的实现方法2. 了解图像J1.何运算的简沽应用3. 了解图像的翎域操作二、试验内容I.图像点运算读入图像ricc.tif,通过图像点运霓变更对比度.rice=imread(,rice.tif,);subplot(131),imshow(rice)I=double(rice);%转换为双
11、精度类型J=I*0.43+60;rice2=uint8(J);%转换为uint8subplot(132),imshow(rice2)J=I*1.5-60;rice3=uint8(J);%转换为Uint8subplot(133),imshow(rice3)2 .图像的代数运算A)图像加法运算I=imread(rice.tif);imshow(I)J=imread(,cameraman.tif);figure,imshow(J)K=imadd(I,J);figure,imshow(K)K2=imadd(IJ,uintl6);figure,imshow(K2,)RGB=imread(flowers.tif);RGB2=imadd(RGB,50);imshow(RGB)figure,imshow(RGB2)RGB3=imadd