⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test_main.m

📁 face recognition test source code
💻 M
字号:
clc;close all;clear all;
deletedatabase('my_database');       % Delete "my_database", if it exists. If input database 
                                     % does not exist no action is performed

img = imread('s1_1.pgm');               % Load an image into workspace
ID  = 1;                                % ID is a progressive, integer number
add2database(img,ID,'my_database');     % Add this image for person #1 to database "my_database"

img = imread('s2_1.pgm');              % Add another image to the database ("my_database" DB)
ID  = 2;                               % This second image is person #2
add2database(img,ID,'my_database');

img = imread('s3_1.pgm');              % Add another image to the database ("my_database" DB)
ID  = 3;                               % This third image is person #3
add2database(img,ID,'my_database');

img = imread('s1_2.pgm');              % Add another image to the database ("my_database" DB)
ID  = 1;                               % For this fourth image added to DB I have to use ID #1.
add2database(img,ID,'my_database');

% Now database of known faces is ready. You can add other images, of
% course, to make the recognition process more robust.

img = imread('s1_3.pgm');                       % Load an unknown image
ID = recognitionVSdatabase(img,'my_database');  % Face identification: it is necessary to specify
                                                % input image and the database of "known" faces

disp('Recognized ID');
disp(ID);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -