32.freqspace
附录 MATLAB图像处理命令 335
功能:确定二维频率响应的频率空间.
语法:
[f1,f2] = freqspace(n)
[f1,f2] = freqspace([m n])
[x1,y1] = freqspace(...,'meshgrid')
f = freqspace(N)
f = freqspace(N,'whole')
相关命令:fsamp2, fwind1, fwind2
33.freqz2
功能:计算二维频率响应.
语法:
[H,f1,f2] = freqz2(h,n1,n2)
[H,f1,f2] = freqz2(h,[n2 n1])
[H,f1,f2] = freqz2(h,f1,f2)
[H,f1,f2] = freqz2(h)
[...] = freqz2(h,...,[dx dy])
[...] = freqz2(h,...,dx)
freqz2(...)
举例
Hd = zeros(16,16);
Hd(5:12,5:12) = 1;
Hd(7:10,7:10) = 0;
h = fwind1(Hd,bartlett(16));
colormap(jet(64))
freqz2(h,[32 32]); axis ([-1 1 -1 1 0 1])
34.fsamp2
MATLAB高级应用——图形及影像处理 336
功能:用频率采样法设计二维FIR过滤器.
语法:
h = fsamp2(Hd)
h = fsamp2(f1,f2,Hd,[m n])
举例
[f1,f2] = freqspace(21,'meshgrid');
Hd = ones(21);
r = sqrt(f1.^2 + f2.^2);
Hd((r0.5)) = 0;
colormap(jet(64))
mesh(f1,f2,Hd)
相关命令:conv2, filter2, freqspace, ftrans2, fwind1, fwind2
35.fspecial
功能:创建预定义过滤器.
语法:
h = fspecial(type)
h = fspecial(type,parameters)
举例
I = imread('saturn.tif');
h = fspecial('unsharp',0.5);
I2 = filter2(h,I)/255;
imshow(I)
figure, imshow(I2)
相关命令:conv2, edge, filter2, fsamp2, fwind1, fwind2
36.ftrans2
功能:通过频率转换设计二维FIR过滤器.
语法:
附录 MATLAB图像处理命令 337
h = ftrans2(b,t)
h = ftrans2(b)
举例
colormap(jet(64))
b = remez(10,[0 0.05 0.15 0.55 0.65 1],[0 0 1 1 0 0]);
[H,w] = freqz(b,1,128,'whole');
plot(w/pi-1,fftshift(abs(H)))
相关命令:conv2, filter2, fsamp2, fwind1, fwind2
37.fwind1
功能:用一维窗口方法设计二维FIR过滤器.
语法:
h = fwind1(Hd,win)
h = fwind1(Hd,win1,win2)
h = fwind1(f1,f2,Hd,...)
举例
[f1,f2] = freqspace(21,'meshgrid');
Hd = ones(21);
r = sqrt(f1.^2 + f2.^2);
Hd((r0.5)) = 0;
colormap(jet(64))
mesh(f1,f2,Hd)
相关命令:conv2, filter2, fsamp2, freqspace, ftrans2, fwind2
38.fwind2
功能:用二维窗口方法设计二维FIR过滤器.
语法:
h = fwind2(Hd,win)
h = fwind2(f1,f2,Hd,win)
举例
[f1,f2] = freqspace(21,'meshgrid');
Hd = ones(21);
r = sqrt(f1.^2 + f2.^2);
Hd((r0.5)) = 0;
colormap(jet(64))
mesh(f1,f2,Hd)
MATLAB高级应用——图形及影像处理 338
相关命令:conv2, filter2, fsamp2, freqspace, ftrans2, fwind1
39.getimage
功能:从坐标轴取得图像数据.
语法:
A = getimage(h)
[x,y,A] = getimage(h)
[...,A,flag] = getimage(h)
[...] =