![关于数字图像处理的基于matlab的_第1页](http://file3.renrendoc.com/fileroot_temp3/2022-2/28/e06f652b-ed82-460d-bbfa-ee1cf7dc57cb/e06f652b-ed82-460d-bbfa-ee1cf7dc57cb1.gif)
![关于数字图像处理的基于matlab的_第2页](http://file3.renrendoc.com/fileroot_temp3/2022-2/28/e06f652b-ed82-460d-bbfa-ee1cf7dc57cb/e06f652b-ed82-460d-bbfa-ee1cf7dc57cb2.gif)
![关于数字图像处理的基于matlab的_第3页](http://file3.renrendoc.com/fileroot_temp3/2022-2/28/e06f652b-ed82-460d-bbfa-ee1cf7dc57cb/e06f652b-ed82-460d-bbfa-ee1cf7dc57cb3.gif)
![关于数字图像处理的基于matlab的_第4页](http://file3.renrendoc.com/fileroot_temp3/2022-2/28/e06f652b-ed82-460d-bbfa-ee1cf7dc57cb/e06f652b-ed82-460d-bbfa-ee1cf7dc57cb4.gif)
![关于数字图像处理的基于matlab的_第5页](http://file3.renrendoc.com/fileroot_temp3/2022-2/28/e06f652b-ed82-460d-bbfa-ee1cf7dc57cb/e06f652b-ed82-460d-bbfa-ee1cf7dc57cb5.gif)
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、A=imread('abc.jpg');%图像的读取B=imshow(A);%显示图像Ax,map=imread('abc.jpg');%x是图像的数据矩阵,map是图像的颜色矩阵image(x);colormap(map);C=size(x);%显示x矩阵的行数,列数,维数D=image(x);%显示图像AE=x(:,:,2);%显示想第二层二维矩阵(一般图像没rgb图像,第一层数据代表红的强度。第二层代表绿的强度。第三层代表蓝的强度)F=imfinio('abc.jpg');%图像文件信息的查询Example:加噪声I=imread('
2、;G:a.tif') ;p=rgb2gray(I);%显示灰度图J1=imnoise(p,'salt & pepper',0.04);subplot(121),subimage(J1);title('加入盐椒噪声后的图像,密度D=0.04');J2=imnoise(p,'gaussian',0,0.04);subplot(122),subimage(J2);title('加入高斯噪声后的图像,M=0,V=0.04');注:gaussian 高斯噪声 salt&petter 盐椒噪声 speckle 乘法噪声
3、Example:滤波1.Mean filterI = imread('coins.png');h = ones(5,5) / 25;%产生五行五列的1/25I2 = imfilter(I,h);imshow(I), title('Original Image');figure, imshow(I2);title('Filtered Image');2.Median filterI=imread('G:a.tif') ;p=rgb2gray(I);J1=imnoise(p,'salt & pepper',0.
4、04);subplot(221),subimage(J1);title('加入盐椒噪声后的图像,密度D=0.04');J2=imnoise(p,'gaussian',0,0.04);subplot(222),subimage(J2);title('加入高斯噪声后的图像,M=0,V=0.04');J3=medfilt2(J1);subplot(223),subimage(J3);title('加入盐椒噪声中值滤波后的图像');J4=medfilt2(J2);subplot(224),subimage(J4);title('加
5、入高斯噪声中值滤波后的图像');Spatial Sharpening filtering空间锐化滤波Example:第一个I=imread('Water lilies.jpg');BW=rgb2gray(I);BW2=edge(BW,'sobel',0.02,'both'); figure,imshow(BW2);第二个I = imread('bacteria.BMP');BW1 = edge(I,'prewitt',0.04)% 0.04为梯度阈值figure(1);imshow(I);figure(2)
6、;imshow(BW1);Basic operations of Digital Image processing ex: J = imcomplement(g); imshow(J),ex: I = imread('circuit.tif'); J = imresize(I,1.25);%图像放大 imshow(I) figure, imshow(J)ex: J = imresize(I,100 150, 'bilinear'); imshow(I) figure, imshow(J)ex: I = imread('pout.tif'); J
7、= imrotate(I,35);%35代表35度 imshow(J)ex: I=imread('cameraman.tif'); T = maketform('affine',cosd(45) -sind(45) 0; sind(45) cosd(45) 0; 0 0 1); tformfwd(10 20,T); I2 = imtransform(I,T); imshow(I2) Ex:I = imread('cameraman.tif');se = translate(strel(1), 25 25);J = imdilate(I,se)%图
8、像扩大;imshow(I), title('Original')figure, imshow(J), title('Translated');Translate an image Using affine transformation I=imread('cameraman.tif');T = maketform('affine',1 0 0; 1 2 0; 0 0 1);tformfwd(10 20,T);I2 = imtransform(I,T);imshow(I2)Frequency Domain Filtering H =
9、 HPFILTER(TYPE, M, N, D0, n) creates the transfer function of a highpass filter, H, of the specified TYPE and size (M-by-N). Valid values for TYPE, D0, and n are: 'ideal' Ideal highpass filter with cutoff frequency D0. n need not be supplied. D0 must be positive. 'btw' Butterworth hi
10、ghpass filter of order n, and cutoff D0. The default value for n is 1.0. D0 must be positive. 'gaussian' Gaussian highpass filter with cutoff (standard deviation) D0. n need not be supplied. D0 must be Positive.H = LPFILTER(TYPE, M, N, D0, n) creates the transfer function of a lowpass filter
11、, H, of the specified TYPE and size (M-by-N). To view the filter as an image or mesh plot, it should be centered using H = fftshift(H). Valid values for TYPE, D0, and n are: 'ideal' Ideal lowpass filter with cutoff frequency D0. n need not be supplied. D0 must be positive. 'btw' Butt
12、erworth lowpass filter of order n, and cutoff D0. The default value for n is 1.0. D0 must be positive. 'gaussian' Gaussian lowpass filter with cutoff (standard deviation) D0. n need not be supplied. D0 must be positive. Some Basic Gray Level TransformationsEx: I = imread('G:a.tif');
13、J = imadjust(I,0.3 0.7,);%增加图片的颜色感官imshow(I), figure, imshow(J)Ex:RGB1 = imread('G:a.tif');RGB2 = imadjust(RGB1,.2 .3 0; .6 .7 1,);imshow(RGB1), figure, imshow(RGB2)Histogram ProcessingEx:I=imread('G:a.tif') ;imhist (I); %灰度图像直方图Y,map=rgb2ind(I,256);imhist(Y,map); %索引图像直方图Ex:I=imread('G:a.tif') ;J=histeq( I) ;%增强图像对比image(J);Histogram equalizationI=imread('G:a.tif') ;J=histeq( I) ;image(J); Histogram specificationJ = HISTEQ(I,HGRAM)I=imread('G:a.tif') ;p=rgb2gray(I);image(p);subplot(221),subimage(p);title('原始图像');J1=imnoise(p,'gaussia
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
评论
0/150
提交评论