Help with program logic (Gesture recognition)?

조회 수: 1 (최근 30일)
Pruthvi
Pruthvi 2014년 3월 20일
댓글: Pruthvi 2014년 3월 20일
Hello! I've written this code for gesture recognition, but the gestures are not classified correctly each time. How do I alter the program to display what the gesture is only if it is classified correctly 4 times consecutively?
clc;
clear all;
close all;
gestdatabase;
vid = videoinput('winvideo', 1, 'YUY2_640x480'); %specify the video adaptor
src = getselectedsource(vid);
vid.ReturnedColorspace = 'grayscale'; %define the color format to GRAYSCALE
vid.FramesPerTrigger = 5;
preview(vid); %preview the video object
while(1)
preview(vid); %preview the video object
gesture=getsnapshot(vid); %capture the image of interest
for i=1:30
J{i}=corr2(gesture,gest1Cell{i});
L{i}=corr2(gesture,gest2Cell{i});
end
greatestJ=cellfun(@(a) max(a(:)),J);
R = max(greatestJ(1,:));
greatestL=cellfun(@(b) max(b(:)),L);
S = max(greatestL(1,:));
H = [R,S];
G= max(H);
if ((G==R)&&(G>0.55))
display('FORWARD');
elseif ((G==S)&&(G>0.55))
display('BACKWARD');
else
display('NO MOTION');
end
end
Thank you!

답변 (1개)

Image Analyst
Image Analyst 2014년 3월 20일
That's a question on algorithm development, not a question of the logic or program flow or syntax. Go to section 21.4 on Gesture recognition algorithms for help on algorithms: http://iris.usc.edu/Vision-Notes/bibliography/contentspeople.html#Face%20Recognition,%20Detection,%20Tracking,%20Gesture%20Recognition,%20Fingerprints,%20Biometrics Obviously your little 20 line program where you simply correlate two images is not going to be robust enough to handle real world situations, so you should look to successful, proven algorithms that have been published.
  댓글 수: 1
Pruthvi
Pruthvi 2014년 3월 20일
Oh no sir, I've used Structural Similarity Index and PCA as well, I just didn't know whether to mention those as I just wanted to know what logic to use to display the gestures only if they've been classified correctly over 4 times. The actual code is over 2 pages long.

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by