关于图像处理的些简单的matlab编码

上传人:jiups****uk12 文档编号:38466855 上传时间:2018-05-02 格式:DOCX 页数:6 大小:21.19KB
返回 下载 相关 举报
关于图像处理的些简单的matlab编码_第1页
第1页 / 共6页
关于图像处理的些简单的matlab编码_第2页
第2页 / 共6页
关于图像处理的些简单的matlab编码_第3页
第3页 / 共6页
关于图像处理的些简单的matlab编码_第4页
第4页 / 共6页
关于图像处理的些简单的matlab编码_第5页
第5页 / 共6页
点击查看更多>>
资源描述

《关于图像处理的些简单的matlab编码》由会员分享,可在线阅读,更多相关《关于图像处理的些简单的matlab编码(6页珍藏版)》请在金锄头文库上搜索。

1、1、关于细胞数组类型: student1,1=liming,wangyi; student1,2=1,2; student2,1=f,m; student2,2=20,22student = 1x2 cell 1x2 cell1x2 cell 1x2 cell student1,1ans = liming wangyicellplot(student)limingwangyi12fm20222、For循环语句 close all;clear all;k=5;hilbert=zeros(k,k);for m=1:kfor n=1:khilbert(m,n)=1/(m+n-1);endendfor

2、mat rat3、pause 函数 clear all; t=0:pi/20:2*pi; x=sin(t); figure; plot(t,x); xlabel(t); ylabel(x); hold on ; for i=1:7;pause ;plot(t,sin(t+i/5);hold on ; end4、利用 error 显示出错信息 clear all while 1;x=input(请输入正数: ); if x x=0:0.01:10; y1=sin(2*x); y2=2*sin(x); plot(x,y1,b-,x,y2,r*); axis(0 pi -1 1); axis(0 p

3、i -2 2); title(正弦函数); xlabel(时间/单位:秒); ylabel(电压/单位:伏特); gtext(y=sin(2x); gtext(y=2sin(x); grid on6、将索引图像为 RGB 图像 X,map=imread(spine.tif);figure;subplot(121);imshow(X,hot(64);rgb=ind2rgb(X,map);subplot(122);imshow(rgb);7、将矩阵转换为灰度图像 I=1 2 3;4 5 6;0 1 0; X=mat2gray(I); figure; imshow(X) 8、RGB图像转换为索引图像

4、 r=imread(football.jpg); x1,map=rgb2ind(r,64); x2,map=rgb2ind(r,0.2); map3=colorcube(128); x3=rgb2ind(r,map3); figure; subplot(141),imshow(r); subplot(142),imshow(x1,map); subplot(143),imshow(x2,map); subplot(144),imshow(x3); 9、索引图像转换为灰度图像 X,map=imread(forest.tif); I=ind2gray(X,map); figure;imshow(X

5、,map); figure;imshow(I); 10、图像的保存 load trees;%将文件trees载入到工作空间中 whos %显示工作空间中的变量 imwrite(X,map,trees.bmp) 11、图像信息工具的显示 h=imshow(hestain.png); hp=impixelinfo; set(hp,position,150 290 300 20); 12、imadjust函数 close all;clear all;clc;gamma=0.5;I=imread(peppers.png);R=I;R(:,:,2)=0;R(:,:,3)=0;R1=imadjust(R,

6、0.5 0.8,0,1,gamma);G=I;G(:,:,1)=0;G(:,:,3)=0;G1=imadjust(G,0 0.3,0 1,gamma);B=IB(:,:,1)=0;B(:,:,2)=0;B1=imadjust(B,0 0.3,0 1,gamma);I1=R1+G1+B1;set(0,defaultfigureposition,100,100,1000,500);set(0,defaultfigurecolor,1,1,1);figure(1);subplot(121),imshow(R);subplot(122),imshow(R1);figure(2);subplot(121

7、),imshow(G);subplot(122),imshow(G1);figure(3);subplot(121),imshow(B);subplot(122),imshow(B1);figure(4);subplot(121),imshow(I);subplot(122),imshow(I1);13、分段处理图像 close all;clear all;clc;R=imread(peppers.png);J=rgb2gray(R);M N=size(J);x=1;y=1;for x=1:M;for y=1:N;if(J(x,y)35 H(x,y)=(105/180)*J(x,y)-75+1

8、50;endendendsubplot(121),imshow(J);subplot(122),imshow(H); 14、非线性变换 close all;clear all;clc;R=imread(peppers.png);G=rgb2gray(R);J=double(G);H=(log(J+1)/10;subplot(121);imshow(G);subplot(122);imshow(H); 15、图像的平移 创建move函数1function J=move(I,a,b);%J=move(I,a,b)moveIabIxy%1M,N,G=size(I);I=im2double(I);J=ones(M,N,G);for i=1:Mfor j=1:Nif (i+a)=1 J(i,j)=255;endendendfigure;subplot(121),imshow(uint8(I);subplot(122),imshow(uint8(J);

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 行业资料 > 其它行业文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号