main.m
来自「matlab人脸检测软件」· M 代码 · 共 57 行
M
57 行
% Version : 5.0
% Date : MAY / 18 / 2007
% Author : Omid Bonakdar Sakhi
clear all;
clc;
close all;
if ~exist('gabor.mat','file')
fprintf ('Creating Gabor Filters ...');
create_gabor;
end
if exist('net.mat','file')
load net;
else
createffnn
end
if exist('imgdb.mat','file')
load imgdb;
else
IMGDB = loadimages;
end
while (1==1)
choice=menu('Face Detection',...
'Create Database',...
'Initialize Network',...
'Train Network',...
'Test on Photos',...
'Exit');
if (choice ==1)
IMGDB = loadimages;
end
if (choice == 2)
createffnn
end
if (choice == 3)
net = trainnet(net,IMGDB);
end
if (choice == 4)
[file_name file_path] = uigetfile ('*.jpg');
if file_path ~= 0
im = imread ([file_path,file_name]);
try
im = rgb2gray(im);
end
tic
im_out = imscan (net,im);
toc
figure;imshow(im_out,'notruesize');
end
end
if (choice == 5)
clear all;
clc;
close all;
return;
end
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?