1、Matlab6图形图像处理函数详细列表Matlab6图形图像处理函数详细列表部门: xxx 时间: xxx制作人:xxx整理范文,仅供参考,可下载自行修改附录 MATLAB图像处理命令1applylut功能: 在二进制图像中利用lookup表进行边沿操作.语法:A = applylut(BW,lut举例lut = makelut(sum(x(: = 4,2。BW1 = imread(text.tif。BW2 = applylut(BW1,lut。imshow(BW1figure, imshow(BW2相关命令:makelut2bestblk功能: 确定进行块操作地块大小.语法:siz = be
2、stblk(m n,kmb,nb = bestblk(m n,k举例siz = bestblk(640 800,72siz =64 50相关命令:blkproc3blkproc功能: 实现图像地显式块操作.语法:B = blkproc(A,m n,funB = 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(Ifigure, im
3、show(I2,。相关命令:colfilt, nlfilter,inline4brighten功能: 增加或降低颜色映像表地亮度.语法:brighten(betanewmap = brighten(betanewmap = brighten(map,betabrighten(fig,beta相关命令:imadjust, rgbplot5bwarea功能: 计算二进制图像对象地面积.语法:total = bwarea(BW举例BW = imread(circles.tif。imshow(BW。bwarea(BWans =15799相关命令:bweuler, bwperim6bweuler功能:
4、计算二进制图像地欧拉数.语法:eul = bweuler(BW,n举例BW = imread(circles.tif。imshow(BW。bweuler(BWans =2相关命令:bwmorph, bwperim7bwfill功能: 填充二进制图像地背景色.语法:BW2 = bwfill(BW1,c,r,nBW2 = bwfill(BW1,nBW2,idx = bwfill(.BW2 = bwfill(x,y,BW1,xi,yi,nx,y,BW2,idx,xi,yi = bwfill(.BW2 = bwfill(BW1,holes,nBW2,idx = bwfill(BW1,holes,n举例
5、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 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 0BW2 = bwfill(BW1,3,3,8BW2 =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 =
6、im2bw(I。BW4 = bwfill(BW3,holes。imshow(BW3figure, imshow(BW4相关命令:bwselect, roifill8bwlabel功能: 标注二进制图像中已连接地部分.语法:L = bwlabel(BW,nL,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 0L = bwlabel(BW,4L =1 1 1
7、0 0 0 0 01 1 1 0 2 2 0 01 1 1 0 2 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 3 3 01 1 1 0 0 0 0 0r,c = find(L=2。rc = r crc =2 53 52 63 6相关命令:bweuler, bwselect9bwmorph功能: 提取二进制图像地轮廓.语法:BW2 = bwmorph(BW1,operationBW2 = bwmorph(BW1,operation,n举例 BW1 = imread(circles.tif。imshow(BW1。BW2
8、= bwmorph(BW1,remove。BW3 = bwmorph(BW1,skel,Inf。imshow(BW2figure, imshow(BW3相关命令:bweuler, bwperim, dilate, erode10bwperim功能: 计算二进制图像中对象地周长.语法:BW2 = bwperim(BW1,n举例 BW1 = imread(circbw.tif。BW2 = bwperim(BW1,8。imshow(BW1figure, imshow(BW2相关命令:bwarea, bweuler, bwfill11bwselect功能: 在二进制图像中选择对象.语法:BW2 = b
9、wselect(BW1,c,r,nBW2 = bwselect(BW1,nBW2,idx = bwselect(.举例 BW1 = imread(text.tif。c = 16 90 144。r = 85 197 247。BW2 = bwselect(BW1,c,r,4。imshow(BW1figure, imshow(BW2相关命令:bwfill, bwlabel, impixel, roipoly, roifill12cmpermute功能: 调整颜色映像表中地颜色.语法:Y,newmap = cmpermute(X,mapY,newmap = cmpermute(X,map,index举
10、例To order a colormap by luminance, use:ntsc = rgb2ntsc(map。dum,index = sort(ntsc(:,1。Y,newmap = cmpermute(X,map,index。相关命令:randperm13cmunique功能: 查找颜色映像表中特定地颜色及相应地图像.语法:Y,newmap = cmunique(X,mapY,newmap = cmunique(RGBY,newmap = cmunique(I相关命令:gray2ind, rgb2ind 14col2im功能: 将矩阵地列重新组织到块中.语法:A = col2im(B
11、,m n,mm nn,block_typeA = col2im(B,m n,mm nn相关命令:blkproc, colfilt, im2col, nlfilter15colfilt功能: 利用列相关函数进行边沿操作.语法:B = colfilt(A,m n,block_type,funB = colfilt(A,m n,block_type,fun,P1,P2,.B = colfilt(A,m n,mblock nblock,block_type,fun,.b5E2RGbCAPB = colfilt(A,indexed,.相关命令:blkproc, col2im, im2col, nlfil
12、ter16colorbar功能: 显示颜色条.语法:colorbar(vertcolorbar(horizcolorbar(hcolorbarh = colorbar(.举例 I = imread(blood1.tif。h = fspecial(log。I2 = filter2(h,I。imshow(I2, colormap(jet(64, colorbar17conv2功能: 进行二维卷积操作.语法:C = conv2(A,BC = conv2(hcol,hrow,AC = conv2(.,shape举例 A = magic(5A =17 24 1 8 1523 5 7 14 164 6 1
13、3 20 2210 12 19 21 311 18 25 2 9B = 1 2 1。0 2 0。3 1 3B =1 2 10 2 03 1 3C = conv2(A,BC =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相关命令:filter218convmtx2功能: 计算二维卷积矩阵.语法:T = convmtx2(H,m,nT
14、 = convmtx2(H,m n相关命令:conv219convn功能: 计算n维卷积.语法:C = convn(A,BC = convn(A,B,shape相关命令:conv220corr2功能: 计算两个矩阵地二维相关系数.语法:r = corr2(A,B相关命令:std221dct2功能: 进行二维离散余弦变换.语法:B = dct2(AB = dct2(A,m,nB = dct2(A,m n举例 RGB = imread(autumn.tif。I = rgb2gray(RGB。J = dct2(I。imshow(log(abs(J, colormap(jet(64, colorbar
15、p1EanqFDPwJ(abs(J = 0。K = idct2(J/255。imshow(K相关命令:fft2, idct2, ifft222dctmtx功能: 计算离散余弦变换矩阵.语法:D = dctmtx(n相关命令:dct223dilate功能: 放大二进制图像.语法:BW2 = dilate(BW1,SEBW2 = dilate(BW1,SE,algBW2 = dilate(BW1,SE,.,n举例 BW1 = imread(text.tif。SE = ones(6,2。BW2 = dilate(BW1,SE。imshow(BW1figure, imshow(BW2相关命令:bwmo
16、rph, erode24dither功能:通过抖动增加外观颜色分辨率,转换图像.语法:X = dither(RGB,mapBW = dither(I相关命令:rgb2ind25double功能: 转换数据为双精度型.语法:B = double(A举例 A = imread(saturn.tif。B = sqrt(double(A。相关命令:im2double, im2uint, uint826edge功能: 识别强度图像中地边界.语法:BW = edge(I,sobelBW = edge(I,sobel,threshBW = edge(I,sobel,thresh,directionBW,th
17、resh = edge(I,sobel,.BW = edge(I,prewittBW = edge(I,prewitt,threshBW = edge(I,prewitt,thresh,directionBW,thresh = edge(I,prewitt,.BW = edge(I,robertsBW = edge(I,roberts,threshBW,thresh = edge(I,roberts,.BW = edge(I,logBW = edge(I,log,threshBW = edge(I,log,thresh,sigmaBW,threshold = edge(I,log,.BW =
18、edge(I,zerocross,thresh,hBW,thresh = edge(I,zerocross,.BW = edge(I,cannyBW = edge(I,canny,threshBW = edge(I,canny,thresh,sigmaBW,threshold = edge(I,canny,.举例 I = imread(rice.tif。BW1 = edge(I,prewitt。BW2 = edge(I,canny。imshow(BW1。figure, imshow(BW227erode功能: 弱化二进制图像地边界.语法:BW2 = erode(BW1,SEBW2 = erod
19、e(BW1,SE,algBW2 = erode(BW1,SE,.,n举例 BW1 = imread(text.tif。SE = ones(3,1。BW2 = erode(BW1,SE。imshow(BW1figure, imshow(BW2相关命令:bwmorph, dilate28fft2功能: 进行二维快速傅里叶变换.语法:B = fft2(AB = fft2(A,m,n举例 load imdemos saturn2imshow(saturn2B = fftshift(fft2(saturn2。imshow(log(abs(B, colormap(jet(64, colorbarDXDiT
20、a9E3d相关命令:dct2, fftshift, idct2, ifft229fftn功能: 进行n维快速傅里叶变换.语法:B = fftn(AB = fftn(A,siz相关命令:fft2, ifftn30fftshift功能:把快速傅里叶变换地DC组件移到光谱中心.语法:B = fftshift(A举例 B = fftn(A。C = fftshift(B。相关命令:fft2, fftn, ifftshift31filter2功能: 进行二维线性过滤操作.语法:B = filter2(h,AB = filter2(h,A,shape举例 A = magic(6A =35 1 6 26 19
21、 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(sobelh =1 2 10 0 01 2 1B = filter2(h,A,validB =8 4 4 823 44 5 4023 50 1 408 4 4 8相关命令:conv2, roifilt232freqspace功能:确定二维频率响应地频率空间.语法:f1,f2 = freqspace(nf1,f2 = freqspace(m nx1,y1 = freqspace(.,meshgridf = freqspace(Nf = freqspace(N,whole相关命令:fsamp2, fwind1, fwind233freqz2功能:计算二维频率响应.语法:H,f1,f2 = freqz2(h,n1,n2H,f1,f2 = freqz2(h,n2 n1H,f1,f2 = freqz2(h,f1,f2H,f1,f2 = freqz2(h. = freqz2(h,.,dx dy. = freqz2(h,.,dxfreqz2(.举例
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1