Disclosure of Invention
The invention aims to provide a forearm movement posture recognition method, an interface interaction control method and a forearm movement posture recognition device, which at least solve the defects in the related art to a certain extent.
In order to achieve the purpose, the technical scheme adopted by the invention is as follows:
a forearm motion gesture recognition method, the forearm motion gesture including a first motion gesture in which two forearms lift upward to intersect the chest at 45 degrees, the recognition method comprising the steps of: acquiring X-axis acceleration and Z-axis acceleration detected by a detector of the left wrist; acquiring X-axis acceleration and Z-axis acceleration detected by a detector of the right wrist; performing division operation on the X-axis acceleration and the Z-axis acceleration detected by the detector of the left wrist to obtain a first ratio; performing division operation on the X-axis acceleration and the Z-axis acceleration detected by the detector of the right wrist to obtain a second ratio; judging whether the first ratio and the second ratio fall into a first preset interval with 1 as the center; if yes, outputting that the forearm is in the first motion posture; wherein, the direction of the X axis is the same as the length direction of the front arm, and the direction of the Z axis is vertical to the top surface of the detector.
Preferably, the forearm movement posture further includes a second posture in which two forearms are lifted in parallel, and the recognition method further includes the steps of: and judging whether the X-axis acceleration detected by the detector of the left wrist and the X-axis acceleration detected by the detector of the right wrist both fall into a second preset interval with 9.8 as the center, and if so, outputting that the forearm is in the second motion posture.
Preferably, the forearm movement postures further comprise a third movement posture of a single-arm right pendulum and a fourth movement posture of a single-arm left pendulum, and the recognition method further comprises the following steps: acquiring the Y-axis angular velocity detected by a detector of the left wrist or the right arm; saving a plurality of Y-axis angular velocities acquired within a set time duration according to a time sequence to form a Y-axis angular velocity list; judging whether the position median in the Y-axis angular velocity list is the maximum value or the minimum value; if the position median is the maximum value, judging whether the position median is larger than a preset right swing threshold value; if the position median is larger than a preset right swing threshold value, outputting that the forearm is in the third motion posture; if the position median is the minimum value, judging whether the position median is smaller than a preset left swing threshold value; and if the position median is smaller than a preset left swing threshold value, outputting that the forearm is in the fourth motion posture.
A forearm motion gesture recognition device, comprising: the acceleration ratio acquisition module is used for performing division operation on the X-axis acceleration and the Z-axis acceleration detected by the detector of the left wrist to acquire a first ratio; performing division operation on the X-axis acceleration and the Z-axis acceleration detected by the detector of the right wrist to obtain a second ratio; the ratio judging module is used for judging whether the first ratio and the second ratio fall into a first preset interval with 1 as the center; and the result output module is used for outputting that the forearm is in the first motion posture when the first ratio and the second ratio both fall into a first preset interval taking 1 as the center.
Preferably, the forearm movement posture recognition device further includes: the acceleration acquisition module is used for acquiring the X-axis acceleration detected by the detector of the left wrist and the X-axis acceleration detected by the detector of the right wrist; the acceleration judging module is used for judging whether the X-axis acceleration detected by the detector of the left wrist and the X-axis acceleration detected by the detector of the right wrist both fall into a second preset interval with 9.8 as the center; and the result output module is also used for outputting that the forearm is in a second motion posture when the X-axis acceleration detected by the detector of the left wrist and the X-axis acceleration detected by the detector of the right wrist both fall into a second preset interval taking 9.8 as the center.
Preferably, the forearm movement posture recognition device further includes: the angular velocity acquisition module is used for acquiring the Y-axis angular velocity detected by the detector of the left wrist or the right arm; the angular velocity judging module is used for storing a plurality of Y-axis angular velocities acquired within a set time length according to a time sequence to form a Y-axis angular velocity list; judging whether the position median in the Y-axis angular velocity list is the maximum value or the minimum value; if the position median is the maximum value, judging whether the position median is larger than a preset right swing threshold value; if the position median is the minimum value, judging whether the position median is smaller than a preset left swing threshold value; the result output module is further used for outputting that the forearm is in a third motion posture when the position median is larger than a preset right swing threshold value, and outputting that the forearm is in a fourth motion posture when the position median is smaller than a preset left swing threshold value.
Preferably, the detector is a smart watch or a bracelet, and an IMU chip is arranged in the smart watch or the bracelet.
The control method of the interface interaction of the electronic equipment comprises the following steps: acquiring posture parameters output by a forearm movement posture recognition device; acquiring an interface interaction control rule; judging whether the attitude parameters meet the conditions of the interface interaction control rules or not; and if so, executing interface interaction operation corresponding to the interface interaction control rule. Wherein, the forearm movement gesture recognition device is any one of the forearm movement gesture recognition devices.
Control apparatus for electronic device interface interaction, comprising: the posture parameter acquisition module is used for acquiring posture parameters output by the forearm movement posture recognition device; the interface interaction control rule acquisition module is used for acquiring an interface interaction control rule of the electronic equipment; the judgment module is used for judging whether the attitude parameters meet the conditions of the interface interaction control rules or not; and the control execution module is used for executing the interface interaction operation corresponding to the interface interaction control rule when the attitude parameter meets the condition of the interface interaction control rule. Wherein, the forearm movement gesture recognition device is any one of the forearm movement gesture recognition devices.
An electronic device comprising a processor, a memory, and a computer program stored in the memory and executable by the processor, the electronic device implementing the steps of the control method of electronic device interface interaction as described above when the computer program is executed by the processor.
Compared with the prior art, the invention has at least the following beneficial effects:
the method can automatically recognize various motion postures of the forearm lifting crossing the chest, the parallel forearm lifting, the left swinging and the right swinging, and can automatically trigger the operation of the interface by utilizing the motion postures of the forearm, thereby improving the immersion feeling of games or software control.
Detailed Description
The invention is further illustrated with reference to the following figures and examples.
Four motion poses defined by some embodiments are shown in fig. 1. The method comprises the following steps: a first motion posture that the two forearms are lifted upwards to intersect at 45 degrees on the chest, a second motion posture that the two forearms are lifted upwards in parallel, a third motion posture of a right single-arm pendulum and a fourth motion posture of a left single-arm pendulum.
According to the invention, the electronic equipment automatically recognizes the motion gesture through a specific gesture recognition method, so that the automatic control of the interface interaction operation of the electronic equipment is realized. The details are as follows.
Fig. 2 shows a flow of the above-described first motion gesture recognition method. As shown in fig. 2, the method for recognizing the first motion gesture includes:
step S1-1, acquiring X-axis acceleration Lx and Z-axis acceleration Lz detected by the detector of the left wrist, and acquiring X-axis acceleration Rx and Z-axis acceleration Rz detected by the detector of the right wrist;
an Inertial Measurement Unit (IMU) chip is built in the detector, and the X-axis acceleration, the Y-axis acceleration, the Z-axis acceleration, the X-axis angular velocity, the Y-axis angular velocity, and the Z-axis angular velocity can be detected by the IMU chip. The detector that can be adopted is preferably but not limited to smart bracelet, smart watch, etc. with built-in IMU chip. The X-axis acceleration and the Z-axis acceleration can be acquired in real time through wired or wireless connection with the detector. The connection to the detector is preferably via a bluetooth module.
The definitions of the X, Y and Z axes are shown in fig. 3. As shown in fig. 3, the X-axis is oriented in the same direction as the length of the forearm, and the Z-axis is oriented perpendicular to the top surface of the detector.
Then, dividing the X-axis acceleration Lx and the Z-axis acceleration Lz detected by the detector of the left wrist to obtain a first ratio Lx/Lz; and (4) dividing the X-axis acceleration Rx and the Z-axis acceleration Rz detected by the detector of the right wrist to obtain a second ratio Rx/Rz.
And step S1-2, judging whether the first ratio Lx/Lz and the second ratio Rx/Rz fall into a first preset interval with 1 as the center.
In this embodiment, the first preset interval is specifically [ 0.95, 1.05 ]. The end value of the first preset interval can also be other values, and the value follows the following principle: the larger the range of the first preset interval is, the smaller the missing recognition probability is and the greater the false recognition probability is, whereas the smaller the range of the first preset interval is, the smaller the false recognition probability is and the greater the missing recognition probability is.
Step S1-3, when the first ratio Lx/Lz and the second ratio Rx/Rz both fall within the first preset interval centered at 1, further determining whether the state maintaining time exceeds a set time duration, where the set time duration is 1 second in this embodiment.
Specifically, after the first ratio Lx/Lz and the second ratio Rx/Rz both fall within a first preset interval centered at 1, determining whether the second reading state is present, if not, entering the second reading state, recording a timestamp when the second reading state is entered, and returning to step S1-1; if yes, judging whether the difference between the current time stamp and the time stamp in the second reading state is larger than 1, if not, returning to the step S1-1, and if so, executing the step S1-4.
And step S1-4, outputting that the forearm is in the first motion posture. In this embodiment, the first motion gesture corresponds to a cancel operation.
Fig. 4 shows a flow of the above-described recognition method of the second motion gesture. As shown in fig. 4, the method for recognizing the second motion gesture includes:
step S2-1, the X-axis acceleration La detected by the detector of the left wrist and the X-axis acceleration Ra detected by the detector of the right wrist are obtained.
As described in the foregoing step S1-1, the detector incorporates an IMU chip, and the X-axis acceleration can be detected by the IMU chip.
Step S2-2, it is determined whether both the X-axis acceleration La detected by the detector of the left wrist and the X-axis acceleration Ra detected by the detector of the right wrist fall within a second preset section centered at 9.8.
In this embodiment, the second preset interval is [ 9.5, 10 ]. The end value of the second preset interval can also be other values, and the value follows the following principle: the larger the range of the second preset interval is, the smaller the missing recognition probability is and the greater the false recognition probability is, whereas the smaller the range of the second preset interval is, the smaller the false recognition probability is and the greater the missing recognition probability is.
Step S2-3, after the X-axis acceleration La detected by the detector of the left wrist and the X-axis acceleration Ra detected by the detector of the right wrist both fall into the second preset interval, further determining whether the state maintaining time exceeds a set time period, where the set time period is 1 second in this embodiment.
Specifically, after the X-axis acceleration La detected by the detector of the left wrist and the X-axis acceleration Ra detected by the detector of the right wrist both fall within a second preset interval, determining whether the wrist is in the second reading state, if not, entering the second reading state, recording a timestamp when the wrist enters the second reading state, and returning to step S2-1; if yes, judging whether the difference between the current time stamp and the time stamp in the second reading state is larger than 1, if not, returning to the step S2-1, and if so, executing the step S2-4.
And step S2-4, outputting that the forearm is in the second motion posture. In this embodiment, the second motion gesture corresponds to a determination operation.
Fig. 5 shows a flow of the above-described recognition method of the third motion gesture and the fourth motion gesture. As shown in fig. 5, the method for recognizing the third motion gesture and the fourth motion gesture includes:
step S3-1, acquiring the Y-axis angular velocity detected by the detector of the left wrist or the right arm;
as described in the foregoing step S1-1, the detector incorporates an IMU chip, and the Y-axis angular velocity can be detected by the IMU chip.
Step S3-2, storing a plurality of Y-axis angular velocities acquired within a set time duration according to a time sequence to form a Y-axis angular velocity list;
in this embodiment, the set time period is specifically 1 second. The formed Y-axis angular velocity list is a kind of temporary list.
Step S3-3, judging whether the position median in the Y-axis angular velocity list is the maximum value; if not, go to step S3-4, if yes, go to step S3-5;
step S3-4, judging whether the position median in the Y-axis angular velocity list is the minimum value; if not, go to step S3-1; if yes, go to step S3-6;
step S3-5, judging whether the position median is larger than a preset right swing threshold value; if not, go to step S3-1; if yes, go to step S3-7;
step S3-6, judging whether the position median is smaller than a preset left swing threshold value; if not, go to step S3-1; if yes, go to step S3-8;
step S3-7, outputting that the forearm is in a third motion posture;
and step S3-8, outputting that the forearm is in the fourth motion posture.
As can be seen from the above, with the above technical solution, the processor can automatically recognize whether the forearm enters the first motion posture, the second motion posture, the third motion posture and the fourth motion posture.
A block diagram of the components of an embodiment of the forearm motion gesture recognition apparatus is shown in fig. 6. As shown in fig. 6, the forearm movement posture recognition device specifically includes the following modules:
the acceleration ratio acquisition module 1 is used for performing division operation on the X-axis acceleration and the Z-axis acceleration detected by the detector of the left wrist to acquire a first ratio; performing division operation on the X-axis acceleration and the Z-axis acceleration detected by the detector of the right wrist to obtain a second ratio;
the ratio judging module 2 is used for judging whether the first ratio and the second ratio fall into a first preset interval with 1 as the center;
and the result output module 7 is used for outputting that the forearm is in the first motion posture when the first ratio and the second ratio both fall into a first preset interval with 1 as the center.
The forearm movement gesture recognition device specifically comprises the following modules:
the acceleration acquisition module 3 is used for acquiring the X-axis acceleration detected by the detector of the left wrist and the X-axis acceleration detected by the detector of the right wrist;
the acceleration judging module 4 is used for judging whether the X-axis acceleration detected by the detector of the left wrist and the X-axis acceleration detected by the detector of the right wrist both fall into a second preset interval with 9.8 as the center;
and the result output module 7 is further configured to output that the forearm is in a second motion posture when the X-axis acceleration detected by the detector of the left wrist and the X-axis acceleration detected by the detector of the right wrist both fall within a second preset interval centered at 9.8.
The forearm movement gesture recognition device specifically comprises the following modules:
the angular velocity acquisition module 5 is used for acquiring the Y-axis angular velocity detected by the detector of the left wrist or the right arm;
the angular velocity determination module 6 is configured to store a plurality of Y-axis angular velocities acquired within a set time duration in a time sequence to form a Y-axis angular velocity list; judging whether the position median in the Y-axis angular velocity list is the maximum value or the minimum value; if the position median is the maximum value, judging whether the position median is larger than a preset right swing threshold value; if the position median is the minimum value, judging whether the position median is smaller than a preset left swing threshold value;
the result output module 7 is further configured to output that the forearm is in a third motion posture when the median value of the positions is greater than a preset right-swing threshold, and output that the forearm is in a fourth motion posture when the median value of the positions is less than a preset left-swing threshold.
Wherein, the detector is preferred to be built-in have intelligent wrist-watch or the bracelet of IMU chip, and intelligent wrist-watch or bracelet are preferred still to include bluetooth module to realize the wireless transmission who detects data.
The flow of the control method of the electronic device interface interaction is shown in fig. 7. As shown in fig. 7, the interface interaction control method specifically includes:
and step S4-1, acquiring the posture parameters output by the forearm movement posture recognition device.
The forearm movement posture recognition device is the forearm movement posture recognition device. In a specific implementation, the attitude parameter is preferably represented by a digital code, for example, 00 represents the first motion attitude, 01 represents the second motion attitude, 10 represents the third motion attitude, and 11 represents the fourth motion attitude.
And step S4-2, acquiring interface interaction control rules.
Specifically, the interface interaction operation includes a cancel operation, a determine operation, a left operation, and a right operation, and the interface interaction control rule specifically includes: the first motion posture corresponds to a cancel operation, the second motion posture corresponds to a confirm operation, the third motion posture corresponds to a right page turning operation, and the fourth motion posture corresponds to a left page turning operation.
The rules are pre-stored in the memory.
And step S4-3, judging whether the attitude parameters meet the conditions of the interface interaction control rules.
That is, it is determined whether the gesture parameters output in step S4-1 include gesture parameters corresponding to the interface interaction operation.
And step S4-4, if the posture parameters meet the conditions of the interface interaction control rules, executing the interface interaction operation corresponding to the interface interaction control rules.
For example, if the gesture parameter output in step S4-1 is 00, a cancel operation is performed; if the attitude parameter output in the step S4-1 is 01, executing a determination operation; if the posture parameter output by the step S4-1 is 10, executing a page turning operation to the right; if the gesture parameter output in step S4-1 is 11, a page turning operation to the left is performed.
Therefore, the control method realizes automatic control of interface interaction of the electronic equipment based on the motion posture of the forearm. Compared with the existing interface interaction mode of a mouse, a keyboard, a touch screen and the like, the control method can improve the immersion feeling of game or software control.
Compared with fingers, the forearm has larger action amplitude, so the IMU chip has the advantages of easy identification and low requirement on the precision of the sensor, and compared with precision sensors such as an optical sensor, the IMU chip has the advantage of low cost, so the automatic control of the interface interaction of the electronic equipment is realized by combining the IMU chip and the forearm, and the IMU chip has the advantages of reliable control and low cost.
A block diagram of the components of the control device for electronic device interface interaction is shown in fig. 8. As shown in fig. 8, the interface interaction control device specifically includes the following modules:
and the posture parameter acquisition module 8 is used for acquiring the posture parameters output by the forearm movement posture recognition device. Wherein the forearm movement posture recognition device is the forearm movement posture recognition device;
the interface interaction control rule obtaining module 9 is used for obtaining an interface interaction control rule of the electronic equipment;
the judgment module 10 is used for judging whether the attitude parameters meet the conditions of the interface interaction control rules;
and the control execution module 11 is configured to execute the interface interaction operation corresponding to the interface interaction control rule when the gesture parameter meets the condition of the interface interaction control rule.
An embodiment of the present invention further provides an electronic device, which includes a processor, a memory, and a computer program stored in the memory and capable of being executed by the processor, wherein when the computer program is executed by the processor, the electronic device implements the steps of the control method for interface interaction of the electronic device as described above.
The present invention has been described in detail with reference to the specific embodiments, and the detailed description is only for the purpose of helping those skilled in the art understand the present invention, and is not to be construed as limiting the scope of the present invention. Various modifications, equivalent changes, etc. made by those skilled in the art under the spirit of the present invention shall be included in the protection scope of the present invention.