Beginner..Please HELP! How to upload a database for face recognition

2 views (last 30 days)
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
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
Adashia Harding on 12 Nov 2015
Edited: Adashia Harding on 12 Nov 2015
Thank you for you help Walter! So, I have distorted an image by adding noise to a chosen image in that particular database (above). I am trying to create a code that will properly identify the matching picture from the database that I created (aka. face recognition). However, I am not sure how to get MATLAB to read what I have input as a database of images. It seems like what you have is what I am looking for, but I just wanted to clarify to make sure that I asked the question properly. I hope this clarifies what I am trying to do in MATLAB.
Walter Roberson
Walter Roberson on 12 Nov 2015
What are your expectations as to what you will be able to do with a "database of images" ?

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!