Skip to content

Commit de36c20

Browse files
committed
Add commands 8
1 parent 602e994 commit de36c20

File tree

1 file changed

+276
-0
lines changed

1 file changed

+276
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,276 @@
1+
- [Matlab常用图像处理命令108例(八)](#matlab常用图像处理命令108例八)
2+
- [98.roifill](#98roifill)
3+
- [99.roifilt2](#99roifilt2)
4+
- [100.roipoly](#100roipoly)
5+
- [101.std2](#101std2)
6+
- [102.subimage](#102subimage)
7+
- [103.truesize](#103truesize)
8+
- [104.uint8](#104uint8)
9+
- [105.uint16](#105uint16)
10+
- [106.warp](#106warp)
11+
- [107.wiener2](#107wiener2)
12+
- [108.zoom](#108zoom)
13+
14+
15+
# Matlab常用图像处理命令108例(八)
16+
17+
## 98.roifill
18+
19+
功能:在图像的任意区域中进行平滑插补。
20+
语法:
21+
22+
```matlab
23+
J = roifill(I,c,r)
24+
J = roifill(I)
25+
J = roifill(I,BW)
26+
[J,BW] = roifill(...)
27+
J = roifill(x,y,I,xi,yi)
28+
[x,y,J,BW,xi,yi] = roifill(...)
29+
```
30+
31+
举例
32+
33+
```matlab
34+
I = imread('eight.tif');
35+
c = [222 272 300 270 221 194];
36+
r = [21 21 75 121 121 75];
37+
J = roifill(I,c,r);
38+
imshow(I)
39+
figure, imshow(J)
40+
```
41+
42+
![](https://raw.githubusercontent.com/timerring/scratchpad2023/main/2023/03/12-22-11-59-1678630315.png)
43+
44+
相关命令:
45+
roifilt2, roipoly
46+
47+
## 99.roifilt2
48+
49+
功能:过滤敏感区域。
50+
语法:
51+
52+
```matlab
53+
J = roifilt2(h,I,BW)
54+
J = roifilt2(I,BW,fun)
55+
J = roifilt2(I,BW,fun,P1,P2,...)
56+
```
57+
58+
举例
59+
60+
```matlab
61+
h = fspecial('unsharp');
62+
J = roifilt2(h,I,BW);
63+
imshow(J)
64+
```
65+
66+
![](https://raw.githubusercontent.com/timerring/scratchpad2023/main/2023/03/12-22-12-09-1678630326.png)
67+
68+
相关命令:
69+
filter2, roipoly
70+
71+
## 100.roipoly
72+
73+
功能:选择一个敏感的多边形区域。
74+
语法:
75+
76+
```matlab
77+
BW = roipoly(I,c,r)
78+
BW = roipoly(I)
79+
BW = roipoly(x,y,I,xi,yi)
80+
[BW,xi,yi] = roipoly(...)
81+
[x,y,BW,xi,yi] = roipoly(...)
82+
```
83+
84+
举例
85+
86+
```matlab
87+
I = imread('eight.tif');
88+
c = [222 272 300 270 221 194];
89+
r = [21 21 75 121 121 75];
90+
BW = roipoly(I,c,r);
91+
imshow(I)
92+
figure, imshow(BW)
93+
```
94+
95+
![](https://raw.githubusercontent.com/timerring/scratchpad2023/main/2023/03/12-22-12-21-1678630338.png)
96+
97+
相关命令:
98+
roifilt2, roicolor, roifill
99+
100+
## 101.std2
101+
102+
功能:计算矩阵元素的标准偏移。
103+
语法:
104+
105+
```matlab
106+
b = std2(A)
107+
```
108+
109+
相关命令: corr2, mean2
110+
111+
## 102.subimage
112+
113+
功能:在一幅图中显示多个图像。
114+
语法:
115+
116+
```matlab
117+
subimage(X,map)
118+
subimage(I)
119+
subimage(BW)
120+
subimage(RGB)
121+
subimage(x,y,...)
122+
h = subimage(...)
123+
```
124+
125+
举例
126+
127+
```matlab
128+
load trees
129+
[X2,map2] = imread('forest.tif');
130+
subplot(1,2,1), subimage(X,map)
131+
subplot(1,2,2), subimage(X2,map2)
132+
```
133+
134+
![](https://raw.githubusercontent.com/timerring/scratchpad2023/main/2023/03/12-22-12-35-1678630349.png)
135+
136+
## 103.truesize
137+
138+
功能:调整图像显示尺寸。
139+
语法:
140+
141+
```matlab
142+
truesize(fig,[mrows mcols])
143+
truesize(fig)
144+
```
145+
146+
相关命令:
147+
imshow, iptsetpref, iptgetpref
148+
149+
## 104.uint8
150+
151+
功能:转换数据为8 位无符号整型。
152+
语法:
153+
154+
```matlab
155+
B = uint8(A)
156+
```
157+
158+
举例
159+
160+
```matlab
161+
a = [1 3 5];
162+
b = uint8(a);
163+
whos
164+
Name Size Bytes Class
165+
a 1x3 24 doublearray
166+
b 1x3 3 uint8 array
167+
```
168+
169+
相关命令:
170+
double, im2double, im2uint8
171+
172+
## 105.uint16
173+
174+
功能:转换数据为16 位无符号整型。
175+
语法:
176+
177+
```matlab
178+
I = uint16(X)
179+
```
180+
181+
举例
182+
183+
```matlab
184+
a = [1 3 5];
185+
b = uint16(a);
186+
whos
187+
Name Size Bytes Class
188+
a 1x3 24 double array
189+
b 1x3 6 uint16 array
190+
```
191+
192+
相关命令:
193+
double, datatypes, uint8, uint32, int8, int16, int32.
194+
195+
## 106.warp
196+
197+
功能:将图像显示到纹理映射表面。
198+
语法:
199+
200+
```matlab
201+
warp(X,map)
202+
warp(I,n)
203+
warp(BW)
204+
warp(RGB)
205+
warp(z,...)
206+
warp(x,y,z,...)
207+
h = warp(...)
208+
```
209+
210+
举例
211+
212+
```matlab
213+
[x,y,z] = cylinder;
214+
I = imread('testpat1.tif');
215+
warp(x,y,z,I);
216+
```
217+
218+
![](https://raw.githubusercontent.com/timerring/scratchpad2023/main/2023/03/12-22-12-49-1678630362.png)
219+
220+
相关命令:
221+
imshow
222+
223+
## 107.wiener2
224+
225+
功能:进行二维适应性去噪过滤处理。
226+
语法:
227+
228+
```matlab
229+
J = wiener2(I,[m n],noise)
230+
[J,noise] = wiener2(I,[m n])
231+
```
232+
233+
举例
234+
235+
```matlab
236+
I = imread('saturn.tif');
237+
J = imnoise(I,'gaussian',0,0.005);
238+
K = wiener2(J,[5 5]);
239+
imshow(J)
240+
figure, imshow(K)
241+
```
242+
243+
![](https://raw.githubusercontent.com/timerring/scratchpad2023/main/2023/03/12-22-13-00-1678630376.png)
244+
245+
相关命令:
246+
filter2, medfilt2
247+
248+
## 108.zoom
249+
250+
功能:缩放图像。
251+
语法:
252+
253+
```matlab
254+
zoom on
255+
zoom off
256+
zoom out
257+
zoom reset
258+
zoom
259+
zoom xon
260+
zoom yon
261+
zoom(factor)
262+
zoom(fig,option)
263+
```
264+
265+
相关命令:
266+
imcrop
267+
268+
参考文献:
269+
270+
[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)
271+
272+
[2] [阮秋琦. 数字图像处理(MATLAB版)[M]. 北京:电子工业出版社, 2014.](https://github.com/timerring/digital-image-processing-matlab/blob/main/reference/Digital_Image_Processing_(MATLAB_version).pdf)
273+
274+
[3] [冈萨雷斯. 数字图像处理(第三版)[M]. 北京:电子工业出版社, 2011.](https://github.com/timerring/digital-image-processing-matlab/blob/main/reference/Digital_Image_Processing_(Third_Edition).pdf)
275+
276+
[返回首页](https://github.com/timerring/digital-image-processing-matlab)

0 commit comments

Comments
 (0)