相关命令:
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) 相关命令: MATLAB 高级应用——图形及影像处理 362
ind2gray, ntsc2rgb, rgb2ind, rgb2ntsc 92.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 高级应用——图形及影像处理 364
figure, 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 高级应用——图形及影像处理 366
figure, imshow(BW) 相关命令:
roifilt2, roicolor, roifill 101.std2 功能:
计算矩阵元素的标准偏移。 语法: b = std2(A) 相关命令: corr2, mean2 102.subimage 功能:
在一幅图中显示多个图像。 语法:
subimage(X,map) subimage(I) subimage(BW) subimage(RGB) subimage(x,y,...) h = subimage(...) 举例 load trees
[X2,map2] = imread('forest.tif'); subplot(1,2,1), subimage(X,map) subplot(1,2,2), subimage(X2,map2) 相关命令:
附录 MATLAB 图像处理命令 367
103.truesize 功能:
调整图像显示尺寸。 语法:
truesize(fig,[mrows mcols]) truesize(fig) 相关命令:
imshow, iptsetpref, iptgetpref 104.uint8
功能:
转换数据为8 位无符号整型。 语法: B = uint8(A) 举例 a = [1 3 5]; b = uint8(a);
whos
Name Size Bytes Class a 1x3 24 doublearray b 1x3 3 uint8 array 相关命令:
double, im2double, im2uint8 105.uint16
功能:
转换数据为16 位无符号整型。 语法:
I = uint16(X) MATLAB 高级应用——图形及影像处理