Hi guys,many people were requesting for gesture recognition code so here it is ...
Well for any recognition system there are some simple common states what we also followed here they are:
1. First you have to have data set.Which you have to prepare or download from any website according to your demand.Like you want to want to recognize an alphabet 'O'.Then you have to provide particular data set for 'O'.
Like this :
Okey this is only one picture but I recommend at least 5 pictures you have to give to recognize a gesture.
2. Now give matlab access to the data sets providing particular path of the folder on your system,it is better to make different folder for different alphabet sample.
3. Now you have to train the network.I will show you how to do it in later part.It is the most important part,here you are making your network understand that " ANY IMAGE LIKE-THIS IS ALPHABET 'O' "
4.Here you need to provide an algorithm that will set such a threshold value that will decide whether the test image is 'O' or NOT.
5.Now you need some more sample of 'O' to test the network whether it is coming fine.
6.Well that is it. I will give you the sample code in my next post so that it will be easy for you to implement.
Store the training informations in a test file
fid = fopen('train.txt','rt');
P1 = fscanf(fid,'%f',[19,inf]);
Open some text file using code to write and fetch the required information about image.
fid = fopen('testO.txt','rt');
TS1 = fscanf(fid,'%f',[19,inf]);
%(As here we are only testing alphabet 'O')
fid = fopen('target8.txt','rt');
T = fscanf(fid,'%f',[8,inf]);
It has been found that the optimal number of neurons for the hidden layer is 85
S1 = 85;
S2 = 5;
Now we have to initialize pre-processing layer
[W1,b1] = initp(P,S1);
We also have to initialize learning layer
[W2,b2] = initp(S1,T);
NOW TRAIN THE NETWORK
A1 = simup(P,W1,b1);
TP = [1...