matlab图像处理的几个实例.docx

matlab图像处理的几个实例.docx

ID:50076779

大小:411.34 KB

页数:12页

时间:2020-03-04

matlab图像处理的几个实例.docx_第1页
matlab图像处理的几个实例.docx_第2页
matlab图像处理的几个实例.docx_第3页
matlab图像处理的几个实例.docx_第4页
matlab图像处理的几个实例.docx_第5页
资源描述:

《matlab图像处理的几个实例.docx》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、Matlab图像处理的几个实例(初学者用)1.图像的基本信息及其加减乘除clear,clc;P=imread('yjx.jpg');whosPQ=imread('dt.jpg');P=im2double(P);Q=im2double(Q);gg1=im2bw(P,0.3);gg2=im2bw(P,0.5);gg3=im2bw(P,0.8);K=imadd(gg1,gg2);L=imsubtract(gg2,gg3);cf=immultiply(P,Q);sf=imdivide(Q,P);subplot(421),imsho

2、w(P),title('郁金香原图');subplot(422),imshow(gg1),title('0.3');subplot(423),imshow(gg2),title('0.5');subplot(424),imshow(gg3),title('0.8');subplot(425),imshow(K),title('0.3+0.5');subplot(426),imshow(L),title('0.5-0.3');subplot(427),imshow(cf),title('P*Q');subplot(428),

3、imshow(sf),title('P/Q');2.图像缩放clear,clc;I=imread('dt.jpg');A=imresize(I,0.1,'nearest');B=imresize(I,0.4,'bilinear');C=imresize(I,0.7,'bicubic');D=imresize(I,[100,200]);F=imresize(I,[400,100]);figuresubplot(321),imshow(I),title('原图');subplot(322),imshow(A),title('最

4、邻近插值');subplot(323),imshow(B),title('双线性插值');subplot(324),imshow(C),title('二次立方插值');subplot(325),imshow(D),title('水平缩放与垂直缩放比例为2:1');subplot(326),imshow(F),title('水平缩放与垂直缩放比例为1:4');灰度变换、直方图变换clear,clc;fg=imread('fg.jpg');zl=imread('zl.jpg');hfg=rgb2gray(fg);fg1=dou

5、ble(hfg);out1=255*(fg1/255).^0.7;out1(find(out1>255))=255;fg1=uint8(fg1);out1=uint8(out1);img=rgb2gray(zl);[harm,x]=imhist(img);J=histeq(hfg,harm);figuresubplot(421),imshow(fg1),title('复古灰度图');subplot(422),imhist(fg1),title('复古灰度图的直方图');subplot(423),imshow(out1),t

6、itle('对复古灰度图像进行幂次变换');subplot(424),imhist(out1),title('幂次变换图像的直方图');subplot(425),imshow(img),title('朱莉');subplot(426),imhist(img),title('朱莉图像对应的直方图');subplot(427),imshow(J),title('直方图变换后的复古图');subplot(428),imhist(J),title('直方图变换后的复古图对应的直方图');傅里叶变换、频域滤波1.傅里叶变换clear

7、,clc;rgb=imread('zl.jpg');rgb=imresize(rgb,0.7,'bilinear');rgb=im2double(rgb);fR=rgb(:,:,1);fG=rgb(:,:,2);fB=rgb(:,:,3);flyfR=fft2(fR);flyfG=fft2(fG);flyfB=fft2(fB);Frgb(:,:,1)=flyfR;Frgb(:,:,2)=flyfG;Frgb(:,:,3)=flyfB;tzR=fftshift(flyfR);tzG=fftshift(flyfG);tzB=f

8、ftshift(flyfB);tzF(:,:,1)=tzR;tzF(:,:,2)=tzG;tzF(:,:,3)=tzB;iflyfR=ifft2(flyfR);iflyfG=ifft2(flyfG);iflyfB=ifft2(flyfB);out(:,:,1)=iflyfR;out(:,:,2)=ifl

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。