MATLAB转换集锦.doc_第1页
MATLAB转换集锦.doc_第2页
MATLAB转换集锦.doc_第3页
MATLAB转换集锦.doc_第4页
MATLAB转换集锦.doc_第5页
已阅读5页,还剩7页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

70.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.isindMATLAB高级应用图形及影像处理 354功能:判断是否为索引图像.语法: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 =00010111011111附录 MATLAB图像处理命令 35511相关命令:applylut78.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功能:进行二维中值过滤.语法:MATLAB高级应用图形及影像处理 356B = 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)MATLAB高级应用图形及影像处理 358B = 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功能:进行四叉树分解.附录 MATLAB图像处理命令 359语法: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 1 2 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)MATLAB高级应用图形及影像处理 360vals,idx = qtgetblk(I,S,dim)举例vals,r,c = qtgetblk(I,S,4)vals(:,:,1) =1 1 1 11 1 2 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 7附录 MATLAB图像处理命令 3610 0 0 0 20 25 7 71 1 1 1 1 2 3 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)相关命令:MATLAB高级应用图形及影像处理 362ind2gray, 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, rgb2gray94.rgb2ntsc功能: 转化RGB的值为NTSC颜色空间.语法:yiqmap = rgb2ntsc(rgbmap)YIQ = rgb2ntsc(RGB)附录 MATLAB图像处理命令 363相关命令: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);MATLAB高级应用图形及影像处理 364figure, imshow(BW)相关命令:roifilt2, roipoly98.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(.)举例I = imread(eight.tif);c = 222 272 300 270 221 194;r = 21 21 75 121 121 75;J = roifill(I,c,r);imshow(I)figure, imshow(J)附录 MATLAB图像处理命令 365相关命令: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(I,c,r)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(I,c,r);imshow(I)MATLAB高级应用图形及影像处理 366figure, 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 treesX2,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)MATLAB高级应用图形及影像处理 368举例a = 1 3 5;b = uint16(a);whosName Size Bytes Classa 1x3 24 double arrayb 1x3 6 uint16 array相关命令:double, datatypes, u

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论