matlab中图像函数大全

合集下载

matlab模糊函数代码

matlab模糊函数代码

matlab模糊函数代码在数学和图像处理领域中,模糊函数是一种常用的工具,用于对图像进行模糊处理以达到一定的效果。

Matlab提供了一些内置函数来实现图像的模糊处理,本文将介绍如何使用Matlab编写模糊函数代码。

Matlab中有多种不同类型的模糊函数,例如高斯模糊、均值模糊和运动模糊等。

下面将逐一介绍这些模糊函数代码的实现方式。

1. 高斯模糊:高斯模糊是最常用的模糊算法之一,它通过卷积图像与一个高斯核来实现。

以下是Matlab中实现高斯模糊的代码示例:```matlabfunction blurredImage = gaussianBlur(image, sigma)kernelSize = 2 * ceil(3 * sigma) + 1; % 根据sigma计算高斯核大小kernel = fspecial('gaussian', [kernelSize kernelSize], sigma); % 生成高斯核blurredImage = imfilter(image, kernel, 'conv'); % 对图像进行卷积操作end```2. 均值模糊:均值模糊是一种简单但常用的模糊算法,它通过计算邻域像素的平均值来实现。

以下是Matlab中实现均值模糊的代码示例:```matlabfunction blurredImage = meanBlur(image, kernelSize)kernel = ones(kernelSize) / (kernelSize^2); % 生成均值核blurredImage = imfilter(image, kernel, 'conv'); % 对图像进行卷积操作end```3. 运动模糊:运动模糊是一种模糊算法,它通过模拟相机快门打开时的移动效果来实现。

以下是Matlab中实现运动模糊的代码示例:```matlabfunction blurredImage = motionBlur(image, angle, distance)PSF = fspecial('motion', distance, angle); % 生成运动模糊核blurredImage = imfilter(image, PSF, 'conv'); % 对图像进行卷积操作end```以上是几种常见的模糊函数的Matlab代码实现。

Matlab常见函数汇总

Matlab常见函数汇总

colorbar 显示彩条getimage 由坐标轴得到图像数据ice(DIPUM)交互彩色编辑image 创建和显示图像对象imagesc 缩放数据并显示为图像immovie 由多帧图像制作电影imshow 显示图像imview 在Image Viewer中显示图像montage 将多个图像帧显示为矩阵蒙太奇movie 播放录制的电影帧rgbcube 显示一个彩色RGB立方体subimage 在单个图形中显示多幅图像truesize 调整图像的显示尺寸warp 将图像显示为纹理映射的表面图像文件输入/输出Dicominfo 从一条DICOM消息中读取元数据Dicomread 读一幅DICOM图像Dicomwrite 写一幅DICOM图像Dicom-dict.txt 包含DICOM数据字典的文本文件Dicomuid 产生DICOM唯一的识别器Imfinfo 返回关于图像的文件的信息Imread 读图像文件Imwrite 写图像文件图像算术Imabsdiff 计算两幅图像的绝对差Imadd 两幅图像相加或把常数加到图像上Imcomplement 图像求补Imdivide 两幅图像相除,或用常数除图像Imlincomb 计算图像的线性组合Immultiply 两幅图像相乘或用常数乘图像Imsubtract 两幅图像相减,或从图像中减去常数几何变换Checkerboard 创建棋盘格图像Findbounds 求几何变换的输出范围Fliptform 颠倒TFORM结构的输入/输出Imcrop 修剪图像Imresize 调整图像大小Imrotate 旋转图像Imtransform 对图像应用几何变换Intline 整数坐标线绘制算法Makersampler 创建重取样器结构Maketform 创建几何变换结构(TFORM)Pixeldup(DIPUM)在两个方向上复制图像的像素Tformarray 对N-D数组应用几何变换Tformfwd 应用正向几何变换Tforminv 应用反向几何变换Vstformfwd(DIPUM)可视化正向几何变换图像匹配Cpstruct2pairs 将CPSTRUCT转换为有效的控制点对Cp2tform 由控制点对推断几何变换Cpcorr 使用互相关校准控制点位置Cpselect 控制点选择工具Normxcorr2 归一化二维互相关像素值及统计Corr2 计算二维相关系数Covmatrix(DIPUM)计算向量族的协方差矩阵Imcontour 创建图像数据的轮廓线Imhist 显示图像数据的直方图Impixel 确定像素的彩色点Improfile 计算沿着线段的像素值横截面Mean2 计算矩阵元素的均值Pixval 显示关于像素的信息Regionprops 测量图像区域的属性Statmoments(DIPUM)计算一幅图像直方图的统计中心距Std2 计算矩阵元素的标准偏差图像分析(包括分割、描述和识别)Bayesgauss(DIPUM)高斯模式的贝叶斯分类器Bound2eight(DIPUM)将4连接边界转换为8连接边界Bound2four(DIPUM)将8连接边界转换为4连接边界Bwboundaries 追踪区域边界Bwtraceboundary 追踪单个边界Bound2im(DIPUM)将边界转换为图像Boundaries(DIPUM)追踪区域边界Bsubsamp(DIPUM)对边界二次取样Colorgrad(DIPUM)计算一幅RGB图像的向量梯度Colorseq(DIPUM)分割一幅彩色图像Connectpoly(DIPUM)连接多边形的顶点Diameter(DIPUM)测量图像区域的直径Edge(DIPUM)在一幅亮度图像中寻找边缘Fchcode(DIPUM)计算边界的freeman链码Frdescp(DIPUM)计算傅里叶描绘子Graythresh 使用Ostu方法计算图像的全局阈值Hough(DIPUM) Hough变换Houghlines(DIPUM)基于Hough变换提取线段Houghpeaks(DIPUM)在Hough变换中检测峰值Houghpixels(DIPUM)计算属于Hough变换bin的图像像素Ifrdescp(DIPUM)计算逆傅里叶描绘子Imstack2vectors(DIPUM)从图像堆栈提取向量Invmoments(DIPUM)计算图像不变距Mahalanobis(DIPUM)计算Mahalanobis距离Minperpoly(DIPUM)计算最小周长多边形Polyangles(DIPUM)计算多边形内角Princomp(DIPUM)得到主分量向量和相关量Qtdecomp 执行四叉树分解Qtgetblk 得到四叉树分解中的块值Qtsetblk 在四叉树中设置块值Randvertex(DIPUM)随机置换多边形顶点Regiongrow(DIPUM)由区域生长来执行分割Signature(DIPUM)计算边界的标记Specxture(DIPUM)计算图像的谱纹理Splitmerge(DIPUM)使用分离-合并算法分割图像Statxture(DIPUM)计算图像中纹理的统计度量Strsimilarity(DIPUM)两个串间的相似性度量X2majoraxis(DIPUM)以区域的主轴排列坐标x图像压缩Compare(DIPUM)计算和显示两个矩阵间的误差Entropy(DIPUM)计算矩阵的熵的一阶估计Huff2mat(DIPUM)解码霍夫曼编码矩阵Huffman(DIPUM)为符号源建立一个变长霍夫曼码Im2jpeg(DIPUM)使用JPEG近似压缩一幅图像Im2jpeg2k(DIPUM)使用JPEG2000近似压缩一幅图像Imratio(DIPUM)计算两幅图像或变量中的比特率Jpeg2im(DIPUM)解码IM2JPEG压缩的图像Jpeg2k2im(DIPUM)解码IM2JPEG2K压缩的图像Lpc2mat(DIPUM)解压缩一维有损预测编码矩阵Mat2huff(DIPUM)霍夫曼编码矩阵Mat2lpc(DIPUM)使用一维有损预测编码矩阵Quantize(DIPUM)量化UINT8类矩阵的元素图像增强Adapthisteq 自适应直方图量化Decorrstretch 对多通道图像应用去相关拉伸Gscale(DIPUM)按比例调整输入图像的亮度Histeq 使用直方图均衡化来增强对比度Intrans(DIPUM)执行亮度变换Imadjust 调整图像亮度值或彩色映射Stretchlim 寻找对比度拉伸图像的限制图像噪声Imnoise 给一幅图像添加噪声Imnoise2(DIPUM)使用指定的PDF生成一个随机数数组Imnoise3(DIPUM)生成周期噪声线性和非线性空间滤波Adpmedian(DIPUM)执行自适应中值滤波Convmtx2 计算二维卷积矩阵Dftcorr(DIPUM)执行频率域相关Dftfilt(DIPUM)执行频率域滤波Fspecial 创建预定义滤波器Medfilt2 执行二维中值滤波Imfilter 滤波二维和N维图像Ordfilter2 执行二维顺序统计滤波Spfilt(DIPUM)执行线性和非线性空间滤波Wiener2 执行二维去噪滤波线性二维滤波器设计Freqspace 确定二维频率响应间隔Freqz2 计算二维频率响应Fsamp2 使用频率取样设计二维FIR滤波器Ftrans2 使用频率变换设计二维FIR滤波器Fwind1 使用一维窗法设计二维滤波器Fwind2 使用二维窗法设计二维滤波器Hpfilter(DIPUM)计算频率域高通滤波器Lpfilter(DIPUM)计算频率域低通滤波器图像去模糊(复原)Deconvblind 使用盲去卷积去模糊图像Deconvlucy 使用Lucy-Richardson方法去模糊Deconvreg 使用规则化滤波器去模糊Deconvwnr 使用维纳滤波器去模糊Edgetaper 使用点扩散函数锐化边缘Otf2psf 光传递函数到点扩散函数Pst2otf 点扩散函数到光传递函数图像变换Dct2 二维离散余弦变换Dctmtx 离散余弦变换矩阵Fan2para 将扇形束投影变换为并行射束Fanbeam 计算扇形射束变换Fft2 二维快速傅里叶变换Fftn N维快速傅里叶变换Fftshift 颠倒FFT输出的象限Idct2 二维逆离散余弦变换Ifanbeam 计算扇形射束逆变换Ifft2 二维快速傅里叶逆变换Ifftn N维快速傅里叶逆变换Iradon 计算逆Radon变换Para2fan 将并行射束投影变换为扇形射束Phantom 生成头部仿真模型的图像Radon 计算Radon变换小波Wave2gray(DIPUM)显示小波分解系数Waveback(DIPUM)执行多灰度级二维快速小波逆变换Wavecopy(DIPUM)存取小波分解结构的系数Wavecut(DIPUM)在小波分解结构中置零系数Wavefast(DIPUM)执行多灰度级二维快速小波变换Wavefilter(DIPUM)构造小波分解和重构滤波器Wavepaste(DIPUM)在小波分解结构中放置系数Wavework(DIPUM)编辑小波分解结构Wavezero(DIPUM)将小波细节系数设置为零领域和块处理Bestblk 为块处理选择块大小Blkproc 为图像实现不同的块处理Col2im 将矩阵列重排为块Colfilt 按列邻域操作Im2col 将图像块重排为列Nlfilter 执行一般的滑动邻域操作形态学操作(亮度和二值图像)Conndef 默认连通性Imbothat 执行底帽滤波Imclearborder 抑制与图像边框相连的亮结构Imclose 关闭图像Imdilate 膨胀图像Imerode 腐蚀图像Imextendedmax 最大扩展变换Imextendedmin 最小扩展变换Imfill 填充图像区域和孔洞Imhmax H最大变换Imhmin H最小变换Imimposemin 强制最小Imopen 打开图像Imreconstruct 形态学重构Imregionalmax 局部最大区域Imregionalmin 局部最小区域Imtophat 执行顶帽滤波Watershed 分水岭变换形态学操作(二值图像)Applylut 使用查表法执行邻域操作Bwarea 计算二值图像中的对象面积Bwareaopen 打开二值区域(删除小对象)Bwdist 计算二值图像的距离变换Bweuler 计算二值图像的欧拉数Bwhitmiss 二值击不中操作Bwlabel 在二维图像中标记连接分量Bwlabeln 在N维二值图像中标记连接分量Bwmorph 对二值图像执行形态学操作Bwpack 打包二值图像Bwperim 确定二值图像中的对象的周长Bwselect 选择二值图像中的对象Bwulterode 最终腐蚀Bwunpack 解包二值图像Endpoints(DIPUM)计算二值图像的端点Makelut 构建applylut使用的查找表结构元素(STREL)的创建和操作Getheight 得到strel的高度Getneighbors 得到strel邻域的偏移位置和高度Getnhood 得到strel邻域Getsequence 得到分解的strel序列Isflat 对平坦的strel返回值Reflect 以其中心反射strelStrel 创建形态学结构元素Translate 变换strel基于区域的处理Histroi(DIPUM)计算图像中的ROI的直方图Poly2mask 将ROI多边形转换为掩膜Roicolor 基于颜色选择ROIRoifill 在任意区域内平稳地内插Roifilt2 对ROI进行滤波Roipoly 选择多边形ROI彩色映射处理Brighten 加亮或加暗彩色映射Cmpermute 在彩色映射中重排颜色Cmunique 寻找唯一的彩色映射颜色和相应的图像Colormap 设置或得到彩色查找表Imapprox 以很少的颜色近似被索引的图像Rgbplot 绘制RGB彩色映射分量彩色空间转换Applyform 应用独立于设备的彩色空间变换Hsv2rgb 将HSV值转换为RGB彩色空间Iccread 读ICC彩色配置文件Lab2double 将L*a*b*彩色值转换为double类Lab2uint16 将L*a*b*彩色值转换为uint16类Lab2uint8 将L*a*b*彩色值转换为uint8类Makecform 创建独立于设备的彩色空间变换结构Ntsc2rgb 将NTSC值转换为RGB彩色空间Rgb2hsv 将RGB值转换为HSV彩色空间Rgb2ntsc 将RGB值转换为NTSC彩色空间Rgb2ycbcr 将RGB值转换为YCBCR彩色空间Ycbcr2rgb 将YCBCR值转换为RGB彩色空间Rgb2hsi(DIPUM)将RGB值转换为HSI彩色空间Hsi2rgb(DIPUM)将HSI值转换为RGB彩色空间Whitepoint 返回标准照明的XYZ值Xyz2double 将XYZ彩色值转换为double类Xyz2uint16 将XYZ彩色值转换为uint16类数组操作Circshift 循环地移位数组Dftuv(DIPUM)计算网格数组Padarray 填充数组Paddedsize(DIPUM)计算用于FFT的最小填充尺寸图像类型和类型转换Changeclass 改变一幅图像的类Dither 使用抖动转换图像Gray2ind 将亮度图像转换为索引图像Grayslice 通过阈值处理从亮度图像创建索引图像Im2bw 通过阈值处理将图像转换为二值图像Im2double 将图像数组转换为双精度Im2java 将图像转换为Java图像Im2java2d 将图像转换为Java缓存的图像对象Im2uint8 将图像数组转换为8比特无符号整数Im2uint16 将图像数组转换为16比特无符号整数Ind2gray 将索引图像转换为亮度图像Ind2rgb 将索引图像转换为RGB图像Label2rgb 将标记矩阵转换为RGB图像Mat2gray 将矩阵转换为亮度图像Rgb2gray 将RGB图像或彩色映射转换为灰度图像Rgb2ind 将RGB图像转换为索引图像其他函数Conwaylaws(DIPUM)对单个像素应用Conway的遗传定律Manualhist(DIPUM)交互地生成2模式直方图Twomodegauss(DIPUM)生成一个2模式高斯函数Uintlut 基于查找表计算新数组值工具箱参数Iptgetpref 获得图像处理工具箱参数的值Iptsetpref 设置图像处理工具箱参数的值。

MATLAB图像处理函数汇总

MATLAB图像处理函数汇总

MATLAB图像处理函数汇总(一)1.applylut功能: 在二进制图像中利用lookup表进行边沿操作. 语法:A = applylut(BW,lut)举例lut = makelut('sum(x(:)) == 4',2);BW1 = imread('text.tif');BW2 = applylut(BW1,lut);imshow(BW1)figure, imshow(BW2)相关命令:makelut2.bestblk功能:确定进行块操作的块大小.语法:siz = bestblk([m n],k)[mb,nb] = bestblk([m n],k)举例siz = bestblk([640 800],72)siz =64 50相关命令:blkproc3.blkproc功能:实现图像的显式块操作.语法:B = blkproc(A,[m n],fun)B = blkproc(A,[m n],fun,P1,P2,...)B = blkproc(A,[m n],[mborder nborder],fun,...)B = blkproc(A,'indexed',...)举例I = imread('alumgrns.tif');I2 = blkproc(I,[8 8],'std2(x)*ones(size(x))');imshow(I)figure, imshow(I2,[]);相关命令:colfilt, nlfilter,inline4.brighten功能: 增加或降低颜色映像表的亮度.语法:brighten(beta)newmap = brighten(beta)newmap = brighten(map,beta) brighten(fig,beta)相关命令:imadjust, rgbplot5.bwarea功能: 计算二进制图像对象的面积. 语法:total = bwarea(BW)举例BW = imread('circles.tif');imshow(BW);附录MATLAB图像处理命令321 bwarea(BW)ans =15799相关命令:bweuler, bwperim6.bweuler.功能: 计算二进制图像的欧拉数. 语法:eul = bweuler(BW,n)举例BW = imread('circles.tif');imshow(BW);bweuler(BW)ans =-2相关命令:bwmorph, bwperim7.bwfill功能: 填充二进制图像的背景色.语法:BW2 = bwfill(BW1,c,r,n)BW2 = bwfill(BW1,n)[BW2,idx] = bwfill(...)BW2 = bwfill(x,y,BW1,xi,yi,n) [x,y,BW2,idx,xi,yi] = bwfill(...)BW2 = bwfill(BW1,'holes',n)[BW2,idx] = bwfill(BW1,'holes',n) 举例BW1 =[1 0 0 0 0 0 0 01 1 1 1 1 0 0 01 0 0 0 1 0 1 01 0 0 0 1 1 1 01 0 0 1 1 0 1 01 0 0 0 1 0 1 01 0 0 0 1 1 1 0]BW2 = bwfill(BW1,3,3,8)BW2 =1 0 0 0 0 0 0 01 1 1 1 1 0 0 01 1 1 1 1 0 1 01 1 1 1 1 1 1 01 1 1 1 0 1 1 11 0 0 1 1 0 1 01 0 0 0 1 0 1 01 0 0 0 1 1 1 0I = imread('blood1.tif');BW3 = ~im2bw(I);BW4 = bwfill(BW3,'holes');imshow(BW3)figure, imshow(BW4)相关命令:bwselect, roifill8.bwlabel功能:标注二进制图像中已连接的部分. 语法:附录MATLAB图像处理命令323L = bwlabel(BW,n)[L,num] = bwlabel(BW,n)举例BW = [1 1 1 0 0 0 0 01 1 1 0 1 1 0 01 1 1 0 1 1 0 01 1 1 0 0 0 1 01 1 1 0 0 0 1 01 1 1 0 0 0 1 01 1 1 0 0 1 1 01 1 1 0 0 0 0 0]L = bwlabel(BW,4)L =1 1 1 0 0 0 0 01 1 1 02 2 0 01 1 1 02 2 0 01 1 1 0 0 0 3 01 1 1 0 0 0 3 01 1 1 0 0 0 3 01 1 1 0 0 0 0 0[r,c] = find(L==2);rc = [r c]rc =2 53 52 63 6相关命令:bweuler, bwselect9.bwmorph功能:提取二进制图像的轮廓.语法:BW2 = bwmorph(BW1,operation) BW2 = bwmorph(BW1,operation,n) 举例BW1 = imread('circles.tif');imshow(BW1);BW2 = bwmorph(BW1,'remove'); BW3 = bwmorph(BW1,'skel',Inf); imshow(BW2)figure, imshow(BW3)相关命令:bweuler, bwperim, dilate, erode10.bwperim功能:计算二进制图像中对象的周长. 语法:BW2 = bwperim(BW1,n)举例BW1 = imread('circbw.tif');BW2 = bwperim(BW1,8);imshow(BW1)figure, imshow(BW2)附录MATLAB图像处理命令325 相关命令:bwarea, bweuler, bwfill11.bwselect功能:在二进制图像中选择对象.语法:BW2 = bwselect(BW1,c,r,n)BW2 = bwselect(BW1,n)[BW2,idx] = bwselect(...)举例BW1 = imread('text.tif');c = [16 90 144];r = [85 197 247];BW2 = bwselect(BW1,c,r,4);imshow(BW1)figure, imshow(BW2)相关命令:bwfill, bwlabel, impixel, roipoly, roifill12.cmpermute功能:调整颜色映像表中的颜色.语法:[Y,newmap] = cmpermute(X,map)[Y,newmap] = cmpermute(X,map,index)举例To order a colormap by luminance, use:ntsc = rgb2ntsc(map);[dum,index] = sort(ntsc(:,1));[Y,newmap] = cmpermute(X,map,index);相关命令:randperm13.cmunique功能:查找颜色映像表中特定的颜色及相应的图像. 语法:[Y,newmap] = cmunique(X,map)[Y,newmap] = cmunique(RGB)[Y,newmap] = cmunique(I)相关命令:gray2ind, rgb2ind14.col2im功能:将矩阵的列重新组织到块中.语法:A = col2im(B,[m n],[mm nn],block_type)A = col2im(B,[m n],[mm nn])相关命令:blkproc, colfilt, im2col, nlfilter15.colfilt功能:利用列相关函数进行边沿操作.语法:B = colfilt(A,[m n],block_type,fun)B = colfilt(A,[m n],block_type,fun,P1,P2,...)B = colfilt(A,[m n],[mblock nblock],block_type,fun,...)B = colfilt(A,'indexed',...)附录MATLAB图像处理命令327相关命令:blkproc, col2im, im2col, nlfilter16.colorbar功能:显示颜色条.语法:colorbar('vert')colorbar('horiz')colorbar(h)colorbarh = colorbar(...)举例I = imread('blood1.tif');h = fspecial('log');I2 = filter2(h,I);imshow(I2,[]), colormap(jet(64)), colorbar 17.conv2功能:进行二维卷积操作.语法:C = conv2(A,B)C = conv2(hcol,hrow,A)C = conv2(...,shape)举例A = magic(5)A =17 24 1 8 1523 5 7 14 164 6 13 20 2210 12 19 21 311 18 25 2 9B = [1 2 1;0 2 0;3 1 3]B =1 2 10 2 03 1 3C = conv2(A,B)C =17 58 66 34 32 38 1523 85 88 35 67 76 1655 149 117 163 159 135 6779 78 160 161 187 129 5123 82 153 199 205 108 7530 68 135 168 91 84 933 65 126 85 104 15 27相关命令:filter218.convmtx2功能:计算二维卷积矩阵.语法:T = convmtx2(H,m,n)T = convmtx2(H,[m n])相关命令:conv219.convn功能: 计算n维卷积.语法:C = convn(A,B)C = convn(A,B,shape)相关命令:conv220.corr2功能:计算两个矩阵的二维相关系数.语法:r = corr2(A,B)相关命令:std221.dct2功能:进行二维离散余弦变换.语法:B = dct2(A)B = dct2(A,m,n)B = dct2(A,[m n])举例RGB = imread('autumn.tif');I = rgb2gray(RGB);J = dct2(I);imshow(log(abs(J)),[]), colormap(jet(64)), colorbar J(abs(J) < 10) = 0;K = idct2(J)/255;imshow(K)相关命令:fft2, idct2, ifft222.dctmtx功能:计算离散余弦变换矩阵.语法:D = dctmtx(n)相关命令:dct223.dilate功能:放大二进制图像.语法:BW2 = dilate(BW1,SE)BW2 = dilate(BW1,SE,alg)BW2 = dilate(BW1,SE,...,n)举例BW1 = imread('text.tif');SE = ones(6,2);BW2 = dilate(BW1,SE);imshow(BW1)figure, imshow(BW2)相关命令:bwmorph, erode24.dither功能:通过抖动增加外观颜色分辨率,转换图像. 语法:X = dither(RGB,map)BW = dither(I)相关命令:rgb2ind25.double附录MATLAB图像处理命令331功能:转换数据为双精度型.语法:B = double(A)举例A = imread('saturn.tif');B = sqrt(double(A));相关命令:im2double, im2uint, uint826.edge功能:识别强度图像中的边界.语法:BW = edge(I,'sobel')BW = edge(I,'sobel',thresh)BW = edge(I,'sobel',thresh,direction)[BW,thresh] = edge(I,'sobel',...)BW = edge(I,'prewitt')BW = edge(I,'prewitt',thresh)BW = edge(I,'prewitt',thresh,direction)[BW,thresh] = edge(I,'prewitt',...)BW = edge(I,'roberts')BW = edge(I,'roberts',thresh)[BW,thresh] = edge(I,'roberts',...)BW = edge(I,'log')BW = edge(I,'log',thresh)BW = edge(I,'log',thresh,sigma)[BW,threshold] = edge(I,'log',...)BW = edge(I,'zerocross',thresh,h)[BW,thresh] = edge(I,'zerocross',...)BW = edge(I,'canny')BW = edge(I,'canny',thresh)BW = edge(I,'canny',thresh,sigma)[BW,threshold] = edge(I,'canny',...)举例I = imread('rice.tif');BW1 = edge(I,'prewitt');BW2 = edge(I,'canny');imshow(BW1);figure, imshow(BW2)27.erode功能:弱化二进制图像的边界.语法:BW2 = erode(BW1,SE)BW2 = erode(BW1,SE,alg)BW2 = erode(BW1,SE,...,n)举例BW1 = imread('text.tif');SE = ones(3,1);BW2 = erode(BW1,SE);imshow(BW1)figure, imshow(BW2)相关命令:bwmorph, dilate28.fft2功能:进行二维快速傅里叶变换.语法:B = fft2(A)B = fft2(A,m,n)举例load imdemos saturn2imshow(saturn2)B = fftshift(fft2(saturn2));imshow(log(abs(B)),[]), colormap(jet(64)), colorbar 相关命令:dct2, fftshift, idct2, ifft229.fftn功能: 进行n维快速傅里叶变换.语法:B = fftn(A)B = fftn(A,siz)相关命令:fft2, ifftn30.fftshif t功能:把快速傅里叶变换的DC组件移到光谱中心. 语法:B = fftshift(A)举例B = fftn(A);C = fftshift(B);相关命令:fft2, fftn, ifftshift31.filter2功能:进行二维线性过滤操作.语法:B = filter2(h,A)B = filter2(h,A,shape)举例A = magic(6)A =35 1 6 26 19 243 32 7 21 23 2531 9 2 22 27 208 28 33 17 10 1530 5 34 12 14 164 36 29 13 18 11h = fspecial('sobel')h =1 2 10 0 0-1 -2 -1B = filter2(h,A,'valid')B =-8 4 4 -8-23 -44 -5 40-23 -50 1 40-8 4 4 -8相关命令:conv2, roifilt232.freqspace功能:确定二维频率响应的频率空间.语法:[f1,f2] = freqspace(n)[f1,f2] = freqspace([m n])[x1,y1] = freqspace(...,'meshgrid')f = freqspace(N)f = freqspace(N,'whole')相关命令:fsamp2, fwind1, fwind233.freqz2功能:计算二维频率响应.语法:[H,f1,f2] = freqz2(h,n1,n2)[H,f1,f2] = freqz2(h,[n2 n1])[H,f1,f2] = freqz2(h,f1,f2)[H,f1,f2] = freqz2(h)[...] = freqz2(h,...,[dx dy])[...] = freqz2(h,...,dx)freqz2(...)举例Hd = zeros(16,16);Hd(5:12,5:12) = 1;Hd(7:10,7:10) = 0;h = fwind1(Hd,bartlett(16));colormap(jet(64))freqz2(h,[32 32]); axis ([-1 1 -1 1 0 1])34.fsamp2功能:用频率采样法设计二维FIR过滤器.语法:h = fsamp2(Hd)h = fsamp2(f1,f2,Hd,[m n])举例[f1,f2] = freqspace(21,'meshgrid');Hd = ones(21);r = sqrt(f1.^2 + f2.^2);Hd((r0.5)) = 0;colormap(jet(64))mesh(f1,f2,Hd)相关命令:conv2, filter2, freqspace, ftrans2, fwind1, fwind235.fspecial功能:创建预定义过滤器.语法:h = fspecial(type)h = fspecial(type,parameters)举例I = imread('saturn.tif');h = fspecial('unsharp',0.5);I2 = filter2(h,I)/255;imshow(I)figure, imshow(I2)相关命令:conv2, edge, filter2, fsamp2, fwind1, fwind236.ftrans2功能:通过频率转换设计二维FIR过滤器.语法:附录MATLAB图像处理命令337h = ftrans2(b,t)h = ftrans2(b)举例colormap(jet(64))b = remez(10,[0 0.05 0.15 0.55 0.65 1],[0 0 1 1 0 0]); [H,w] = freqz(b,1,128,'whole');plot(w/pi-1,fftshift(abs(H)))相关命令:conv2, filter2, fsamp2, fwind1, fwind237.fwind1功能:用一维窗口方法设计二维FIR过滤器.语法:h = fwind1(Hd,win)h = fwind1(Hd,win1,win2)h = fwind1(f1,f2,Hd,...)举例[f1,f2] = freqspace(21,'meshgrid');Hd = ones(21);r = sqrt(f1.^2 + f2.^2);Hd((r0.5)) = 0;colormap(jet(64))mesh(f1,f2,Hd)相关命令:conv2, filter2, fsamp2, freqspace, ftrans2, fwind2 38.fwind2功能:用二维窗口方法设计二维FIR过滤器.语法:h = fwind2(Hd,win)h = fwind2(f1,f2,Hd,win)举例[f1,f2] = freqspace(21,'meshgrid');Hd = ones(21);r = sqrt(f1.^2 + f2.^2);Hd((r0.5)) = 0;colormap(jet(64))mesh(f1,f2,Hd)相关命令:conv2, filter2, fsamp2, freqspace, ftrans2, fwind1 39.getimage功能:从坐标轴取得图像数据.语法:A = getimage(h)[x,y,A] = getimage(h)[...,A,flag] = getimage(h)[...] = getimage举例imshow rice.tifI = getimage;40.gray2ind功能:转换灰度图像为索引图像.语法:[X,map] = gray2ind(I,n)相关命令:ind2gray41.grayslice功能:从灰度图像创建索引图像.语法:X = grayslice(I,n)X = grayslice(I,v)举例I = imread('ngc4024m.tif');X = grayslice(I,16);imshow(I)figure, imshow(X,jet(16))相关命令:gray2ind42.histeq功能:用柱状图均等化增强对比.语法:J = histeq(I,hgram)J = histeq(I,n)[J,T] = histeq(I,...)举例I = imread('tire.tif');J = histeq(I);imshow(I)figure, imshow(J)imhist(I,64)figure; imhist(J,64)相关命令:brighten, imadjust, imhist43.hsv2rgb功能: 转换HSV值为RGB颜色空间. 语法:rgbmap = hsv2rgb(hsvmap)RGB = hsv2rgb(HSV)相关命令:rgb2hsv, rgbplot44.idct2功能:计算二维离散反余弦变换.语法:B = idct2(A)B = idct2(A,m,n)B = idct2(A,[m n])相关命令:dct2, dctmtx, fft2, ifft245.ifft2功能:计算二维快速傅里叶反变换.语法:B = ifft2(A)B = ifft2(A,m,n)相关命令:fft2, fftshift, idct246.ifftn功能: 计算n维快速傅里叶反变换. 语法:B = ifftn(A)B = ifftn(A,siz)相关命令:fft2, fftn, ifft247.sim2bw功能:转换图像为二进制图像.语法:BW = im2bw(I,level)BW = im2bw(X,map,level)BW = im2bw(RGB,level)举例load treesBW = im2bw(X,map,0.4);imshow(X,map)figure, imshow(BW)相关命令:ind2gray, rgb2gray48.im2col功能:重调图像块为列.语法:B = im2col(A,[m n],block_type)B = im2col(A,[m n])B = im2col(A,'indexed',...)相关命令:blkproc, col2im, colfilt, nlfilter49.im2double功能:转换图像矩阵为双精度型.语法:I2 = im2double(I1)RGB2 = im2double(RGB1)BW2 = im2double(BW1)X2 = im2double(X1,'indexed')相关命令:double, im2uint8, uint850.im2uint8功能:转换图像阵列为8位无符号整型. 语法:I2 = im2uint8(I1)RGB2 = im2uint8(RGB1)BW2 = im2uint8(BW1)X2 = im2uint8(X1,'indexed')相关命令:im2uint16, double, im2double, uint8, imapprox, uint16 51.im2uint16功能:转换图像阵列为16位无符号整型.语法:I2 = im2uint16(I1)RGB2 = im2uint16(RGB1)X2 = im2uint16(X1,'indexed')相关命令:im2uint8, double, im2double, uint8, uint16, imapprox 52.imadjust功能:调整图像灰度值或颜色映像表.语法:J = imadjust(I,[low high],[bottom top],gamma) newmap = imadjust(map,[low high],[bottom top],gamma) RGB2 = imadjust(RGB1,...)举例I = imread('pout.tif');J = imadjust(I,[0.3 0.7],[]);imshow(I)figure, imshow(J)相关命令:brighten, histeq53.imapprox功能:对索引图像进行近似处理.语法:[Y,newmap] = imapprox(X,map,n)附录MATLAB图像处理命令343[Y,newmap] = imapprox(X,map,tol)Y = imapprox(X,map,newmap)[...] = imapprox(...,dither_option)相关命令:cmunique, dither, rgb2ind54.imcontour功能:创建图像数据的轮廓图.语法:imcontour(I,n)imcontour(I,v)imcontour(x,y,...)imcontour(...,LineSpec)[C,h] = imcontour(...)举例I = imread('ic.tif');imcontour(I,3)相关命令:clabel, contour, LineSpec55.imcrop功能:剪切图像.语法:I2 = imcrop(I)X2 = imcrop(X,map)RGB2 = imcrop(RGB)I2 = imcrop(I,rect)X2 = imcrop(X,map,rect)RGB2 = imcrop(RGB,rect)[...] = imcrop(x,y,...)[A,rect] = imcrop(...)[x,y,A,rect] = imcrop(...)举例I = imread('ic.tif');I2 = imcrop(I,[60 40 100 90]);imshow(I)figure, imshow(I2)相关命令:zoom56.imfeature功能:计算图像区域的特征尺寸.语法:stats = imfeature(L,measurements) stats = imfeature(L,measurements,n)举例BW = imread('text.tif');L = bwlabel(BW);stats = imfeature(L,'all');stats(23)ans =Area: 89Centroid: [95.6742 192.9775] BoundingBox: [87.5000 184.5000 16 15] MajorAxisLength: 19.9127 MinorAxisLength: 14.2953 Eccentricity: 0.6961Orientation: 9.0845ConvexHull: [28x2 double] ConvexImage: [15x16 uint8 ]ConvexArea: 205Image: [15x16 uint8 ]FilledImage: [15x16 uint8 ] FilledArea: 122EulerNumber: 0Extrema: [ 8x2 double] EquivDiameter: 10.6451Solidity: 0.4341Extent: 0.3708PixelList: [89x2 double]相关命令:bwlabel57.imfinfo功能:返回图形文件信息.语法:info = imfinfo(filename,fmt)info = imfinfo(filename)举例info = imfinfo('canoe.tif')info =Filename:'canoe.tif'FileModDate: '25-Oct-1996 22:10:39' FileSize: 69708Format: 'tif'FormatVersion: []Width: 346Height: 207BitDepth: 8ColorType: 'indexed' FormatSignature: [73 73 42 0] ByteOrder: 'little-endian' NewSubfileType: 0 BitsPerSample: 8Compression: 'PackBits' PhotometricInterpretation: 'RGB Palette' tripOffsets: [ 9x1 double] SamplesPerPixel: 1 RowsPerStrip: 23 StripByteCounts: [ 9x1 double] XResolution: 72YResolution: 72ResolutionUnit: 'Inch'Colormap: [256x3 double] PlanarConfiguration: 'Chunky'TileLength: []TileOffsets: [] TileByteCounts: [] Orientation: 1FillOrder: 1 GrayResponseUnit: 0.0100 MaxSamplue: 255 MinSamplue: 0Thresholding: 1相关命令:imread, imwrite58.imhist功能:显示图像数据的柱状图.语法:imhist(I,n)imhist(X,map)[counts,x] = imhist(...)举例I = imread('pout.tif');imhist(I)相关命令:histeq59.immovie功能:创建多帧索引图的电影动画. 语法:mov = immovie(X,map)举例load mrimov = immovie(D,map);相关命令:montage60.imnoise功能:增加图像的渲染效果.语法:J = imnoise(I,type)J = imnoise(I,type,parameters)举例I = imread('eight.tif');J = imnoise(I,'salt & pepper',0.02); imshow(I)figure, imshow(J)rand61.impixel功能:确定像素颜色值.语法:P = impixel(I)P = impixel(X,map)P = impixel(RGB)P = impixel(Incur)P = impixel(X,map,c,r)P = impixel(RGB,c,r)[carp] = impixel(...)P = impixel(x,y,I,xi,yi)P = impixel(x,y,X,map,xi,yi)P = impixel(x,y,RGB,xi,yi)[xi,yi,P] = impixel(x,y,...)举例RGB = imread('flowers.tif');c = [12 146 410];r = [104 156 129];pixels = impixel(RGB,c,r)pixels =61 59 101253 240 0237 37 44相关命令:improfile, pixval62.improfile功能:沿线段计算剖面图的像素值.语法:c = improfilec = improfile(n)c = improfile(I,xi,yi)c = improfile(I,xi,yi,n)[cx,cy,c] = improfile(...)[cx,cy,c,xi,yi] = improfile(...) [...] = improfile(x,y,I,xi,yi) [...] = improfile(x,y,I,xi,yi,n) [...] = improfile(...,method)举例I = imread('alumgrns.tif');x = [35 338 346 103];y = [253 250 17 148];improfile(I,x,y), grid on相关命令:impixel, pixval63.imread功能:从图形文件中读取图像.语法:A = imread(filename,fmt)[X,map] = imread(filename,fmt)[...] = imread(filename)[...] = imread(...,idx) (TIFF only)[...] = imread(...,ref) (HDF only)[...] = imread(...,'BackgroundColor',BG) (PNG only) [A,map,alpha] = imread(...) (PNG only)举例[X,map] = imread('flowers.tif',6);info = imfinfo('skull.hdf');[X,map] = imread('skull.hdf',info(4).Reference);bg = [255 0 0];A = imread('image.png','BackgroundColor',bg); [A,map,alpha] = imread('image.png');相关命令:imfinfo, imwrite,fread,double,uint8,uint1664.imresize功能:改变图像大小.语法:B = imresize(A,m,method)B = imresize(A,[mrows ncols],method)B = imresize(...,method,n)B = imresize(...,method,h)65.imrotate功能:旋转图像.语法:B = imrotate(A,angle,method)B = imrotate(A,angle,method,'crop')举例I = imread('ic.tif');J = imrotate(I,-4,'bilinear','crop');imshow(I)figure, imshow(J)相关命令:imcrop, imresize66.imshow功能:显示图像.语法:附录MATLAB图像处理命令351imshow(I,n)imshow(I,[low high])imshow(BW)imshow(X,map)imshow(RGB)imshow(...,display_option)imshow(x,y,A,...)imshow filenameh = imshow(...)相关命令:getimage, imread, iptgetpref, iptsetpref, subimage, truesize, warp 67.imwrite功能:把图像写入图形文件中.语法:imwrite(A,filename,fmt)imwrite(X,map,filename,fmt)imwrite(...,filename)imwrite(...,Param1,Val1,Param2,Val2...)举例imwrite(X,map,'flowers.hdf','Compression','none',...'WriteMode','append')相关命令:imfinfo, imread68.ind2gray功能:把检索图像转化为灰度图像.语法:I = ind2gray(X,map)举例load treesI = ind2gray(X,map);imshow(X,map)figure,imshow(I)相关命令:gray2ind, imshow, rgb2ntsc69.ind2rgb功能:转化索引图像为RGB真彩图像.语法:RGB = ind2rgb(X,map)相关命令:ind2gray, rgb2ind70.iptgetpref功能:获取图像处理工具箱参数设置. 语法:value = iptgetpref(prefname)举例value = iptgetpref('ImshowAxesVisible') value =off相关命令:imshow, iptsetpref71.iptsetpref功能:设置图像处理工具箱参数.语法:iptsetpref(prefname,value)举例iptsetpref('ImshowBorder','tight')相关命令:imshow, iptgetpref, truesize72.iradon附录MATLAB图像处理命令353功能:进行反Radon变换.语法:I = iradon(P,theta)I = iradon(P,theta,interp,filter,d,n)[I,h] = iradon(...)举例P = phantom(128);R = radon(P,0:179);I = iradon(R,0:179,'nearest','Hann'); imshow(P)figure, imshow(I)相关命令:radon, phantom73.isbw功能:判断是否为二进制图像.语法:flag = isbw(A)相关命令:isind, isgray, isrgb74.isgray功能:判断是否为灰度图像.语法:flag = isgray(A)相关命令:isbw, isind, isrgb75.isind功能:判断是否为索引图像.语法:flag = isind(A)相关命令:isbw, isgray, isrgb76.isrgb功能:判读是否为RGB真彩图像.语法:flag = isrgb(A)相关命令:isbw, isgray, isind77.makelut功能:创建一个用于applylut函数的lookup表. 语法:lut = makelut(fun,n)lut = makelut(fun,n,P1,P2,...)举例f = inline('sum(x(:)) >= 2');lut = makelut(f,2)lut =11111111111相关命令:78.mat2gray功能:转化矩阵为灰度图像.语法:I = mat2gray(A,[amin amax])I = mat2gray(A)举例I = imread('rice.tif');J = filter2(fspecial('sobel'),I);K = mat2gray(J);imshow(I)figure, imshow(K)相关命令:gray2ind79.mean2功能:计算矩阵元素的平均值.语法:b = mean2(A)相关命令:std2, mean, std80.medfilt2功能:进行二维中值过滤.语法:B = medfilt2(A,[m n])B = medfilt2(A)B = medfilt2(A,'indexed',...)举例I = imread('eight.tif');J = imnoise(I,'salt & pepper',0.02);K = medfilt2(J);imshow(J)figure, imshow(K)相关命令:filter2, ordfilt2, wiener281.montage功能:在矩形框中同时显示多幅图像. 语法:montage(I)montage(BW)montage(X,map)montage(RGB)h = montage(...)load mrimontage(D,map)附录MATLAB图像处理命令357相关命令:immovie82.nlfilter功能:进行边沿操作.语法:B = nlfilter(A,[m n],fun)B = nlfilter(A,[m n],fun,P1,P2,...)B = nlfilter(A,'indexed',...)举例B = nlfilter(A,[3 3],'median(x(:))');相关命令:blkproc, colfilt83.ntsc2rgb功能: 转换NTSC的值为RGB颜色空间.语法:rgbmap = ntsc2rgb(yiqmap)RGB = ntsc2rgb(YIQ)相关命令:rgb2ntsc, rgb2ind, ind2rgb, ind2gray84.ordfilt2功能:进行二维统计顺序过滤.语法:B = ordfilt2(A,order,domain)B = ordfilt2(A,order,domain,S)B = ordfilt2(...,padopt)相关命令:medfilt285.phantom功能:产生一个头部幻影图像.语法:P = phantom(def,n)P = phantom(E,n)[P,E] = phantom(...)举例P = phantom('Modified Shepp-Logan',200); imshow(P)相关命令:radon, iradon86.pixval功能:显示图像像素信息.语法:pixval onpixval offpixvalpixval(fig,option)相关命令:impixel, improfile87.qtdecomp功能:进行四叉树分解.语法:S = qtdecomp(I)S = qtdecomp(I,threshold)S = qtdecomp(I,threshold,mindim)S = qtdecomp(I,threshold,[mindim maxdim]) S = qtdecomp(I,fun)S = qtdecomp(I,fun,P1,P2,...)举例I = [1 1 1 1 2 3 6 61 12 1 4 5 6 81 1 1 1 10 15 7 71 1 1 1 20 25 7 720 22 20 22 1 2 3 420 22 22 20 5 6 7 820 22 20 20 9 10 11 1222 22 20 20 13 14 15 16];S = qtdecomp(I,5);full(S)ans =4 0 0 0 2 0 2 00 0 0 0 0 0 0 00 0 0 0 1 1 2 00 0 0 0 1 1 0 04 0 0 0 2 0 2 00 0 0 0 0 0 0 00 0 0 0 2 0 2 00 0 0 0 0 0 0 0相关命令:qtgetblk, qtsetblk88.qtgetblk功能:获取四叉树分解中的块值.语法:[vals,r,c] = qtgetblk(I,S,dim)[vals,idx] = qtgetblk(I,S,dim)举例[vals,r,c] = qtgetblk(I,S,4)vals(:,:,1) =1 1 1 11 12 11 1 1 11 1 1 1vals(:,:,2) =20 22 20 2220 22 22 2020 22 20 2022 22 20 20r =15c =11相关命令:qtdecomp, qtsetblk89.qtsetblk功能:设置四叉树分解中的块值. 语法:J = qtsetblk(I,S,dim,vals)举例newvals = cat(3,zeros(4),ones(4)); J = qtsetblk(I,S,4,newvals)J =0 0 0 0 2 3 6 60 0 0 0 4 5 6 80 0 0 0 10 15 7 70 0 0 0 20 25 7 71 1 1 1 123 41 1 1 1 5 6 7 81 1 1 1 9 10 11 121 1 1 1 13 14 15 16相关命令:qtdecomp, qtgetblk90.radon功能: 计算Radon变换.语法:R = radon(I,theta)R = radon(I,theta,n)[R,xp] = radon(...)举例iptsetpref('ImshowAxesVisible','on')I = zeros(100,100);I(25:75,25:75) = 1;theta = 0:180;[R,xp] = radon(I,theta);imshow(theta,xp,R,[]), colormap(hot), colorbar相关命令:iradon, phantom91.rgb2gray功能: 转换RGB图像或颜色映像表为灰度图像. 语法:I = rgb2gray(RGB)newmap = rgb2gray(map)相关命令:ind2gray, ntsc2rgb, rgb2ind, rgb2ntsc92.rgb2hsv功能: 转化RGB值为HSV颜色空间.语法:hsvmap = rgb2hsv(rgbmap)HSV = rgb2hsv(RGB)相关命令:hsv2rgb, rgbplot93.rgb2ind功能: 转化RGB图像为索引图像.语法:[X,map] = rgb2ind(RGB,tol)[X,map] = rgb2ind(RGB,n)X = rgb2ind(RGB,map)[...] = rgb2ind(...,dither_option)举例RGB = imread('flowers.tif');[X,map] = rgb2ind(RGB,128);imshow(X,map)相关命令:cmunique, dither, imapprox, ind2rgb, rgb2gray 94.rgb2ntsc功能: 转化RGB的值为NTSC颜色空间.语法:yiqmap = rgb2ntsc(rgbmap)YIQ = rgb2ntsc(RGB)相关命令:ntsc2rgb, rgb2ind, ind2rgb, ind2gray95.rgb2ycbcr功能: 转化RGB的值为YcbCr颜色空间. 语法:ycbcrmap = rgb2ycbcr(rgbmap)YCBCR = rgb2ycbcr(RGB)相关命令:ntsc2rgb, rgb2ntsc, ycbcr2rgb96.rgbplot功能:划分颜色映像表.语法:rgbplot(map)举例rgbplot(jet)相关命令:colormap97.roicolor功能:选择感兴趣的颜色区.语法:BW = roicolor(A,low,high)BW = roicolor(A,v)举例I = imread('rice.tif');BW = roicolor(I,128,255);imshow(I);figure, imshow(BW)相关命令:roifilt2, roipoly98.roifill功能:在图像的任意区域中进行平滑插补. 语法:J = roifill(Incur)J = roifill(I)J = roifill(I,BW)[J,BW] = roifill(...)J = roifill(x,y,I,xi,yi)[x,y,J,BW,xi,yi] = roifill(...)举例I = imread('eight.tif');c = [222 272 300 270 221 194];r = [21 21 75 121 121 75];J = roifill(Incur);imshow(I)figure, imshow(J)相关命令:roifilt2, roipoly99.roifilt2功能:过滤敏感区域.语法:J = roifilt2(h,I,BW)J = roifilt2(I,BW,fun)J = roifilt2(I,BW,fun,P1,P2,...)举例h = fspecial('unsharp');J = roifilt2(h,I,BW);imshow(J)相关命令:filter2, roipoly100.roipoly功能:选择一个敏感的多边形区域. 语法:BW = roipoly(Incur)BW = roipoly(I)BW = roipoly(x,y,I,xi,yi)[BW,xi,yi] = roipoly(...)[x,y,BW,xi,yi] = roipoly(...)举例I = imread('eight.tif');c = [222 272 300 270 221 194];r = [21 21 75 121 121 75];BW = roipoly(Incur);imshow(I)figure, imshow(BW)相关命令:roifilt2, roicolor, roifill101.std2功能:计算矩阵元素的标准偏移. 语法:b = std2(A)相关命令:corr2, mean2102.subimage功能:在一幅图中显示多个图像. 语法:subimage(X,map)subimage(I)subimage(BW)subimage(RGB)subimage(x,y,...)h = subimage(...)举例load trees[X2,map2] = imread('forest.tif');subplot(1,2,1), subimage(X,map)subplot(1,2,2), subimage(X2,map2)相关命令:附录MATLAB图像处理命令367103.truesize功能:调整图像显示尺寸.语法:truesize(fig,[mrows mcols])truesize(fig)相关命令:imshow, iptsetpref, iptgetpref104.uint8功能:转换数据为8位无符号整型.语法:B = uint8(A)举例a = [1 3 5];b = uint8(a);whosName Size Bytes Classa 1x3 24 doublearrayb 1x3 3 uint8 array相关命令:double, im2double, im2uint8105.uint16功能:转换数据为16位无符号整型.语法:I = uint16(X)举例a = [1 3 5];b = uint16(a);whosName Size Bytes Classa 1x3 24 double arrayb 1x3 6 uint16 array相关命令:double, datatypes, uint8, uint32, int8, int16, int32. 106.warp功能:将图像显示到纹理映射表面.语法:warp(X,map)warp(I,n)warp(BW)warp(RGB)warp(z,...)warp(x,y,z,...)h = warp(...)举例[x,y,z] = cylinder;I = imread('testpat1.tif');warp(x,y,z,I);相关命令:imshow107.wiener2功能:进行二维适应性去噪过滤处理.语法:J = wiener2(I,[m n],noise)[J,noise] = wiener2(I,[m n])举例I = imread('saturn.tif');J = imnoise(I,'gaussian',0,0.005);K = wiener2(J,[5 5]);imshow(J)figure, imshow(K)相关命令:filter2, medfilt2108.ycbcr2rgb功能: 转化YcbCr值为RGB颜色空间. 语法:rgbmap = ycbcr2rgb(ycbcrmap)RGB = ycbcr2rgb(YCBCR)相关命令:ntsc2rgb, rgb2ntsc, rgb2ycbcr109.zoom功能:缩放图像.语法:zoom onzoom offzoom outzoom resetzoomzoom xonzoom yon。

matlab数字图像处理函数大全

matlab数字图像处理函数大全

Import, Export, and ConversionDisplay and ExplorationGeometric Transformation, Spatial ReferencingImage EnhancementImage AnalysisRead image from graphics fileWrite image to graphics fileInformation about graphics fileRead metadata from National Imagery Transmission Format (NITF) file Read image from NITF fileRead metadata from DPX fileRead DPX imageRead metadata from header file of Analyze 7.5 data setRead image data from image file of Analyze 7.5 data setRead metadata from Interfile fileRead images in Interfile formatAnonymize DICOM fileGet or set active DICOM data dictionaryDisplay DICOM file structureRead metadata from DICOM messageFind attribute in DICOM data dictionaryRead DICOM imageGenerate DICOM unique identifierWrite images as DICOM filesRead high dynamic range (HDR) imageWrite Radiance high dynamic range (HDR) image fileCreate high dynamic range imageRender high dynamic range image for viewingInterface for image I/OCheck if file is R-SetOpen R-Set fileCreate reduced resolution data set from image fileConvert grayscale or binary image to indexed imageConvert indexed image to grayscale imageConvert matrix to grayscale imageConvert RGB image or colormap to grayscaleConvert indexed image to RGB imageConvert label matrix into RGB imageConvert Bayer pattern encoded image to truecolor imageBinarize image by thresholdingQuantize image using specified quantization levels and output values Multilevel image thresholds using Otsu's methodAdaptive image threshold using local first-order statisticsGlobal histogram threshold using Otsu's methodConvert image to binary image, based on thresholdGlobal image threshold using Otsu's methodConvert grayscale image to indexed image using multilevel thresholdingConvert image to double precisionConvert image to 16-bit signed integersConvert image to Java buffered imageConvert image to single precisionConvert image to 16-bit unsigned integersConvert image to 8-bit unsigned integersCreate checkerboard imageCreate head phantom imageAdd noise to imageDisplay imageDisplay multiple image frames as rectangular montage Display multiple images in single figureMake movie from multiframe imagePlay movies, videos, or image sequencesDisplay image as texture-mapped surfaceGet values of Image Processing Toolbox preferencesDisplay Image Processing Toolbox Preferences dialog boxSet Image Processing Toolbox preferences or display valid values Image Viewer appImage Information toolAdjust Contrast toolDisplay Range toolDistance toolPixel Information toolPixel Information tool without text labelPixel Region toolMagnification box for scroll panelOverview tool for image displayed in scroll panelGet values of Image Processing Toolbox preferencesDisplay Image Processing Toolbox Preferences dialog boxSet Image Processing Toolbox preferences or display valid values Image Information toolChoose Colormap toolAdjust Contrast toolCrop imageDisplay Range toolDistance toolPixel Information toolPixel Information tool without text labelPixel Region toolPixel Region tool panelMagnification box for scroll panelOverview tool for image displayed in scroll panelOverview tool panel for image displayed in scroll panelSave Image ToolScroll panel for interactive image navigationCreate draggable ellipseCreate draggable freehand regionCreate draggable, resizable lineCreate draggable pointCreate draggable, resizable polygonCreate draggable rectangleRegion-of-interest (ROI) base classSelect polyline with mouseSpecify points with mouseSpecify rectangle with mouseImage data from axesImage model object from image objectImage Model objectConvert axes coordinates to pixel coordinatesInformation about image attributesGet handle to current axes containing imageGet handle to current figure containing imageOpen Image dialog boxGet all image handlesAdd function handle to callback listCheck validity of handleGet Application Programmer Interface (API) for handleRetrieve pointer behavior from HG objectDirectories containing IPT and MATLAB iconsCreate pointer manager in figureDelete function handle from callback listStore pointer behavior structure in Handle Graphics object Align figure windowsCreate rectangularly bounded drag constraint functionAdjust display size of imagencing, and Image RegistrationCrop imageResize imageRotate imageTranslate imageImage pyramid reduction and expansionApply geometric transformation to imageFit geometric transformation to control point pairsApply 2-D spatial transformation to imageFind output bounds for spatial transformationFlip input and output roles of TFORM structureCreate resampling structureCreate spatial transformation structure (TFORM)Apply spatial transformation to N-D arrayApply forward spatial transformationApply inverse spatial transformationCreate checkerboard image2-D Affine Geometric Transformation3-D Affine Geometric Transformation2-D Projective Geometric Transformation2-D piecewise linear geometric transformation2-D Polynomial Geometric Transformation2-D Local Weighted Mean Geometric TransformationApply geometric transformation to imageIntensity-based image registrationEstimate geometric transformation that aligns two 2-D or 3-D images Display imageCompare differences between imagesComposite of two imagesReference 2-D image to world coordinatesReference 3-D image to world coordinatesIntensity-based image registrationConfigurations for intensity-based registrationEstimate geometric transformation that aligns two 2-D or 3-D images Estimates geometric transformation that aligns two 2-D images using phase Estimate displacement field that aligns two 2-D or 3-D images Composite of two imagesCompare differences between imagesMattes mutual information metric configuration objectMean square error metric configuration objectRegular step gradient descent optimizer configuration objectOne-plus-one evolutionary optimizer configuration objectControl Point Selection ToolFit geometric transformation to control point pairsTune control-point locations using cross correlationConvert CPSTRUCT to valid pairs of control pointsNormalized 2-D cross-correlationInfer spatial transformation from control point pairsAdjust image intensity values or colormapAdjust Contrast toolSharpen image using unsharp maskingEnhance contrast using histogram equalizationContrast-limited adaptive histogram equalization (CLAHE)Adjust histogram of image to match N-bin histogram of reference image Apply decorrelation stretch to multichannel imageFind limits to contrast stretch imageConvert integer values using lookup tableAdd noise to imageN-D filtering of multidimensional images2-D Gaussian filtering of images3-D Gaussian filtering of 3-D imagesCreate predefined 2-D filterGuided filtering of imagesNormalized 2-D cross-correlation2-D adaptive noise-removal filtering2-D median filtering2-D order-statistic filteringLocal standard deviation of imageLocal range of imageLocal entropy of grayscale imageGeneral sliding-neighborhood operationsCreate Gabor filter or Gabor filter bankApply Gabor filter or set of filters to 2-D image2-D box filtering of images3-D box filtering of 3-D imagesCalculate integral imageCalculate 3-D integral image2-D box filtering of integral images3-D box filtering of 3-D integral imagesExtract objects from binary image by sizeExtract objects from binary image using properties Pad array2-D frequency response2-D FIR filter using frequency sampling2-D FIR filter using frequency transformation2-D FIR filter using 1-D window method2-D FIR filter using 2-D window method2-D convolution matrixBinary hit-miss operationMorphological operations on binary images Ultimate erosionRemove small objects from binary imageBottom-hat filteringSuppress light structures connected to image border Morphologically close imageDilate imageErode imageExtended-maxima transformExtended-minima transformFill image regions and holesH-maxima transformH-minima transformImpose minimaMorphologically open imageMorphological reconstructionRegional maximaRegional minimaTop-hat filteringWatershed transformCreate connectivity arrayCheck validity of connectivity argumentNeighborhood operations on binary images using lookup tables Nonlinear filtering using lookup tablesCreate lookup table for use with bwlookupMorphological structuring elementMorphological offset structuring elementDeblur image using blind deconvolutionDeblur image using Lucy-Richardson methodDeblur image using regularized filterDeblur image using Wiener filterTaper discontinuities along image edgesConvert optical transfer function to point-spread function Convert point-spread function to optical transfer functionPad arraySpecify polygonal region of interest (ROI)Convert region of interest (ROI) polygon to region maskFill in specified regions in image using inward interpolation Select region of interest (ROI) based on colorFilter region of interest (ROI) in imageCreate draggable ellipseCreate draggable freehand regionCreate draggable, resizable polygonCreate draggable rectangleRegion-of-interest (ROI) base classInterface for image I/ODistinct block processing for imageDetermine optimal block size for block processingGeneral sliding-neighborhood operationsRearrange matrix columns into blocksColumnwise neighborhood operationsRearrange image blocks into columnsAbsolute difference of two imagesAdd two images or add constant to imageLinear combination of color channelsComplement imageDivide one image into another or divide image by constant Linear combination of imagesMultiply two images or multiply image by constantSubtract one image from another or subtract constant from image Trace region boundaries in binary imageTrace object in binary imagePlot region boundariesFind edges in intensity imageFind circles using circular Hough transformCreate circleGradient magnitude and direction of an imageDirectional gradients of an imageFind 3-D gradient magnitude and direction of imagesFind the directional gradients of a 3-D imageHough transformExtract line segments based on Hough transformIdentify peaks in Hough transformQuadtree decompositionBlock values in quadtree decompositionSet block values in quadtree decompositionMeasure properties of image regionsArea of objects in binary imageExtract objects from binary image by sizeFind connected components in binary imageGenerate convex hull image from binary imageDistance transform of binary imageGeodesic distance transform of binary imageEuler number of binary imageFind perimeter of objects in binary imageExtract objects from binary image using propertiesSelect objects in binary imageGray-weighted distance transform of grayscale imageCreate contour plot of image dataHistogram of image dataPixel color valuesPixel-value cross-sections along line segments2-D correlation coefficientAverage or mean of matrix elementsStandard deviation of matrix elementsLabel connected components in 2-D binary imageLabel connected components in binary imageCreate label matrix from bwconncomp structurePack binary imageUnpack binary imageEntropy of grayscale imageLocal entropy of grayscale imageLocal range of imageLocal standard deviation of imageCreate gray-level co-occurrence matrix from imageProperties of gray-level co-occurrence matrixMean-squared errorPeak Signal-to-Noise Ratio (PSNR)Structural Similarity Index (SSIM) for measuring image qualitySegment image into foreground and background using active contour Binary image segmentation using Fast Marching MethodSegment image into two or three regions using geodesic distance-based colorCalculate weights for image pixels based on image gradient Calculate weights for image pixels based on grayscale intensity difference Select contiguous image region with similar gray valuesGlobal image threshold using Otsu's methodMultilevel image thresholds using Otsu's methodGlobal histogram threshold using Otsu's methodAdaptive image threshold using local first-order statisticsFind region boundaries of segmentation2-D superpixel oversegmentation of imagesBurn binary mask into 2-D imageConvert label matrix to cell array of linear indicesDistance transform of binary imageGeodesic distance transform of binary imageGray-weighted distance transform of grayscale imageHough transform2-D discrete cosine transformDiscrete cosine transform matrixConvert fan-beam projections to parallel-beamFan-beam transform2-D inverse discrete cosine transformInverse fan-beam transformInverse Radon transformConvert parallel-beam projections to fan-beamRadon transform2-D fast Fourier transformShift zero-frequency component to center of spectrum2-D inverse fast Fourier transformInverse FFT shiftConvert RGB to CIE 1976 L*a*b*Convert RGB color values to NTSC color spaceConvert RGB to CIE 1931 XYZConvert RGB color values to YCbCr color spaceConvert CIE 1976 L*a*b* to RGBConvert CIE 1976 L*a*b* to CIE 1931 XYZConvert CIE 1931 XYZ to CIE 1976 L*a*b*Convert CIE 1931 XYZ to RGBConvert YCbCr color values to RGB color spaceConvert NTSC values to RGB color spaceConvert L*a*b* data to doubleConvert L*a*b* data to uint16Convert L*a*b* data to uint8Convert XYZ color values to doubleConvert XYZ color values to uint16Search for ICC profilesRead ICC profileFind system default ICC profile repositoryWrite ICC color profile to disk fileTrue for valid ICC color profileCreate color transformation structureApply device-independent color space transformation Approximate indexed image by reducing number of colors XYZ color values of standard illuminantsAdaptive image threshold using local first-order statistics Find region boundaries of segmentationRemove small objects from binary imageTrace region boundaries in binary imageFind connected components in binary imageDistance transform of binary imageEuler number of binary imageLabel connected components in 2-D binary image Nonlinear filtering using lookup tables Morphological operations on binary imagesPack binary imageFind perimeter of objects in binary imageSelect objects in binary imageTrace object in binary imageUnpack binary imageCreate connectivity arrayConvert Bayer pattern encoded image to truecolor image Find edges in intensity imageFit geometric transformation to control point pairs Create predefined 2-D filterDefault display range of image based on its classSelect contiguous image region with similar gray values Enhance contrast using histogram equalizationHough transformExtract line segments based on Hough transform Identify peaks in Hough transformConvert HSV colormap to RGB colormapConvert image to double precisionConvert image to 16-bit signed integersConvert image to single precisionConvert image to 16-bit unsigned integersConvert image to 8-bit unsigned integersAbsolute difference of two imagesAdjust image intensity values or colormapBinarize image by thresholdingBottom-hat filtering2-D box filtering of imagesSuppress light structures connected to image border Morphologically close imageComplement imageCrop imageDilate imageErode imageExtended-maxima transformExtended-minima transformFill image regions and holesN-D filtering of multidimensional imagesFind circles using circular Hough transformApply Gabor filter or set of filters to 2-D image2-D Gaussian filtering of imagesFind 3-D gradient magnitude and direction of imagesFind the directional gradients of a 3-D imageHistogram of image dataH-maxima transformH-minima transformLinear combination of imagesMean-squared errorMorphologically open imageBurn binary mask into 2-D imageImage pyramid reduction and expansionQuantize image using specified quantization levels and output values Read image from graphics fileMorphological reconstructionRegional maximaRegional minimaResize imageRotate imageTop-hat filteringTranslate imageApply geometric transformation to image2-D box filtering of integral imagesCalculate integral imageConvert integer values using lookup tableCheck validity of colormapCheck validity of connectivity argumentConvert CIE 1976 L*a*b* to RGBConvert label matrix into RGB imageConvert label matrix to cell array of linear indicesAverage or mean of matrix elements2-D median filteringMultilevel image thresholds using Otsu's method2-D order-statistic filteringGlobal histogram threshold using Otsu's methodPad arrayPeak Signal-to-Noise Ratio (PSNR)Measure properties of image regionsConvert RGB image or colormap to grayscaleConvert RGB colormap to HSV colormapConvert RGB to CIE 1976 L*a*b*Convert RGB color values to YCbCr color spaceFind limits to contrast stretch image2-D superpixel oversegmentation of imagesWatershed transformConvert YCbCr color values to RGB color spaceReference 2-D image to world coordinatesReference 3-D image to world coordinates2-D Affine Geometric Transformation2-D Projective Geometric TransformationMorphological structuring elementMorphological offset structuring elementDistance transform of binary imageLabel connected components in 2-D binary image Nonlinear filtering using lookup tablesMorphological operations on binary images2-D correlation coefficientFind edges in intensity imageEnhance contrast using histogram equalizationConvert image to double precisionConvert image to single precisionConvert image to 8-bit unsigned integersConvert image to 16-bit unsigned integersAbsolute difference of two imagesAdjust image intensity values or colormapBottom-hat filteringMorphologically close imageComplement imageDilate imageErode imageFill image regions and holesN-D filtering of multidimensional imagesGradient magnitude and direction of an image Directional gradients of an imageHistogram of image dataLinear combination of imagesAdd noise to imageConvert YCbCr color values to RGB color space Morphologically open imageMorphological reconstructionEstimate displacement field that aligns two 2-D or 3-D images Resize imageRotate imageDisplay imageTop-hat filteringInverse Radon transformConvert matrix to grayscale imageAverage or mean of matrix elements2-D median filteringNormalized 2-D cross-correlationPad arrayRadon transformMeasure properties of image regionsConvert RGB image or colormap to grayscaleConvert RGB color values to YCbCr color spaceStandard deviation of matrix elementsLocal standard deviation of imageFind limits to contrast stretch image从图形文件读取图像写入图像到图形文件关于图形文件的信息从国家图像传输格式的元数据(NITF)文件从NITF文件读取图像读取DPX文件元数据读取DPX图像从分析7.5数据集的头文件读取元数据从分析7.5数据集的图像文件中读取图像数据从归档文件元数据在内部文件格式读取图像匿名DICOM文件获取或设置活动DICOM数据字典显示DICOM文件结构读取DICOM消息元数据发现在DICOM数据字典属性读取DICOM图像生成DICOM的唯一标识符写图像的DICOM文件读高动态范围(HDR)图像写下光辉的高动态范围(HDR)图像文件创建高动态范围图像用于观看的高动态范围图像图像I / O接口检查文件是否存在与r-组开放与r-组文件从图像文件创建减少的分辨率数据集将灰度或二值图像转换为索引图像将索引图像转换为灰度图像转换矩阵到灰度图像将RGB图像的灰度或颜色表索引图像的RGB图像转换转换成RGB图像标签矩阵Bayer编码图像转换为彩色图像二值化图像的阈值分割量化图像使用指定的量化电平和输出值采用多级图像阈值Otsu方法采用局部一阶统计的自适应图像阈值使用全局直方图阈值Otsu方法基于阈值的图像转换成二值图像使用全局阈值Otsu方法采用多层阈值化方法将灰度图像转换为索引图像将图像转换为双精度将图像转换为16位有符号整数将图像转换成java缓冲图像将图像转换为单精度将图像转换为16位无符号整数将图像转换为8位无符号整数创建棋盘格图像创建头部影像添加噪声到图像显示图像显示多个图像帧矩形蒙太奇在单个图形中显示多个图像从多帧图像的电影播放电影、视频或图像序列显示图像作为纹理映射的表面获取图像处理工具箱的首选项显示图像处理工具箱首选项对话框设置图像处理工具箱的首选项或显示有效值图像查看器应用程序图像信息的工具对比度调整工具显示范围的工具距离工具像素信息的工具无文本标签的像素信息工具像素区域的工具用于滚动面板的放大盒在滚动面板中显示的图像的概述工具获取图像处理工具箱的首选项显示图像处理工具箱首选项对话框设置图像处理工具箱的首选项或显示有效值图像信息的工具选择映射工具对比度调整工具作物图像显示范围的工具距离工具像素信息的工具无文本标签的像素信息工具像素区域的工具像素区域工具面板用于滚动面板的放大盒在滚动面板中显示的图像的概述工具滚动面板中显示的图像的工具面板保存图像的工具用于交互式图像导航的滚动面板创建可拖动椭圆创建可拖动自由区域创建可拖动,可调整大小的线创建可拖动点创建可拖动,可调整大小的多边形创建可拖动矩形感兴趣区域(感兴趣区域)基类用鼠标选择多段线用鼠标指定点用鼠标指定矩形从轴的图像数据图像对象的图像模型对象图像模型对象将坐标轴转换为像素坐标关于图像属性的信息获取当前包含图像的轴的句柄获取当前图像包含图像的句柄打开图像对话框获取所有图像处理添加函数句柄到回调列表检查处理的有效性获取处理的应用程序程序员接口(接口)从汞对象检索指针行为目录包含了IPT和Matlab的图标创建图形中的指针管理器从回调列表中删除函数句柄句柄图形对象中的存储指针行为结构排列图的窗口创建矩形拖动约束函数有界调整图像的显示大小作物图像调整图像大小旋转图像转换图像图像金字塔的还原与扩展将几何变换应用于图像拟合控制点对的几何变换二维空间变换在图像中的应用查找空间变换的输出范围输入和输出翻转平台结构的作用创建重采样结构创造空间转换结构(平台)将空间变换N-D数组应用前向空间变换应用逆空间变换创建棋盘格图像二维仿射几何变换三维仿射几何变换二维射影几何变换二维分段线性几何变换二维多项式几何变换二维局部加权平均几何变换将几何变换应用于图像基于强度的图像配准估计对齐两个二维或三维图像的几何变换显示图像比较图像之间的差异两幅图像的复合参考二维图像到世界坐标参考三维图像到世界坐标基于强度的图像配准基于强度的注册的配置估计对齐两个二维或三维图像的几何变换使用相位相关的两个二维图像的几何变换估计估计对齐两个二维或三维图像的位移场两幅图像的复合比较图像之间的差异Mattes互信息度量的配置对象均方误差度量配置对象正规步长梯度下降优化配置对象一加一进化优化配置对象控制点选择工具拟合控制点对的几何变换使用交叉相关的调整控制点位置cpstruct转换控制点的有效对标准化二维互相关从控制点对的空间变换调整图像的灰度值或颜色表对比度调整工具利用反锐化掩模图像锐化采用直方图均衡化增强对比度对比度自适应直方图均衡化(CLAHE)调整直方图的图像与参考图像n-bin直方图申请去相关拉伸的多通道图像查找对比度拉伸图像的限制使用查找表转换整数值添加噪声到图像N维的多维图像滤波二维图像的二维高斯滤波三维图像的三维高斯滤波创建预定义的二维滤波器图像引导滤波标准化二维互相关二维自适应噪声滤除二维中值滤波二维阶统计滤波图像局部标准偏差局部图像范围灰度图像局部熵一般滑动邻域运算Gabor滤波器和Gabor滤波器组的创建应用Gabor滤波器或滤波器组二维图像二维图像的二维图像滤波三维图像的三维盒滤波计算积分图像计算三维积分图像积分图像的二维箱滤波三维整体图像的三维箱滤波通过大小从二值图像中提取对象使用属性从二值图像中提取对象焊盘阵列二维频率响应采用频率采样的二维滤波器采用频率变换的二维滤波器二维FIR滤波器采用一维窗口的方法采用二维窗法的二维二维滤波器二维卷积矩阵二进制命中错误操作二值图像的形态学运算终极侵蚀从二值图像中删除小对象帽子底部过滤抑制连接到图像边缘的光结构形态接近的图像放大图像腐蚀图像扩展极大值变换扩展最小变换填充图像区域和孔h-maxima变换利用H-minima变换强制最小形态上打开的图像形态重构区域极值局部极小顶帽滤波分水岭变换创建连接的阵列检查连通性参数的有效性使用查找表的二值图像的邻域运算使用查找表的非线性滤波创建bwlookup使用查找表形态学结构元素形态学偏移结构元素利用盲反卷积去模糊图像用露西理查德森的方法去模糊图像利用正则化滤波复原图像使用维纳滤波复原图像沿图像边缘的锥度不连续性将光学传递函数转换为点扩散函数转换点扩展函数到光传输函数焊盘阵列指定感兴趣区域(投资回报率)将感兴趣区域(感兴趣区域)的多边形转换为区域掩模用内插法填充图像中的指定区域基于颜色的选择感兴趣区域(感兴趣区域)图像中的感兴趣区域(感兴趣区域)创建可拖动椭圆创建可拖动自由区域创建可拖动,可调整大小的多边形创建可拖动矩形感兴趣区域(感兴趣区域)基类图像I / O接口图像的不同块处理确定块处理的最佳块大小一般滑动邻域运算将矩阵列重新排列成块纵列邻域操作将图像块重新排列成列两幅图像的绝对差添加两个图像或添加常量到图像彩色通道的线性组合补充图像用常数将一幅图像分割成另一幅图像图像的线性组合用常数相乘的两幅图像或多幅图像从另一个或减去一个图像减去一个图像二元图像中的迹区域边界二进制图像中的跟踪对象绘图区域的边界在强度图像中查找边缘发现使用Hough变换圆创建圈子图像的梯度幅值和方向图像的方向梯度查找图像的三维梯度幅值和方向查找三维图像的方向梯度Hough变换基于Hough变换提取直线段确定峰Hough变换四叉树分解在四叉树分解块值在四叉树分解模块设置的值图像区域的测量特性二值图像中的对象区域通过大小从二值图像中提取对象查找二进制图像中的连接组件从二值图像生成凸壳图像二值图像的距离变换二值图像的测地距离变换二值图像的欧拉数在二值图像中查找对象的周长使用属性从二值图像中提取对象在二值图像中选择对象灰度图像的灰度加权距离变换创建图像数据的等高线图图像数据直方图像素的颜色值沿线段的像素值的横截面二维相关系数矩阵元素的平均值或平均值矩阵元素的标准偏差二维二值图像中的标签连接部件二值图像中的标签连接组件从bwconncomp创建标签矩阵结构包的二进制图像打开二进制图像灰度图像熵灰度图像局部熵局部图像范围图像局部标准偏差从图像创建灰度共生矩阵灰度共生矩阵的性质均方误差峰值信噪比(PSNR)结构相似性指数(SSIM)测量图像质量用主动轮廓分割成前景和背景的图像采用快速行进法的二值图像分割用基于测地距离的彩色分割的两个或三个区域的分割图像基于图像梯度的图像像素权重计算基于灰度强度差的图像像素权重计算选择具有相似灰度值的连续图像区域使用全局阈值Otsu方法采用多级图像阈值Otsu方法使用全局直方图阈值Otsu方法采用局部一阶统计的自适应图像阈值查找区域边界的分割二维超像素oversegmentation的图像将二元掩模烧成二维图像将标签矩阵转换为线性指标的单元阵列图像变换二值图像的距离变换二值图像的测地距离变换灰度图像的灰度加权距离变换Hough变换二维离散余弦变换离散余弦变换矩阵将扇形束投影转换成平行光束扇束变换二维逆离散余弦变换逆扇形束变换逆Radon变换将平行光束投影转换成扇形光束Radon变换二维快速傅立叶变换将零频分量移到光谱中心二维逆快速傅立叶变换逆FFT转换颜色转换转换RGB与CIE 1976 L*a*b*将RGB颜色值的NTSC色彩空间转换RGB与CIE 1931 XYZ转换到YCbCr色彩空间RGB颜色值1976将CIE L*a*b*到RGB1976将CIE L*a*b*到CIE 1931 XYZ将CIE 1931 XYZ CIE 1976 L*a*b*CIE 1931 XYZ到RGB的转换YCbCr颜色值转换到RGB颜色空间转换成NTSC值RGB颜色空间将L * A * B *数据转换为双将L*a*b*数据uint16将L*a*b*数据卡片XYZ颜色值转换为双将XYZ颜色值uint16搜索国际商会简介读的ICC配置文件查找系统默认的国际刑事法院配置文件库将颜色配置文件写入磁盘文件真正的有效的国际刑事法院颜色配置文件创建颜色转换结构应用设备独立的颜色空间变换通过减少颜色数的近似索引图像标准照明体XYZ颜色值generation采用局部一阶统计的自适应图像阈值查找区域边界的分割从二值图像中删除小对象二元图像中的迹区域边界查找二进制图像中的连接组件二值图像的距离变换二值图像的欧拉数二维二值图像中的标签连接部件使用查找表的非线性滤波二值图像的形态学运算包的二进制图像在二值图像中查找对象的周长在二值图像中选择对象二进制图像中的跟踪对象打开二进制图像创建连接的阵列Bayer编码图像转换为彩色图像在强度图像中查找边缘拟合控制点对的几何变换创建预定义的二维滤波器基于它的类的图像的默认显示范围选择具有相似灰度值的连续图像区域采用直方图均衡化增强对比度Hough变换基于Hough变换提取直线段确定峰Hough变换转换到RGB的色度HSV颜色图将图像转换为双精度将图像转换为16位有符号整数将图像转换为单精度将图像转换为16位无符号整数将图像转换为8位无符号整数两幅图像的绝对差调整图像的灰度值或颜色表二值化图像的阈值分割帽子底部过滤二维图像的二维图像滤波抑制连接到图像边缘的光结构形态接近的图像补充图像作物图像放大图像腐蚀图像扩展极大值变换扩展最小变换填充图像区域和孔N维的多维图像滤波发现使用Hough变换圆应用Gabor滤波器或滤波器组二维图像二维图像的二维高斯滤波查找图像的三维梯度幅值和方向查找三维图像的方向梯度图像数据直方图h-maxima变换利用H-minima变换图像的线性组合均方误差形态上打开的图像将二元掩模烧成二维图像图像金字塔的还原与扩展量化图像使用指定的量化电平和输出值从图形文件读取图像形态重构区域极值局部极小调整图像大小旋转图像顶帽滤波转换图像将几何变换应用于图像积分图像的二维箱滤波计算积分图像使用查找表转换整数值检查的有效性信息检查连通性参数的有效性1976将CIE L*a*b*到RGB转换成RGB图像标签矩阵将标签矩阵转换为线性指标的单元阵列矩阵元素的平均值或平均值二维中值滤波采用多级图像阈值Otsu方法二维阶统计滤波使用全局直方图阈值Otsu方法焊盘阵列峰值信噪比(PSNR)图像区域的测量特性将RGB图像的灰度或颜色表将RGB颜色表HSV色图转换RGB与CIE 1976 L*a*b*转换到YCbCr色彩空间RGB颜色值查找对比度拉伸图像的限制二维超像素oversegmentation的图像分水岭变换YCbCr颜色值转换到RGB颜色空间参考二维图像到世界坐标参考三维图像到世界坐标二维仿射几何变换二维射影几何变换形态学结构元素形态学偏移结构元素GPU 计算二值图像的距离变换二维二值图像中的标签连接部件使用查找表的非线性滤波二值图像的形态学运算二维相关系数在强度图像中查找边缘采用直方图均衡化增强对比度将图像转换为双精度将图像转换为单精度将图像转换为8位无符号整数将图像转换为16位无符号整数两幅图像的绝对差调整图像的灰度值或颜色表帽子底部过滤形态接近的图像补充图像放大图像腐蚀图像填充图像区域和孔N维的多维图像滤波图像的梯度幅值和方向图像的方向梯度图像数据直方图图像的线性组合添加噪声到图像YCbCr颜色值转换到RGB颜色空间形态上打开的图像形态重构估计对齐两个二维或三维图像的位移场调整图像大小旋转图像显示图像顶帽滤波逆Radon变换转换矩阵到灰度图像矩阵元素的平均值或平均值二维中值滤波标准化二维互相关焊盘阵列Radon变换图像区域的测量特性将RGB图像的灰度或颜色表转换到YCbCr色彩空间RGB颜色值矩阵元素的标准偏差图像局部标准偏差查找对比度拉伸图像的限制。

MATLAB 图像处理命令使用

MATLAB 图像处理命令使用

MATLAB 图像处理命令使用1.MATLAB中图像处理的一些简单函数A、imreadimread函数用于读入各种图像文件,其一般的用法为[X,MAP]=imread(‘filename’,‘fmt’)其中,X,MAP分别为读出的图像数据和颜色表数据,fmt为图像的格式,filename为读取的图像文件(可以加上文件的路径)。

例:[X,MAP]=imread(’flowers.tif’,’tif’);比较读取二值图像,灰度图像,索引图像,彩色图像的X和MAP的特点,可以利用size 函数用来显示数组的维数,了解数据的特点。

B=size(a) 返回数组a 的维数。

B、imwriteimwrite函数用于输出图像,其语法格式为:imwrite(X,map,filename,fmt)imwrite(X,map,filename,fmt)按照fmt指定的格式将图像数据矩阵X和调色板map写入文件filename。

C、imfinfoimfinfo函数用于读取图像文件的有关信息,其语法格式为imfinfo(filename,fmt)imfinfo函数返回一个结构info,它反映了该图像的各方面信息,其主要数据包括:文件名(路径)、文件格式、文件格式版本号、文件的修改时间、文件的大小、文件的长度、文件的宽度、每个像素的位数、图像的类型等。

2.MATLAB中图像文件的显示imshowimshow函数是最常用的显示各种图像的函数,其语法如下:imshow(X,map)其中X是图像数据矩阵,map是其对应的颜色矩阵,若进行图像处理后不知道图像数据的值域可以用[]代替map。

(1)二进制(二值)图像显示方法,在MATLAB中一幅二值图像是uint8或双精度的,该矩阵仅包含0和1。

如果希望工具箱中的函数能将图像理解为二进制的,那么所有数据都要是逻辑数据,必须对其进行设置(将所有数据标志均设置on).可以对数据利用“~”取反操作实现图像逆转即黑白反色。

Matlab中图像处理常用函数的用法

Matlab中图像处理常用函数的用法

Matlab中常见函数的用法1 size()函数1)s=size(A),当只有一个输出参数时,返回一个行向量,该行向量的第一个元素时矩阵的行数,第二个元素是矩阵的列数。

2)[r,c]=size(A),当有两个输出参数时,size函数将矩阵的行数返回到第一个输出变量r,将矩阵的列数返回到第二个输出变量c。

3)size(A,n)如果在size函数的输入参数中再添加一项n,并用1、2或者3为n赋值,则 size将返回矩阵的行数或列数。

其中r=size(A,1)该语句返回的时矩阵A的行数, c=size(A,2) 该语句返回的时矩阵A的列数。

如果A为一个二维数组,则可以将其看成一个第三维为1的数组,即size(A,3)的返回值为1。

2 padarray()函数B = padarray(A,padsize,padval,direction)A为输入图像,B为填充后的图像,padsize给出了给出了填充的行数和列数,通常用[r c]来表示。

padval和direction分别表示填充方法和方向。

它们的具体值和描述如下:Padval选项:'symmetric'表示图像大小通过围绕边界进行镜像反射来扩展;'replicate'表示图像大小通过复制外边界中的值来扩展;'circular'图像大小通过将图像看成是一个二维周期函数的一个周期来进行扩展。

Direction选项:'pre'表示在每一维的第一个元素前填充;'post'表示在每一维的最后一个元素后填充;'both'表示在每一维的第一个元素前和最后一个元素后填充,此项为默认值。

若参量中不包括direction,则默认值为'both';若参量中不包含padval,则默认用0来填充。

若参量中不包括任何参数,则默认填充为零且方向为'both'。

matlab图像处理函数大全

matlab图像处理函数大全

matlab图像处理函数大全Matlab是一种强大的科学计算软件,广泛应用于各个领域,包括图像处理。

在Matlab中,有许多内置的图像处理函数,可以帮助我们实现各种图像处理任务。

本文将介绍一些常用的Matlab图像处理函数,帮助您更好地理解和运用这些函数。

1. imread函数imread函数用于读取图像文件,并将其存储为Matlab的图像矩阵。

它可以读取多种图像格式,如JPEG、PNG、BMP等。

例如,可以使用以下代码读取名为"image.jpg"的图像文件:```matlabimage = imread('image.jpg');```2. imshow函数imshow函数用于显示图像。

它可以接受一个图像矩阵作为输入,并将其显示在Matlab的图像窗口中。

例如,可以使用以下代码显示之前读取的图像:```matlabimshow(image);```3. imresize函数imresize函数用于调整图像的大小。

它可以接受一个图像矩阵和目标大小作为输入,并返回调整大小后的图像矩阵。

例如,可以使用以下代码将图像调整为200x200的大小:```matlabresized_image = imresize(image, [200, 200]);```4. rgb2gray函数rgb2gray函数用于将彩色图像转换为灰度图像。

它可以接受一个彩色图像矩阵作为输入,并返回一个灰度图像矩阵。

例如,可以使用以下代码将彩色图像转换为灰度图像:```matlabgray_image = rgb2gray(image);```5. imadjust函数imadjust函数用于调整图像的对比度和亮度。

它可以接受一个灰度图像矩阵和目标对比度和亮度范围作为输入,并返回调整后的图像矩阵。

例如,可以使用以下代码增加图像的对比度和亮度:```matlabadjusted_image = imadjust(gray_image, [0.2, 0.8], [0, 1]);```6. imfilter函数imfilter函数用于对图像进行滤波操作。

matlab中images函数

matlab中images函数

1. 图像处理在科学研究和工程领域中具有重要作用,而MATLAB作为一种强大的科学计算软件,拥有丰富的图像处理功能。

其中,images 函数是MATLAB中用于图像处理的重要函数之一。

2. images函数是MATLAB中一个用于创建图像的函数。

它可以在MATLAB中生成各种类型和大小的图像,包括灰度图像、彩色图像以及各种特定形状和大小的图像。

images函数的基本语法如下所示: ```matlabimg = images('PropertyName', 'PropertyValue', ...)```其中,img是生成的图像对象,'PropertyName'和'PropertyValue'是用于指定图像属性的参数。

3. images函数可以用来创建各种类型的图像,包括灰度图像和彩色图像。

对于灰度图像,可以通过指定图像的大小和灰度值来创建。

下面的代码创建了一个大小为256x256的灰度图像,灰度值为128:```matlabimg = images('CData', ones(256,256)*128);```对于彩色图像,可以通过指定图像的大小和RGB值来创建。

下面的代码创建了一个大小为256x256的彩色图像,颜色为红色:```matlabimg = images('CData', cat(3, ones(256,256), zeros(256,256),zeros(256,256)));```4. images函数还可以用来创建特定形状和大小的图像。

通过指定图像的大小和形状参数,可以轻松地创建各种形状的图像,如矩形、圆形和椭圆形。

下面的代码创建了一个大小为256x256的红色矩形图像: ```matlabimg = images('CData', cat(3, ones(256,256), zeros(256,256), zeros(256,256)), 'XData', [0 10], 'YData', [0 10]);```5. images函数还可以用来处理图像的显示和调整。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

Matlab中图像函数大全图像增强除高频噪声1、lps2、中值滤波(非线性)3、空域模板滤波1. 直方图均衡化的 Matlab 实现1.1 imhist 函数功能:计算和显示图像的色彩直方图格式:imhist(I,n)imhist(X,map)说明:imhist(I,n) 其中,n 为指定的灰度级数目,缺省值为256;imhist(X,map) 就算和显示索引色图像 X 的直方图,map 为调色板。

用 stem(x,counts) 同样可以显示直方图。

1.2 imcontour 函数功能:显示图像的等灰度值图格式:imcontour(I,n),imcontour(I,v)说明:n 为灰度级的个数,v 是有用户指定所选的等灰度级向量。

1.3 imadjust 函数功能:通过直方图变换调整对比度格式:J=imadjust(I,[low high],[bottom top],gamma)newmap=imadjust(map,[low high],[bottom top],gamma)说明:J=imadjust(I,[low high],[bottom top],gamma) 其中,gamma 为校正量r,[low high] 为原图像中要变换的灰度范围,[bottom top] 指定了变换后的灰度范围;newmap=imadjust(map,[low high],[bottom top],gamma) 调整索引色图像的调色板 map 。

此时若 [low high] 和 [bottom top] 都为2×3的矩阵,则分别调整 R、G、B 3个分量。

1.4 histeq 函数功能:直方图均衡化格式:J=histeq(I,hgram)J=histeq(I,n)[J,T]=histeq(I,...)newmap=histeq(X,map,hgram)newmap=histeq(X,map)[new,T]=histeq(X,...)说明:J=histeq(I,hgram) 实现了所谓“直方图规定化”,即将原是图象 I 的直方图变换成用户指定的向量 hgram 。

hgram 中的每一个元素都在 [0,1] 中;J=histeq(I,n) 指定均衡化后的灰度级数 n ,缺省值为 64;[J,T]=histeq(I,...) 返回从能将图像 I 的灰度直方图变换成图像 J 的直方图的变换 T ;newmap=histeq(X,map) 和 [new,T]=histeq(X,...) 是针对索引色图像调色板的直方图均衡。

2. 噪声及其噪声的 Matlab 实现imnoise 函数格式:J=imnoise(I,type)J=imnoise(I,type,parameter)说明:J=imnoise(I,type) 返回对图像 I 添加典型噪声后的有噪图像 J ,参数type 和 parameter 用于确定噪声的类型和相应的参数。

3. 图像滤波的 Matlab 实现3.1 conv2 函数功能:计算二维卷积格式:C=conv2(A,B)C=conv2(Hcol,Hrow,A)C=conv2(...,'shape')说明:对于 C=conv2(A,B) ,conv2 的算矩阵 A 和 B 的卷积,若 [Ma,Na]=size(A), [Mb,Nb]=size(B), 则 size(C)=[Ma+Mb-1,Na+Nb-1];C=conv2(Hcol,Hrow,A) 中,矩阵 A 分别与 Hcol 向量在列方向和 Hrow 向量在行方向上进行卷积;C=conv2(...,'shape') 用来指定 conv2 返回二维卷积结果部分,参数 shape 可取值如下:》full 为缺省值,返回二维卷积的全部结果;》same 返回二维卷积结果中与 A 大小相同的中间部分;valid 返回在卷积过程中,未使用边缘补 0 部分进行计算的卷积结果部分,当 size(A)>size(B) 时,size(C)=[Ma-Mb+1,Na-Nb+1]。

3.2 conv 函数功能:计算多维卷积格式:与 conv2 函数相同3.3 filter2函数功能:计算二维线型数字滤波,它与函数 fspecial 连用格式:Y=filter2(B,X)Y=filter2(B,X,'shape')说明:对于 Y=filter2(B,X) ,filter2 使用矩阵 B 中的二维 FIR 滤波器对数据 X 进行滤波,结果 Y 是通过二维互相关计算出来的,其大小与 X 一样;对于 Y=filter2(B,X,'shape') ,filter2 返回的 Y 是通过二维互相关计算出来的,其大小由参数 shape 确定,其取值如下:》full 返回二维相关的全部结果,size(Y)>size(X);》same 返回二维互相关结果的中间部分,Y 与 X 大小相同;》valid 返回在二维互相关过程中,未使用边缘补 0 部分进行计算的结果部分,有 size(Y)<size(X) 。

3.4 fspecial 函数功能:产生预定义滤波器格式:H=fspecial(type)H=fspecial('gaussian',n,sigma) 高斯低通滤波器H=fspecial('sobel')Sobel 水平边缘增强滤波器H=fspecial('prewitt')Prewitt 水平边缘增强滤波器H=fspecial('laplacian',alpha)近似二维拉普拉斯运算滤波器H=fspecial('log',n,sigma)高斯拉普拉斯(LoG)运算滤波器H=fspecial('average',n)均值滤波器H=fspecial('unsharp',alpha) 模糊对比增强滤波器说明:对于形式 H=fspecial(type) ,fspecial 函数产生一个由 type 指定的二维滤波器 H ,返回的 H 常与其它滤波器搭配使用。

4. 彩色增强的 Matlab 实现4.1 imfilter函数功能:真彩色增强格式:B=imfilter(A,h)说明:将原始图像 A 按指定的滤波器 h 进行滤波增强处理,增强后的图像 B 与A 的尺寸和类型相同图像的变换1. 离散傅立叶变换的 Matlab 实现Matlab 函数 fft、fft2 和 fftn 分别可以实现一维、二维和 N 维DFT 算法;而函数 ifft、ifft2 和 ifftn 则用来计算反 DFT 。

这些函数的调用格式如下:A=fft(X,N,DIM)其中,X 表示输入图像;N 表示采样间隔点,如果 X 小于该数值,那么 Matlab 将会对 X 进行零填充,否则将进行截取,使之长度为 N ;DIM 表示要进行离散傅立叶变换。

A=fft2(X,MROWS,NCOLS)其中,MROWS 和 NCOLS 指定对 X 进行零填充后的 X 大小。

A=fftn(X,SIZE)其中,SIZE 是一个向量,它们每一个元素都将指定 X 相应维进行零填充后的长度。

函数 ifft、ifft2 和 ifftn的调用格式于对应的离散傅立叶变换函数一致。

例子:图像的二维傅立叶频谱% 读入原始图像I=imread('lena.bmp');imshow(I)% 求离散傅立叶频谱J=fftshift(fft2(I));figure;imshow(log(abs(J)),[8,10])2. 离散余弦变换的 Matlab 实现2.1. dct2 函数功能:二维 DCT 变换格式:B=dct2(A)B=dct2(A,m,n)B=dct2(A,[m,n])说明:B=dct2(A) 计算 A 的 DCT 变换 B ,A 与 B 的大小相同;B=dct2(A,m,n) 和 B=dct2(A,[m,n]) 通过对 A 补 0 或剪裁,使 B 的大小为m×n。

2.2. dict2 函数功能:DCT 反变换格式:B=idct2(A)B=idct2(A,m,n)B=idct2(A,[m,n])说明:B=idct2(A) 计算 A 的 DCT 反变换 B ,A 与 B 的大小相同;B=idct2(A,m,n) 和 B=idct2(A,[m,n]) 通过对 A 补 0 或剪裁,使 B 的大小为m×n。

2.3. dctmtx函数功能:计算 DCT 变换矩阵格式:D=dctmtx(n)说明:D=dctmtx(n) 返回一个n×n 的 DCT 变换矩阵,输出矩阵 D 为 double 类型。

3. 图像小波变换的 Matlab 实现3.1 一维小波变换的 Matlab 实现(1) dwt 函数功能:一维离散小波变换格式:[cA,cD]=dwt(X,'wname')[cA,cD]=dwt(X,Lo_D,Hi_D)说明:[cA,cD]=dwt(X,'wname') 使用指定的小波基函数 'wname' 对信号 X 进行分解,cA、cD 分别为近似分量和细节分量;[cA,cD]=dwt(X,Lo_D,Hi_D) 使用指定的滤波器组 Lo_D、Hi_D 对信号进行分解。

(2) idwt 函数功能:一维离散小波反变换格式:X=idwt(cA,cD,'wname')X=idwt(cA,cD,Lo_R,Hi_R)X=idwt(cA,cD,'wname',L)X=idwt(cA,cD,Lo_R,Hi_R,L)说明:X=idwt(cA,cD,'wname') 由近似分量 cA 和细节分量 cD 经小波反变换重构原始信号 X 。

'wname' 为所选的小波函数X=idwt(cA,cD,Lo_R,Hi_R) 用指定的重构滤波器 Lo_R 和Hi_R 经小波反变换重构原始信号 X 。

X=idwt(cA,cD,'wname',L) 和 X=idwt(cA,cD,Lo_R,Hi_R,L) 指定返回信号 X 中心附近的 L 个点。

3.2 二维小波变换的 Matlab 实现二维小波变换的函数-------------------------------------------------函数名函数功能---------------------------------------------------dwt2 二维离散小波变换wavedec2 二维信号的多层小波分解idwt2 二维离散小波反变换waverec2 二维信号的多层小波重构wrcoef2 由多层小波分解重构某一层的分解信号upcoef2 由多层小波分解重构近似分量或细节分量 detcoef2 提取二维信号小波分解的细节分量appcoef2 提取二维信号小波分解的近似分量upwlev2 二维小波分解的单层重构dwtpet2 二维周期小波变换idwtper2 二维周期小波反变换-------------------------------------------------------------(1) wcodemat 函数功能:对数据矩阵进行伪彩色编码格式:Y=wcodemat(X,NB,OPT,ABSOL)Y=wcodemat(X,NB,OPT)Y=wcodemat(X,NB)Y=wcodemat(X)说明:Y=wcodemat(X,NB,OPT,ABSOL) 返回数据矩阵 X 的编码矩阵 Y ;NB 伪编码的最大值,即编码范围为 0~NB,缺省值 NB=16;OPT 指定了编码的方式(缺省值为 'mat'),即:OPT='row' ,按行编码OPT='col' ,按列编码OPT='mat' ,按整个矩阵编码ABSOL 是函数的控制参数(缺省值为 '1'),即:ABSOL=0 时,返回编码矩阵ABSOL=1 时,返回数据矩阵的绝对值ABS(X)(2) dwt2 函数功能:二维离散小波变换格式:[cA,cH,cV,cD]=dwt2(X,'wname')[cA,cH,cV,cD]=dwt2(X,Lo_D,Hi_D)说明:[cA,cH,cV,cD]=dwt2(X,'wname')使用指定的小波基函数 'wname' 对二维信号 X 进行二维离散小波变幻;cA,cH,cV,cD 分别为近似分量、水平细节分量、垂直细节分量和对角细节分量;[cA,cH,cV,cD]=dwt2(X,Lo_D,Hi_D) 使用指定的分解低通和高通滤波器 Lo_D 和 Hi_D 分解信号 X 。

相关文档
最新文档