Beginner..Please HELP! How to upload a database for face recognition
Show older comments
I want to create a code that will recognize an image after noise/blurring has been applied to a randomized picture. I created my own data base from images online and uploaded them line by line in MATLAB. Now, I am having an issue of getting MATLAB to read the lines as a database. Please help. How do I begin the code??
imageDB{1}=imread('download.jpg');
imageDB{2}=imread('aj.jpg');
imageDB{3}=imread('kh.jpg');
imageDB{4}=imread('njon.jpg');
imageDB{5}=imread('mj.jpg');
imageDB{6}=imread('kjen.jpg');
imageDB{7}=imread('kimk.jpg');
imageDB{8}=imread('cb.jpg');
imageDB{9}=imread('me.jpg');
imageDB{10}=imread('rihanna.jpg');
imageDB{11}=imread('lizzie.jpg');
imageDB{12}=imread('pw.jpg');
imageDB{13}=imread('rd.jpg');
imageDB{14}=imread('ah - Copy.jpg');
imageDB{15}=imread('ncan.jpg');
imageDB{16}=imread('robw.jpg');
imageDB{17}=imread('markw.jpg');
imageDB{18}=imread('gcloo.jpg');
imageDB{19}=imread('bettywetty.jpg');
imageDB{20}=imread('hb.jpg');
imageDB{21}=imread('pr.jpg');
imageDB{22}=imread('cd.jpg');
imageDB{23}=imread('jl.jpg');
imageDB{24}=imread('sg.jpg');
imageDB{25}=imread('tc.jpg');
Answers (1)
Walter Roberson
on 12 Nov 2015
inames = {'download.jpg', 'aj.jpg', 'kh.jpg', 'njon.jpg', .... };
numimg = length(inames);
imageDB = cell(numimg, 2);
for K = 1 : numimg
try
imageDB{K} = imread(inames{K});
catch ME
warning(sprintf('could no read file %s', inames{K}));
end
end
But beyond that, it is not clear what you mean by "read the lines as a database". What do you want stored in the database ?
2 Comments
Adashia Harding
on 12 Nov 2015
Edited: Adashia Harding
on 12 Nov 2015
Walter Roberson
on 12 Nov 2015
What are your expectations as to what you will be able to do with a "database of images" ?
Categories
Find more on Database Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!