A gesture recognition method for a mobile device, wherein the mobile device comprises an image capture unit, a gesture recognition unit, and a storage device, and the gesture recognition method comprises steps of:
- (S1) capturing an image frame within a current visual range by the image capture unit;
- (S2) determining whether the image frame captured by the image capture unit includes a hand image with a palm by the gesture recognition unit;
- (S3) when a determination result of the step (S2) is satisfied, the gesture recognition unit determining whether the hand image is a valid gesture;
- (S4) when a determination result of the step (S3) is satisfied, the gesture recognition unit recording a plurality of coordinate information of a plurality of locations corresponding to a plurality of fingers of the palm shown in the hand image in a finger list, and storing the finger list in the storage unit;
- (S5) the gesture recognition unit obtaining an orientation of the palm according to the hand image;
- (S6) the gesture recognition unit calculating a width of the palm according to the hand image, and calculating a dynamic displacement threshold according to the width of the palm;
- (S7) the gesture recognition unit determining whether to launch an action command according to the dynamic displacement threshold and at least one determination condition, and when a determination result of the step (S7) is not satisfied, re-executing the step (S1);
- (S8) when the determination result of the step (S7) is satisfied, launching the action command, and re-executing the step (S1);
- and
- (S9) when the determination result of the step (S2) is not satisfied or when the determination result of the step (S3) is not satisfied, determining whether the record of the plurality of coordinate information in the finger list is empty, and re-executing the step (S1) when a determination result of the step (S9) is satisfied, and executing the step (S7) when the determination result of the step (S9) is not satisfied;
- wherein the gesture recognition unit determines whether to launch an action command according to the orientation of the palm, the dynamic displacement threshold and at least one determination condition, wherein the at least one determination condition in the step (S7) comprises steps of:
- (S70) the gesture recognition unit obtaining a difference by comparing between the corresponding coordinate information in the plurality of coordinate information in the finger list being recorded in the last time and in the penultimate time so as to determine whether the orientation of the palm and a moving direction of the palm are the same;
- (S71) when a determination result of the step (S70) is satisfied, a reverse variable is set as false and stored in the storage unit;
- (S72) the gesture recognition unit determining whether the palm is still within a visual range of the image capture unit according to the image frame captured by the image capture unit currently;
- (S73) when a determination result of the step (S72) is satisfied, the gesture recognition unit utilizing the plurality of coordinate information and a time difference obtained in a time information of the plurality of locations in the finger list recorded in the last N time to calculate the velocity of the motion of the palm, wherein N is a positive integer greater than 2, and N corresponds to the image frames per second being captured by the image capture unit;
- and
- (S74) determining whether the velocity of the motion of the palm is greater than a velocity threshold, and when a determination result is satisfied, re-execute the step (S1).