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

matlab图像处理基础实例

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

得到图像边界,并计算周长、面积和重心坐标 >> a=imread('lbxx.bmp'); >> a1=bwperim(a); >> l=0;

>> [m,n]=size(a1); >> for i=1:m*n if(a1(i)==1) l=l+1; end end

>> [m,n]=size(a);s=0; >> for i=1:m*n if(a(i)==1) s=s+1; end end

>> x=0;y=0; >> for i=1:m for j=1:n if(a(i,j)==1) x=i+x;y=j+y; end end end

>> x=x/s;y=y/s; >> l,s,x,y

>> a=imread('trees.tif')%么有加;号

33 33 33 33 33 33 33 19 33 28 33 33 33 33 33 33 33 33 33 19 33 33 19 33 19 33 33 33 19 21 33 33 33 33 33 33 33 33 33 28 33 33 33 19 33 33 33 33 33 21 33 33 33 33 45 57 57 33 33 10 45 33 33 45 45 45 45 33 33 19 33 45 33 33 45 45 33 33 33 19 57 33 33 33 45 33 33 33 33 28 33 33 33 33 57 33 33 33 33 33 57 45 33 45 45 33 33 33 19 19 45 33 45 33 33 45 33 33 33 33 45 45 33 57 45 33 33 33 33 19 。。。。。。。。。。。。。。。。。。。 >> a=imread('trees.tif'); >> imshow(a) >> subplot(211) >> imshow(a) >> subplot(212) >> imshow(~a)

>> [x,map]=imread('trees.tif'); >> image(x);%显示矩阵x图像

>> Colormap(map)%设置颜色映射表,这样才可以将tif文件显示成彩色的????

>> i=imread('trees.tif'); >> j=filter2([1 2 -1 -2],i); >> imshow(j,[])

>> i=imread('rice.png'); >> subplot(121)

>> imshow(i,[100 200]);%灰度范围为[100 200] >> subplot(122)

>> imshow(i,20)%灰度等级为20

>> load trees

>> a=[10 60];imagesc(X,a);Colormap(gray)

imshow rice.png %直接从磁盘显示,无需单独读入

>> a=imread('onion.png'); >> i=rgb2gray(a);

>> h=[1 2 1;0 0 0;-1 -2 -1];

>> i2=filter2(h,i);%使用二维滤波器h进行滤波 >> imshow(i2,[]) >> colorbar

显示单帧图像

>> mri=uint8(zeros(128,128,1,27)); >> for frame=1:27

[mri(:,:,:,frame),map]=imread('mri.tif',frame); end

>> imshow(mri(:,:,:,3),map);%显示第三帧

problem:如何知道一幅图像有几帧???????? 显示多帧图像

>> montage(mri,map)

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