CN112587901B - Swimming gesture recognition method, device, system and storage medium - Google Patents

Swimming gesture recognition method, device, system and storage medium Download PDF

Info

Publication number
CN112587901B
CN112587901B CN202011331030.2A CN202011331030A CN112587901B CN 112587901 B CN112587901 B CN 112587901B CN 202011331030 A CN202011331030 A CN 202011331030A CN 112587901 B CN112587901 B CN 112587901B
Authority
CN
China
Prior art keywords
air pressure
swimming
time window
value
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011331030.2A
Other languages
Chinese (zh)
Other versions
CN112587901A (en
Inventor
才正国
赵明喜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Anhui Huami Health Technology Co Ltd
Original Assignee
Anhui Huami Health Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Anhui Huami Health Technology Co Ltd filed Critical Anhui Huami Health Technology Co Ltd
Priority to CN202011331030.2A priority Critical patent/CN112587901B/en
Publication of CN112587901A publication Critical patent/CN112587901A/en
Application granted granted Critical
Publication of CN112587901B publication Critical patent/CN112587901B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63BAPPARATUS FOR PHYSICAL TRAINING, GYMNASTICS, SWIMMING, CLIMBING, OR FENCING; BALL GAMES; TRAINING EQUIPMENT
    • A63B71/00Games or sports accessories not covered in groups A63B1/00 - A63B69/00
    • A63B71/06Indicating or scoring devices for games or players, or for other sports activities
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63BAPPARATUS FOR PHYSICAL TRAINING, GYMNASTICS, SWIMMING, CLIMBING, OR FENCING; BALL GAMES; TRAINING EQUIPMENT
    • A63B2220/00Measuring of physical parameters relating to sporting activity
    • A63B2220/70Measuring or simulating ambient conditions, e.g. weather, terrain or surface conditions
    • A63B2220/74Atmospheric pressure
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63BAPPARATUS FOR PHYSICAL TRAINING, GYMNASTICS, SWIMMING, CLIMBING, OR FENCING; BALL GAMES; TRAINING EQUIPMENT
    • A63B2230/00Measuring physiological parameters of the user
    • A63B2230/62Measuring physiological parameters of the user posture

Landscapes

  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Physical Education & Sports Medicine (AREA)
  • Electric Clocks (AREA)

Abstract

The invention discloses a swimming gesture recognition method, a swimming gesture recognition device, a swimming gesture recognition system and a storage medium, wherein the method comprises the following steps: acquiring an air pressure numerical value sequence acquired by an air pressure meter in a first time window; analyzing the air pressure numerical sequence to determine a first swimming posture characteristic vector corresponding to a first time window; and identifying the first swimming posture feature vector to determine a first swimming posture of a user of wearing equipment where the barometer is located within a first time window. The method determines the swimming posture of a user in a certain time by the air pressure value collected by the air pressure meter in the time. Not only has high accuracy, but also has simple calculation and low power consumption.

Description

Swimming gesture recognition method, device, system and storage medium
Technical Field
The invention relates to the technical field of wearable equipment, in particular to a swimming posture recognition method, a swimming posture recognition device, a swimming posture recognition system and a storage medium.
Background
Along with the rapid development of intelligent wearable equipment, the function of wearable equipment is more and more, user group is more and more wide to wearable equipment that intelligent wrist-watch and bracelet represented provides probably for realizing the all-weather motion of the person of wearing and discerning. Especially for swimming sports, the recognition of swimming gestures is a focus of development of wearable devices.
At present, the main swimming gesture recognition method is to collect the motion data of the user in the swimming process through a 6-axis sensor (acceleration and gyroscope) or a 9-axis sensor (accelerometer, gyroscope and magnetometer), and further recognize the swimming gesture of the user.
However, the above scheme has the problems of high power consumption of the device, high identification complexity and large data volume needing to be processed.
Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the related art.
Therefore, the first purpose of the present invention is to provide a swimming posture recognition method, which not only has high accuracy, but also has simple calculation and low power consumption.
A second object of the present invention is to provide a swimming stroke recognition device.
A third object of the invention is to propose a swimming gesture recognition system.
A fourth object of the invention is to propose a storage medium.
In order to achieve the above object, a first aspect of the present invention provides a swimming stroke recognition method, including: acquiring an air pressure numerical value sequence acquired by an air pressure meter in a first time window; analyzing the air pressure numerical value sequence to determine a first swimming posture characteristic vector corresponding to the first time window; and identifying the first swimming posture feature vector to determine a first swimming posture of a user of wearing equipment where the barometer is located in a first time window.
According to the swimming posture identification method, firstly, an air pressure numerical sequence collected by an air pressure meter in a first time window is obtained, then the air pressure numerical sequence is analyzed to determine a first swimming posture characteristic vector corresponding to the first time window, and finally the first swimming posture characteristic vector is identified to determine a first swimming posture of a user of wearing equipment where the air pressure meter is located in the first time window. Therefore, the method determines the swimming posture of the user in a certain time by the air pressure value collected by the air pressure meter in the time. Not only has high accuracy, but also has simple calculation and low power consumption.
To achieve the above object, a second aspect of the present invention provides a swimming stroke recognition device, including: the acquisition module is used for acquiring an air pressure numerical value sequence acquired by an air pressure meter in a first time window; the first determination module is used for analyzing the air pressure numerical value sequence to determine a first swimming posture characteristic vector corresponding to the first time window; and the second determination module is used for identifying the first swimming posture feature vector so as to determine a first swimming posture of a user of the wearing equipment where the barometer is located in a first time window.
According to the swimming posture recognition device provided by the embodiment of the invention, the air pressure numerical sequence acquired by the air pressure meter in the first time window is acquired through the acquisition module, the air pressure numerical sequence is analyzed through the first determination module to determine the first swimming posture characteristic vector corresponding to the first time window, and the first swimming posture characteristic vector is recognized through the second determination module to determine the first swimming posture of the user of the wearing equipment where the air pressure meter is located in the first time window. Therefore, the device determines the swimming posture of the user in a certain time through the air pressure value collected in the time by the air pressure meter. Not only has high accuracy, but also has simple calculation and low power consumption.
To achieve the above object, a swimming stroke recognition system according to a third embodiment of the present invention includes: a processor; a memory for storing executable instructions of the processor; wherein the processor is configured to call up and execute the executable instructions stored in the memory to implement the swimming gesture recognition method set forth in the embodiments of the first aspect of the present invention.
According to the swimming gesture recognition system provided by the embodiment of the invention, when the processor calls and executes the executable instructions stored in the memory, the swimming gesture of the user in a certain time can be determined according to the air pressure value collected by the air pressure meter in the time. Not only has high accuracy, but also has simple calculation and low power consumption.
To achieve the above object, a fourth aspect of the present invention provides a storage medium having a computer program stored thereon, where the computer program is executed by a processor to implement the swimming stroke recognition method according to the first aspect of the present invention.
The storage medium, when the computer program stored thereon is executed by the processor, is capable of determining a swimming stroke of the user during a certain time by acquiring an air pressure value from the barometer during the time. Not only has high accuracy, but also has simple calculation and low power consumption.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
FIG. 1 is a flow chart of a swimming gesture recognition method according to an embodiment of the invention;
FIG. 2 is a flow diagram of a swim gesture recognition method according to one embodiment of the invention;
FIG. 3 is a flow chart of determining a first barometric pressure characteristic according to an example of the present disclosure;
FIG. 4 is a graph showing the variation of the barometric pressure values collected by a barometer in the freestyle mode;
FIG. 5A is a graph showing an actual variation curve of air pressure values in an indoor office scene and a swimming simulation graph according to a specific example of the present invention;
FIG. 5B is a graph showing an actual variation curve of air pressure values in a stair climbing scenario and a swimming simulation graph according to a specific example of the present invention;
fig. 5C is an actual variation curve of the air pressure value and a swimming simulation graph in a scene of riding an elevator according to a specific example of the present invention;
FIG. 5D is a graph of an actual variation of air pressure values in a swimming scenario and a swimming simulation graph, according to one specific example of the present invention;
fig. 5E is an actual variation curve of the air pressure value in the outdoor trip scene and a swimming simulation graph according to a specific example of the present invention;
FIG. 6 is a flow chart of determining a first swim stroke feature vector according to one example of the invention;
FIG. 7 is a flow chart for determining a first swim stroke feature vector according to another example of the invention;
FIG. 8 is a flow chart for determining a first swim stroke according to one embodiment of the present invention;
FIG. 9 is a flow chart of barometer-only swim gesture recognition according to a specific example of the invention;
FIG. 10 is a flow chart for verifying a first swim stroke according to an example of the present disclosure;
fig. 11 is a flowchart of swimming stroke recognition based on acceleration sensors only, according to a specific example of the present invention;
FIG. 12 is a flow chart of a process for merging swim gesture recognition according to an example of the present invention;
fig. 13 is a block diagram of a swimming stroke recognition device according to an embodiment of the present invention;
FIG. 14 is a block diagram of a swimming gesture recognition apparatus according to one embodiment of the present invention;
FIG. 15 is a block diagram of a swimming gesture recognition apparatus according to one example of the invention;
FIG. 16 is a block diagram of a swimming gesture recognition apparatus according to another example of the present invention;
fig. 17 is a block diagram of a swimming gesture recognition system according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
The method for recognizing the swimming posture of the user based on the barometric pressure value acquired by the barometer mainly considers that the existing method for recognizing the swimming posture based on the 6-axis and the 9-axis has high power consumption and complex data processing, has high requirements on the wearing angle, the wearing mode and the tightness of a wearer, and is not suitable for wearing equipment. The swimming stroke identification method based on the barometer is irrelevant to wearing angles, wearing modes and tightness, the differentiation influence of water and air on the barometer in the swimming process is focused on data dimensionality, the swimming stroke is identified by analyzing the air pressure difference under different swimming strokes, and the influence of various factors on the identification result in swimming and self is eliminated.
It should be noted that, regarding the recognition of swimming gestures, in consideration of the differences and commonalities between different users and different swimming gestures, the embodiment of the present invention performs the recognition of the swimming gestures based on a set of continuous barometric pressure value sequences over a period of time, and the swimming gestures recognized by the embodiment of the present invention include: free swimming, breaststroke, butterfly swimming, backstroke, etc. A swimming stroke recognition method, apparatus, system, and storage medium according to embodiments of the present invention will be described below with reference to the accompanying drawings.
Fig. 1 is a flowchart of a swimming stroke recognition method according to an embodiment of the present invention.
As shown in fig. 1, the swimming stroke recognition method includes the steps of:
s101, acquiring a pressure numerical value sequence acquired by a pressure meter in a first time window.
Wherein, the barometer is built-in user's the equipment of wearing, should wear equipment and can include earphone, earplug and wrist wearable equipment etc. wherein, wrist wearable equipment can include intelligent wrist-watch, bracelet etc..
The first time window is a time sequence including a current time and having a certain time width, and generally, in order to reliably capture various swimming actions of the user during swimming, the time length of the first time window may be set to be not less than 10s (seconds), and in order to ensure that the barometer can acquire a barometric value when the user goes out of or enters water, the sampling frequency of the barometer is not less than 2Hz (hertz).
Specifically, in practical application, the barometer built in the wearing device of the user acquires air pressure at a sampling frequency fs (fs is greater than or equal to 2Hz), and the air pressure is the absolute pressure of the environment where the wearing device is located. Then the barometer can collect n-T fs pressure values within each time window of time width T (T ≧ 10 s).
For example, assuming fs is 2Hz and T is 10s, n is 20, that is, the barometer can acquire 20 air pressure values within 10s at a sampling frequency of 2Hz, and the air pressure value sequence of the 20 air pressure values is X { X ═ X {1,x2,…,x20In which x1、x2The air pressure value collected by the barometer in the 1 st second is obtained; x is the number of3、x4The air pressure value collected by the barometer in the 2 nd second is obtained; x is the number of5、x6The air pressure value collected by the barometer in the 3 rd second is obtained; x is a radical of a fluorine atom7、x8The air pressure value collected by the barometer in the 4 th second is obtained; x is the number of9、x10The air pressure value collected by the barometer in the 5 th second is obtained; x is the number of11、x12The air pressure value collected by the barometer in the 6 th second is obtained; x is the number of13、x14The air pressure value collected by the barometer in the 7 th second is obtained; x is the number of15、x16The air pressure value collected by the barometer in the 8 th second is obtained; x is the number of17、x18For barometer acquisition within 9 secondsA value of air pressure; x is the number of19、x20The air pressure value collected by the barometer in the 10 th second is obtained.
It should be noted that, the barometer is generally in a normally open state (working state) as a basic module of a wearing device (especially, a smart watch or a bracelet) of a user. Therefore, the technical scheme of collecting the air pressure value through the barometer built in the wearing equipment and identifying the swimming posture based on the air pressure value sequence in the embodiment of the invention has higher feasibility, can be widely applied to the current wearing equipment, particularly intelligent watches and bracelets, and can realize all-weather swimming posture identification.
S102, analyzing the air pressure numerical sequence to determine a first swimming posture characteristic vector corresponding to a first time window.
It can be understood that, since the absolute pressure collected by the barometer when the barometer is underwater includes the liquid pressure generated by water, and the pressure collected by the barometer in the air is only the pressure value of the current environment, the air pressure collected by the barometer is continuously changed during the swimming process of a person, and the swimming postures of the user can be determined according to the change trend of the air pressure collected by the barometer in a certain time period due to different swimming postures and different movement frequencies and stay time periods in the air or in the water of the user.
Specifically, after the air pressure numerical value sequence X is obtained, the sequence X may be analyzed to determine that features of the air pressure numerical values in the time window are adjacent, such as the size of the air pressure numerical values, the duration and the variation trend of each air pressure numerical value, and the feature vector is the first swimming posture feature vector corresponding to the first time window.
S103, identifying the first swimming posture feature vector to determine a first swimming posture of a user of wearing equipment where the barometer is located in a first time window.
It should be noted that the machine training model may be obtained by performing machine training on different swimming postures of the user in advance to obtain swimming posture feature vectors corresponding to the different swimming postures.
Specifically, the first swimming posture feature vector can be deeply learned through a machine training model obtained in advance, so that a swimming posture recognition result corresponding to the first swimming posture feature vector is obtained, namely the first swimming posture of the user of the wearing equipment where the barometer is located in the first time window.
The swimming posture recognition method of the embodiment of the invention determines the swimming posture of the user in a certain time through the barometric pressure value collected in the time by the barometer. Not only has high accuracy, but also has simple calculation and low power consumption.
It should be noted that, only when the user is in the swimming state, the first swimming posture feature vector for identifying the swimming posture of the user can be further obtained after the air pressure numerical value sequence is obtained. Therefore, in the embodiment of the present invention, it is required to determine whether the user is in a swimming state, that is, to perform swimming detection, which is described in detail below.
In an embodiment of the present invention, before parsing the barometric pressure numerical sequence to determine the first swim style feature vector within the first time window, i.e. before performing step S102, as shown in fig. 2, the method further includes:
s201, preprocessing the air pressure numerical value sequence to determine a first air pressure characteristic value corresponding to a first time window.
It is understood that, if the user is in the swimming state in the first time window, the first time window necessarily includes the barometric pressure collected by the barometer when the user enters the water, and the barometric pressure value in the water is necessarily greater than the barometric pressure value in the air, so in the embodiment of the present application, the first barometric pressure characteristic value corresponding to the first time window may be the highest barometric pressure value in the sequence of barometric pressure values, or may be the average barometric pressure value of the first 3 highest barometric pressure values in the sequence of barometric pressure values, and so on.
Alternatively, the first air pressure characteristic value may also be determined in a manner as shown in fig. 3:
s301, calculating the absolute value of the difference value of every two adjacent air pressure values in the air pressure value sequence.
Specifically, the air pressure value collected by the air pressure meter in the first time window is obtainedAfter sequence X, the absolute value Q of the difference between two adjacent air pressure values is calculated byi
Qi=|xi+1-xi| (1)
Wherein i is more than or equal to 1 and less than or equal to n-1, xi+1、xiThe jump value represents the change degree of a user in water outlet and water inlet compared with a normal scene (the user is not in a swimming state).
For example, when n is 20, the absolute value Q of the difference between 19 adjacent air pressure values can be calculatediAre each Q1、Q2、…Q19
S302, determine a maximum absolute value of the absolute values of the differences as a first air pressure characteristic value corresponding to the first time window.
Specifically, the absolute value Q of the difference between n-1 two adjacent air pressure values is calculatediThen, the maximum value is determined, namely the maximum absolute value QmaxAnd determining the maximum absolute value as a first air pressure characteristic value corresponding to the first time window.
S202, judging whether the first air pressure characteristic value is not smaller than a water inlet change threshold value, if so, executing the step S102; if not, go to step S203.
S203, acquiring a barometric pressure count value sequence in the next time window.
The water entry change threshold value is a change value between two adjacent air pressure values acquired by the barometer before and after the water entry when the user is in a swimming state.
The water inlet change threshold may be calculated in advance from the air pressure value collected by the air pressure gauge when the user is in the swimming state, or may be calculated based on the historical air pressure value when the user is swimming, for example, the water inlet change threshold may be 400. The embodiments of the invention are not limited thereto.
Specifically, a first air pressure characteristic value Q corresponding to a first time window is determinedmaxThen, judgeFirst air pressure characteristic value QmaxWhether or not it is greater than or equal to the inlet variation threshold Qth1If Q ismax≥Qth1If so, it indicates that the user has water input action in the first time window, so that it can be determined that the user wearing the barometer is currently in a swimming state, and further, the steps S102 and S103 can be continuously performed to determine the current swimming posture of the user. If Q ismax<Qth1If so, it indicates that the user wearing the barometer is not currently in the swimming state, and then step S203 is executed, that is, the current window does not need to perform swimming stroke recognition, and the barometer value sequence in the next time window is continuously obtained.
Therefore, firstly, the maximum change value between two adjacent air pressure numerical values in a first time window is determined through simple calculation, if the user is determined to be in a swimming state according to the maximum change value, then the air pressure numerical value sequence in the first time window is analyzed, so that the swimming posture of the user in the first time window is determined; if the user is determined not to be in the swimming state according to the maximum change value, exiting the current detection step, so that the swimming detection of whether the user is in the swimming state is realized, the swimming posture identification of the user in the swimming state is realized, the calculation processing of the user in the first time window when the user is not in the swimming state is avoided, and the power consumption of wearing the equipment is further reduced.
In an example of the present invention, after determining the first air pressure characteristic value corresponding to the first time window, that is, after performing step S201, the method may further include: if the first air pressure characteristic value is smaller than the water inlet change threshold value and smaller than the air pressure threshold value, updating the current water outlet times; and if the current water outlet times are larger than the first threshold value, determining that the user is not in the swimming state currently.
The air pressure threshold refers to an absolute value of air pressure in the environment where the user is currently located. The air pressure threshold may be determined according to actual conditions, for example, according to an average value of air pressure values collected in a time window adjacent to the current time window, in which the previous user is not in the swimming state, or according to a common atmospheric pressure of an environment in which the user is currently located. Typically, the air pressure threshold may be 20.
Specifically, a first air pressure characteristic value Q corresponding to a first time window is determinedmaxThen, if the first air pressure characteristic value Q is judgedmaxLess than the inlet variation threshold Qth1And less than the air pressure threshold Qth2I.e. Qmax<Qth1And Qmax<Qth2Then, the jump value (Q) between all two adjacent air pressure values in the air pressure value sequence is described1、Q2、…Qn-1) If the change value of the air pressure when the user enters the water is not exceeded and the absolute value of the air pressure when the barometer is in the air is not exceeded, the user is not in the swimming state at this time, for example, the user may be in a short rest state or the user has finished exiting the swimming state.
At this time, it can be further determined which state the user is in at all times in the following manner.
Updating the current water outlet times N according to the following formula1According to the number of water outlet times N1Determining the state of the user:
N1=N2+1 (2)
wherein N is2Refers to the total water outlet times of the user before the current time. It should be noted that, when it is detected that the user is in the swimming state, the counting of the water outlet times of the user may be started, and the water outlet times may be stored in the memory for later recall. Then, if the current water outlet times are larger than the first threshold value, the user can be considered to have finished swimming.
Wherein the first threshold value Nth1The number of times of water outlet corresponding to the longest time that a user (or a barometer) stays in the air during swimming due to swimming change or rest is determined, if the current number of times of water outlet is N1Greater than a first threshold value Nth1I.e. N1>Nth1If the number of water outlet times is in an increasing state (i.e. the user is always in the air) in a plurality of consecutive time windows, then it indicates that the user has finished swimming, is not in a swimming state (because the swimming posture change or other rest action time in the middle of the user is not so long), and then subsequently,and swimming stroke recognition is not required.
It should be noted that, if the current water outlet times N1Is less than or equal to a first threshold value Nth1I.e. N1≤Nth1Then, it indicates that the user may change the swimming stroke or other rest actions on the way, and therefore, the swimming stroke recognition is needed subsequently.
Therefore, if the user is judged not to be in the swimming state according to the air pressure numerical sequence collected by the barometer in the first time window, the subsequent swimming gesture recognition process can be stopped, and the problem of resource waste caused by the fact that the swimming gesture recognition is carried out under the condition that the user is not in the swimming state is solved; and the problem of false recognition caused by neglecting the subsequent swimming stroke recognition of the user when the user changes the swimming stroke midway or has a rest in the swimming process is avoided.
In an example of the present invention, after determining the first air pressure characteristic value corresponding to the first time window, that is, after performing step S201, the method may further include: and if the first air pressure characteristic value is smaller than the water inlet change threshold value and is larger than or equal to the air pressure threshold value, determining that the motion state of the user in the first time window is the same as the motion state in the adjacent previous time window.
Specifically, if the first air pressure characteristic value QmaxLess than the inlet variation threshold Qth1And is greater than or equal to the air pressure threshold Qth2I.e. Qmax<Qth1And Qmax≥Qth2If the user is in the first time window, the change of the water entering and exiting of the user (compared with the change of the water entering and exiting in the adjacent previous time window) is not typical, but the barometer is not in the air, and because the change degree of the air pressure value collected by the barometer is usually relatively obvious when the user changes the swimming posture, the user in the time window can be considered to continue the motion state in the adjacent previous time window, namely the operation state. That is, in the above case, it can be determined that the motion state of the user in the first time window is the same as the motion state in the adjacent previous time window.
If the motion state in the previous time window is the swimming state, and the user is in the swimming state in the first time window, determining the swimming posture of the user in the first time window according to the step S102 and the step S103, namely according to the first air pressure characteristic value corresponding to the first time window; if the motion state in the previous time window is the non-swimming state, the user is not in the swimming state in the first time window, and subsequent swimming gesture recognition is not needed.
That is, in each time window, firstly, swimming detection is performed to detect whether the user is in a swimming state, and if the user is in the swimming state, swimming gesture recognition is performed in the current time window; and if the user is not in the swimming state, the swimming posture identification in the current time window is not needed.
Through the analysis, the first air pressure characteristic value Q is determined after the air pressure numerical value sequence in any time window is obtainedmaxAnd then judging whether the user is in a swimming state at present and whether the swimming stroke needs to be identified according to the relation between the first air pressure characteristic value and each air pressure threshold value. When the user is in the swimming state, determining which mode is adopted to perform subsequent swimming posture identification according to the first air pressure characteristic value, when the user is not in the swimming state, judging whether the user exits the swimming state according to the current times in the air, and if the user exits the swimming state, performing subsequent swimming posture identification.
As can be seen from the above example, in this embodiment, the jump between two adjacent barometric pressure values is used as a key, and whether the swimming device is in a swimming state or not is determined based on the barometer built in the wearable device, and the swimming posture needs to be identified, in order to illustrate the feasibility and reliability of the scheme, the following experiment verifies that:
for a smart watch or bracelet, the built-in barometer measures the absolute pressure of the environment in which the device is located. Then for a smart watch or bracelet in the air, the absolute pressure P measured by the barometerabsoluteEqual to the atmospheric pressure P at the position, altitude and air temperatureair. In general, the atmosphere rises every 12m (meters) in heightThe pressure was reduced by 100Pa (pascal). Therefore, suppose the atmospheric pressure at sea level is P0Then, at a location with an altitude h, the atmospheric pressure is:
Figure BDA0002795822270000081
that is, when the smart watch or bracelet is in such an environment, the absolute pressure P obtained by the built-in barometerabsoluteThe method comprises the following steps:
Figure BDA0002795822270000082
generally speaking, under the condition of normal use of the intelligent watch or bracelet wearer, the change of the wearing height of the intelligent watch or bracelet is small, and the absolute pressure obtained by the corresponding barometer also changes slightly.
In particular, when the wearer is on an elevator going up or down stairs, or going up or down stairs, the absolute pressure measured by the barometer will vary significantly, but considering that the speeds of the elevator going up or down stairs and going up or down stairs are constrained, i.e. the rate of change Δ P of the barometer per unit time (1 second)absoluteIn line with the height change rate ah. The following can be obtained:
Figure BDA0002795822270000091
in general, Δ h < 12, i.e., Δ P, can be satisfiedabsolute<100。
When the wearer is in swimming, namely under the condition that the intelligent watch or the bracelet is located at the depth H below the water surface within a certain time period, the absolute pressure P measured by the barometer at the momentabsoluteEqual to the atmospheric pressure P at the position, altitude and air temperatureairThe pressure P of the liquid generated by the liquid at the depthwaterThe sum of (a) and (b). Namely:
Figure BDA0002795822270000092
wherein, Pwater=ρ·g·H,
Figure BDA0002795822270000093
g=9.8N/kg。
The person of wearing is at the in-process of swimming, and when intelligent wrist-watch or bracelet got into degree of depth H under water from the air, the change volume of barometer measurement value was:
ΔPabsolute=9800·H (7)
generally, in the swimming process, the arm wearing the smart watch or the bracelet at least goes deep to 4cm under water, namely, in the process of entering the underwater depth H from the smart watch or the bracelet through air, assuming that the required time is 1 second (unit time), the absolute pressure of the barometer will obviously increase:
ΔPabsolute=392 (8)
comparing the absolute pressure change rate of the barometer in the air environment with the absolute pressure change rate of the barometer under water from the air, the absolute pressure change rate of the barometer under water from the air is obviously larger than that of the barometer under water from the air, namely the absolute pressure change rate of the barometer under water from the air is larger than that of the barometer in the air environment.
Fig. 4 shows a variation curve of a measurement output value (barometric pressure value) of a barometer in a scene where a user's arm (a smart watch worn on the arm or a barometer built in a bracelet) frequently goes out and enters water in a freestyle manner, and data on the curve is a barometer raw data.
Based on the above formula derivation and fig. 4, it can be seen that the core of the swimming test based on the barometer lies in capturing the jump between the measurement values of the adjacent barometers, and the jump is obviously severe due to the height change in the water outlet and water inlet compared with the normal scene, so that the method for swimming test based on the barometer provided by the embodiment of the invention has feasibility.
Also, fig. 5A, 5B, 5C, 5D, and 5E respectively show an actual variation curve of a measured output value of the barometer worn by the user in a scene where the user works indoors, goes up and down stairs, rides an elevator, goes out outdoors, and swims, and a swimming simulation curve, where the actual variation curve is obtained from a measured value of an actual output of the barometer, that is, barometer raw data (barometer raw data), and the swimming simulation curve is a swim detected barometric variation curve (swim detection simulation). According to the curves, the swimming simulation curves are stable under the scenes of indoor office work, going upstairs and downstairs, taking an elevator, going out outdoors and swimming, namely, stable swimming detection output is provided, the swimming detection curves are almost unchanged under the scenes of indoor office work, going upstairs and downstairs, taking an elevator and going out outdoors, and the swimming detection curves are greatly changed under the scene of swimming, so that the feasibility of the method for swimming detection based on the barometer provided by the embodiment of the invention is further shown.
Therefore, the jump between two adjacent air pressure values is taken as a key, whether the user is in the swimming state currently or not is determined based on the built-in barometer of the wearing device, and the swimming posture needs to be identified, so that the method and the device have feasibility and reliability.
In one embodiment of the invention, the first swim style feature vector QmaxMay include at least one of the following features: the method comprises the following steps of measuring the average value of air pressure, the variance of air pressure, the number of times of the air pressure meter entering and exiting the water surface, the first time length of the air pressure meter under water, the second time length of the air pressure meter under air, the average value of air pressure under water, the variance of air pressure under water, the quartile of air pressure under water or the ratio of air pressure under water.
Specifically, when the pressure value sequence X is acquired, X is { X ═ X1,x2,…,xnAfter the calculation, the pressure mean value f is calculated according to the following formulamean
Figure BDA0002795822270000101
Then, the barometric pressure variance f is calculated according to the following formulavar
Figure BDA0002795822270000102
In addition, the first swimming stroke feature vector QmaxThe method is determined by analyzing the air pressure numerical sequence, so the following examples of the invention provide methods for determining the number of times the barometer enters or exits the water surface, the first time length that the barometer is under water, the second time length that the barometer is in air, the underwater air pressure mean, the underwater air pressure variance, the underwater air pressure quartile and the underwater air pressure ratio. As shown in fig. 6, the first swimming stroke feature vector includes a first time period that the barometer is under water and a second time period that the barometer is in air, and the analyzing the barometric pressure value sequence to determine the first swimming stroke feature vector in the first time window may include the following steps:
s601, obtaining an air pressure numerical value sequence corresponding to a second time window, wherein a second air pressure characteristic value corresponding to the second time window is smaller than an air pressure threshold value, and the time distance between the second time window and the first time window is shortest.
Specifically, a time window which has the shortest time distance with the first time window and the corresponding air pressure characteristic value smaller than the air pressure threshold value is selected as a second time window, and then the air pressure numerical value sequence Y collected by the air pressure meter in the second time window is obtained.
And S602, determining the air pressure value at the current moment according to the average value of the air pressure value sequence corresponding to the second time window.
Specifically, after the air pressure numerical sequence Y corresponding to the second time window is obtained, a mean value of the air pressure numerical sequence Y is calculated, where the mean value is the air pressure value Y at the current time0I.e. the atmospheric pressure at that time.
S603, determining the times of the barometer entering and exiting the water surface and the time of the barometer entering and exiting the water surface, which are contained in the first time window, according to the air pressure value at the current time.
Specifically, the air pressure value y at the current time is calculated0Then, the corresponding air pressure of the first time windowN X of the numerical sequence XiObtaining x satisfying the following formulai
sign(xi-y0)·sign(xi-1-y0)<0 (11)
Wherein sign function is a sign function, and counting the air pressure value x satisfying the formula (11) in the first time windowi. If xi<y0、xi-1>y0In this case, xiIs the air pressure value, x, collected by the barometer when it is in the airi-1Is an air pressure value collected underwater; or, xi>y0、xi-1<y0In this case, xiIs the air pressure value, x, collected by the barometer in wateri-1Is the air pressure value collected while in air.
xiThe number of the barometer is the number of times of entering and exiting the water surface (the number of times of exiting and entering) contained in the first time window. x is the number ofiAnd the moment in the first time window is the moment when the barometer goes out of the water surface.
For example, X in the sequence of air pressure values X (assuming n is 20)iIs x2、x10、x16If the number of times of the barometer in and out of the water surface in the first time window is 3, the times of the barometer in and out of the water surface are 2, 10 and 16 in sequence, wherein 2 is a barometric value x210 is the air pressure value x10At the sampling time 16, is the air pressure value x16The sampling instant of (c).
S604, determining a first time length when the barometer is under water and a second time length when the barometer is in the air in the first time window according to every two adjacent water inlet and outlet moments.
Specifically, after the time of entering and exiting the water surface of the barometer contained in the first time window is determined, the time distance between two adjacent zero-crossing points is calculated, namely the time distance between two adjacent zero-crossing points x is calculated for the adjacent zero-crossing points xiAnd xjThe adjacent zero-crossing point x is calculated according to the following formulaiAnd xjTime distance d between:
d=|i-j|
(12)
since the zero crossing points of the air pressure numerical value represent the entrance and exit of the barometer from the water surface, the time distance d between two adjacent zero crossing points represents the duration of the barometer under water or in the air, and therefore the first time length of the barometer under water and the second time length of the barometer in the air can be calculated by calculating the time distance between two adjacent zero crossing points.
In this example, as shown in fig. 7, the first swimming stroke feature vector may further include: after determining the air pressure value at the current time, i.e., after the step S602, the method may further include the following steps:
s701, determining each underwater air pressure value contained in the air pressure value sequence collected by the air pressure meter in the first time window according to the air pressure value at the current moment.
Specifically, the air pressure value y at the current moment is determined0Then, a sequence of pressure values X ═ X { X } that can be collected for the barometer within the first time window1,x2,…,xnCounting the value y larger than the air pressure0Pressure value x ofiThat is, the statistics satisfy xi>y0Each air pressure value xiI.e. each underwater air pressure value, i.e. greater than y0Each air pressure value xi
S702, determining an underwater air pressure mean value, an underwater air pressure variance, an underwater air pressure quartile and an underwater air pressure ratio in a first time window according to each underwater air pressure value.
Specifically, each of y and y is determined0Each air pressure value xi(forming a set of air pressure values), calculating the set of air pressure values (e.g., x)2、x3、x10And x16) The underwater air pressure mean value and the underwater air pressure variance in the first time window can be obtained, wherein the underwater air pressure mean value represents the underwater average depth of the barometer, and the underwater air pressure variance represents the underwater depth change intensity of the barometer. Calculating 25%, 50% andand obtaining a 25 quantile value, a 50 quantile value and a 75 quantile value by using a 75% quantile value, namely an underwater air pressure quartile, wherein the underwater air pressure quartile describes the underwater depth distribution of the barometer. And if the number m of the underwater air pressure values contained in the air pressure value sequence is counted, the underwater air pressure duty ratio is m/n, and the underwater air pressure duty ratio represents the underwater time distribution of the barometer, so that the time distribution of the barometer in the air can be obtained.
Therefore, the specific first swimming posture characteristic vector in the first time window can be determined by analyzing the air pressure value in the first time window.
In addition, according to the embodiment of the application, when the swimming stroke of the user is determined according to the air pressure numerical value sequence collected by the barometer in a time window, the confidence coefficient of the currently determined swimming stroke can be given, so that when the confidence coefficient is low, the swimming stroke can be corrected in time. That is, in one embodiment of the present invention, as shown in fig. 8, recognizing the first swim stroke feature vector to determine the first swim stroke within the first time window may include:
s801, identifying the first swim gesture feature vector by using a first preset classification model to determine a first swim gesture and a first confidence value within a first time window.
It should be noted that, a plurality of groups of air pressure values of different people under different swimming postures can be collected in advance, swimming posture feature vectors are calculated after sliding windows of the air pressure values are grouped, a training set and a verification set composed of the feature vectors are formed, and a machine learning (for example, a Back Propagation (BP) neural network) training model is performed to obtain a swimming posture feature vector-swimming posture model, which is a first preset classification model.
Specifically, as shown in fig. 9, after a first swimming posture feature vector (at least one feature of an air pressure mean, an air pressure variance, a number of times that the barometer goes out of and goes out of the water surface, a first time period that the barometer is under water, a second time period that the barometer is in air, an underwater air pressure mean, an underwater air pressure variance, an underwater air pressure quartile and an underwater air pressure ratio) in a first time window is determined, considering that dimensions of the features are different, normalization processing is performed on the features first to avoid that some features are ignored due to too small dimensions, and then the features after the normalization processing are identified by using a first preset classification model to determine a first swimming posture and a corresponding first confidence value in the first time window. Wherein the first confidence value represents the degree of confidence in the first swimming stroke obtained by the above method.
Further, with continued reference to fig. 8, after determining the first swimming stroke and the first confidence value within the first time window, i.e. after step S801, the method may further include:
s802, if the first confidence value is smaller than a second threshold value, starting the acceleration sensor to acquire an acceleration sequence acquired by the acceleration sensor in a third time window.
The second threshold may be set as needed, such as 0.8, 0.9, or 0.95, etc.
Specifically, after the first swimming stroke and the first confidence value within the first time window are determined, if the first confidence value is smaller than the second threshold value, the confidence level of the first swimming stroke at the moment is lower, so that an acceleration sensor built in wearing equipment of the user can be started to assist in realizing the identification of the swimming stroke. Specifically, an acceleration sequence acquired by the acceleration sensor in the third time window can be acquired, so that the swimming posture of the user is further judged according to the acceleration characteristic of the user in the time window.
Specifically, the sampling frequency fs of the acceleration sensor may be the same as or different from the sampling frequency fs (fs ≧ 2Hz) of the barometer, and correspondingly, the time width of the third time window may be the same as or different from the time width T (T ≧ 10s) of the first time window.
For example, if the acceleration sensor acquires the acceleration sequence a in the third time window, where a is ═ u1,u2,…,un;v1,v2,…,vn;w1,w2,…,wn;a1,a,…,anIn which uiAcceleration in the x-axis, viAcceleration in the y-axis, wiAcceleration in the z-axis, aiThe resultant acceleration amplitude at time i, i.e.:
Figure BDA0002795822270000131
and n is T fs, n is not less than 20.
And S803, verifying the first swimming posture according to the acceleration sequence collected by the acceleration sensor in the third time window.
It can be understood that, since the acceleration change states of the user are different in different swimming postures, in the embodiment of the present application, the swimming posture of the user may be determined based on an acceleration sequence within a certain time period, for example, according to a change trend, a frequency, and the like of the acceleration.
In one implementation, as shown in fig. 10, the user's swim stroke may be verified according to an acceleration sequence in the following manner:
and S1001, analyzing an acceleration sequence acquired by the acceleration sensor in a third time window to determine a second swimming posture feature vector corresponding to the third time window.
In this example, the second swim stroke feature vector includes at least one of the following features: acceleration mean, acceleration variance, number of acceleration zero crossings, quartile, skewness, kurtosis, extremum, main peak position corresponding to the acceleration sequence, main peak value corresponding to the acceleration sequence or peak number contained in the acceleration sequence.
Specifically, after the acceleration sequence is obtained, the acceleration mean, the acceleration variance, and the number of zero-crossing accelerations of the acceleration sequence are calculated, then a waveform obtained by autocorrelation of the acceleration sequence is calculated, and the number of peaks in the acceleration sequence can be determined according to the autocorrelation waveform, where a peak is a local extreme point where the distance from the position of an adjacent peak meets a certain spacing constraint condition and the peak width meets a certain constraint condition, and a main peak in the peaks is a peak with the largest corresponding amplitude, so that the position of the main peak and the main peak (the amplitude corresponding to the position of the main peak) are further determined.
The quartile of the acceleration sequence can be used for describing a distribution interval of the acceleration in the third time window; skewness and kurtosis of the acceleration sequence can be used for describing the distribution characteristics of the acceleration in the third time window; extreme values of the acceleration sequence may be used to describe the severity of the fluctuation of the acceleration within the third time window; the position of the main peak corresponding to the acceleration sequence, the main peak value corresponding to the acceleration sequence, and the number of peaks included in the acceleration sequence may all be used to describe the periodicity of the acceleration in the third time window.
S1002, identifying the second swim gesture feature vector by using a second preset classification model to determine a second swim gesture and a second confidence value within a third time window.
It should be noted that acceleration of a plurality of groups of different people under different swimming postures can be collected in advance, swimming posture feature vectors are calculated after sliding windows of the acceleration are grouped, a training set and a verification set composed of the feature vectors are formed, and a machine learning (such as a BP neural network) training model is performed to obtain a swimming posture feature vector-swimming posture model, namely a second preset classification model.
Specifically, as shown in fig. 11, after the second swimming stroke feature vector is determined, considering that the dimensions of the features are different, the features are normalized first to avoid that some features are ignored due to too small dimensions, and then the normalized features are identified by using a second preset classification model to determine the second swimming stroke and the corresponding second confidence value in a third time window. Wherein the second confidence value represents the degree of confidence in the second swimming stroke obtained by the above method.
And S1003, verifying the first swimming posture according to the second swimming posture and the second confidence value.
In one example, the verifying the first swimming stroke according to the second swimming stroke and the second confidence value, i.e. the step S1003 may include: if the second swimming stroke is a non-legal swimming stroke, it is determined that the user is currently in a swimming pause state.
In one example, the verifying the first swimming stroke according to the second swimming stroke and the second confidence value, that is, the step S1003 may further include: if the second swim gesture is a legal swim gesture and the second confidence is greater than the second threshold, then the swim gestures within the first and third time windows are determined to be the second swim gesture.
In one example, the verifying the first swimming stroke according to the second swimming stroke and the second confidence value, that is, the step S1003 may further include: if the second swimming posture is a legal swimming posture and the second confidence coefficient is less than or equal to a second threshold value, acquiring first weight values respectively corresponding to various swimming postures output by the first preset classification model and second weight values respectively corresponding to various swimming postures output by the second preset classification model; and determining the swimming postures in the first time window and the third time window according to the first weight values and the second weight values respectively corresponding to the various swimming postures.
Specifically, after the second swimming stroke and the second confidence value are determined, whether the second swimming stroke is a legal swimming stroke or an illegal swimming stroke can be determined, wherein the legal swimming stroke comprises: free, breaststroke, butterfly and backstroke; an illegal swimming style refers to a user's engagement or rest action during swimming other than a stroke (i.e., the user is in the water but not performing the stroke), such as adjusting goggles, swimming caps, etc.
As shown in fig. 12, if the second swimming stroke is an illegal stroke, it indicates that the user is currently in the swimming pause stage, but does not exit the swimming state; if the second swimming stroke is legal and the second confidence value is greater than the second threshold, it indicates that the user is swimming and performing periodic stroke motion, and the obtained result of the second swimming stroke is more reliable and reliable.
Referring to fig. 12, if the second swimming stroke is a legal swimming stroke and the second confidence value is less than or equal to the second threshold, it indicates that the user is performing a periodic stroke (i.e., swimming), and the confidence level of the result of the second swimming stroke is not high, and the confidence level of the result of the first swimming stroke is not high, so it can be seen that the accuracy of the first swimming stroke or the second swimming stroke obtained by the embodiment of the present invention is not high, i.e., the accuracy of the first swimming stroke or the second swimming stroke is not high, and therefore, in order to improve the accuracy of the swimming stroke recognition, the first swimming stroke and the second swimming stroke may be used as alternatives to perform a fusion process to determine the swimming strokes within the first time window and the second time window. The fusion treatment process is as follows:
first, first weight values corresponding to various swimming postures output by a first preset classification model and second weight values corresponding to various swimming postures output by a second preset classification model are obtained, for example, when the first swimming postures obtained only based on a barometer are sibCorresponding first weight value pibAnd each second swimming stroke obtained based on only the acceleration sensor is siaCorresponding second weight values pia
Then, the swimming stroke recognition result s is calculated according to the following formula:
Figure BDA0002795822270000151
wherein alpha is a weight coefficient, and the size range of alpha is more than 0 and less than 1.
Since the results of the recognition of the swimming gestures in the adjacent sliding windows should have continuity and stability in the time dimension, the swimming gesture result output smoothly by the current window is most of the current and previous W-1 window results (maj authority), that is:
Figure BDA0002795822270000161
thus, the swimming postures in the first time window and the third time window can be determined.
In summary, when the swimming posture recognition method provided by the embodiment of the invention is used for detecting the swimming posture of a user only based on the barometer built in the user wearing equipment, if the confidence is low, the acceleration sensor can be dynamically started to assist the swimming posture recognition, and a negative sample class (illegal swimming posture) is added to cover the scenes that the wearer is in water but does not have periodic stroke motion, so that the swimming posture misrecognition only depending on the barometer under the condition is reduced, the recognition results given by the two barometers and the acceleration sensor are subjected to fusion processing, and meanwhile, the smooth fusion within multiple windows is performed in the time dimension, so that the swimming posture recognition result is more robust and smooth.
Based on the same inventive concept, an embodiment of the present invention provides a swimming stroke recognition device, and fig. 13 is a block diagram of the swimming stroke recognition device according to an embodiment of the present invention.
As shown in fig. 13, the swimming stroke recognition apparatus 100 includes an acquisition module 10, a first determination module 20, and a second determination module 30.
The acquiring module 10 is configured to acquire an air pressure numerical sequence acquired by an air pressure meter in a first time window; the first determining module 20 is configured to analyze the air pressure numerical sequence to determine a first swimming posture feature vector corresponding to the first time window; the second determining module 30 is configured to identify the first swimming gesture feature vector to determine a first swimming gesture of a user of the wearing device where the barometer is located within a first time window.
In one embodiment, as shown in fig. 14, the swimming gesture recognition device 100 may further include: a third determination module 40 and a fourth determination module 50.
The third determining module 40 is configured to pre-process the air pressure numerical value sequence to determine a first air pressure characteristic value corresponding to the first time window; the fourth determination module 50 is configured to determine that the first air pressure characteristic is not less than the inlet water change threshold.
In one example, the third determination module 40 may be specifically configured to: calculating the absolute value of the difference value of every two adjacent air pressure values in the air pressure value sequence; and determining the maximum absolute value of the absolute values of the difference values as a first air pressure characteristic value corresponding to the first time window.
In one example, as shown in fig. 15, the swimming gesture recognition device 100 may further include: an update module 60 and a fifth determination module 70. The updating module 60 is configured to update the current water outlet frequency if the first air pressure characteristic value is smaller than the water inlet change threshold and smaller than the air pressure threshold; the fifth determining module 70 is used for determining that the user is not currently in the swimming state if the current water outlet times are larger than the first threshold value.
In one example, as shown in fig. 16, the swimming gesture recognition device 100 may further include: a sixth determining module 80. The sixth determining module 80 is configured to determine that the motion state of the user in the first time window is the same as the motion state in the adjacent previous time window if the first air pressure characteristic value is smaller than the inlet water variation threshold and greater than or equal to the air pressure threshold.
In one example, the first swim stroke feature vector includes at least one of the following features: the method comprises the following steps of measuring the average value of air pressure, the variance of air pressure, the number of times of the air pressure meter entering and exiting the water surface, the first time length of the air pressure meter under water, the second time length of the air pressure meter under air, the average value of air pressure under water, the variance of air pressure under water, the quartile of air pressure under water or the ratio of air pressure under water.
In one example, the first swim gesture feature vector includes a first time period that the barometer is underwater and a second time period that the barometer is in the air, and the first determining module 20, when parsing the sequence of barometric pressure values to determine the first swim gesture feature vector within the first time window, is configured to: acquiring an air pressure numerical value sequence corresponding to a second time window, wherein a second air pressure characteristic value corresponding to the second time window is smaller than an air pressure threshold value, and the time distance between the second time window and the first time window is shortest; determining the air pressure value at the current moment according to the average value of the air pressure value sequence corresponding to the second time window; determining the times of the barometer entering and exiting the water surface and the time of the barometer entering and exiting the water surface, which are contained in the first time window, according to the air pressure value at the current moment; and determining the first time length of the air pressure meter under water in the first time window and the second time length of the air pressure meter in the air according to every two adjacent water inlet and outlet moments.
In one example, the first swimming stroke feature vector further includes: the first determining module 20, after determining the air pressure value at the current moment, may further be configured to: determining each underwater air pressure value contained in the air pressure value sequence acquired by the air pressure meter in the first time window according to the air pressure value at the current moment; and determining the underwater air pressure mean value, the underwater air pressure variance, the underwater air pressure quartile and the underwater air pressure ratio in the first time window according to the underwater air pressure values.
In one example, second determination module 30, in identifying the first swim stroke feature vector to determine the first swim stroke within the first time window, may be operative to: the first swim gesture feature vector is identified using a first preset classification model to determine a first swim gesture and a first confidence value within a first time window.
In one example, the second determination module 30, after determining the first swim stroke and the first confidence value within the first time window, may be further operable to: if the first confidence value is smaller than a second threshold value, starting the acceleration sensor to acquire an acceleration sequence acquired by the acceleration sensor in a third time window; and verifying the first swimming posture according to an acceleration sequence acquired by the acceleration sensor in the third time window.
In an example, the second determining module 30, when verifying the first swimming stroke within the first time window according to the acceleration sequence acquired by the acceleration sensor within the third time window, may specifically be configured to: analyzing an acceleration sequence acquired by the acceleration sensor in a third time window to determine a second swimming posture feature vector corresponding to the third time window; identifying the second swimming posture feature vector by using a second preset classification model to determine a third swimming posture and a second confidence value in a third time window; and verifying the first swimming gesture according to the second swimming gesture and the second confidence value.
In one example, the second determining module 30, when verifying the first swimming stroke according to the second swimming stroke and the second confidence value, is specifically configured to: if the second swimming stroke is a non-legal swimming stroke, determining that the user is currently in a swimming pause state; if the second swim gesture is a legal swim gesture and the second confidence value is greater than the second threshold, determining the swim gestures within the first time window and the third time window as the second swim gesture; if the second swimming posture is a legal swimming posture and the second confidence value is smaller than or equal to the second threshold value, acquiring first weight values respectively corresponding to various swimming postures output by the first preset classification model and second weight values respectively corresponding to various swimming postures output by the second preset classification model; and determining the swimming postures in the first time window and the third time window according to the first weight values and the second weight values respectively corresponding to the various swimming postures.
In one example, the second swim stroke feature vector includes at least one of the following features: acceleration mean, acceleration variance, number of acceleration zero crossings, quartile, skewness, kurtosis, extremum, main peak position corresponding to the acceleration sequence, main peak value corresponding to the acceleration sequence or peak number contained in the acceleration sequence.
It should be noted that, for specific embodiments of the swimming gesture recognition device, reference may be made to the above-mentioned specific embodiments of the swimming gesture recognition method, and details are not described here again to avoid redundancy.
The swimming posture recognition device of the embodiment of the invention determines the swimming posture of the user in a certain time through the air pressure value collected in the certain time by the air pressure meter. Not only has high accuracy, but also has simple calculation and low power consumption.
Fig. 17 is a block diagram of a swimming stroke recognition system according to an embodiment of the present invention.
As shown in fig. 17, the swimming stroke recognition system 200 includes the swimming stroke recognition apparatus 100 according to the above embodiment of the present invention.
The swimming posture recognition system of the embodiment of the invention can determine the swimming posture of the user in a certain time through the air pressure value collected in the certain time by the air pressure meter by the swimming posture recognition device of the embodiment of the invention. Not only has high accuracy, but also has simple calculation and low power consumption.
The embodiment of the present invention further provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the swimming gesture recognition method described above in the embodiment of the present invention is implemented.
The storage medium, when the computer program stored thereon is executed by the processor, is capable of determining a swimming stroke of the user during a certain time by acquiring an air pressure value from the barometer during the time. Not only has high accuracy, but also has simple calculation and low power consumption.
It should be noted that the logic and/or steps represented in the flowcharts or otherwise described herein, such as an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
In the description of the present invention, it is to be understood that the terms "central," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," "counterclockwise," "axial," "radial," "circumferential," and the like are used in the orientations and positional relationships indicated in the drawings for convenience in describing the invention and to simplify the description, and are not intended to indicate or imply that the referenced devices or elements must have a particular orientation, be constructed and operated in a particular orientation, and are therefore not to be considered limiting of the invention.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or to implicitly indicate the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
In the present invention, unless otherwise expressly stated or limited, the terms "mounted," "connected," "secured," and the like are to be construed broadly and can, for example, be fixedly connected, detachably connected, or integrally formed; can be mechanically or electrically connected; they may be directly connected or indirectly connected through intervening media, or they may be interconnected within two elements or in a relationship where two elements interact with each other unless otherwise specifically limited. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
In the present invention, unless expressly stated or limited otherwise, the first feature "on" or "under" the second feature may be directly contacting the second feature or the first and second features may be indirectly contacting each other through intervening media. Also, a first feature "on," "over," and "above" a second feature may be directly or diagonally above the second feature, or may simply indicate that the first feature is at a higher level than the second feature. A first feature being "under," "below," and "beneath" a second feature may be directly under or obliquely under the first feature, or may simply mean that the first feature is at a lesser elevation than the second feature.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (24)

1. A swimming gesture recognition method, comprising:
acquiring an air pressure numerical value sequence acquired by an air pressure meter in a first time window;
analyzing the air pressure numerical value sequence to determine a first swimming posture characteristic vector corresponding to the first time window;
identifying the first swimming posture feature vector to determine a first swimming posture of a user of wearing equipment where the barometer is located within a first time window;
before the analyzing the barometric pressure numerical sequence to determine a first swim style feature vector within the first time window, the method further includes:
preprocessing the air pressure numerical value sequence to determine a first air pressure characteristic value corresponding to the first time window;
determining that the first air pressure characteristic value is not smaller than a water inlet change threshold value;
after the determining the first air pressure characteristic value corresponding to the first time window, the method further includes:
if the first air pressure characteristic value is smaller than the water inlet change threshold and smaller than the air pressure threshold, updating the current water outlet times;
and if the current water outlet times are larger than a first threshold value, determining that the user is not in a swimming state currently.
2. The method of claim 1, wherein preprocessing the sequence of air pressure values to determine a first air pressure characteristic corresponding to the first time window comprises:
calculating the absolute value of the difference value of every two adjacent air pressure values in the air pressure value sequence;
and determining the maximum absolute value of the absolute values of the difference values as a first air pressure characteristic value corresponding to the first time window.
3. The method of claim 1, wherein after said determining the first barometric pressure characteristic corresponding to the first time window, further comprising:
and if the first air pressure characteristic value is smaller than the water inlet change threshold value and not smaller than the air pressure threshold value, determining that the motion state of the user in the first time window is the same as the motion state in the adjacent previous time window.
4. A method according to any one of claims 1-3, wherein the first swim stroke feature vector comprises at least one of the following features: the device comprises an air pressure mean value, an air pressure variance, the number of times the barometer is taken in and out of the water surface, a first time length when the barometer is under water, a second time length when the barometer is in the air, an underwater air pressure mean value, an underwater air pressure variance, an underwater air pressure quartile or an underwater air pressure ratio.
5. The method of claim 4, wherein the first swim style feature vector comprises a first time period that the barometer is underwater and a second time period that the barometer is in air, and wherein parsing the sequence of barometric pressure values to determine the first swim style feature vector within the first time window comprises:
acquiring an air pressure numerical value sequence corresponding to a second time window, wherein a second air pressure characteristic value corresponding to the second time window is smaller than the air pressure threshold value, and the time distance between the second time window and the first time window is shortest;
determining the air pressure value at the current moment according to the average value of the air pressure value sequence corresponding to the second time window;
determining the times of the barometer entering and exiting the water surface and the time of the barometer entering and exiting the water surface, which are contained in the first time window, according to the air pressure value at the current moment;
and determining a first time length of the barometer under water in the first time window and a second time length of the barometer in the air according to every two adjacent water inlet and outlet moments.
6. The method of claim 5, wherein the first swim stroke feature vector further comprises: the method comprises the following steps of determining the average value of the underwater air pressure, the variance of the underwater air pressure, the quartile of the underwater air pressure and the ratio of the underwater air pressure, and after determining the value of the air pressure at the current moment, further comprising the following steps:
determining each underwater air pressure value contained in the air pressure value sequence collected by the air pressure meter in the first time window according to the air pressure value at the current moment;
and determining the underwater air pressure mean value, the underwater air pressure variance, the underwater air pressure quartile and the underwater air pressure ratio in the first time window according to the underwater air pressure values.
7. The method of any one of claims 1-3, wherein the identifying the first swim gesture feature vector to determine the first swim gesture within the first time window comprises:
the first swim gesture feature vector is identified using a first preset classification model to determine a first swim gesture and a first confidence value within the first time window.
8. The method of claim 7, after the determining the first swim stroke and the first confidence value within the first time window, further comprising:
if the first confidence value is smaller than a second threshold value, starting an acceleration sensor to acquire an acceleration sequence acquired by the acceleration sensor in a third time window;
and verifying the first swimming posture according to an acceleration sequence acquired by the acceleration sensor in a third time window.
9. The method of claim 8, wherein the verifying the first swim stroke within the first time window from the acceleration sequence acquired by the acceleration sensor within a third time window comprises:
analyzing an acceleration sequence acquired by the acceleration sensor in a third time window to determine a second swimming posture feature vector corresponding to the third time window;
identifying the second swimming stroke feature vector by using a second preset classification model to determine a third swimming stroke and a second confidence value in the third time window;
and verifying the first swimming gesture according to the second swimming gesture and the second confidence value.
10. The method of claim 9, wherein verifying the first swim stroke based on the second swim stroke and a second confidence value comprises:
if the second swimming stroke is a non-legal swimming stroke, determining that the user is currently in a swimming pause state;
if the second swim gesture is a legal swim gesture and the second confidence value is greater than a second threshold value, determining that the swim gestures within the first time window and the third time window are second swim gestures;
if the second swimming posture is a legal swimming posture and the second confidence value is smaller than or equal to a second threshold value, acquiring first weight values respectively corresponding to various swimming postures output by the first preset classification model and second weight values respectively corresponding to various swimming postures output by the second preset classification model;
and determining the swimming postures in the first time window and the third time window according to the first weight values and the second weight values respectively corresponding to the various swimming postures.
11. The method of claim 9, wherein the second swim stroke feature vector includes at least one of the following features: acceleration mean, acceleration variance, number of acceleration zero crossings, quartile, skewness, kurtosis, extremum, position of main peak corresponding to the acceleration sequence, or number of peaks included in the acceleration sequence.
12. A swimming stroke recognition device, comprising:
the acquisition module is used for acquiring an air pressure numerical value sequence acquired by an air pressure meter in a first time window;
the first determination module is used for analyzing the air pressure numerical value sequence to determine a first swimming posture characteristic vector corresponding to the first time window;
the second determination module is used for identifying the first swimming posture feature vector so as to determine a first swimming posture of a user of the wearing equipment where the barometer is located in a first time window;
the third determining module is used for preprocessing the air pressure numerical value sequence to determine a first air pressure characteristic value corresponding to the first time window;
the fourth determining module is used for determining that the first air pressure characteristic value is not smaller than a water inlet change threshold value;
the updating module is used for updating the current water outlet times if the first air pressure characteristic value is smaller than the water inlet change threshold and smaller than the air pressure threshold;
and the fifth determining module is used for determining that the user is not in the swimming state currently if the current water outlet times are larger than a first threshold value.
13. The apparatus of claim 12, wherein the third determining module is specifically configured to:
calculating the absolute value of the difference value of every two adjacent air pressure values in the air pressure value sequence;
and determining the maximum absolute value of the absolute values of the difference values as a first air pressure characteristic value corresponding to the first time window.
14. The apparatus of claim 12, further comprising:
a sixth determining module, configured to determine that the motion state of the user in the first time window is the same as the motion state in an adjacent previous time window if the first air pressure characteristic value is smaller than the water entry change threshold and not smaller than the air pressure threshold.
15. The apparatus of any of claims 12-14, wherein the first swim stroke feature vector comprises at least one of the following features: the device comprises an air pressure mean value, an air pressure variance, the number of times the barometer is taken in and out of the water surface, a first time length when the barometer is under water, a second time length when the barometer is in the air, an underwater air pressure mean value, an underwater air pressure variance, an underwater air pressure quartile or an underwater air pressure ratio.
16. The apparatus of claim 15, wherein the first swim style feature vector comprises a first time period that the barometer is underwater and a second time period that the barometer is in air, and wherein the first determining module, when parsing the sequence of barometric pressure values to determine the first swim style feature vector within the first time window, is configured to:
acquiring an air pressure numerical value sequence corresponding to a second time window, wherein a second air pressure characteristic value corresponding to the second time window is smaller than the air pressure threshold value, and the time distance between the second time window and the first time window is shortest;
determining the air pressure value at the current moment according to the average value of the air pressure value sequence corresponding to the second time window;
determining the times of the barometer entering and exiting the water surface and the time of the barometer entering and exiting the water surface, which are contained in the first time window, according to the air pressure value at the current moment;
and determining a first time length of the barometer under water in the first time window and a second time length of the barometer in the air according to every two adjacent water inlet and outlet moments.
17. The apparatus of claim 16, further comprising in the first swim stroke feature vector: the first determining module is further configured to, after determining the air pressure value at the current time, determine:
determining each underwater air pressure value contained in the air pressure value sequence collected by the air pressure meter in the first time window according to the air pressure value at the current moment;
and determining the underwater air pressure mean value, the underwater air pressure variance, the underwater air pressure quartile and the underwater air pressure ratio in the first time window according to the underwater air pressure values.
18. The apparatus of any of claims 12-14, wherein the second determination module, when identifying the first swim stroke feature vector to determine the first swim stroke within the first time window, is to:
and identifying the first swimming stroke feature vector by utilizing a first preset classification model so as to determine a first swimming stroke and a first confidence value in the first time window.
19. The apparatus of claim 18, wherein the second determination module, after the determining the first swim stroke and the first confidence value within the first time window, is further to:
if the first confidence value is smaller than a second threshold value, starting an acceleration sensor to acquire an acceleration sequence acquired by the acceleration sensor in a third time window;
and verifying the first swimming posture according to an acceleration sequence acquired by the acceleration sensor in a third time window.
20. The apparatus according to claim 19, wherein the second determination module, when verifying the first swimming stroke within the first time window based on the acceleration sequence acquired by the acceleration sensor within a third time window, is specifically configured to:
analyzing an acceleration sequence acquired by the acceleration sensor in a third time window to determine a second swimming posture characteristic vector corresponding to the third time window;
identifying the second swimming stroke feature vector by using a second preset classification model to determine a third swimming stroke and a second confidence value in the third time window;
and verifying the first swimming stroke according to the second swimming stroke and the second confidence value.
21. The apparatus of claim 20, wherein the second determination module, when verifying the first swimming stroke based on the second swimming stroke and a second confidence value, is specifically configured to:
if the second swimming stroke is a non-legal swimming stroke, determining that the user is currently in a swimming pause state;
if the second swim gesture is a legal swim gesture and the second confidence value is greater than a second threshold value, determining that the swim gestures within the first time window and the third time window are second swim gestures;
if the second swimming posture is a legal swimming posture and the second confidence value is smaller than or equal to a second threshold value, acquiring first weight values respectively corresponding to various swimming postures output by the first preset classification model and second weight values respectively corresponding to various swimming postures output by the second preset classification model;
and determining the swimming postures in the first time window and the third time window according to the first weight values and the second weight values respectively corresponding to the various swimming postures.
22. The apparatus of claim 20, wherein the second swim stroke feature vector includes at least one of the following features: acceleration mean, acceleration variance, number of acceleration zero crossings, quartile, skewness, kurtosis, extremum, position of main peak corresponding to the acceleration sequence, or number of peaks included in the acceleration sequence.
23. A swimming gesture recognition system, comprising a swimming gesture recognition apparatus according to any one of claims 12-22.
24. A storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements a swimming gesture recognition method according to any one of claims 1-11.
CN202011331030.2A 2020-11-24 2020-11-24 Swimming gesture recognition method, device, system and storage medium Active CN112587901B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011331030.2A CN112587901B (en) 2020-11-24 2020-11-24 Swimming gesture recognition method, device, system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011331030.2A CN112587901B (en) 2020-11-24 2020-11-24 Swimming gesture recognition method, device, system and storage medium

Publications (2)

Publication Number Publication Date
CN112587901A CN112587901A (en) 2021-04-02
CN112587901B true CN112587901B (en) 2022-05-31

Family

ID=75183814

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011331030.2A Active CN112587901B (en) 2020-11-24 2020-11-24 Swimming gesture recognition method, device, system and storage medium

Country Status (1)

Country Link
CN (1) CN112587901B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113713358B (en) * 2021-06-28 2023-12-26 深圳市奋达智能技术有限公司 Swimming monitoring method, device, storage medium and program product based on multi-sensor fusion
CN115212541B (en) * 2022-04-12 2023-11-17 湘潭大学 Free swimming limb and oral-nasal water inlet and outlet time recording device and data analysis method
CN114602155B (en) * 2022-05-11 2023-02-21 荣耀终端有限公司 Swimming information statistical method, computer-readable storage medium and electronic device
CN115006826B (en) * 2022-08-09 2022-10-25 澳瑞特体育产业股份有限公司 Exercise stroke acquisition device and method and air resistance fitness training equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140149066A1 (en) * 2012-11-29 2014-05-29 Johnson Outdoors Inc. Swim Stroke Counter
CN104208865A (en) * 2013-06-03 2014-12-17 飞比特公司 Fitness monitoring device with altimeter
CN107510937A (en) * 2017-09-25 2017-12-26 广东小天才科技有限公司 Swimming posture normalization detection method and wearable device
US20180117415A1 (en) * 2016-10-31 2018-05-03 Seiko Epson Corporation Electronic apparatus, program, method, system, and recording medium that output a difference between a left and right stroke of a swimmer
CN109276253A (en) * 2018-11-12 2019-01-29 歌尔股份有限公司 A method of detection user's swimming exercise amount

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106175781B (en) * 2016-08-25 2019-08-20 歌尔股份有限公司 Utilize the method and wearable device of wearable device monitoring swimming state

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140149066A1 (en) * 2012-11-29 2014-05-29 Johnson Outdoors Inc. Swim Stroke Counter
CN104208865A (en) * 2013-06-03 2014-12-17 飞比特公司 Fitness monitoring device with altimeter
US20180117415A1 (en) * 2016-10-31 2018-05-03 Seiko Epson Corporation Electronic apparatus, program, method, system, and recording medium that output a difference between a left and right stroke of a swimmer
CN107510937A (en) * 2017-09-25 2017-12-26 广东小天才科技有限公司 Swimming posture normalization detection method and wearable device
CN109276253A (en) * 2018-11-12 2019-01-29 歌尔股份有限公司 A method of detection user's swimming exercise amount

Also Published As

Publication number Publication date
CN112587901A (en) 2021-04-02

Similar Documents

Publication Publication Date Title
CN112587901B (en) Swimming gesture recognition method, device, system and storage medium
CN104661703B (en) For the correction prompt system of appropriate external chest compression
Jensen et al. Classification of kinematic swimming data with emphasis on resource consumption
CN103996019B (en) For the system and method at multiple positions on one object of detect and track
US20170241797A1 (en) Pedometer with Accelerometer and Foot Motion Distinguishing Method
US9934793B2 (en) Method for determining alcohol consumption, and recording medium and terminal for carrying out same
TW201201115A (en) Facial expression recognition systems and methods and computer program products thereof
JP2011510420A5 (en)
WO2016124482A1 (en) Pain management wearable device
JP2011081504A (en) Conference support system and program
WO2023005469A1 (en) Method and apparatus for determining respiration detection region, storage medium, and electronic device
CN106132287A (en) Heart rate monitor system
CN102707806A (en) Motion recognition method based on acceleration sensor
CN109603142A (en) A kind of the identification method of counting and its device of dumbbell exercise
CN107280674A (en) The breathing pattern decision method of equipment is enrolled based on audio
US20120264095A1 (en) Emotion abreaction device and using method of emotion abreaction device
CN107918726A (en) Apart from inducing method, equipment and storage medium
You et al. Sparse power spectrum based robust voice activity detector
CN107105092A (en) A kind of human body tumble recognition methods based on dynamic time warping
Taghvaei et al. Image-based fall detection and classification of a user with a walking support system
Grassi et al. A hardware-software framework for high-reliability people fall detection
Ning et al. Fall detection algorithm based on gradient boosting decision tree
US20190388008A1 (en) System and method for recognizing gait
CN101656070A (en) Voice detection method
WO2018014432A1 (en) Voice application triggering control method, device and terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 230051 No. 01, 5th floor, building B2, Zhongan chuanggu Science Park, No. 900, Wangjiang West Road, high tech Zone, Hefei City, Anhui Province

Applicant after: Anhui huami Health Technology Co.,Ltd.

Address before: Room 189, building H2, phase II, innovation industrial park, 2800 innovation Avenue, high tech Zone, Hefei City, Anhui Province

Applicant before: Anhui Huami Information Technology Co.,Ltd.

GR01 Patent grant
GR01 Patent grant