gududehuo 发表于 2024-7-15 17:59

Matlab常用图像措置命令108例(六)

66.imshow

功能:显示图像。 语法:
imshow(I,n)
imshow(I,)
imshow(BW)
imshow(X,map)
imshow(RGB)
imshow(...,display_option)
imshow(x,y,A,...)
imshow filename
h = 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, imread
68.ind2gray

功能:把检索图像转化为灰度图像。 语法:
I = ind2gray(X,map)举例
load trees
I = ind2gray(X,map);
imshow(X,map)
figure,imshow(I)

相关命令: gray2ind, imshow, rgb2ntsc
69.ind2rgb

功能:转化索引图像为RGB 真彩图像。 语法:
RGB = ind2rgb(X,map) 相关命令: ind2gray, rgb2ind
70.iptgetpref

功能:获取图像措置东西箱参数设置。 语法:
value = iptgetpref(prefname)举例
value = iptgetpref('ImshowAxesVisible')
value =
off相关命令: imshow, iptsetpref
71.iptsetpref

功能:设置图像措置东西箱参数。 语法:
iptsetpref(prefname,value)举例
iptsetpref('ImshowBorder','tight') 相关命令: imshow, iptgetpref, truesize
72.Iradon

功能:进行反Radon 变换。 语法:
I = iradon(P,theta)
I = iradon(P,theta,interp,filter,d,n)
= iradon(...)举例
P = phantom(128);
R = radon(P,0:179);
I = iradon(R,0:179,'nearest','Hann');
imshow(P)
figure, imshow(I) 相关命令: radon, phantom
73.isbw

功能:判断是否为二进制图像。 语法:
flag = isbw(A)

相关命令: isind, isgray, isrgb
74.isgray

功能:判断是否为灰度图像。 语法:
flag = isgray(A)相关命令: isbw, isind, isrgb
75.isind

功能:判断是否为索引图像。 语法:
flag = isind(A)相关命令: isbw, isgray, isrgb
76.isrgb

功能:判读是否为RGB真彩图像。 语法:
flag = isrgb(A)相关命令: isbw, isgray, isind
77.makelut

功能:创建一个用于applylut 函数的lookup 表。 语法:
lut = makelut(fun,n)
lut = makelut(fun,n,P1,P2,...)举例
f = inline('sum(x(:)) >= 2'); lut = makelut(f,2)
lut = 0
0
0
1
0
1
1
1
0
1
1
1
1
1
1
1相关命令: applylut
78.mat2gray

功能:转化矩阵为灰度图像。 语法:
I = mat2gray(A,)
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

功能:进行二维中值过滤。 语法:
B = medfilt2(A,)
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, wiener2
81.montage

功能:在矩形框中同时显示多幅图像。 语法:
montage(I)
montage(BW)
montage(X,map)
montage(RGB)
h = montage(...)

举例
load mri montage(D,map)相关命令:
immovie
82.nlfilter

功能:进行边缘操作。 语法:
B = nlfilter(A,,fun)
B = nlfilter(A,,fun,P1,P2,...)
B = nlfilter(A,'indexed',...)举例
B = nlfilter(A,,'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)
B = ordfilt2(...,padopt)相关命令: medfilt2
85.phantom

功能:发生一个头部幻影图像。 语法:
P = phantom(def,n)
P = phantom(E,n)
= phantom(...) 举例
P = phantom('Modified Shepp-Logan',200);
imshow(P)

相关命令: radon, iradon
参考文献:
Rafael C. Gonzalez, Richard E. Woods, and Steven L. Eddins. 2003. Digital Image Processing Using MATLAB. Prentice-Hall, Inc., USA.
阮秋琦. 数字图像措置(MATLAB版). 北京:电子工业出书社, 2014.
冈萨雷斯. 数字图像措置(第三版). 北京:电子工业出书社, 2011.
<hr/> 文章和代码以及样例图片等相关资源,已经归档至【Github仓库:digital-image-processing-matlab】或者公众号【AIShareLab】答复 数字图像措置 也可获取。
页: [1]
查看完整版本: Matlab常用图像措置命令108例(六)