how to make mat file for different data?

3 views (last 30 days)
Mansoor ahmadi
Mansoor ahmadi on 2 Jan 2015
Commented: Image Analyst on 3 Jan 2015
Hello! everyone.Can anyone help me in my project. I'm new in image processing and matlab. I'm working in my final project in university, my project is 'signature recognition system' the first I get the image of signature and extract the features of image then it store with features in a mat file(the mat file is used as a database) and every image is belongs to a person, and name of person should store with his image in one row. my question is: How can I make a mat file that store this data as below: person_name1 lastname1 feature1 feature2 image1 person_name2 lastname2 feature feature image2 person_name2 lastname2 feature feature image3 . . . so on.. when I insert new image it is search in database and compare with it's features then return the name, lastname and image.I want the complete code because my project dateline is near. help me please. thank you.
Mansoor ahmadi
Mansoor ahmadi on 3 Jan 2015
thanks a lots for your response.
my project can hold 30 signature, for classification i use backpropagation neural network algorithm. for feature extraction i use Zernike moments, i have to create a mat file that when i sign new signature it is should compared with every signature by its features then return the same image from mat file with its name and lastname.
help me please. thanks

Sign in to comment.

Answers (2)

Image Analyst
Image Analyst on 2 Jan 2015
I don't know how to use the Database Toolbox (I don't have it). But for your other question on storing in a mat file, I'd just make an array of structures and store that in the mat file. Have fields for photo, signature, name, age, dateOfBirth, or whatever else you want
% Assign person1
person(1).photo = ...... whatever ......
person(1).signature= ...... whatever ......
person(1).name = ...... whatever ......
person(1).age = ...... whatever ......
person(1).dateOfBirth = ...... whatever ......
% Assign person2
person(2).photo = ...... whatever ......
person(2).signature= ...... whatever ......
person(2).name = ...... whatever ......
person(2).age = ...... whatever ......
person(2).dateOfBirth = ...... whatever ......
and so on. You can also have fields like featureVector which can be a list of several parameters you measured from their signature (no, we don't have code for that).
Then, so save in a mat file
save(matFullFileName, 'person');
For your database questions, see You can call them to see if that toolbox will help you.
Image Analyst
Image Analyst on 3 Jan 2015
Just loop over all feature vectors in your "database" and compare them. For example look at the mean absolute deviation for starters.
for k = 1 : numRefSignatures
thisSignature = person(k).signature; % Extract this person's feature vector.
mad(k) = mean(abs(thisSignature - refSignature));
[closestMad, indexOfMatchingPerson] = min(mad);
This way, MAD, is probably not all that great because it makes no accommodation for the fact that the items in your feature vector may have vastly different values, but it gives you the idea. So if some values have values in the thousands and other are less than 1, you really shouldn't be getting the means unless you somehow normalize them to all the same scale.

Sign in to comment.

Image Analyst
Image Analyst on 3 Jan 2015
It seems to me to be a rather ambitious project. I'd recommend you limit the scope and do something like have a limited number of subjects, like 20 or 30 or so. Then have each one sign their name and get their photo taken. Then characterize each signature by something like the area fraction within the bounding box, number of holes (Euler number), and number of distinct regions. Then for any new test signature, see which of the stored signatures matches up best. If you really wants to be ambitious, you can find algorithms here: On-Line Signatures, Online Signatures Off Line Signature Analysis Recognition of the Person from Writing, Identification, Authorship, Writer Identification Signature Recognition, Surveys, Analysis, Comparisons

Community Treasure Hunt

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

Start Hunting!