MATLAB图像处理函数汇总2

上传人:痛*** 文档编号:157435386 上传时间:2022-09-29 格式:DOC 页数:25 大小:62KB
返回 下载 相关 举报
MATLAB图像处理函数汇总2_第1页
第1页 / 共25页
MATLAB图像处理函数汇总2_第2页
第2页 / 共25页
MATLAB图像处理函数汇总2_第3页
第3页 / 共25页
点击查看更多>>
资源描述
MATLAB图像处理函数汇总 (二)21.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) = 2); lut = makelut(f,2) lut = 0 0 0 1 0 1 1 1 0 1 1 1 1 1 附录 MATLAB图像处理命令 355 1 1 相关命令: applylut 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) 相关命令: gray2ind 79.mean2 功能: 计算矩阵元素的平均值. 语法: b = mean2(A) 相关命令: std2, mean, std 80.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 mri montage(D,map) 附录 MATLAB图像处理命令 357 相关命令: immovie 82.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, colfilt 83.ntsc2rgb 功能: 转换NTSC的值为RGB颜色空间. 语法: rgbmap = ntsc2rgb(yiqmap) RGB = ntsc2rgb(YIQ) 相关命令: rgb2ntsc, rgb2ind, ind2rgb, ind2gray 84.ordfilt2 功能: 进行二维统计顺序过滤. 语法: B = ordfilt2(A,order,domain) B = ordfilt2(A,order,domain,S) MATLAB高级应用图形及影像处理 358B = ordfilt2(.,padopt) 相关命令: medfilt2 85.phantom 功能: 产生一个头部幻影图像. 语法: P = phantom(def,n) P = phantom(E,n) P,E = phantom(.) 举例 P = phantom(Modified Shepp-Logan,200); imshow(P) 相关命令: radon, iradon 86.pixval 功能: 显示图像像素信息. 语法: pixval on pixval off pixval pixval(fig,option) 相关命令: impixel, improfile 87.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 6 1 1 2 1 4 5 6 8 1 1 1 1 10 15 7 7 1 1 1 1 20 25 7 7 20 22 20 22 1 2 3 4 20 22 22 20 5 6 7 8 20 22 20 20 9 10 11 12 22 22 20 20 13 14 15 16; S = qtdecomp(I,5); full(S) ans = 4 0 0 0 2 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 2 0 0 0 0 0 1 1 0 0 4 0 0 0 2 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 2 0 0 0 0 0 0 0 0 0 相关命令: qtgetblk, qtsetblk 88.qtgetblk 功能: 获取四叉树分解中的块值. 语法: vals,r,c = qtgetblk(I,S,dim) vals,idx = qtgetblk(I,S,dim) MATLAB高级应用图形及影像处理 360举例 vals,r,c = qtgetblk(I,S,4) vals(:,:,1) = 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 vals(:,:,2) = 20 22 20 22 20 22 22 20 20 22 20 20 22 22 20 20 r = 1 5 c = 1 1 相关命令: qtdecomp, qtsetblk 89.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 6 0 0 0 0 4 5 6 8 0 0 0 0 10 15 7 7 附录 MATLAB图像处理命令 361 0 0 0 0 20 25 7 7 1 1 1 1 1 2 3 4 1 1 1 1 5 6 7 8 1 1 1 1 9 10 11 12 1 1 1 1 13 14 15 16 相关命令: qtdecomp, qtgetblk 90.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, phantom 91.rgb2gray 功能: 转换RGB图像或颜色映像表为灰度图像. 语法: I = rgb2gray(RGB) newmap = rgb2gray(map) 相关命令: ind2gray, ntsc2rgb, rgb2ind, rgb2ntsc MATLAB高级应用图形及影像处理 36292.rgb2hsv 功能: 转化RGB值为HSV颜色空间. 语法: hsvmap = rgb2hsv(rgbmap) HSV = rgb2hsv(RGB) 相关命令: hsv2rgb, rgbplot 93.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) 附录 MATLAB图像处理命令 363 相关命令: ntsc2rgb, rgb2ind, ind2rgb, ind2gray 95.rgb2ycbcr 功能: 转化RGB的值为YcbCr颜色空间. 语法: ycbcrmap = rgb2ycbcr(rgbmap) YCBCR = rgb2ycbcr(RGB) 相关命令: ntsc2rgb, rgb2ntsc, ycbcr2rgb 96.rgbplot 功能: 划分颜色映像表. 语法: rgbplot(map) 举例 rgbplot(jet) 相关命令: colormap 97.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, roipoly 98.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, roipoly 99.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, roipoly 100.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, roifill 101.std2 功能: 计算矩阵元素的标准偏移. 语法: b = std2(A) 相关命令: corr2, mean2 102.subimage 功能: 在一幅图中显示多个图像. 语法: subimage(X,map) subimage(I) subimage(BW) subimage(RGB)
展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 管理文书 > 施工组织


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!