第一范文网 - 专业文章范例文档资料分享平台

西安交大数字图像处理第一次作业

来源:用户分享 时间:2025/6/15 16:39:37 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

figure(4)

imshow(uint8(img5),[0,31]) title('5灰度级');

for i=1:x for j=1:y

img4(i,j)=floor(I(i,j)/16); end end figure(5)

imshow(uint8(img4),[0,15]) title('4灰度级');

for i=1:x for j=1:y

img3(i,j)=floor(I(i,j)/32); end end figure(6)

imshow(uint8(img3),[0,7]) title('3灰度级');

for i=1:x for j=1:y

img2(i,j)=floor(I(i,j)/64); end end figure(7)

imshow(uint8(img2),[0,3]) title('2灰度级');

for i=1:x for j=1:y

img1(i,j)=floor(I(i,j)/128); end end figure(8)

imshow(uint8(img1),[0,1]) title('1灰度级');

lena2.m

A=imread('lena512.bmp'); B=mean2(A);

C=std2(A); D=C^2;

lena3.m

A=imread('lena512.bmp'); figure(1); imshow(A);

title('原始图像');

B1=imresize(A,[2048 2048],'nearest'); figure(2); imshow(B1);

title('最近邻插值法');

B2=imresize(A,[2048 2048],'bilinear'); figure(3); imshow(B2);

title('双线性插值法');

B3=imresize(A,[2048 2048],'bicubic'); figure(4); imshow(B3);

title('双三次插值法');

lena4.m

%Lena 图像:

transformtype='affine';

transformmatrix=[1 1.5 0;0 1 0;0 0 1]; T=maketform(transformtype,transformmatrix); I=imread('lena512.bmp'); nI=imtransform(I,T); figure(1); imshow(I);

title('原始图像');

B1=imresize(nI,[2048 2048],'nearest'); subplot(1,3,1); imshow(B1);

title('水平偏移 最近邻内插');

B2=imresize(nI,[2048 2048],'bilinear'); subplot(1,3,2); imshow(B2);

title('水平偏移 双线性内插');

B3=imresize(nI,[2048 2048],'bicubic'); subplot(1,3,3); imshow(B3);

title('水平偏移 双三次内插');

%Elain 图像:

transformtype='affine';

transformmatrix=[1 1.5 0;0 1 0;0 0 1]; T=maketform(transformtype,transformmatrix); I=imread('elaine512.bmp'); nI=imtransform(I,T); figure(5); imshow(I);

title('原始图像');

B1=imresize(nI,[2048 2048],'nearest'); subplot(1,3,1); imshow(B1);

title('水平偏移 最近邻内插');

B2=imresize(nI,[2048 2048],'bilinear'); subplot(1,3,2); imshow(B2);

title('水平偏移 双线性内插');

B3=imresize(nI,[2048 2048],'bicubic'); subplot(1,3,3); imshow(B3);

title('水平偏移 双三次内插');

lena5.m

%Lena 图像:

I=imread('lena512.bmp'); figure(1); imshow(I);

title('原始图像');

I1=imrotate(I,30,'nearest');

B1=imresize(I1,[2048 2048],'nearest'); subplot(1,3,1); imshow(B1);

title('旋转30度 最近邻内插'); I2=imrotate(I,30,'bilinear');

B2=imresize(I2,[2048 2048],'bilinear'); subplot(1,3,2); imshow(B2);

title('旋转30度 双线性内插'); L3=imrotate(I,30,'bicubic');

B3=imresize(L3,[2048 2048],'bicubic'); subplot(1,3,3); imshow(B3);

title('旋转30度 双三次内插');

%Elaine 图像:

L=imread('elaine512.bmp'); figure(5); imshow(L);

title('原始图像');

L1=imrotate(L,30,'nearest');

C1=imresize(L1,[2048 2048],'nearest'); subplot(1,3,1); imshow(C1);

title('旋转30度 最近邻内插'); L2=imrotate(L,30,'bilinear');

C2=imresize(L2,[2048 2048],'bilinear'); subplot(1,3,2); imshow(C2);

title('旋转30度 双线性内插'); L3=imrotate(L,30,'bicubic');

C3=imresize(L3,[2048 2048],'bicubic'); subplot(1,3,3); imshow(C3);

title('旋转30度 双三次内插');

搜索更多关于: 西安交大数字图像处理第一次作业 的文档
西安交大数字图像处理第一次作业.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c0zznc2gxyf62h61030qy_5.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top