preprocess_gesture.m
If you have not seen previous post then please go through it first then come back go to Previous Part
Create a Menu
clc
F = MENU('Choose a database set','Test Set','Train Set');
if F==1
K = MENU('Choose a file','Test O');
FOR TESTING A DATASET
if K == 1
loop=5
for i=1:loop
string = ['test\O\' num2str(i) '.tif'];
Rimages{i} = imread(string);
end
end
end
end;
FOR TRAINING
if F==2
loop=3 %Set loop to 3. All train sets have 3 images
L = MENU('Choose a file','Train O');
if L == 1
for i=1:loop
string = ['train\O\' num2str(i) '.tif'];
Rimages{i} = imread(string);
end
end
end
Now do what I am doing here
T{i}=imresize(Timages{i},[150,140]);
x = [0 -1 1];
y = [0 1 -1]';
dx{i} = convn(T{i},x,'same');
dy{i} = convn(T{i},y,'same');
gradient{i} = dy{i} ./dx{i};
theta{i} = atan(gradient{i});
cl{i}= im2col(theta{i},[1 1],'distinct');
N{i} = (cl{i}*180)/3.14159265359; .
c1{i}=(N{i}>0)&(N{i}<10 div="" nbsp="">10>
s1{i}=sum(c1{i});
c2{i}=(N{i}>10.0001)&(N{i}<20 div="" nbsp="">20>
s2{i}=sum(c2{i});
c3{i}=(N{i}>20.0001)&(N{i}<30 div="" nbsp="">30>
sum(c3{i});
s3{i}=sum(c3{i});
c4{i}=(N{i}>30.0001)&(N{i}<40 div="" nbsp="">40>
sum(c4{i});
s4{i}=sum(c4{i});
c5{i}=(N{i}>40.0001)&(N{i}<50 div="" nbsp="">50>
sum(c5{i});
s5{i}=sum(c5{i});
c6{i}=(N{i}>50.0001)&(N{i}<60 div="" nbsp="">60>
sum(c6{i});
s6{i}=sum(c6{i});
c7{i}=(N{i}>60.0001)&(N{i}<70 div="" nbsp="">70>
sum(c7{i});
s7{i}=sum(c7{i});
c8{i}=(N{i}>70.0001)&(N{i}<80 div="" nbsp="">80>
sum(c8{i});
s8{i}=sum(c8{i});
c9{i}=(N{i}>80.0001)&(N{i}<90 div="" nbsp="">90>
sum(c9{i});
s9{i}=sum(c9{i});
c10{i}=(N{i}>90.0001)&(N{i}<100 div="" nbsp="">100>
sum(c10{i});
s10{i}=sum(c10{i});
c11{i}=(N{i}>-89.9)&(N{i}<-80 div="" nbsp="">-80>
sum(c11{i});
s11{i}=sum(c11{i});
c12{i}=(N{i}>-80.0001)&(N{i}<-70 div="" nbsp="">-70>
sum(c12{i});
s12{i}=sum(c12{i});
c13{i}=(N{i}>-70.0001)&(N{i}<-60 div="" nbsp="">-60>
sum(c13{i});
s13{i}=sum(c13{i});
c14{i}=(N{i}>-60.0001)&(N{i}<-50 div="" nbsp="">-50>
sum(c14{i});
s14{i}=sum(c14{i});
c15{i}=(N{i}>-50.0001)&(N{i}<-40 div="" nbsp="">-40>
sum(c15{i});
s15{i}=sum(c15{i});
c16{i}=(N{i}>-40.0001)&(N{i}<-30 div="" nbsp="">-30>
sum(c16{i});
s16{i}=sum(c16{i});
c17{i}=(N{i}>-30.0001)&(N{i}<-20 div="" nbsp="">-20>
sum(c17{i});
s17{i}=sum(c17{i});
c18{i}=(N{i}>-20.0001)&(N{i}<-10 div="" nbsp="">-10>
sum(c18{i});
s18{i}=sum(c18{i});
c19{i}=(N{i}>-10.0001)&(N{i}<-0 .0001="" div="" nbsp="">-0>
sum(c19{i});
s19{i}=sum(c19{i});
D{i}= [s1{i} s2{i} s3{i} s4{i} s5{i} s6{i} s7{i} s8{i} s9{i} s10{i} s11{i} s12{i} s13{i} s14{i} s15{i} s16{i} s17{i} s18{i} s19{i}];
close(w);
The code on gesture control-neural network is awesome but can the same be done even on a music player??? can you tell me which part of your code has to modified in order to achieve it ??
ReplyDeleteOkey... I will try to post an article on this ..... :)
Deletethank yo so much :)
Deletehey thanks a lot for uploading information on music control its so nice of you to have replied to just an anonymous post.Truly speaking I donno matlab much so I think I'll use this information and complete my project successfully,And surely I'll keep you updated with my comments here regarding my project.
DeleteThank you so much one again :)
Your Welcome :)
Deletecan u tell me, the code for gender identification from face images??
ReplyDeletehey i wanted to know is there any issue in the syntax? as c1{i}=(N{i}>0)&(N{i}<10 div="" nbsp="">
ReplyDeletes1{i}=sum(c1{i}); is issuing an error. pls help? reply asap.
the code doesn't seem to work ..y? .. and also where should i save the pics for training
ReplyDeletei want develop this project in R2013b but it can work properly please help me how to implement please
ReplyDeletePlz can you send me coding..gesture control car using image processing
ReplyDelete