1. Field of the Invention
The invention relates to a gesture detecting method and a gesture detecting system and, more particularly, to a gesture detecting method and a gesture detecting system capable of providing a center, a radius, a direction and an arc angle corresponding to a gesture in real-time without establishing a gesture model.
2. Description of the Prior Art
As motion control gets more and more popular, the present operation behavior of user may change in the future, wherein gesture control may be adapted for various applications. For example, the motion of drawing a circle is instinctive in people, so how to accurately and quickly determine a circular gesture is a significant issue for gesture detecting technology. So far there are some prior arts developed for detecting circular gesture. However, the prior arts have to establish a gesture model in advance and a gesture operated by a user has to be a complete circle. In other words, the prior arts can only detect a circular gesture with the pre-established gesture model. The related circular gesture detecting technology can be referred to U.S. patent publication No. 20100050134 filed by GestureTek, Inc. However, under some applications, the gesture operated by the user has to be determined in real-time before a circle is done. That is to say, if the gesture operated by the user is only an arc instead of a circle, the prior arts cannot recognize the gesture such that the gesture detecting technology is limited.
The invention provides a gesture detecting method, a gesture detecting system and a computer readable storage medium to solve the aforesaid problems.
According to an embodiment of the invention, a gesture detecting method comprises steps of defining an initial reference point in a screen of an electronic device; dividing the screen into N areas radially according to the initial reference point, wherein N is a positive integer; when a gesture corresponding object moves in the screen and a trajectory of the gesture corresponding object crosses M of the N areas, selecting a sample point from each of the M areas so as to obtain M sample points, wherein M is a positive integer smaller than or equal to N; and calculating a center and a radius of the trajectory of the gesture corresponding object according to P of the M sample points so as to determine a circular or curved trajectory input, wherein P is a positive integer smaller than or equal to M.
In this embodiment, the gesture detecting method may further comprise steps of assigning a label value for each of the N areas such that each of the M sample points is corresponding to the label value of each of the M areas; calculating a difference between the label value of an i-th sample point and the label value of an (i+1)-th sample point so as to obtain M−1 differences, wherein i is a positive integer smaller than M; accumulating the M−1 differences so as to obtain an accumulated value; and determining a direction of the trajectory of the gesture corresponding object according to positive/negative of the accumulated value.
In this embodiment, the gesture detecting method may further comprise step of calculating an arc angle of the trajectory of the gesture corresponding object by (360/N)*M.
In this embodiment, the gesture detecting method may further comprise step of determining that the trajectory of the gesture corresponding object is a circle when M is equal to N.
According to another embodiment of the invention, a gesture detecting system comprises a data processing device and an input unit, wherein the input unit communicates with the data processing device. The data processing device comprises a processing unit and a display unit electrically connected to the processing unit. The processing unit defines an initial reference point in a screen of the display unit and divides the screen into N areas radially according to the initial reference point, wherein N is a positive integer. The input unit is used for moving a gesture corresponding object in the screen. When a trajectory of the gesture corresponding object crosses M of the N areas, the processing unit selects a sample point from each of the M areas so as to obtain M sample points and calculates a center and a radius of the trajectory of the gesture corresponding object according to P of the M sample points so as to determine a circular or curved trajectory input, wherein M is a positive integer smaller than or equal to N and P is a positive integer smaller than or equal to M.
In this embodiment, the processing unit assigns a label value for each of the N areas such that each of the M sample points is corresponding to the label value of each of the M areas and calculates a difference between the label value of an i-th sample point and the label value of an (i+1)-th sample point so as to obtain M−1 differences, wherein i is a positive integer smaller than M. The data processing device further comprises a counter electrically connected to the processing unit and used for accumulating the M−1 differences so as to obtain an accumulated value. The processing unit determines a direction of the trajectory of the gesture corresponding object according to positive/negative of the accumulated value.
In this embodiment, the processing unit may calculate an arc angle of the trajectory of the gesture corresponding object by (360/N)*M.
In this embodiment, the processing unit may determine that the trajectory of the gesture corresponding object is a circle when M is equal to N.
According to another embodiment of the invention, a computer readable storage medium stores a set of instruction and the set of instructions executes steps of defining an initial reference point in a screen; dividing the screen into N areas radially according to the initial reference point, wherein N is a positive integer; when a gesture corresponding object moves in the screen and a trajectory of the gesture corresponding object crosses M of the N areas, selecting a sample point from each of the M areas so as to obtain M sample points, wherein M is a positive integer smaller than or equal to N; and calculating a center and a radius of the trajectory of the gesture corresponding object according to P of the M sample points so as to determine a circular or curved trajectory input, wherein P is a positive integer smaller than or equal to M.
In this embodiment, the set of instructions may execute steps of assigning a label value for each of the N areas such that each of the M sample points is corresponding to the label value of each of the M areas; calculating a difference between the label value of an i-th sample point and the label value of an (i+1)-th sample point so as to obtain M−1 differences, wherein i is a positive integer smaller than M; accumulating the M−1 differences so as to obtain an accumulated value; and determining a direction of the trajectory of the gesture corresponding object according to positive/negative of the accumulated value.
In this embodiment, the set of instructions may execute step of calculating an arc angle of the trajectory of the gesture corresponding object by (360/N)*M.
In this embodiment, the set of instructions may execute step of determining that the trajectory of the gesture corresponding object is a circle when M is equal to N.
As mentioned in the above, the invention divides the screen of the electronic device into a plurality of areas radially and determines the center, radius, direction and arc angle corresponding to the trajectory of the gesture corresponding object according to how many areas the trajectory of the gesture corresponding object crosses in the screen. When the trajectory of the gesture corresponding object crosses all areas in the screen, the invention determines the trajectory of the gesture corresponding object is a circular gesture accordingly. Therefore, the invention is capable of providing a center, a radius, a direction and an arc angle corresponding to a gesture in real-time without establishing a gesture model so as to provide various gesture definitions and applications thereof.
These and other objectives of the present invention will no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred embodiment that is illustrated in the various figures and drawings.
Referring to
As shown in
Referring to
In the following, an embodiment is depicted along with the gesture detecting system 1 shown in
Referring to
As shown in
It should be noted that when selecting the aforesaid sample points P1-P9, the processing unit 100 may select a plurality of points on the trajectory G1 of the gesture corresponding object and then calculate a difference between the label values of former and later points. If the difference is equal to zero, it means that the two points are located at the same area, so the later point will not be sampled. If the difference is unequal to zero, it means that the two points are located at different areas, so the later point will be sampled. The aforesaid sampling manner is to ensure the distance between two sample points should be far enough (e.g. located at different areas) so as to prevent the processing unit 100 from calculating irrational center of the trajectory due to concentrated sample points.
In this embodiment, the processing unit 100 may calculate a center and a radius of the trajectory G1 of the gesture corresponding object by least square method according to coordinates of per nine sample points (i.e. the aforesaid P is equal to nine). It should be noted that the invention may use nine registers to store nine sample points, which are used to calculate the center and the radius of the trajectory G1 of the gesture corresponding object, respectively. When the counter 108 accumulates that the processing unit 100 has selected nine sample points P1-P9 on the trajectory G1 of the gesture corresponding object, the processing unit 100 will calculate the center C1 and the radius r1 of the trajectory G1 of the gesture corresponding object by least square method according to coordinates of the nine sample points P1-P9 (step S110). Furthermore, the processing unit 100 may determine a direction of the trajectory G1 of the gesture corresponding object according to positive/negative of an accumulated value accumulated in the counter 106. In this embodiment, the accumulated value accumulated in the counter 106 is equal to eight (i.e. positive), so the processing unit 100 determines that the direction of the trajectory G1 of the gesture corresponding object is clockwise (step S110), as shown in
Afterward, the processing unit 100 will replace and update the initial reference point O by the center C1 of the trajectory G1 of the gesture corresponding object and erase the accumulated value in the counter 106 after a predetermined time period (e.g. three seconds) accumulated in the timer 104. As shown in
In this embodiment, the data processing device 10 may use at least one of the center C1, the radius r1, the direction and the arc angle of the trajectory G1 of the gesture corresponding object to execute corresponding function. Referring to
It should be noted that the aforesaid zoom in/out function is only one embodiment for illustration purpose. The invention is not limited to the aforesaid embodiment and may be adapted to other applications based on practical design.
Referring to
In this embodiment, the processing unit 100 may calculate a center and a radius of the trajectory G2 of the gesture corresponding object by least square method according to coordinates of per nine sample points (i.e. the aforesaid P is equal to nine). It should be noted that the invention may use nine registers to store nine sample points, which are used to calculate the center and the radius of the trajectory G2 of the gesture corresponding object, respectively. When the counter 108 accumulates that the processing unit 100 has selected nine sample points P1-P9 on the trajectory G2 of the gesture corresponding object, the processing unit 100 will calculate the center C2 and the radius r2 of the trajectory G2 of the gesture corresponding object by least square method according to coordinates of the nine sample points P1-P9 (step S110). Afterward, the processing unit 100 will replace and update the initial reference point O by the center C2 of the trajectory G2 of the gesture corresponding object and erase the accumulated value in the counter 108. Then, when the counter 108 accumulates that the processing unit 100 has selected another nine sample points P10-P18 on the trajectory G2 of the gesture corresponding object, the processing unit 100 will calculate the center C2′ and the radius r2′ of the trajectory G2 of the gesture corresponding object by least square method according to coordinates of the nine sample points P10-P18 (step S110). Afterward, the processing unit 100 will replace and update the center C2 by the center C2′ of the trajectory G2 of the gesture corresponding object and update the radius r2 by the radius r2′. In other words, the invention will replace and update the center and the radius continuously while the trajectory of the gesture corresponding object is moving. It should be noted that the number of sample points, which is used for replacing and updating the center and the radius, can be determined based on practical applications and is not limited to the aforesaid nine sample points.
In this embodiment, the accumulated value accumulated in the counter 106 is equal to minus seventeen (i.e. negative), so the processing unit 100 determines that the direction of the trajectory G2 of the gesture corresponding object is counterclockwise (step S110), as shown in
Furthermore, the control logic of the gesture detecting method shown in
Compared with the prior art, the invention divides the screen into a plurality of areas and determines the center, radius, direction and arc angle corresponding to the trajectory of the gesture corresponding object according to how many areas the trajectory of the gesture corresponding object crosses in the screen. When the trajectory of the gesture corresponding object crosses all areas in the screen, the invention determines the trajectory of the gesture corresponding object is a circular gesture accordingly. Therefore, the invention is capable of providing a center, a radius, a direction and an arc angle corresponding to a gesture in real-time without establishing a gesture model so as to provide various gesture definitions and applications thereof.
Those skilled in the art will readily observe that numerous modifications and alterations of the device and method may be made while retaining the teachings of the invention. Accordingly, the above disclosure should be construed as limited only by the metes and bounds of the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
100144731 | Dec 2011 | TW | national |