📄 ftr_ext.m
字号:
%Simple demonstration of one image face detection operation.
function [modu] = ftr_ext(x)
%global output
[output,count,m,svec]=facefind(x);%full scan
x1 = floor(output(1));
x2 = floor(output(2));
y1 = floor(output(3));
y2 = floor(output(4));
M = x2-x1 +1;
N = y2-y1 +1;
FFTi = zeros(M,N);
FFTq = zeros(M,N);
for m = 1: 1 : M
for n = 1: 1 : N
for l = y1 : 1: y2
for k = x1 : 1: x2
FFTi(m,n) = FFTi(m,n) + x(k,l) * (cos(2*pi*((m*k/M) +(n*l/N))));
FFTq(m,n) = FFTq(m,n) + x(k,l) * (sin(2*pi*((m*k/M) + (n*l/N))));
end
end
end
end
for m = 1: 1 : M
for n = 1: 1 : N
modu(m,n) = sqrt(FFTi(m,n) * FFTi(m,n) + FFTq(m,n) * FFTq(m,n));
disp(modu(m,n));
end
end
imagesc(x), colormap(gray);%show image
plotbox(output,[],2);%plot the detections as red squares
%plotsize(x,m)%plot minmum and maximum face size to detect as green squares in top left corner
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -