Gesture Recognition using PCA

2 views (last 30 days)
Anand
Anand on 23 Mar 2012
Hi, I am new to mathworks.in so please pardon me if i commit any mistake but i need your help desperately. I'm working on my 3rd year project of "Gesture Recognition using PCA".
1. I'll be using PCA to compare the data from the images extracted from the live/stored video and the pca database for recognizing different gestures. I've recorded the video from my 2MP webcam with 176x144 resolution and saved them already.
2. Till now I've been able to extract the frames from the video and also performed PCA.
3.What I think is that now i should somehow find the similarity between the stored PCA database and the PCA performed on the extracted frames.
4. There is MATLAB function for comparing 2 matrices "isequal()" but I dont think that it would be of any help. I need to find the amount of similarities between the principal components obtained (I know that the 2 principal components will never be the same) and trigger some specific action.
Please guide me in the right direction. How can i recognize the gesture? Also tell if you know any other way of doing it with PCA. I've to submit this project asap.
The code i've written is:
clear all;
mat=zeros(25344,75); %defining a matrix rows=176x144 col=75
%there are 75 frames in my 15fps video
for i=1:75
frame=aviread('C:\vert1',i); % getting frames from stored .avi
img=frame2im(frame); % converting frames to images
g=rgb2gray(img); % performing grb to gray conversion
gdb=im2double(g); % converting to double
gm=gdb(:); % converting each image to col matrix
mat(:,i)=gm; % concatenating the col matrices of all images
end;
pcav1=princomp(mat); % performing PCA on the final matrix
thank you!

Answers (0)

Community Treasure Hunt

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

Start Hunting!