最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 正文

MATLAB图像处理工具箱函数

来源:动视网 责编:小OO 时间:2025-10-03 00:30:37
文档

MATLAB图像处理工具箱函数

表A-1通用函数函数功能语法Colorbar显示颜色条colorbarcolorbar(‘Vert’)colorbar(‘horiz’)colorbar(h_h=colorbar(……)colorbar(…,’peer’,axes_handle)Getimage从坐标轴取得图形数据A=getimage(h)[x,y,A]=getimage(h)[…,A,flag]=getimage(h)[…]=getimageImshow显示图像Imshow(I,n)Imshow(I,[lowhigh])Im
推荐度:
导读表A-1通用函数函数功能语法Colorbar显示颜色条colorbarcolorbar(‘Vert’)colorbar(‘horiz’)colorbar(h_h=colorbar(……)colorbar(…,’peer’,axes_handle)Getimage从坐标轴取得图形数据A=getimage(h)[x,y,A]=getimage(h)[…,A,flag]=getimage(h)[…]=getimageImshow显示图像Imshow(I,n)Imshow(I,[lowhigh])Im
表A-1    通用函数

函数功能语法
Colorbar显示颜色条colorbar

colorbar(‘Vert’)

colorbar(‘horiz’)

colorbar(h_

h=colorbar(……)

colorbar(…,’peer’,axes_handle)

Getimage从坐标轴取得图形数据A=getimage(h)

[x,y,A]=getimage(h)

[…,A,flag]=getimage(h)

[…]=getimage

Imshow显示图像Imshow(I,n)

Imshow(I,[low high])

Imshow(BW)

Imshow(X,map)

Imshow(RGB)

Imshow(…,display_option)

Imshow(x,y,A,…)

Imshow filename

H= Imshow(…)

Montage在矩形框中同时显示多幅图像montage(I)

montage(BW)

montage(X,map)

montage(RGB)

h=montage(…)

Immovie创建多帧索引色图像的电影动画mov=immovie(X,map)

mov=immovie(RGB)

Subimage在一幅图中显示多个图像Subimage(X,map)

Subimage(I)

Subimage(BW)

Subimage(RGB)

Subimage(x,y,…)

H=subimage(…)

Truesize调整图像显示尺寸Truesize(fig,[mrows mcols])

Truesize(fig)

Warp将图像显示到纹理映射表面Warp(X,map)

Warp(I,n)

Warp(z,…)

Warp(x,y,z,…)

H=warp(…)

Zoom缩放图像Zoom on 

Zoom off

Zoom out

Zoom reset

zoom

zoom xon

zoom yon

zoom(factor)

zoom(fig,option)

表A-2    几何操作函数

函数功能语法
Imcrop剪切图像I2=imcrop(I)

X2=imcrop(X,map)

RGB2=imcrop(RGB)

I2=imcrop(I,rect)

RGB2=imcrop(RGB,rect)

[…]=imcrop(x,y,…)

[A,rect]=imcrop(…)

[x,y,A,rect]=imcrop(…)

Imresize改变图像大小B=imresize(A,m,method)
Imrotate旋转图像B=imrotate(A,angel,method)

B=imrotate(A,angel,method,’crop’)

表A-3    图像文件I/O函数

函数功能语法
Imfinfo返回图形文件信息Info=imfinfo(filename,fmt)

Info=imfinfo(filename)

Imread从图形文件中读取图像A=imrea(filename,fmt)

[X,map]=imrea(filename,fmt)

[…]=imread(filename)

[…]=imread(URL,…)

[…]=imread(…idx)    (CUR,ICO,and TIFF only)

[…]=imread(…,’frames’,idx) (GIF only)

[…]=imread(…,ref)  (HDF only)

[…]=imread(…,’backGrounColor’,BG)  (PNG only)

[A,map,alpha]=imread(…)  (ICO,CUR and PNG only)

Imwrite把图像写入图形文件中Imwrite(A,filename,fnt)

Imwrite(X,map,filename,fmt)

Imwrite(…,filename)

Imwrite(…,Param1,Val1,Param2,Val2,…)

表A-4    线性滤波函数

函数功能语法
Conv2进行二维卷积操作C=conv2(A,B)

C=conv2(hcol,hrow,A)

C=conv2(…,’shape’)

Convmtx2计算二维卷积矩阵T=convmtx2(H,m,n)

T=convmtx2(H,[m,n])

Convn计算n维卷积

C=convn(A,B)

C=convn(A,B,’shape’)

Filter2进行二维线性过滤操作Y=filter2(h,x)

Y=filter2(h,X,shape)

Fspecial创建预定义过滤器H=fspecial(type)

H=fspecial(type,parameters)

表A-5    像素和统计处理函数

函数功能语法
Corr2计算两个矩阵的二维相关系数R=corr2(A,B)
Imcontour创建图像数据的轮廓图Imcontour(I,n)

Imcontour(I,v)

Imcontour(x,y,…)

Imcontour(…,lineSpec)

[C,h]=imcontour(…)

Imfeature计算图像区域的特征尺寸Stats=imfeature(L,measurements)

Stats=imfeature(L,measurements,n)

Imhist显示图像数据的柱状图Imhist(I,n)

Imhist(X,map)

[count,X]=imhist(…)

Impixel确定像素颜色值P=impixel(I)

P=impixel(X,map)

P=impixel(RGB)

P=impixel(I,c,r)

P=impixel(X,map,C,r)

P=impixel(RGB,c,r)

[c,r,P]=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,…)

Improfile沿线段计算剖面图的像素值C=improfile

C=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)

Mean2计算矩阵元素的平均值B=mean2(A)
Pixval显示图像像素信息Pixval on
Std2计算矩阵元素的标准偏移B=std2(A)
表A-6    图像增强函数

函数功能语法
Histeq用柱状图均衡化增强对比J=histeq(I,hgram)

J=histeq(I,n)

[J,T]=histeq(I,…)

Newmap=histeq(X,map,hgram)

Newmap=histeq(X,map)

[newmap,T]=histeq(X,…)

Imadjust调整图像灰度值或颜色映射表J=imadjust(I,[low_in high_in],[low_out high_out],gamma)

Newmap=imadjust(map,[low_in high_in],[low_out high_out],gamma)

RGB2=imadjust(RGB1,…)

Imnoise增强图像渲染效果J=imnoise(I,type)

J=imnoise(I,type,parameters)

Medfilt2进行二维中值过滤B=medfilt2(A,[m,n])

B=medfilt2(A)

B=medfilt2(A,’indexed’,…)

Ordfilt2进行二维统计顺序过滤B=ordfilt2(A,order,domain)

B=ordfilt2(A,order,domain,S)

B=ordfilt2(…,padopt)

Wiener2进行二维适应性去噪过滤处理J=wiener2(I,[m,n],noise)

[J,noise]=wiener2(I,[m,n])

表A-7    图像分析函数

函数功能语法
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,thresh]=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’,…)

Qtgetblk获取四叉树中的块值[vals,r,c]=qtgetblk(I,S,dim)

[vals,idx]=qtgetblk(I,S,dim)

Qtsetblk设置四叉树中的块值J=qtsetblk(I,S,dim,vals)
表A-8    线性二维滤波设计函数

函数功能语法
Frespace确定二维频率响应频率空间[f1,f2]=freqspace(n)

[f1,f2]=freqspace([m,n])

[x1,y1]freqspace(…,’meshgrid’)

F=freqspace(N)

F=freqspace(N,’whole’)

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(…)

Fsamp2用频率采样法设计二维FIR过滤器

H=fsamp2(Hd)

H=fsamp2(f1,f2,Hd,[m,n])

Ftrans2通过频率转换设计二维FIR过滤器

H=ftrans2(b,t)

H=ftrans2b)

Fwind1用一维窗口法设计二维FIR过滤器

H=fwind1(Hd,win)

H=fwind1(Hd,win1,win2)

H=fwind1(f1,f2,Hd,…)

Fwind2用二维窗口法设计二维FIR过滤器

H=fwind2(Hd,win)

H=fwind2(f1,f2,Hd,win)

表A-9    二进制图像操作函数

函数功能语法
Applylut在二进制图像中利用lookup表进行边沿操作

A=applylut(BW,LUT)
Bwarea计算二进制图像对象的面积Total=bwarea(BW)
Bweuler计算二进制图像的欧拉数Eul=bweuler(BW,n)
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)

Bwlabel标注二进制图像中已连接的部分L=bwlabel(BW,n)

[L,num]=bwlabel(BW,n)

Bwmorph提取二进制图像的轮廓BW2=bwmorph(BW1,operation)

BW2=bwmorph(BW1,operation,n)

Bwperim计算二进制图像中对象的周长BW2=bwperim(BW1)

bW2=bwperim(BW1,CONN)

Bwselect在二进制图像中选择对象BW2=bwselect(BW1,c,r,n)

BW2=bwselect(BW1,n)

[BW2,idx]=bwselect(…)

BW2=bwselect(x,y,BW1,xi,yi)

[x,y,BW2,idx,xi,yi]=bwselect(…)

Dilate放大二进制图像BW2=dilate(BW1,SE)

BW2=dilate(BW1,SE,lag)

BW2=dilate(BW1,SE,…,n)

Erode弱化二进制图像的边界BW2=erode(BW1,SE)

BW2=erode(BW1,SE,lag)

BW2=erode(BW1,SE,…,n)

Makelut创建一个用于applylut()函数的look表

Lut=makelut(fun,n)

Lut=makelut(fun,n,P1,P2,…)

表A-10    图像变换函数

函数功能语法
Dct2进行二维离散余弦变换B=dct2(A)

B=dct2(A,m,n)

B=dct2(A,[m,n])

Dctmtx计算离散余弦变换矩阵D=dctmtx(n)
Fft2进行二维快速傅立叶变换Y=fft2(X)

Y=fft2(X,m,n)

Fftn进行n维快速傅立叶变换

Y=fftn(X)

Y=fftn(X,size)

Fftshift把快速傅立叶变换的DC组件移到光谱中心

Y=fftshift(X)

Y=fftshift(X,dim)

Idct2计算二维离散反余弦变换B=idct2(A)

B=idct2(A,m,n)

B=idct2(A,[m,n])

Ifft2计算二维快速傅立叶反变换  Y=ifft2(X)

Y=ifft2(X,m,n)

Ifftn计算n维快速傅立叶反变换

Y=ifftn(X)

Y=ifftn(X,size)

Iradon进行反radon变换

I=iradon(P,theta)

I=iradon(P,theta,interp,filter,d,n)

[I,h]=iradon(…)

Phantom产生一个头部幻影图像P=phantom(def,n)

P=phantom(E,n)

[P,E]=phantom(…)

Radon计算randon变换

R=radon(I,theta)

[R,xp]=radon(…)

表A-11    颜色空间转换函数

函数功能语法
Hsv2rgb转换HSV的值为RGB颜色空间

M=hsv2rgb(H)
Rgb2hsv转化RGB的值为HSV颜色空间

Cmap=rgb2hsv(M)
Rgb2ntsc转化RGB的值为NTSC颜色空间

Yiqmap=rgb2ntsc(rgbmap)

YIQ=rgb2ntsc(RGB)

Rgb2ycbcr转化RGB的值为YCBCR颜色空间

Ycbcrmap=rgb2ycbcr(rgbmap)

YCBCR=rgb2ycbcr(RGB)

Ycbcr2rgb转化YCBCR的值为RGB颜色空间

Rgbmap=ycbcr2rgb(ycbcrmap)

RGB=ycbcr2rgb(YCBCR)

Ntsc2rgb转化NTSC的值为RGB颜色空间

Rgbmap=ntsc2rgb(yiqmap)

RGB=ntsc2rgb(YIQ)

表A-12    边沿和块处理函数

函数功能语法
Bestblk确定进行块操作的块大小Siz=bestblk([m n],k)

[mb,nb]=bestblk([m,n],k)

Blkproc实现图像的显示块操作B=blkproc(A,[m n],fun)

B=blkproc(A,[m n],fun,P1,P2,…)

B=blkproc(A,[m n],[mborder nborder],fun,…)

Col2im将矩阵的列重新组织到块中A=col2im(B,[m n],[mm nn],block_type)

A=col2im(B,[m n],[mm nn])

Colfilt利用列相关函数进行边沿操作B=colfilt(b,[m n],block_type,fun)

B=colfilt(b,[m n],block_type,fun,P1,P2,…)

B=colfilt(b,[m n],[mborder nborder],…)

B=colfilt(A,’indexed’,…)

Im2col重调图像块为列B=im2col(A,[m n],block_type)

B=im2col(A,[m n])

B=im2col(A,’indexed’,…)

Nlfilter进行边沿操作B=nlfilter(A,[m n ],fun)

B=nlfilter(A,[m n ],fun,P1,P2,…)

B=nlfilter(A, ’indexed’,…)

表A-13    区域处理函数

函数功能语法
Roicolor选择感兴趣的颜色区BW=roicolor(A,low,high)

BW=roicolor(A,v)

Roifill在图像的任意区域中进行平滑插补J=roifill(I,c,r)

J=roifill(I)

J=roifill(I,BW)

[J,BW]=roifill(…)

J=roifill(x,y,I,xi,yi)

[x,y,J,BW,xi,yi]=roifill(…)

Roifilt2过滤敏感区域J=roifilt2(h,I,BW)

J=roifilt2(I,BW,fun)

J=roifilt2(I,BW,fun,P1,P2,…)

Roipoly选择一个敏感的多边形区域BW=roipoly(I,c,r)

BW=roipoly(I)

BW=roipoly(x,y,I,xi,yi)

[BW,xi,yi]=roipoly(…)

[x,y,BW,xi,yi]=roipoly(…)

表A-14    图像类型和类型转换函数

函数功能语法
Dither通过抖动增加外观颜色分辨率,转换图像X=dither(RGB,map)

BW=dither(I)

Gray2ind转换灰度图像为索引色图像[X,map]=gray2ind(I,n)

[X,map]=gray2ind(BW,n)

Grayslice从灰度图像创建索引图像X=grayslice(I,n)

Xgrayslice(I,v)

Im2bw转换图像为二进制图像BW=im2bw(I,level)

BW=im2bw(I,map,level)

BW=im2bw(RGB,level)

Im2double转换图像矩阵为双精度型I2=im2double(I1)

RGB2=im2double(RGB1)

I=im2double(BW)

X2=im2double(X1,’dindexed’)

Double转换数据为双精度型Double(x)
Uint8转换数据为8位无符号整型

I=uint8(x)
Im2uint8转换图像矩阵为8位无符号整型

I2=im2uint8(I1)

RGB2=im2uint8(RGB1)

I=im2uint8(BW)

X2=im2uint8(X1,’indexed’)

Im2uint16转换图像矩阵为16位无符号整型

I2=im2uint16(I1)

RGB2=im2uint16(RGB1)

I=im2uint16(BW)

X2=im2uint16(X1,’indexed’)

Uint16转换数据为16位无符号整型

I=uint16(x)
Ind2gray把索引色图像转换为灰度图像I=ind2gray(X,map)
Ind2rgb转化索引图像为RGB真彩图像

RGB=ind2rgb(X,map)
Isbw判断是否为二进制图像Flag=isbw(A)
Isgray判断是否为灰度图像Flag=isgray(A)
Isind判断是否为索引色图像Flag=isind(A)
Isrgb判断是否为RGB真彩色图像

Flag=isrgb(A)
Mat2gray转化矩阵为灰度图像I=mat2gray(A,[amin,amax])

I=mat2gray(A)

Rgb2gray转化RGB图像或颜色映射表为灰度图像

I=rgb2gray(RGB)

Newmap=rgb2gray(map)

Rgb2ind转化RGB图像为索引色图像

[X,map]=rgb2ind(RGB,tol)

[X,map]=rgb2ind(RGB,nl)

X=rgb2ind(RGB,map)

[…]=rgb2ind(…,dither_option)

表A-15    工具箱参数设置函数

函数功能语法
Iptgetpref获取图像处理工具箱参数设置Value=iptgetpref(prefname)
Iptsetpre设置图像处理工具箱参数Iptsetpref(prefname,value)
表B    MATLAB7.0图像处理工具箱新增函数

函数功能语法
Adapthisteq对比度直方图均衡化J=adapthisteq(I)

J=adapthisteq(I,param1,val1,param2,val2,…)

Applycform用于色彩空间变换Out=applycform(I,C)
Brighten增加或降低颜色映射表的亮度Brighten(beta)

Newmap=Brighten(beta)

Newmap=brighten(map,beta)

Brighten(fig,beta)

文档

MATLAB图像处理工具箱函数

表A-1通用函数函数功能语法Colorbar显示颜色条colorbarcolorbar(‘Vert’)colorbar(‘horiz’)colorbar(h_h=colorbar(……)colorbar(…,’peer’,axes_handle)Getimage从坐标轴取得图形数据A=getimage(h)[x,y,A]=getimage(h)[…,A,flag]=getimage(h)[…]=getimageImshow显示图像Imshow(I,n)Imshow(I,[lowhigh])Im
推荐度:
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top