Capacitance data acquisition device for gesture recognition and gesture recognition method thereof
Technical Field
The invention belongs to the technical field of gesture recognition, and particularly relates to a capacitance data acquisition device for gesture recognition and a gesture recognition method thereof.
Background
With the rapid development of computers, people are inseparable from computers. As an important step, human-computer interaction has not been satisfied by using a common peripheral device such as a mouse and a keyboard. Although, these approaches are widely used and well known. However, people still pursue a man-machine interaction mode which is simpler, more comfortable and suitable for human habits. Therefore, gesture recognition takes place at the right moment.
The gestures are one of the ways of communication between people, have the characteristics of diversity and specificity, and provide possibility for further development of human-computer interaction. In terms of traffic safety, various functions and data in the automobile are operated through gestures, so that the attention of a driver can be sufficiently focused on the current road situation, and traffic accidents are reduced. In the development of the internet of things, the gesture recognition can fully improve the interaction between people and all things. And simultaneously provides possibility for realizing the virtual reality technology. However, the existing gesture recognition devices, such as data gloves, infrared recognition devices, or camera recognition devices, all generally have the problems of high price, complex equipment and high requirement on light. This defeats the purpose of people initially interacting naturally without contact and with mechanical devices. Therefore, it is necessary to consider establishing a non-contact gesture recognition interactive device system which has simple equipment, high resolution, strong noise resistance and is economical and applicable.
Disclosure of Invention
The invention aims to provide a capacitance data acquisition device for gesture recognition and a gesture recognition method thereof.
The invention relates to a capacitance data acquisition device for gesture recognition, which comprises a capacitance signal acquisition device and an acquisition circuit. The capacitance signal collector comprises a metal foil, a substrate and an isolation plate. The metal foil is fixed between the substrate and the isolation plate. The acquisition circuit comprises a main control module, a power supply module and a capacitance sensing module. The power supply module supplies power to the main control module through the voltage stabilizing chip.
The main control module comprises a single chip microcomputer, a first capacitor C1, a second capacitor C2, a third capacitor C3, a fourth capacitor C4, a fifth capacitor C5, a first resistor R1, a second resistor R2, a first key switch S1, a first crystal oscillator Y1 and a second crystal oscillator Y2. The reset pin of the singlechip is connected with one end of the first capacitor C1, the first resistor R1 and the first key switch S1. The other ends of the first capacitor C1 and the first key switch S1 are both grounded. The other end of the first resistor R1 is connected with the power supply output end of the power supply module. And a VDD pin of the singlechip is connected with a power supply output end of the power module, and a VSS pin is grounded. Two external crystal oscillator pins of the single chip microcomputer are respectively connected with two ends of the first crystal oscillator Y1 and are respectively connected with one ends of the second capacitor C2 and the third capacitor C3. The other ends of the second capacitor C2 and the third capacitor C3 are both grounded. Two second external crystal oscillator pins of the single chip microcomputer are respectively connected with two ends of the second resistor R2, connected with two ends of the second crystal oscillator, and respectively connected with one ends of the fourth capacitor C4 and the fifth capacitor C5. The other ends of the fourth capacitor C4 and the fifth capacitor C5 are both grounded.
The capacitance sensing module comprises a capacitance sensor. The SCL pin of the capacitive sensor is connected to one end of the fourth resistor R4, and the SDA pin is connected to one end of the third resistor R3. The other end of the third resistor R3 is connected with a first I/O port of the singlechip. The other end of the fourth resistor R4 is connected with a second I/O port of the singlechip. The pins PAD, GND, ADDR, SD and CLKIN of the capacitance sensor are all grounded, and the pin VDD is connected with one end of the sixth capacitor C6 and one end of the seventh capacitor C7 and +5V voltage of external input. The other ends of the sixth capacitor C6 and the seventh capacitor C7 are both grounded. The pin IN0A of the capacitive sensor is connected to one end of the first inductor L1 and the eighth capacitor C8, and the pin IN0B is connected to the other end of the first inductor L1 and the eighth capacitor C8. The IN0A pin of the capacitive sensor serves as a signal input end of the capacitive sensing module and is electrically connected with the metal foil.
Further, the power module includes a voltage stabilizing chip, a ninth capacitor C9, a tenth capacitor C10, an eleventh capacitor C11, and a twelfth capacitor C12. The model of the voltage stabilizing chip is AMS 111. The VCC pin of the voltage stabilizing chip is connected to the anode of the ninth capacitor C9, one end of the tenth capacitor C10 and the +5V VCC for external input, and the OUT pin is connected to the anode of the eleventh capacitor C11 and one end of the twelfth capacitor C12. The GND pin of the voltage stabilizing chip, the ninth capacitor C9, the negative electrode of the eleventh capacitor C11, the tenth capacitor C10 and the twelfth capacitor C12 are all grounded. And an OUT pin of the voltage stabilizing chip is a power supply output end of the power supply module.
Furthermore, the acquisition circuit also comprises an LCD display screen. The model of the LCD display screen is LCD 12864. Pins 1 and 20 of the LCD screen are grounded, pins 2 and 19 are connected with an external input voltage of 5V, and pins 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 and 17 are respectively connected with a third I/O port to a fifteenth I/O port of the singlechip.
Furthermore, the acquisition circuit also comprises a key operation module. The key operation module comprises a second key switch S2, a third key switch S3, a fourth key switch S4, a fifth key switch S5 and a sixth key switch S6. One end of the second key switch S2 is connected with one end of the ninth resistor R9 and the sixteenth I/O port of the single chip microcomputer. One end of the third key switch S3 is connected with one end of the eighth resistor R8 and the seventeenth I/O port of the singlechip. One end of the fourth key switch S4 is connected with one end of the seventh resistor R7 and the eighteenth I/O port of the singlechip. One end of the fifth key switch S5 is connected with one end of the sixth resistor R6 and the nineteenth I/O port of the single chip microcomputer. One end of the sixth key switch S6 is connected with one end of the fifth resistor R5 and the twentieth I/O port of the singlechip. The other ends of the second key switch S2, the third key switch S3, the fourth key switch S4, the fifth key switch S5 and the sixth key switch S6 are all grounded. The other ends of the fifth resistor R5, the sixth resistor R6, the seventh resistor R7, the eighth resistor R8 and the ninth resistor R9 are connected with an external input +5V voltage.
Further, the capacitive sensor U2 is model FDC 2214.
Further, the single chip microcomputer is STM32F 1.
Furthermore, the metal foil adopts copper foil.
The gesture recognition method of the capacitance data acquisition device for gesture recognition comprises the following steps:
step one, establishing a gesture recognition database, and inputting each sampling gesture to be recognized into the database by a user.
1.1, assign 1 to i and j.
1.2, the user makes the ith sampling gesture with the hand to place on the division board, the capacitance sensor gathers m electric capacity data of metal foil output, and convert m electric capacity data gathered into digital signal transmission master control module. m pieces of capacitance data are sij1,sij2,sij3,......,sijm. Go to step 1.3.
1.3, if i is less than l and j is less than n, increasing j by 1 and executing the step 1.2; if i is less than l and j is equal to n, increasing i by 1, assigning 1 to j, and repeatedly executing the step 1.2; if i is l and j is n, then proceed to row step 1.4. l is the number of gestures to be input, and n is the repeated placement times of each gesture, 1 is more than or equal to n is less than or equal to 20.
1.4, integrating the capacitance data obtained in the steps 1.1 to 1.3 into a gesture sample data set S.
Step two, normalizing all elements in the gesture sample data set S to obtain a normalized gesture data set Snor。
Wherein,smaxthe element with the largest numerical value in the gesture sample data set S is selected; sminThe element with the smallest value in the gesture sample data set S.
Step three, normalizing the gesture data set SnorThe inner elements are subjected to equalization processing to obtain an equalized gesture data set Save。
Save={{save,11,save,12,save,13,......,save,1m},{save,21,save,22,save,23,......,save,2m},......,{save,l1,save,l2,save,l3,......,save,lm}}
Wherein,
step four, normalizing the gesture data set SnorThe l.m elements in the sequence are sorted from small to large.
Step five, taking a normalized gesture data set SnorAs a convergence element. An intermediate element of a set of z elements being the first element of the setAn element;the value obtained by rounding up in the 0.5 Xz direction was obtained. The convergent elements will normalize the gesture data set SnorSeparated into two first intermediate sets. A value of 1 is assigned to a.
And step six, taking all the intermediate elements of the a-th intermediate set as a + 1-th intermediate elements. The a +1 th intermediate element is referred to as a sub-element of the corresponding a-th intermediate element. Two a +1 th intermediate elements in the same a-th intermediate set are sibling elements to each other.
If the number of elements in one a-th intermediate set is greater than or equal to 5, the corresponding a + 1-th intermediate element divides the a-th intermediate set into two a + 1-th intermediate sets.
If the number of elements in an a-th intermediate set is equal to 4, the corresponding a + 1-th intermediate element divides the a-th intermediate set into a terminal element and an a + 1-th intermediate set. The terminal element is a sub-element corresponding to the a +1 th intermediate element.
If the number of elements in an a-th intermediate set is equal to 3, the corresponding a + 1-th intermediate element divides the a-th intermediate set into two terminal elements. Both of the two terminal elements are sub-elements corresponding to the a +1 th intermediate element.
If the number of the elements in an a-th intermediate set is equal to 2, the element in the a-th intermediate set except the a + 1-th intermediate element is the terminal element. The terminal element is a sub-element corresponding to the a +1 th intermediate element.
And entering the step seven.
Step seven, if the a +1 th intermediate set exists, increasing a by 1, and repeatedly executing the step six; otherwise, go to step eight.
And step eight, making the hand into a gesture to be recognized by the user, and attaching the hand to the placing plate. And averaging the plurality of identified capacitance data output by the metal foil to obtain identified capacitance average data x'.
Step nine, calculating the normalization value x of the recognized gesture detected in the step fournor。
Step ten, using the convergent element as a first target element g1And add vertical screening set G. Assign 1 to b and proceed to step eleven.
Step eleven, comparing the target element g of the bbNormalizing the value x with the recognized gesturenorThe size of (2). If xnorLess than the b-th target element gbIs then the b-th target element gbThe smaller of the two sub-elements of (a) is taken as the (b + 1) th target element gb+1(ii) a Otherwise, it will be the b-th target element gbThe larger of the two sub-elements of (a) as the (b + 1) th target element gb+1。
B +1 th target element gb+1And adding a longitudinal screening set G and entering the step twelve.
Step twelve, if the b +1 th target element gb+1If there are two sub-elements, then b is incremented by 1 and step eleven is performed; if the b +1 th target element gb+1If there is a sub-element, the b +1 th target element gb+1As the b +2 th target element gb+2Adding a longitudinal screening set G and entering a step thirteen; if the b +1 th target element gb+1If no sub-element exists, step thirteen is directly entered.
Thirteen, calculating all elements in the longitudinal screening set G and the normalization value x of the recognized gesturenorOf Euclidean distance dvV ═ 1,2, …, c; c is the number of elements in the longitudinal screening set G.
Wherein, gvThe v-th element in the set G is longitudinally screened.
Step fourteen, get d1、d2、...、dcOf d'min。d′minThe corresponding element in the vertical screening set G is used as the first candidate element. If the first candidate element does not have a brother element, the gesture to be recognized made by the user and the first candidate element are in the equalized gesture data set SaveThe corresponding sampling gesture is the same, and the gesture recognition is finished.
If the first candidate element has the brother element, taking the brother element of the first candidate element as a second candidate element, and calculating the normalization value x of the second candidate element and the recognized gesturenorThe Euclidean distance d ″)min;g' is a second candidate element; step fifteen is entered.
Fifteen step, d 'comparison'minAnd d ″)min(ii) a If d'min<d″minThe user' S gesture to be recognized and the first candidate element are averaged in a gesture data set SaveThe corresponding sampling gestures are the same, and the gesture recognition is finished; if d'min≥d″minThe user's gesture to be recognized and the first candidateSelection element averaging gesture data set SaveThe corresponding sampling gesture is the same, and the gesture recognition is finished.
The invention has the beneficial effects that:
1. according to the invention, the hand motion placed on the metal foil is converted into an accurate capacitance signal in a way that the capacitance sensor is matched with the metal foil, so that the gesture recognition can be realized. Compared with the existing gesture recognition equipment such as data gloves, infrared recognition devices, camera recognition devices and the like, the gesture recognition equipment has the advantage of low cost.
2. The capacitance sensing technology applied by the invention well solves the problem of small signal amplification, thereby improving the acquisition precision.
3. The invention eliminates the influence of ambient light on the judgment and improves the accuracy of gesture recognition.
4. According to the method, the recognized gesture is matched with the data in the database through the Mesh network topology progressive search algorithm, so that the recognized gesture is compared with all data in the database, the data which is closest to the recognized gesture in the database can be found, and the calculation amount in the recognition process is greatly reduced.
5. The invention can realize the accurate recognition of gestures such as stones, scissors, cloth, numbers 1,2, 3, 4, 5 and the like.
Drawings
FIG. 1 is a block diagram of the system of the present invention;
FIG. 2 is a schematic circuit diagram of a power module of the present invention;
FIG. 3 is a schematic circuit diagram of a main control module according to the present invention;
FIG. 4 is a schematic circuit diagram of a capacitive sensing module according to the present invention;
FIG. 5 is a wiring diagram of the LCD panel of the present invention;
fig. 6 is a schematic circuit diagram of the key operation module according to the present invention.
Detailed Description
The invention is further described below with reference to the accompanying drawings.
As shown in fig. 1, a capacitance data acquisition device for gesture recognition includes a capacitance signal collector 1 and a collection circuit. The capacitance signal collector 1 comprises a metal foil, a substrate and an isolation plate. The metal foil is fixed between the substrate and the partition plate. The isolation plate is located above the substrate. The metal foil is copper foil. The acquisition circuit comprises a main control module 2, a power supply module 3, a capacitance sensing module 4, an LCD display screen U4 and a key operation module 5. The power module 3 converts the externally input 5V voltage into 3.3V voltage through the voltage stabilizing chip to supply power to the main control module 2. The capacitance sensing module 4 converts the capacitance value analog signal between the metal foil of the capacitance signal collector 1 and the ground wire into a digital signal through the capacitance sensor and transmits the digital signal to the main control module 2. When the user puts on the isolation plate, the capacitance value output by the metal foil changes. The LCD screen U4 is connected to the main control module 2 for displaying the result of gesture recognition and the current usage mode. The key operation module 5 sends the mode adjusting instruction to the main control module 2 through the key switch.
As shown in fig. 2, the power module 3 includes a voltage regulator chip U3, a ninth capacitor C9, a tenth capacitor C10, an eleventh capacitor C11, and a twelfth capacitor C12. The model of the voltage stabilizing chip U3 is AMS 111. The VCC pin of the voltage stabilizing chip U3 is connected to the anode of the ninth capacitor C9, one end of the tenth capacitor C10, and the +5V VCC external input, and the OUT pin is connected to the anode of the eleventh capacitor C11 and one end of the twelfth capacitor C12. The GND pin of the voltage stabilizing chip U3, the negative electrode of the ninth capacitor C9, the negative electrode of the eleventh capacitor C11, and the other ends of the tenth capacitor C10 and the twelfth capacitor C12 are all grounded. The OUT pin of the voltage stabilization chip U3 is +3.3V, which is the power supply output terminal of the power module 3.
As shown in fig. 3, the main control module 2 includes a single chip microcomputer U1, a first capacitor C1, a second capacitor C2, a third capacitor C3, a fourth capacitor C4, a fifth capacitor C5, a first resistor R1, a second resistor R2, a first key switch S1, a first crystal oscillator Y1, and a second crystal oscillator Y2. The model of the singlechip U1 is STM32F 1. The reset pin (pin 25) of the singlechip U1 is connected with the first capacitor C1, the first resistor R1 and one end of the first key switch S1. The other ends of the first capacitor C1 and the first key switch S1 are both grounded. The other end of the first resistor R1 is connected to the +3.3V power supply output terminal of the power module 3. The VDD pin (72, 108, 144, 39, 17, 52, 62, 84, 95, 121 and 131 pins) of the single chip microcomputer U1 is connected with the +3.3V power supply output end of the power module 3, and the VSS pin (71, 107, 143, 38, 16, 51, 61, 83, 94, 120 and 130 pins) is grounded. Two external crystal oscillator pins (7 and 8 pins) of the singlechip U1 are respectively connected with two ends of the first crystal oscillator Y1 and are respectively connected with one ends of the second capacitor C2 and the third capacitor C3. The other ends of the second capacitor C2 and the third capacitor C3 are both grounded. Two second external crystal oscillator pins (23 and 24 pins) of the singlechip U1 are respectively connected with two ends of a second resistor R2, two ends of the second crystal oscillator, and one ends of a fourth capacitor C4 and a fifth capacitor C5. The other ends of the fourth capacitor C4 and the fifth capacitor C5 are both grounded.
As shown in fig. 4, the capacitive sensing module 4 includes a capacitive sensor U2. Capacitive sensor U2 is model FDC 2214. The SCL pin (pin 1) of the capacitive sensor U2 is connected to one end of the fourth resistor R4, and the SDA pin (pin 2) is connected to one end of the third resistor R3. The other end of the third resistor R3 is connected with a first I/O port (pin 44) of the singlechip U1. The other end of the fourth resistor R4 is connected with a second I/O port (pin 45) of the singlechip U1. The PAD, GND, ADDR, SD and CLKIN pins of the capacitive sensor U2 are all grounded, and the VDD pin is connected to one end of the sixth capacitor C6 and the seventh capacitor C7 and the +5V voltage is input from the outside. The other ends of the sixth capacitor C6 and the seventh capacitor C7 are both grounded. The pin IN0A of the capacitive sensor U2 is connected to one end of the first inductor L1 and the eighth capacitor C8, and the pin IN0B is connected to the other end of the first inductor L1 and the eighth capacitor C8. The IN0A pin of the capacitive sensor U2 serves as a signal input terminal of the capacitive sensing module 4 and is electrically connected to the metal foil. The remaining pins of the capacitive sensor U2 are all floating.
As shown in fig. 5, the LCD screen U4 is of the type LCD 12864. Pins 1 and 20 of the LCD screen U4 are grounded, pins 2 and 19 are connected with an external input 5V voltage VCC, and pins 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 and 17 are respectively connected with pins 114, 115, 117, 77, 78, 79, 80, 81, 82, 85, 86, 118 and 119 of the singlechip U1 from a third I/O port to a fifteenth I/O port. The remaining pins of the LCD screen U4 are left floating.
As shown in fig. 6, the key operation module 5 includes a second key switch S2, a third key switch S3, a fourth key switch S4, a fifth key switch S5, and a sixth key switch S6. One end of the second key switch S2 is connected to one end of the ninth resistor R9 and the sixteenth I/O port K2 (pin 10) of the single chip microcomputer U1. One end of the third key switch S3 is connected to one end of the eighth resistor R8 and the seventeenth I/O port K3(11 pin) of the single chip microcomputer U1. One end of the fourth key switch S4 is connected to one end of the seventh resistor R7 and the eighteenth I/O port K4(12 pins) of the single chip microcomputer U1. One end of the fifth key switch S5 is connected to one end of the sixth resistor R6 and the nineteenth I/O port K5 (pin 13) of the single chip microcomputer U1. One end of the sixth key switch S6 is connected to one end of the fifth resistor R5 and the twentieth I/O port K6(14 pins) of the single chip microcomputer U1. The other ends of the second key switch S2, the third key switch S3, the fourth key switch S4, the fifth key switch S5 and the sixth key switch S6 are all grounded. The other ends of the fifth resistor R5, the sixth resistor R6, the seventh resistor R7, the eighth resistor R8 and the ninth resistor R9 are connected with an external input +5V voltage VCC. The other pins of the singlechip U1 are all suspended.
The gesture recognition method of the capacitance data acquisition device for gesture recognition comprises the following steps:
step one, establishing a gesture recognition database, and inputting each sampling gesture to be recognized into the database by a user.
1.1, assign 1 to i and j.
1.2, the user makes the ith sampling gesture with hands and places the ith sampling gesture on the isolation board for T time, wherein T is m/f, and m is more than or equal to 1And 0 and f are data acquisition frequencies of the capacitive sensor. The user's hand influences the capacitance value output by the foil. The capacitance sensor converts the acquired m capacitance data into digital signals and transmits the digital signals to the main control module 2. m pieces of capacitance data are sij1,sij2,sij3,...,sijm. Go to step 1.3.
1.3, if i is less than l and j is less than n, increasing j by 1 and executing the step 1.2; if i is less than l and j is equal to n, increasing i by 1, assigning 1 to j, and repeatedly executing the step 1.2; if i is l and j is n, then proceed to row step 1.4. l is the number of gestures to be input, and n is the repeated placement times of each gesture, 1 is more than or equal to n is less than or equal to 20.
1.4, obtaining a gesture sample data set S in steps 1.1 to 1.3.
Step two, normalizing all elements in the gesture sample data set S to obtain a normalized gesture data set Snor。
Wherein,smaxthe element with the largest numerical value in the gesture sample data set S is selected; sminThe element with the smallest value in the gesture sample data set S.
Step three, normalizing the gesture data set SnorThe inner elements are subjected to equalization processing to obtain an equalized gesture data set Save。
Save={{save,11,save,12,save,13,......,save,1m},{save,21,save,22,save,23,......,save,2m},......,{save,l1,save,l2,save,l3,......,save,lm}}
Wherein,
step four, normalizing the gesture data set SnorThe l.m elements in the sequence are sorted from small to large.
Step five, taking a normalized gesture data set SnorAs a convergence element. An intermediate element of a set of z elements being the first element of the setAn element;the value obtained by rounding up in the 0.5 Xz direction was obtained. The convergent elements will normalize the gesture data set SnorSeparated into two first intermediate sets. All elements within a first intermediate set are larger or smaller than the aggregate element. A value of 1 is assigned to a.
And step six, taking all the intermediate elements of the a-th intermediate set as a + 1-th intermediate elements. The a +1 th intermediate element is referred to as a sub-element of the corresponding a-th intermediate element. The a-th intermediate element is referred to as the parent element of the corresponding a + 1-th intermediate element. Two a +1 th intermediate elements within the same a-th intermediate set are siblings of each other (i.e., two elements having the same parent are siblings of each other).
If the number of elements in one a-th intermediate set is greater than or equal to 5, the corresponding a + 1-th intermediate element divides the a-th intermediate set into two a + 1-th intermediate sets. The elements in an a +1 th intermediate set are all larger than the a +1 th intermediate element or are all smaller than the a +1 th intermediate element.
If the number of elements in an a-th intermediate set is equal to 4, the corresponding a + 1-th intermediate element divides the a-th intermediate set into a terminal element and an a + 1-th intermediate set with the number of elements equal to 2. The terminal element is a sub-element corresponding to the a +1 th intermediate element.
If the number of elements in an a-th intermediate set is equal to 3, the a + 1-th intermediate element divides the corresponding a-th intermediate set into two terminal elements. Both of the two terminal elements are sub-elements corresponding to the a +1 th intermediate element.
If the number of the elements in an a-th intermediate set is equal to 2, the element in the a-th intermediate set except the a + 1-th intermediate element is the terminal element. The terminal element is a sub-element corresponding to the a +1 th intermediate element.
And entering the step seven.
Step seven, if an a +1 th intermediate set exists (namely, at least one a-th intermediate set with the element number being more than or equal to 4 exists), increasing a by 1, and repeatedly executing the step six; otherwise, the gesture data set S is normalizednorAll the elements in the step (a) become one of the convergence element, the intermediate element and the terminal element, and the step (eight) is carried out.
And step eight, making the hand into a gesture to be recognized by the user, and attaching the hand to the placing plate. The user's hand influences the capacitance value output by the foil. The capacitance sensor converts a plurality of collected identified capacitance data into digital signals and transmits the digital signals to the main control module 2. The master control module 2 calculates an average value x' of the received plurality of digital signals.
Step nine, calculating the normalization value x of the recognized gesture detected in the step fournor。
Step ten, using the convergent element as a first target element g1And adding the vertical screening set G which is initially an empty set. Assign 1 to b and proceed to step eleven.
Step eleven, comparing the target element g of the bbNormalizing the value x with the recognized gesturenorThe size of (2). If xnorLess than the b-th target element gbIs then the b-th target element gbThe smaller of the two sub-elements of (a) is taken as the (b + 1) th target element gb+1(ii) a Otherwise, it will be the b-th target element gbThe larger of the two sub-elements of (a) as the (b + 1) th target element gb+1。
B +1 th target element gb+1And adding a longitudinal screening set G and entering the step twelve.
Step twelve, if the b +1 th target element gb+1If there are two sub-elements, then b is incremented by 1 and step eleven is performed; if the b +1 th target element gb+1If there is a sub-element, the b +1 th target element gb+1As the b +2 th target element gb+2Adding a longitudinal screening set G, entering a thirteen step, wherein b +2 elements are totally contained in the longitudinal screening set G, and assigning b +2 to c; if the b +1 th target element gb+1If no sub-elements exist, directly entering step thirteen, wherein b +1 elements are totally arranged in the longitudinal screening set G, and assigning b +1 to c.
Thirteen, calculating all elements in the longitudinal screening set G and the normalization value x of the recognized gesturenorOf Euclidean distance dvV ═ 1,2, …, c; c is the number of elements in the longitudinal screening set G.
Wherein, gvThe v-th element (i.e., the v-th target element) in the set G is screened longitudinally.
Step fourteen, get d1、d2、...、dcIs recorded as d 'to the minimum value of'min。d′minThe corresponding element in the vertical screening set G is used as the first candidate element. If it is firstCandidate elements do not have sibling elements (i.e., equalized gesture dataset S)aveThere is no element having the same parent element as the first candidate element), the user-made gesture to be recognized and the first candidate element are averaged in the gesture data set S)aveThe corresponding sampling gesture is the same, and the gesture recognition is finished.
If the first candidate element has sibling elements (i.e. the equalized gesture data set S)aveAn element having the same parent element as the first candidate element) exists, the sibling element of the first candidate element is taken as a second candidate element, and the normalization value x of the second candidate element and the recognized gesture is calculatednorThe Euclidean distance d ″)min;g' is the value of the second candidate element. Step fifteen is entered.
Fifteen step, d 'comparison'minAnd d ″)min(ii) a If d'min<d″minThe user' S gesture to be recognized and the first candidate element are averaged in a gesture data set SaveThe corresponding sampling gestures are the same, and the gesture recognition is finished; if d'min≥d″minThe user' S gesture to be recognized and the first candidate element are averaged in a gesture data set SaveThe corresponding sampling gesture is the same, and the gesture recognition is finished.