Skip to content

Commit 602e994

Browse files
committed
Add commands 7
1 parent cd3f5d9 commit 602e994

File tree

1 file changed

+281
-0
lines changed

1 file changed

+281
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,281 @@
1+
- [Matlab常用图像处理命令108例(七)](#matlab常用图像处理命令108例七)
2+
- [86.pixval](#86pixval)
3+
- [87.qtdecomp](#87qtdecomp)
4+
- [88.qtgetblk](#88qtgetblk)
5+
- [89.qtsetblk](#89qtsetblk)
6+
- [90.radon](#90radon)
7+
- [91.rgb2gray](#91rgb2gray)
8+
- [92.rgb2hsv](#92rgb2hsv)
9+
- [93.rgb2ind](#93rgb2ind)
10+
- [94.rgb2ntsc](#94rgb2ntsc)
11+
- [95.rgb2ycbcr](#95rgb2ycbcr)
12+
- [96.rgbplot](#96rgbplot)
13+
- [97.roicolor](#97roicolor)
14+
15+
16+
# Matlab常用图像处理命令108例(七)
17+
18+
## 86.pixval
19+
20+
功能:显示图像像素信息。
21+
语法:
22+
23+
```matlab
24+
pixval on pixval off pixval
25+
pixval(fig,option)
26+
```
27+
28+
相关命令: impixel, improfile
29+
30+
## 87.qtdecomp
31+
32+
功能:进行四叉树分解。
33+
语法:
34+
35+
```matlab
36+
S = qtdecomp(I)
37+
S = qtdecomp(I,threshold)
38+
S = qtdecomp(I,threshold,mindim)
39+
S = qtdecomp(I,threshold,[mindim maxdim])
40+
S = qtdecomp(I,fun)
41+
S = qtdecomp(I,fun,P1,P2,...)
42+
```
43+
44+
举例
45+
46+
```matlab
47+
I = [1 1 1 1 2 3 6 6
48+
1 1 2 1 4 5 6 8
49+
1 1 1 1 10 15 7 7
50+
1 1 1 1 20 25 7 7
51+
20 22 20 22 1 2 3 4
52+
20 22 22 20 5 6 7 8
53+
20 22 20 20 9 10 11 12
54+
22 22 20 20 13 14 15 16];
55+
S = qtdecomp(I,5); full(S)
56+
ans =
57+
4 0 0 0 2 0 2 0
58+
0 0 0 0 0 0 0 0
59+
0 0 0 0 1 1 2 0
60+
0 0 0 0 1 1 0 0
61+
4 0 0 0 2 0 2 0
62+
0 0 0 0 0 0 0 0
63+
0 0 0 0 2 0 2 0
64+
0 0 0 0 0 0 0 0
65+
```
66+
67+
相关命令:
68+
qtgetblk, qtsetblk
69+
70+
## 88.qtgetblk
71+
72+
功能:获取四叉树分解中的块值。
73+
语法:
74+
75+
```matlab
76+
[vals,r,c] = qtgetblk(I,S,dim)
77+
[vals,idx] = qtgetblk(I,S,dim)
78+
```
79+
80+
举例
81+
82+
```matlab
83+
[vals,r,c] = qtgetblk(I,S,4)
84+
vals(:,:,1) = 1 1 1 1
85+
1 1 2 1
86+
1 1 1 1
87+
1 1 1 1
88+
vals(:,:,2) = 20 22 20 22
89+
20 22 22 20
90+
91+
20 22 20 20
92+
22 22 20 20
93+
r = 1
94+
5
95+
c = 1
96+
1
97+
```
98+
99+
相关命令:
100+
qtdecomp, qtsetblk
101+
102+
## 89.qtsetblk
103+
104+
功能:设置四叉树分解中的块值。
105+
语法:
106+
107+
```matlab
108+
J = qtsetblk(I,S,dim,vals)
109+
```
110+
111+
举例
112+
113+
```matlab
114+
newvals = cat(3,zeros(4),ones(4));
115+
J = qtsetblk(I,S,4,newvals)
116+
J =
117+
0 0 0 0 2 3 6 6
118+
0 0 0 0 4 5 6 8
119+
0 0 0 0 10 15 7 7
120+
0 0 0 0 20 25 7 7
121+
1 1 1 1 1 2 3 4
122+
1 1 1 1 5 6 7 8
123+
1 1 1 1 9 10 11 12
124+
1 1 1 1 13 14 15 16
125+
```
126+
127+
相关命令:
128+
qtdecomp, qtgetblk
129+
130+
## 90.radon
131+
132+
功能:计算Radon变换。
133+
语法:
134+
135+
```matlab
136+
R = radon(I,theta)
137+
R = radon(I,theta,n)
138+
[R,xp] = radon(...)
139+
```
140+
141+
举例
142+
143+
```matlab
144+
iptsetpref('ImshowAxesVisible','on')
145+
I = zeros(100,100);
146+
I(25:75,25:75) = 1;
147+
theta = 0:180;
148+
[R,xp] = radon(I,theta);
149+
imshow(theta,xp,R,[]), colormap(hot), colorbar
150+
```
151+
152+
![](https://raw.githubusercontent.com/timerring/scratchpad2023/main/2023/03/11-22-59-29-1678546764.png)
153+
154+
相关命令:
155+
iradon, phantom
156+
157+
## 91.rgb2gray
158+
159+
功能:转换RGB 图像或颜色映像表为灰度图像。
160+
语法:
161+
162+
```matlab
163+
I = rgb2gray(RGB)
164+
newmap = rgb2gray(map)
165+
```
166+
167+
相关命令:
168+
ind2gray, ntsc2rgb, rgb2ind, rgb2ntsc
169+
170+
## 92.rgb2hsv
171+
172+
功能:
173+
转化RGB值为HSV颜色空间。
174+
语法:
175+
176+
```matlab
177+
hsvmap = rgb2hsv(rgbmap)
178+
HSV = rgb2hsv(RGB)
179+
```
180+
181+
相关命令:
182+
hsv2rgb, rgbplot
183+
184+
## 93.rgb2ind
185+
186+
功能:转化RGB图像为索引图像。
187+
语法:
188+
189+
```matlab
190+
[X,map] = rgb2ind(RGB,tol)
191+
[X,map] = rgb2ind(RGB,n)
192+
X = rgb2ind(RGB,map)
193+
[...] = rgb2ind(...,dither_option)
194+
```
195+
196+
举例
197+
198+
```matlab
199+
RGB = imread('flowers.tif');
200+
[X,map] = rgb2ind(RGB,128);
201+
imshow(X,map)
202+
```
203+
204+
![](https://raw.githubusercontent.com/timerring/scratchpad2023/main/2023/03/11-22-59-40-1678546776.png)
205+
206+
相关命令:
207+
cmunique, dither, imapprox, ind2rgb, rgb2gray
208+
209+
## 94.rgb2ntsc
210+
211+
功能:转化RGB的值为NTSC颜色空间。
212+
语法:
213+
214+
```matlab
215+
yiqmap = rgb2ntsc(rgbmap)
216+
YIQ = rgb2ntsc(RGB)
217+
```
218+
219+
相关命令:
220+
ntsc2rgb, rgb2ind, ind2rgb, ind2gray
221+
222+
## 95.rgb2ycbcr
223+
224+
功能:转化RGB的值为YcbCr 颜色空间。
225+
语法:
226+
227+
```matlab
228+
ycbcrmap = rgb2ycbcr(rgbmap)
229+
YCBCR = rgb2ycbcr(RGB)
230+
```
231+
232+
相关命令:
233+
ntsc2rgb, rgb2ntsc, ycbcr2rgb
234+
235+
## 96.rgbplot
236+
237+
功能:划分颜色映像表。
238+
语法:
239+
240+
```matlab
241+
rgbplot(map)
242+
```
243+
244+
![](https://raw.githubusercontent.com/timerring/scratchpad2023/main/2023/03/11-22-59-57-1678546792.png)
245+
246+
举例rgbplot(jet)
247+
248+
## 97.roicolor
249+
250+
功能:选择感兴趣的颜色区。
251+
语法:
252+
253+
```matlab
254+
BW = roicolor(A,low,high)
255+
BW = roicolor(A,v)
256+
```
257+
258+
举例
259+
260+
```matlab
261+
I = imread('rice.tif');
262+
BW = roicolor(I,128,255);
263+
imshow(I);
264+
figure, imshow(BW)
265+
```
266+
267+
![](https://raw.githubusercontent.com/timerring/scratchpad2023/main/2023/03/11-23-00-07-1678546804.png)
268+
269+
相关命令: roifilt2, roipoly
270+
271+
272+
273+
参考文献:
274+
275+
[1] [Rafael C. Gonzalez, Richard E. Woods, and Steven L. Eddins. 2003. Digital Image Processing Using MATLAB. Prentice-Hall, Inc., USA.](https://github.com/timerring/digital-image-processing-matlab/blob/main/reference/Digital_Image_Processing_Using_Matlab.pdf)
276+
277+
[2] [阮秋琦. 数字图像处理(MATLAB版)[M]. 北京:电子工业出版社, 2014.](https://github.com/timerring/digital-image-processing-matlab/blob/main/reference/Digital_Image_Processing_(MATLAB_version).pdf)
278+
279+
[3] [冈萨雷斯. 数字图像处理(第三版)[M]. 北京:电子工业出版社, 2011.](https://github.com/timerring/digital-image-processing-matlab/blob/main/reference/Digital_Image_Processing_(Third_Edition).pdf)
280+
281+
[返回首页](https://github.com/timerring/digital-image-processing-matlab)

0 commit comments

Comments
 (0)