A counting method, apparatus, device, and storage medium
By performing quaternion calculations on acceleration and gyroscope data, the problem of inaccurate counting in repetitive strength training movements of existing counting methods is solved, achieving accurate counting of movements, and improving the reliability of counting, especially in heavy weight training scenarios.
Patent Information
- Application Number
- CN202210391664.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-14
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2042-04-14
AI Technical Summary
Existing counting methods rely on predetermined strength training movements, ignoring human subjectivity and failing to accurately count repetitive strength training movements, especially when the movements are slow and the muscles are trembling, resulting in insufficient counting accuracy.
By performing quaternion calculations on acceleration and gyroscope data, a four-dimensional spatial attitude signal is obtained. The position sequence of peaks or troughs is determined based on the signal strength, and the data is partitioned and the target motion feature vector is extracted, thereby determining the action count value.
It improves the detection rate of counting weak and trembling cyclic movements, especially in heavy weight strength training scenarios, reducing counting failures caused by slow movements and muscle tremors, and improving counting accuracy.
Smart Images

Figure CN116943130B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of smart wearable device technology, and in particular to a counting method, apparatus, device and storage medium. Background Technology
[0002] With a large number of people currently engaged in fitness, exercisers are paying close attention to the duration and number of repetitions to achieve scientific results. Existing counting methods rely on predetermined strength training movements, imposing constraints and assumptions on movement execution while neglecting human subjectivity. Furthermore, the acceleration and gyroscope signals used in existing counting methods cannot directly describe strength training movements, leading to inaccurate determination of the cycle for some repetitive strength training exercises, which can affect the accuracy of counting. Summary of the Invention
[0003] This invention provides a counting method, apparatus, device, and storage medium to enable the counting and statistics of a single type of stable, repetitive strength training movement without relying on any predetermined strength training movement.
[0004] According to one aspect of the present invention, a counting method is provided, comprising:
[0005] Quaternion calculations were performed on the acceleration and gyroscope data to obtain the four-dimensional spatial attitude signal.
[0006] The peak position sequence or trough position sequence corresponding to each dimension is determined based on the intensity of the four-dimensional spatial attitude signal.
[0007] The four-dimensional spatial attitude signal is partitioned according to the peak position sequence or the trough position sequence to obtain the interval signal corresponding to each dimension;
[0008] Determine the target motion feature vector based on the interval signal;
[0009] The action count value is determined based on the target motion feature vector.
[0010] According to another aspect of the present invention, a counting device is provided, the device comprising:
[0011] The calculation module is used to perform quaternion calculations on acceleration data and gyroscope data to obtain four-dimensional spatial attitude signals;
[0012] The first determining module is used to determine the peak position sequence or trough position sequence corresponding to each dimension based on the intensity of the four-dimensional spatial attitude signal.
[0013] The partitioning module is used to partition the four-dimensional spatial attitude signal according to the peak position sequence or the trough position sequence to obtain the interval signal corresponding to each dimension.
[0014] The second determining module is used to determine the target motion feature vector based on the interval signal;
[0015] The third determining module is used to determine the action count value based on the target motion feature vector.
[0016] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0017] At least one processor; and
[0018] A memory communicatively connected to the at least one processor; wherein,
[0019] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the counting method according to any embodiment of the present invention.
[0020] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the counting method described in any embodiment of the present invention.
[0021] This invention provides a four-dimensional spatial attitude signal obtained by performing quaternion calculations on acceleration and gyroscope data. Based on the intensity of the four-dimensional spatial attitude signal, a peak or trough position sequence corresponding to each dimension is determined. The four-dimensional spatial attitude signal is then partitioned according to the peak or trough position sequence to obtain interval signals corresponding to each dimension. A target motion feature vector is determined based on the interval signals, and an action count value is determined based on the target motion feature vector. This invention converts IMU sensor signals into a quaternion domain that can describe the spatial attitude of the device. It transforms acceleration and gyroscope signals, which cannot intuitively describe strength training movements, into attitude fluctuation signals that can spatially represent changes in movement orientation. This improves the detection rate of weak and jittery periodic movements, especially in heavy weight strength training scenarios, reducing counting failures caused by slow movements and muscle tremors.
[0022] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0023] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0024] Figure 1 This is a flowchart of a counting method in an embodiment of the present invention;
[0025] Figure 2 This is a flowchart of another counting method in an embodiment of the present invention;
[0026] Figure 3 This is a schematic diagram of a sliding window update rule in an embodiment of the present invention;
[0027] Figure 4a This is a schematic diagram of a pseudo-peak in an embodiment of the present invention;
[0028] Figure 4b This is a schematic diagram of a pseudo-valley in an embodiment of the present invention;
[0029] Figure 5 This is a schematic diagram of a method for calculating the overlap ratio in an embodiment of the present invention;
[0030] Figure 6 This is a schematic diagram of the structure of a counting device according to an embodiment of the present invention;
[0031] Figure 7 This is a schematic diagram of the structure of an electronic device that implements the counting method of the present invention. Detailed Implementation
[0032] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0033] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0034] Example 1
[0035] Figure 1 This is a flowchart of a counting method according to an embodiment of the present invention. This embodiment is applicable to counting situations. The method can be executed by the counting device in the embodiment of the present invention, which can be implemented in software and / or hardware, such as... Figure 1 As shown, the method specifically includes the following steps:
[0036] S101. Perform quaternion calculations on the acceleration data and gyroscope data to obtain the four-dimensional spatial attitude signal.
[0037] It should be explained that acceleration data can be windowed data obtained from the raw 3-axis data of an accelerometer. The raw 3-axis data can be output by the accelerometer, a device that measures acceleration by sensing acceleration and converting it into an electrical signal. Gyroscope data can be the raw 3-axis data of a gyroscope sensor, specifically the output of the gyroscope sensor. A gyroscope sensor is used to measure or maintain orientation and angular velocity. In this embodiment, the accelerometer and gyroscope can be located in an IMU (Inertial Measurement Unit) sensor on a smartwatch / band. By measuring direction and acceleration force, the device is determined to be moving, thus achieving the purpose of counting. Accelerometer and gyroscope data can be collected using the same sampling frequency. By matching the collected data with the type of movement the user is currently engaged, the user's step count, calorie consumption, etc., can be monitored. An IMU sensor is a device that measures the three-axis attitude angles (or angular rates) and acceleration of an object. Generally, an IMU sensor consists of three single-axis accelerometers and three single-axis gyroscopes. The accelerometers detect the acceleration signals of the object in the independent three axes of the carrier coordinate system, and the gyroscopes detect the angular velocity signals of the carrier relative to the navigation coordinate system. After processing these signals, the attitude of the object can be calculated.
[0038] It should be noted that quaternion solution refers to using the quaternion method to perform attitude calculations on acceleration data and gyroscope data. Quaternions can characterize the clockwise Euler axis and the required rotation angle during rigid body attitude transformation.
[0039] Among them, the four-dimensional spatial attitude signal can be obtained by performing quaternion calculations on acceleration data and gyroscope data.
[0040] Specifically, raw 3-axis data from the accelerometer and the 3-axis data from the gyroscope are collected. The raw 3-axis data from the accelerometer is windowed to obtain acceleration data. Quaternion calculations are performed on the acceleration data and the raw 3-axis data from the gyroscope to obtain the four-dimensional spatial attitude signal.
[0041] The present invention proposes to perform quaternion calculations on the 3-axis acceleration signal and the 3-axis gyroscope signal, transforming the sensor signal into a spatial attitude fluctuation signal that can describe the force training action. This makes the reciprocating action of force training correspond to the fluctuation and repetition of the spatial attitude signal, turning the weak and jittery action signal into a clear and stable spatial attitude signal.
[0042] S102. Determine the peak position sequence or trough position sequence corresponding to each dimension based on the intensity of the four-dimensional spatial attitude signal.
[0043] It should be noted that the peak position sequence can be a sequence composed of all the peak positions in the four-dimensional spatial attitude signal as a wave signal, and the trough position sequence can be a sequence composed of all the trough positions in the four-dimensional spatial attitude signal as a wave signal.
[0044] In practice, the different dimensions of the calculated four-dimensional spatial attitude signal are used as fluctuation signals describing changes in spatial attitude. The peaks and troughs in these fluctuation signals represent the start or end point of the spatial attitude repetition cycle. Therefore, finding the peaks and troughs in the fluctuation signals of each dimension of the four-dimensional spatial attitude signal is key to determining the spatial attitude repetition interval.
[0045] Specifically, the four-dimensional spatial attitude signal is windowed to obtain the four-dimensional spatial attitude signal within the window. The four-dimensional spatial attitude signal within the window is then subjected to second-order difference to obtain the maximum and minimum values of the intensity of the four-dimensional spatial attitude signal within the window, i.e., the possible peak and trough positions. Based on the maximum and minimum values of the intensity of the four-dimensional spatial attitude signal within the window, the height difference reference value corresponding to the window is determined (preferably, 1 / 6 of the difference between the maximum and minimum values can be used as the height difference reference value). Based on the height difference reference value corresponding to each window, the peak position sequence or trough position sequence corresponding to each dimension is determined.
[0046] S103. Divide the four-dimensional spatial attitude signal into regions according to the peak position sequence or trough position sequence to obtain the interval signal corresponding to each dimension.
[0047] Among them, the interval signal can be the signal of each interval after dividing the four-dimensional spatial attitude signal.
[0048] Specifically, after determining the peak position sequence or trough position sequence corresponding to each dimension, the peak position sequence or trough position sequence is used as the dividing point to partition the four-dimensional spatial attitude signal, thereby obtaining the interval signal corresponding to each dimension.
[0049] S104. Determine the target motion feature vector based on the interval signal.
[0050] It should be noted that the target motion feature vector can be the motion feature vector corresponding to the counted motion features extracted based on the interval signal, and can be used to describe the signal change characteristics of reciprocating motion at the level of raw acceleration data.
[0051] Specifically, the confidence level of signals in adjacent intervals is obtained, and the target motion feature vector is extracted from the continuous and stable high-confidence interval signals.
[0052] S105. Determine the action count value based on the target motion feature vector.
[0053] The action count value can be a count of the actions the user is currently performing.
[0054] Specifically, the action fingerprint is determined by checking the overlap area between the target motion feature vector and the action fingerprint to determine the action count value.
[0055] This invention provides a four-dimensional spatial attitude signal obtained by performing quaternion calculations on acceleration and gyroscope data. Based on the intensity of the four-dimensional spatial attitude signal, a peak or trough position sequence corresponding to each dimension is determined. The four-dimensional spatial attitude signal is then partitioned according to the peak or trough position sequence to obtain interval signals corresponding to each dimension. A target motion feature vector is determined based on the interval signals, and an action count value is determined based on the target motion feature vector. This invention converts IMU sensor signals into a quaternion domain that can describe the spatial attitude of the device. It transforms acceleration and gyroscope signals, which cannot intuitively describe strength training movements, into attitude fluctuation signals that can spatially represent changes in movement orientation. This improves the detection rate of weak and jittery periodic movements, especially in heavy weight strength training scenarios, reducing counting failures caused by slow movements and muscle tremors.
[0056] Example 2
[0057] Figure 2This is a flowchart of another counting method in this embodiment of the invention, which is an optimization based on the above embodiment. In this embodiment, the quaternion calculation of acceleration data and gyroscope data to obtain a four-dimensional spatial attitude signal can be specifically described as follows: acquire acceleration data and gyroscope data; perform windowing processing on the acceleration data to obtain acceleration data within the window; perform quaternion calculation on the acceleration data and gyroscope data within the window to obtain a four-dimensional spatial attitude signal.
[0058] Furthermore, in this second embodiment, determining the peak position sequence or trough position sequence corresponding to each dimension based on the intensity of the four-dimensional spatial attitude signal can be further described as follows: performing windowing processing on the four-dimensional spatial attitude signal to obtain the four-dimensional spatial attitude signal within the window; obtaining the maximum and minimum values of the intensity of the four-dimensional spatial attitude signal within the window; determining the height difference reference value corresponding to the window based on the maximum and minimum values of the intensity of the four-dimensional spatial attitude signal within the window; and determining the peak position sequence or trough position sequence corresponding to each dimension based on the height difference reference value corresponding to each window.
[0059] Specifically, in this second embodiment, determining the target motion feature vector based on the interval signal can be further simplified to: obtaining the confidence level of adjacent interval signals; determining the mean of the motion feature vector of each interval signal in the target spatial attitude signal as the target motion feature vector, wherein the target spatial attitude signal includes a preset number of consecutive adjacent interval signals with a confidence level greater than a confidence level threshold.
[0060] Furthermore, in this second embodiment, the determination of the action count value based on the target motion feature vector can be specifically described as follows: if the overlap ratio between the motion feature vector and the target action fingerprint vector is greater than or equal to the ratio threshold, then the action corresponding to the target action fingerprint vector is counted.
[0061] like Figure 2 As shown, another counting method in this embodiment of the invention specifically includes the following steps:
[0062] S201. Acquire acceleration data and gyroscope data.
[0063] Specifically, the same sampling frequency can be used to collect the 3-axis raw data of the accelerometer sensor and the 3-axis raw data of the gyroscope sensor of the IMU sensor on the smartwatch / band.
[0064] In practical operation, the sampling frequency of the raw acceleration data will affect whether the key information of common fast / slow strength training movements can be accurately reproduced. Considering the application of the counting method proposed in this invention embodiment in smartwatches / bands with limited storage and computing speed, and taking into account both power consumption and performance, it is preferable to determine the acceleration sampling rate as 25Hz, that is, to obtain 25 acceleration x-axis sample values, 25 acceleration y-axis sample values, and 25 acceleration z-axis sample values per second.
[0065] S202. Perform windowing processing on the acceleration data to obtain the acceleration data within the window.
[0066] It is known that window processing can be a process of setting a window of fixed duration, processing the data within the window, and then sliding the window according to a set step size to process the entire data.
[0067] In practice, considering the duration of a single movement in a set during daily strength training and the number of times a movement might be repeated within a single training set, the size of the data window for the raw 3-axis accelerometer data will affect whether enough continuous motion information can be observed within the window. Based on statistical analysis of a certain scale of real user datasets, a preferred data window length is determined to be 15 seconds, i.e., the raw 3-axis accelerometer data is cached, with the cache length corresponding to a continuous 15-second motion duration. To ensure that the most complete motion signal can be observed within a single window, a 1-second sliding update rule is preferably used for windowing processing.
[0068] Figure 3 This is a schematic diagram of a sliding window update rule in an embodiment of the present invention. Figure 3 As shown, the data window length is set to 15 seconds, and a 1-second sliding update rule is adopted. The sliding windows are t1, t2, and t3 in sequence. That is, the sliding window for acceleration x-axis, y-axis, and z-axis at time t1 starts at 0 seconds and ends at 15 seconds; the sliding window for acceleration x-axis, y-axis, and z-axis at time t2 starts at 1 second and ends at 16 seconds; and the sliding window for acceleration x-axis, y-axis, and z-axis at time t3 starts at 2 seconds and ends at 17 seconds.
[0069] In practical operation, provided that sufficient raw accelerometer data across all three axes is obtained to fill the data window, low-pass filtering with a cutoff frequency of at least 2.5Hz can be applied to each raw accelerometer data axis to remove measurement noise and interference caused by motion jitter. The specific low-pass filtering method selected will affect the convergence speed, signal waveform distortion, and storage / computation overhead. Preferably, a Butterworth low-pass filter of order 2 is used, and the first 8 filtered data points are discarded during the filtering process to shield against false counts caused by signal waveform jitter during convergence.
[0070] In the data windowing and filtering preprocessing proposed in this embodiment of the invention, the key parameters and settings are determined based on a comprehensive analysis of real-world training users and datasets.
[0071] S203. Perform quaternion calculations on the acceleration data and gyroscope data within the window to obtain the four-dimensional spatial attitude signal.
[0072] Specifically, quaternion calculations are performed on the obtained low-pass filtered acceleration data and gyroscope data with the same sampling frequency. The quaternion calculation uses complementary filtering to calculate a four-dimensional spatial attitude signal of the same frequency, which can then be used... To represent, where, and These represent the spatial attitude signal in one of the four dimensions of the four-dimensional spatial attitude signal. The four-dimensional spatial attitude signal includes four dimensions, and the spatial attitude signal in each dimension can be represented by... (i represents the number of dimensions, i = 0, 1, 2, 3) is used to represent this, where... This represents the first data point of the spatial attitude signal in each dimension, and so on. This represents the nth data point of the spatial attitude signal in each dimension, where n represents the length of any dimension after quaternion processing.
[0073] S204. Perform windowing processing on the four-dimensional spatial attitude signal to obtain the four-dimensional spatial attitude signal within the window.
[0074] In actual operation, due to the solved four-dimensional spatial attitude signal There may be DC components and low-frequency drift, so high-pass filtering can be applied to the spatial attitude signals of each dimension of the four-dimensional spatial attitude signal. After optimization on a real user dataset of a certain scale, the cutoff frequency of the high-pass filter was preferably determined to be 0.2Hz. Taking into account waveform distortion and storage and computational overhead, a Butterworth high-pass filter of order 2 was selected as the high-pass filtering method.
[0075] Subsequently, the four-dimensional spatial attitude signal preprocessed by high-pass filtering was processed. The spatial attitude signals of each dimension are processed by windowing. The length of the data window should ensure that at least two complete action signals can be seen within a single window. Based on statistical analysis on a certain scale of real user datasets, the preferred data window length is determined to be 6 seconds. The windowing process also employs a 1-second sliding update rule, the specific of which is consistent with the method in step S202 and will not be repeated here. The 1-second sliding step length is determined based on minimizing counting latency. It should be noted that the sliding step length can be adjusted for different hardware computing speeds and application requirements, but it should not exceed half the data window length.
[0076] After the above steps, the spatial attitude signals in each dimension are processed. (i represents the dimension number, i = 0, 1, 2, 3) The spatial attitude signals in each dimension obtained after high-pass filtering can be expressed as Q. i ={q i0 q i1 , ..., q i(n-1)} (i represents the number of dimensions, i = 0, 1, 2, 3) is used to represent q, where q i0 This represents the first data point of the spatial attitude signal in each dimension after high-pass filtering, and so on. i(n-1) This represents the nth data point of the spatial attitude signal in each dimension after high-pass filtering, where n represents the spatial attitude signal in each dimension. (i represents the number of dimensions, i = 0, 1, 2, 3) The length of any dimension after high-pass filtering and quaternion solving. It should be noted that the size of n in this operation is equal to 150, which is the result of 25 multiplied by 6. 25 is the sampling rate of the accelerometer and gyroscope, which is 25Hz, and 6 is the length of the data window.
[0077] S205. Obtain the maximum and minimum values of the intensity of the four-dimensional spatial attitude signal within the window.
[0078] Specifically, the four-dimensional spatial attitude signal These waves, acting as fluctuation signals describing changes in spatial attitude, represent the start or end of the cyclical movement of spatial attitude. Therefore, in four-dimensional spatial attitude signals... Finding peaks and troughs in the fluctuation signals across various dimensions is crucial for determining the spatial attitude reciprocating range. This involves analyzing the four-dimensional spatial attitude signals within the window. Spatial attitude signals Q in various dimensions i ={q i0 q i1 , ..., q i(n-1)(i represents the number of dimensions, i = 0, 1, 2, 3, and n represents the length of any dimension after high-pass filtering of the spatial attitude signal in each dimension and quaternion calculation) Perform second-order difference to determine the four-dimensional spatial attitude signal within the window. The maximum and minimum values of the intensity, and the four-dimensional spatial attitude signal within the window. The maximum and minimum values of the intensity are the peaks and troughs in the possible wave signal.
[0079] S206. Determine the reference value of the height difference corresponding to the window based on the maximum and minimum values of the intensity of the four-dimensional spatial attitude signal within the window.
[0080] The height difference reference value can be the minimum height difference reference value set between the peaks and troughs.
[0081] Specifically, the four-dimensional spatial attitude signal within the window Statistical analysis of the maximum and minimum values is performed, and preferably, the four-dimensional spatial attitude signal within the window can be used. One-sixth of the difference between the maximum and minimum values is used as the reference value for the height difference of the window, that is, the minimum height difference reference value between the peak and the trough.
[0082] S207. Determine the peak position sequence or trough position sequence for each dimension based on the height difference reference value corresponding to each window.
[0083] Specifically, points with larger amplitudes are searched near the possible peak positions of the wave signal as peaks, and points with smaller amplitudes are searched near the possible trough positions of the wave signal as troughs. The height difference between the peaks and troughs is compared with a reference value to further filter peak and trough position sequences that meet the definitions of peaks and troughs. The peak position sequence can be... (i represents the number of dimensions, i = 0, 1, 2, 3) is used to represent this, where... This indicates the position information of the first peak in the peak position sequence, and so on. Indicates the position of the first peak in the sequence. Information on the position of each peak. The number of elements in the peak position sequence can be used to represent the number of peak positions; the trough position sequence can be represented by... (i represents the number of dimensions, i = 0, 1, 2, 3) is used to represent this, where... This indicates the location information of the first trough in the trough location sequence, and so on. Indicates the position of the trough in the sequence. Information on the location of each trough. This indicates the number of elements in the trough position sequence.
[0084] Furthermore, the steps to determine the peak or trough position sequence for each dimension based on the height difference reference value corresponding to each window are as follows:
[0085] A1. Determine the target set based on the height difference reference value corresponding to each window.
[0086] It should be noted that the target set can be a collection of all peak and trough position information determined based on the height difference reference value corresponding to each window. Specifically, the target set includes both peak and trough position information.
[0087] It should be explained that the peak position information can be the position information of all existing peaks in the wave signal, and the trough position information can be the position information of all existing troughs in the wave signal.
[0088] Specifically, the four-dimensional spatial attitude signal within the window that serves as a wave signal. Fluctuation signal Q in each dimension i ={q i0 q i1 , ..., q i(n-1) After searching for the peaks and troughs of the} (i represents the number of dimensions, i = 0, 1, 2, 3, and n represents the length of any dimension after quaternion calculation of the spatial attitude signal in each dimension through high-pass filtering), all peaks and troughs are initially determined.
[0089] B1. Determine the amplitude difference between adjacent peaks and troughs based on the peak and trough location information.
[0090] The amplitude difference can be the difference in signal amplitude between adjacent peaks and troughs.
[0091] Specifically, the amplitude difference between adjacent peaks and troughs is calculated based on the peak and trough location information.
[0092] C1. Determine the location information to be deleted based on the amplitude difference between adjacent peaks and troughs.
[0093] It should be noted that the location information to be deleted can be peak location information and / or trough location information. Specifically, the location information to be deleted includes: pseudo-peak location information and / or pseudo-trough location information.
[0094] It should be explained that pseudo-peak location information can be the location information of peaks whose amplitude is less than that of the two adjacent peaks, and pseudo-trough location information can be the location information of troughs whose amplitude is greater than that of the two adjacent troughs.
[0095] In actual operation, some of the peaks and troughs initially identified may be the starting or ending points of the cycle of sub-action segments in the spatial attitude reciprocating process. Therefore, it is necessary to further screen and investigate the peak and trough position information in the target set.
[0096] Figure 4a This is a schematic diagram of a pseudo-peak in an embodiment of the present invention, such as... Figure 4a As shown, A, C, and E are all peaks, while B and D are all troughs. Point A is actually the starting point of a single cycle of a strength training movement and should be the only peak position within that cycle. However, all determined peak positions include not only point A but also point C, which is a pseudo-peak. This invention provides a rule for determining the pseudo-peak position information of strength training movement signals, as follows:
[0097] Calculate the amplitude difference between adjacent peaks and troughs. When the amplitude difference between the first group of peaks and troughs (amplitude difference between A and B) and the amplitude difference between the fourth group of peaks and troughs (amplitude difference between E and D) are significantly greater than the amplitude difference between the second group of peaks and troughs (amplitude difference between C and B) and the amplitude difference between the third group of peaks and troughs (amplitude difference between C and D), then peak C in the second and third groups is determined to be a pseudo-peak.
[0098] Figure 4b This is a schematic diagram of a pseudo-trough in an embodiment of the present invention, such as... Figure 4b As shown, A′, C′, and E′ are all troughs, while B′ and D′ are all peaks. The actual point A′ is the starting point of a single cycle of a strength training movement and should be the only trough position within that cycle. However, all determined trough positions include not only point A′ but also point C′, which is a pseudo-trough. This invention provides a rule for determining pseudo-trough position information applicable to strength training movement signals, as follows:
[0099] Calculate the amplitude difference between adjacent peaks and troughs. When the amplitude difference between the first group of peaks and troughs (the amplitude difference between B′ and A′) and the amplitude difference between the fourth group of peaks and troughs (the amplitude difference between D′ and E′) are significantly greater than the amplitude difference between the second group of peaks and troughs (the amplitude difference between B′ and C′) and the amplitude difference between the third group of peaks and troughs (the amplitude difference between D′ and C′), then the trough C′ in the second and third groups is determined to be a pseudo-trough.
[0100] Preferably, the "obvious" standard used in the above two determination rules is 1.62, that is, the amplitude difference of the larger set of peaks and troughs is 1.62 times the amplitude difference of the smaller set of peaks and troughs.
[0101] D1. Determine the peak position sequence or trough position sequence corresponding to each dimension based on the target set and the position information to be deleted.
[0102] Specifically, using the two determination rules mentioned above, the peak positions within a single window used to mark the start or end of a single cycle of a periodic action are determined. The peak position sequence corresponding to each dimension can be represented by {p i0 p i1 , ..., p i(m-1)} (i represents the number of dimensions, i = 0, 1, 2, 3) is used to represent p i0 This indicates the peak position information of the first peak in the peak position sequence corresponding to each dimension, determined based on the target set and the position information to be deleted, and so on, p i(m-1) This represents the peak position information of the m-th peak in the peak position sequence corresponding to each dimension, determined based on the target set and the position information to be deleted. Here, m represents the number of peak position information items after the above operations to remove pseudo-peaks and pseudo-valleys. The determined valley position sequence corresponding to each dimension can be represented by {v... i0 v i1 , ..., v i(k-1)} (i represents the number of dimensions, i = 0, 1, 2, 3) is used to represent, where v i0 This indicates that the trough position information of the first trough in the trough position sequence corresponding to each dimension is determined based on the target set and the position information to be deleted, and so on, v i(k-1) This indicates the valley position information of the k-th valley in the valley position sequence corresponding to each dimension, determined based on the target set and the position information to be deleted. k represents the number of valley position information after the above operations of removing pseudo-peaks and pseudo-valleys.
[0103] In practice, due to the window sliding update strategy, the determination of the start or end point of a single cycle for the same action in adjacent windows, i.e., the peak position, may be offset. Therefore, it is necessary to check and merge peaks that were originally in the same position between different windows. The rules for merging adjacent peaks are as follows:
[0104] For any four adjacent peak positions {p i0 p i1 p i2 p i3}(where i represents the dimension number, i = 0, 1, 2, 3) should ensure that the interval length between any two adjacent peaks is uniform, i.e., the four peak positions {p i0 p i1 p i2 p i3The intervals {i} (where i represents the dimension, i = 0, 1, 2, 3) are formed, and the lengths of these three intervals can be represented as {l0, l1, l2}. When the length l1 of the interval formed by the two adjacent peaks in the middle is significantly smaller than the lengths l0 and l2 of the adjacent intervals on the left and right, then the peak p, which serves as the right boundary of this interval... i2 (i represents the dimension number, i = 0, 1, 2, 3) will be removed from the peak position sequence.
[0105] The peak position sequence after the above cross-window merging is determined as {p i0 p i1 , ..., p i(M-1)} (i represents the number of dimensions, i = 0, 1, 2, 3), where p i0 This represents the peak position information of the first peak in the peak position sequence after cross-window merging, and so on, p i(M-1) This represents the peak position information of the Mth peak in the peak position sequence after cross-window merging, where M is the number of peak position information in the updated peak position sequence.
[0106] The embodiments of this invention propose extracting peak position information from spatial attitude fluctuation signals in each dimension of four-dimensional spatial attitude signals, superimposing pseudo-peak and pseudo-valley removal strategies, and merging peak position information across windows, which can effectively determine the starting or ending position of the strength training movement cycle.
[0107] S208. Divide the four-dimensional spatial attitude signal into regions according to the peak position sequence or trough position sequence to obtain the interval signal corresponding to each dimension.
[0108] For example, the following explanation uses the partitioning of the four-dimensional spatial attitude signal according to the peak position sequence to obtain the interval signal corresponding to each dimension.
[0109] Specifically, through the above steps, it was achieved that the peak position sequence {p} used to mark the start or end of a single cycle action was found in each of the four dimensions of the four-dimensional spatial attitude wave signal. i0 p i1 , ..., p i(M-1)} (where i represents the dimension number, i = 0, 1, 2, 3, and M is the number of peak position information in the updated peak position sequence), using the determined peak position sequence as the dividing point of the window data for segmenting the low-pass filtered acceleration data, four families of interval signals {L0, L1, L2, L3} can be obtained, each family of interval signals L i The determination of (i = 0, 1, 2, 3) is based on the cyclical fluctuation characteristics of the spatial attitude signals in each dimension of the four-dimensional spatial attitude signal, that is, based on the peak position sequence {p} in this dimension. i0 pi1 , ..., p i(M-1)} (where i represents the dimension number, i = 0, 1, 2, 3, and M is the number of peak position information in the updated peak position sequence) is determined. The family of interval signals corresponding to each dimension is determined by the 3-axis acceleration interval signal {L}. ix L iy L iz The system consists of (i represents the dimension, i = 0, 1, 2, 3). Taking the x-axis as an example, the acceleration x-axis interval signal L... ix According to {p i0 p i1 , ..., p i(M-1) The peak positions (where i represents the dimension number, i = 0, 1, 2, 3, and M is the number of peak position information in the updated peak position sequence) are used as index values to divide the signal into M intervals on the acceleration x-axis. It can be by Composition, where i represents the dimension number, i = 0, 1, 2, 3, j represents the j-th interval, j = 0, 1, ..., M+1, where M is the number of interval signals on the acceleration x-axis, and p ij and p i(j+1) Let {p} be the sequence of two adjacent peak positions in each dimension of the i-th four-dimensional spatial attitude signal. i0 p i1 , ..., p i(M-1) The original acceleration interval signal is determined by the elements in} (i represents the dimension number, i = 0, 1, 2, 3, and M is the number of interval signals on the acceleration x-axis).
[0110] S209. Obtain the confidence level of the signals in adjacent intervals.
[0111] In this embodiment, the confidence level of adjacent interval signals can be the confidence level of the similarity and stability of adjacent interval signals.
[0112] In actual operation, considering that in the execution of daily strength training movements, there is consistency or gradual change in the speed of two adjacent movements in a single set, the confidence level used in this embodiment of the invention to evaluate the stability of adjacent interval signals is based on the time length of the adjacent interval signals.
[0113] Furthermore, obtaining the confidence level of signals in adjacent intervals can be specifically achieved through the following steps:
[0114] A2. Obtain the duration of signals in adjacent intervals and the cross-correlation coefficient of signals in adjacent intervals.
[0115] The duration of adjacent interval signals can be the length of time of the adjacent interval signals. Specifically, the duration of adjacent interval signals can be from the start time of the first signal in the interval to the end time of the last signal in the interval.
[0116] It should be noted that the cross-correlation coefficient can be obtained by cross-correlation calculation of signals from two adjacent intervals.
[0117] Specifically, we will use the acceleration x-axis in the i-th dimension of the four-dimensional attitude signal as an example for explanation. Let the acceleration interval be... and The durations in are respectively and Where i represents the dimension number, i = 0, 1, 2, 3, and j represents the j-th interval, j = 0, 1, ..., M+1 (where M is the number of interval signals on the acceleration x-axis). If the ratio When the ratio is greater than or equal to a certain threshold T1 and greater than or equal to a certain threshold T2 (T1 is less than T2), Forced to be changed to 1; if the ratio When the ratio is greater than or equal to a certain threshold T1 and less than a certain threshold T2 (T1 is less than T2), It was forcibly changed to 0. The advantage of this design is that it ensures that when the execution cycles of two adjacent actions are not significantly different, the difference in time length does not affect the confidence level.
[0118] For two adjacent signal intervals, there is generally a difference in signal duration. This embodiment of the invention employs interpolation and resampling of the shorter signal sequence to extend its length to match that of the longer sequence. With the lengths matching, cross-correlation is calculated between the interpolated and resampled interval signal and its adjacent interval signal to obtain the cross-correlation coefficient between the two adjacent interval signals. The cross-correlation coefficient between the j-th interval and the (j+1)-th interval can be represented by Rj. j(j+1) Let be the interval, where j represents the j-th interval, j = 0, 1, ..., M+1 (where M is the number of interval signals on the x-axis of acceleration). It is important to note that if the cross-correlation coefficient is less than 0, it will be forcibly changed to 0; that is, statistically, a negative cross-correlation coefficient is considered strictly uncorrelated.
[0119] B2. Determine the confidence level of adjacent interval signals based on the duration of adjacent interval signals and the cross-correlation coefficient of adjacent interval signals.
[0120] Specifically, after obtaining the duration of adjacent interval signals and the cross-correlation coefficient between adjacent interval signals, taking the acceleration x-axis in the i-th dimension of the four-dimensional spatial attitude signal as an example, the confidence level, which comprehensively considers the similarity and stability of adjacent interval signals, is defined as:
[0121]
[0122] Among them, P conf Indicates the confidence level of signals in adjacent intervals. and These are signals from two adjacent acceleration intervals. and These are the acceleration adjacent interval signals. and The duration in R j(j+1) signals of adjacent intervals and The cross-correlation number, where i represents the dimension number, i = 0, 1, 2, 3, and j represents the j-th interval, j = 0, 1, ..., M+1 (where M is the number of interval signals on the acceleration x-axis).
[0123] Since the interval signal is extracted after sliding windowing, a certain interval signal may be in the middle of the current window or at the end of the previous sliding window. This means that the same interval signal may have different confidence levels in different sliding windows. This embodiment of the invention considers confidence level primarily to measure the periodicity and stability of action execution; therefore, it always selects the interval signal up to its current maximum confidence level as the input for subsequent steps.
[0124] The confidence calculation of the stability of action duration and consistency of action form of signals fused between adjacent intervals proposed in this embodiment of the invention quantifies the similarity and stability of two consecutive action cycles into a probabilistic model, which can reduce the dependence on manually set rules.
[0125] S210. The mean value of the motion feature vector of each interval signal in the target space attitude signal is determined as the target motion feature vector.
[0126] In this embodiment, the target space attitude signal can be a continuous and stable high-confidence interval signal. Specifically, the target space attitude signal includes a preset number of consecutive adjacent interval signals with a confidence level greater than a confidence threshold.
[0127] The preset quantity can be the number of pairs of consecutive adjacent interval signals pre-set according to the actual situation; preferably, the preset quantity can be 4 pairs. The confidence threshold can be the confidence value of adjacent interval signals pre-set according to the actual situation; preferably, the confidence threshold can be 0.8.
[0128] It should be noted that the motion feature vector can be a vector representation of the motion characteristics of the 3-axis acceleration interval signal within the interval.
[0129] Specifically, the mean value of the motion feature vector of each interval signal in the target space attitude signal is calculated, and the mean value of the motion feature vector of each interval signal in the target space attitude signal is determined as the target motion feature vector.
[0130] Furthermore, before determining the mean of the motion feature vector of each interval signal in the target space attitude signal as the target motion feature vector, the following steps are also included:
[0131] A3. Obtain the 90th and 10th percentile values of each interval of the target space attitude signal.
[0132] The 90th percentile value can include the 90th percentile value of the acceleration x-axis, the 90th percentile value of the acceleration y-axis, and the 90th percentile value of the acceleration z-axis of each interval signal in the target space attitude signal. Similarly, the 10th percentile value can include the 10th percentile value of the acceleration x-axis, the 10th percentile value of the acceleration y-axis, and the 10th percentile value of the acceleration z-axis of each interval signal in the target space attitude signal.
[0133] Specifically, based on the division of the signal intervals on the three axes of the accelerometer data, the motion characteristics of the signals on the three axes within the intervals are calculated. The features used to describe the motion include: the 90th and 10th percentile values of the acceleration x-axis, the 90th and 10th percentile values of the acceleration y-axis, and the 90th and 10th percentile values of the acceleration z-axis.
[0134] B3. Determine the motion feature vector of each interval signal in the target space attitude signal based on the 90th and 10th percentile values of each interval signal in the target space attitude signal.
[0135] Specifically, the motion feature vector of each interval signal in the target space attitude signal, determined based on the 90th and 10th percentile values of each interval signal, can be expressed as:
[0136]
[0137] in, Let represent the motion feature vector, i represent the dimension number, i = 0, 1, 2, 3, j represent the j-th interval, j = 0, 1, ..., M+1 (where M is the number of interval signals on the acceleration x-axis), frc(c,X) represents the calculation of the c-quantile value for signal X, i.e., frc(90,x) represents the 90th quantile value of acceleration on the x-axis, frc(10,x) represents the 10th quantile value of acceleration on the x-axis, frc(90,y) represents the 90th quantile value of acceleration on the y-axis, frc(10,y) represents the 10th quantile value of acceleration on the y-axis, frc(90,z) represents the 90th quantile value of acceleration on the z-axis, and frc(10,z) represents the 10th quantile value of acceleration on the z-axis.
[0138] Furthermore, obtaining the confidence level of signals in adjacent intervals can be specifically achieved through the following steps:
[0139] A4. If there are at least two target space attitude signals, obtain the significance factor of each target space attitude signal.
[0140] In this embodiment, the saliency factor can be a factor used to describe the confidence level in each dimension of the target space attitude signal. The saliency factor should reflect the saliency of the action within the interval division under the quadrant of the target space attitude signal.
[0141] Specifically, for each dimension of the target space attitude signal, if the confidence scores of a predetermined number (preferably 4) consecutive interval signals in a certain dimension all exceed a confidence threshold (preferably 0.8), then that dimension is identified as a candidate dimension for counting and tracking. When there are more than one candidate dimension at the same time, the candidate dimension with the largest sum of significance factors of the interval signals in a single dimension is selected as the final dimension for counting and tracking.
[0142] The reason for adopting the above principle in the embodiments of the present invention is that, when the measures used to describe the periodicity and stability of an action are similar, it is more prudent to choose the dimension that can more significantly describe the action.
[0143] The process of obtaining the significance factor of each target space attitude signal is as follows: when the confidence levels of the target space attitude signal are similar in the four dimensions, a reasonable target space attitude signal dimension is selected as the basis for tracking and matching counting. It is necessary to describe the significance factor accompanying the confidence level in the target space attitude signal dimension. The significance factor should reflect the significance of the action within the interval division under the target space attitude signal quadrant.
[0144] Furthermore, the saliency factor for obtaining the spatial attitude signal of each target can be specifically defined by the following steps:
[0145] a. Obtain the difference between the 75th percentile and the 25th percentile of each interval signal in the spatial attitude signal of each target.
[0146] The 75th percentile value can include the 75th percentile value of the acceleration x-axis, the 75th percentile value of the acceleration y-axis, and the 75th percentile value of the acceleration z-axis of each interval signal in the target space attitude signal. Similarly, the 25th percentile value can include the 25th percentile value of the acceleration x-axis, the 25th percentile value of the acceleration y-axis, and the 25th percentile value of the acceleration z-axis of each interval signal in the target space attitude signal.
[0147] Specifically, the difference between the 75th and 25th percentile values of each axis of the accelerometer data within the interval is calculated. This quantile difference quantifies the significance of the oscillation of a certain axis of acceleration within this interval. Ultimately, the significance factor used to characterize the signal in this interval is defined as the maximum value of the quantile differences across the three axes of acceleration.
[0148] b. The sum of the differences between the 75th percentile and the 25th percentile of the interval signal in the target space attitude signal is determined as the significance factor of the target space attitude signal.
[0149] Specifically, the significance factor for the j-th interval partition on the i-th dimension can be expressed as:
[0150]
[0151] in, This represents the significance factor under the j-th interval division on the i-th dimension. This represents the significance factor of the acceleration in the j-th interval along the i-th dimension of the x-axis. This represents the significance factor of acceleration in the j-th interval along the i-th dimension of the y-axis. This represents the significance factor under the j-th interval division on the i-th dimension of the acceleration z-axis, where i represents the number of dimensions, i = 0, 1, 2, 3, and j represents the j-th interval, j = 0, 1, ..., M+1 (where M is the number of interval signals on the acceleration x-axis).
[0152] Among them, significance factor The calculation formula is:
[0153]
[0154] in, Let represent the significance factor under the j-th interval division in the i-th dimension of the acceleration x-axis, and frc(c,X) represent the calculation of the c-quantile value for the signal X, i.e. Indicates interval signal The 75th percentile value, Indicates interval signal The 25th percentile value, i represents the dimension number, i = 0, 1, 2, 3, j represents the j-th interval, j = 0, 1, ..., M+1 (where M is the number of interval signals on the x-axis of acceleration).
[0155] Among them, significance factor The calculation formula is:
[0156]
[0157] in, Let represent the significance factor under the j-th interval division in the i-th dimension of the acceleration y-axis, and frc(c,X) represent the calculation of the c-quantile value for the signal X, i.e. Indicates interval signal The 75th percentile value, Indicates interval signal The 25th percentile value, i represents the dimension number, i = 0, 1, 2, 3, j represents the j-th interval, j = 0, 1, ..., M+1 (where M is the number of interval signals on the x-axis of acceleration).
[0158] Among them, significance factor The calculation formula is:
[0159]
[0160] in, Let frc(c,X) represent the significance factor in the j-th interval division along the i-th dimension of the acceleration x-axis, and let frc(c,X) represent the calculation of the c-quantile value for the signal X. Indicates interval signal The 75th percentile value, Indicates interval signal The 25th percentile value, i represents the dimension number, i = 0, 1, 2, 3, j represents the j-th interval, j = 0, 1, ..., M+1 (where M is the number of interval signals on the x-axis of acceleration).
[0161] The strategy for determining the dimension of the target spatial attitude signal for tracking, matching, and counting proposed in this embodiment of the invention introduces a saliency factor. The original acceleration signal is segmented at the beginning or end of the period of spatial attitude change, and the saliency of the interval signal caused by the segmentation in different dimensions is used as the basis for selecting the dimension of the target spatial attitude signal.
[0162] The quantile-based saliency factor and motion features proposed in this invention play a role in determining the quadrant axis of the tracking matching count and describing motion specificity, respectively, and have the characteristics of low computational load and low storage consumption.
[0163] B4. The mean value of the motion feature vector of each interval signal in the target space attitude signal with the largest significance factor among at least two target space attitude signals is determined as the target motion feature vector.
[0164] Preferably, in the process of determining the dimension of the target spatial attitude signal used for counting and tracking, the mean value of the motion feature vectors of the first four intervals in the selected target spatial attitude signal quadrant is calculated as the target motion feature vector (also known as the action fingerprint), which is used to describe the signal change characteristics of the reciprocating motion at the level of the original acceleration data.
[0165] Specifically, the target motion feature vector is calculated as follows:
[0166]
[0167] Among them, fv fingerprint Represents the target motion feature vector. This represents the mean of frc(90,x), where frc(90,x) represents the 90th percentile value of the acceleration along the x-axis. This represents the mean of frc(10,x), where frc(10,x) represents the 10th percentile value of the acceleration along the x-axis. This represents the mean of frc(90,y), where frc(90,y) represents the 90th percentile value of the acceleration along the y-axis. This represents the mean of frc(10,y), where frc(10,y) represents the 10th percentile value of the acceleration along the y-axis. This represents the mean of frc(90,z), where frc(90,z) represents the 90th percentile value of the acceleration along the z-axis. This represents the mean of frc(10,z), where frc(10,z) represents the 10th percentile value of the acceleration along the z-axis.
[0168] The clustering action fingerprint proposed in this invention is based on motion feature vectors extracted from interval signals. It automatically acquires key information of the most recent stable and repetitive actions in statistics and stores them as fingerprints for subsequent matching. The determination of action fingerprints retains the distinguishability between different actions without using complex clustering operations.
[0169] S211. If the overlap ratio between the motion feature vector and the target action fingerprint vector is greater than or equal to the ratio threshold, then the action corresponding to the target action fingerprint vector is counted.
[0170] The target action fingerprint vector can be the aforementioned target motion feature vector.
[0171] It should be noted that the overlap ratio can be the ratio of the overlapping area of the motion feature vector and the target action fingerprint vector.
[0172] The ratio threshold can be a value that represents the ratio of the overlapping area of the motion feature vector and the target action fingerprint vector, which is preset according to the actual situation. This embodiment does not limit this value.
[0173] Figure 5 This is a schematic diagram of a method for calculating the overlap ratio in an embodiment of the present invention. For example... Figure 5 As shown, the motion feature vector (i.e., the motion feature vector mentioned above) of the new interval signal is calculated as {frc 90, frc10}, the stored motion fingerprint (i.e., the target motion fingerprint vector mentioned above) is calculated as {frc 90, frc10}, and the overlap ratio of the motion feature vector (i.e., the motion feature vector mentioned above) and the motion fingerprint (i.e., the target motion fingerprint vector mentioned above) is calculated as {frc 90, frc10}.
[0174] Specifically, fingerprint matching and probability estimation are performed on the subsequent interval signals. After determining the dimension of the target space attitude signal to be tracked, the subsequent counting process of strength training movements only needs to perform steps S201 to S210 on the already selected target space attitude signal dimension.
[0175] The motion feature vector derived from the motion features of the new interval signal calculated subsequently. With the target action fingerprint vector fv fingerprint Perform an overlap area check. If the overlap ratio between the motion feature vector and the target action fingerprint vector is greater than or equal to a threshold, count the action corresponding to the target action fingerprint vector; if the overlap ratio is less than the threshold, the action of the new interval signal is considered not to match the target action fingerprint, and the counting of that action is stopped.
[0176] In addition, for interval signals that match the action characteristics, the corresponding confidence level P is further examined. conf Only interval signals with a confidence level greater than the confidence threshold are accepted and counted; otherwise, the interval signal is not included in the counting statistics.
[0177] The fingerprint matching and probability estimation output proposed in this invention calculates a relatively simple motion feature overlap area ratio, integrates confidence level and macroscopic morphological factors of the action, and obtains the action matching probability. This yields a quantitative statistical representation of strength training counts in probabilistic form. The fingerprint matching output probability proposed in this invention transforms the counting problem into a pattern matching problem, achieving statistical representation of action counts in the form of quantitative probabilities. Furthermore, by outputting probabilities over the time dimension, it improves the accuracy of the counting.
[0178] The strength training counting method proposed in this invention, based on the spatial posture reciprocating characteristics of IMU sensors on smartwatches / bands, does not rely on any predetermined strength training movements, makes no constraints or assumptions regarding movement execution, and has low storage and computational overhead in its main processing steps and calculation stages, making it suitable for implementation on resource-constrained embedded devices. The embodiments of this invention convert IMU sensor signals into a quaternion domain that can describe the spatial posture of the device, transforming acceleration and gyroscope signals, which cannot intuitively describe strength training movements, into posture fluctuation signals that can spatially represent changes in movement orientation. This improves the counting detection rate for weak and jittery periodic movements, especially in heavy weight strength training scenarios, reducing counting failures caused by slow movements and muscle tremors.
[0179] Example 3
[0180] Figure 6 This is a schematic diagram of a counting device according to an embodiment of the present invention. This embodiment is applicable to counting applications. The device can be implemented using software and / or hardware, and can be integrated into any device that provides counting functionality, such as... Figure 6 As shown, the counting device specifically includes: a calculation module 301, a first determination module 302, a partitioning module 303, a second determination module 304, and a third determination module 305.
[0181] Among them, the calculation module 301 is used to perform quaternion calculation on acceleration data and gyroscope data to obtain four-dimensional spatial attitude signal;
[0182] The first determining module 302 is used to determine the peak position sequence or trough position sequence corresponding to each dimension based on the intensity of the four-dimensional spatial attitude signal.
[0183] The partitioning module 303 is used to partition the four-dimensional spatial attitude signal according to the peak position sequence or the trough position sequence to obtain the interval signal corresponding to each dimension.
[0184] The second determining module 304 is used to determine the target motion feature vector based on the interval signal;
[0185] The third determining module 305 is used to determine the action count value based on the target motion feature vector.
[0186] Optionally, the solution module 301 includes:
[0187] The first acquisition unit is used to acquire acceleration data and gyroscope data;
[0188] The first windowing processing unit is used to perform windowing processing on the acceleration data to obtain the acceleration data within the window.
[0189] The calculation unit is used to perform quaternion calculations on the acceleration data and gyroscope data within the window to obtain a four-dimensional spatial attitude signal.
[0190] Optionally, the first determining module 302 includes:
[0191] The second windowing processing unit is used to perform windowing processing on the four-dimensional spatial attitude signal to obtain the four-dimensional spatial attitude signal within the window.
[0192] The second acquisition unit is used to acquire the maximum and minimum values of the intensity of the four-dimensional spatial attitude signal within the window;
[0193] The first determining unit is used to determine the height difference reference value corresponding to the window based on the maximum and minimum values of the intensity of the four-dimensional spatial attitude signal within the window;
[0194] The second determining unit is used to determine the peak position sequence or trough position sequence corresponding to each dimension based on the height difference reference value corresponding to each window.
[0195] Optionally, the second determining unit is specifically used for:
[0196] The target set is determined based on the height difference reference value corresponding to each window, wherein the target set includes: peak position information and trough position information;
[0197] The amplitude difference between adjacent peaks and troughs is determined based on the peak and trough location information.
[0198] The location information to be deleted is determined based on the amplitude difference between adjacent peaks and troughs, wherein the location information to be deleted includes: pseudo-peak location information and / or pseudo-trough location information;
[0199] Based on the target set and the location information to be deleted, determine the peak position sequence or trough position sequence corresponding to each dimension.
[0200] Optionally, the second determining module 304 includes:
[0201] The third acquisition unit is used to acquire the confidence level of signals in adjacent intervals;
[0202] The third determining unit is used to determine the mean value of the motion feature vector of each interval signal in the target space attitude signal as the target motion feature vector, wherein the target space attitude signal includes a preset number of consecutive adjacent interval signals with a confidence level greater than a confidence level threshold.
[0203] Optionally, the third acquisition unit is specifically used for:
[0204] Obtain the duration of signals in adjacent intervals and the cross-correlation coefficient of signals in adjacent intervals;
[0205] The confidence level of the adjacent interval signal is determined based on the duration of the adjacent interval signal and the cross-correlation coefficient of the adjacent interval signal.
[0206] Optionally, the second determining module 304 further includes:
[0207] The fourth acquisition unit is used to acquire the 90th percentile and 10th percentile values of each interval signal in the target space attitude signal before determining the mean of the motion feature vector of each interval signal in the target space attitude signal as the target motion feature vector.
[0208] The fourth determining unit is used to determine the motion feature vector of each interval signal in the target space attitude signal based on the 90th percentile and 10th percentile values of each interval signal in the target space attitude signal before determining the mean value of the motion feature vector of each interval signal in the target space attitude signal as the target motion feature vector.
[0209] Optionally, the third determining unit includes:
[0210] The acquisition sub-unit is used to acquire the saliency factor of each target space attitude signal if there are at least two target space attitude signals.
[0211] A subunit is defined as the mean value of the motion feature vector of each interval signal in the target space attitude signal with the largest saliency factor among the at least two target space attitude signals, which is then used as the target motion feature vector.
[0212] Optionally, the acquisition subunit is specifically used for:
[0213] Obtain the difference between the 75th percentile and the 25th percentile of each interval signal in the spatial attitude signal of each target;
[0214] The sum of the differences between the 75th percentile and the 25th percentile of the interval signal in the target space attitude signal is determined as the significance factor of the target space attitude signal.
[0215] Optionally, the third determining module 305 is specifically used for:
[0216] If the overlap ratio between the motion feature vector and the target action fingerprint vector is greater than or equal to a ratio threshold, then the action corresponding to the target action fingerprint vector is counted.
[0217] The counting method provided in this embodiment of the invention can execute any embodiment of the invention and has the corresponding functional modules and beneficial effects of the execution method.
[0218] Example 4
[0219] Figure 7 A schematic diagram of an electronic device 40 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0220] like Figure 7 As shown, the electronic device 40 includes at least one processor 41 and a memory, such as a read-only memory (ROM) 42 or a random access memory (RAM) 43, communicatively connected to the at least one processor 41. The memory stores computer programs executable by the at least one processor. The processor 41 can perform various appropriate actions and processes based on the computer program stored in the ROM 42 or loaded into the RAM 43 from storage unit 48. The RAM 43 may also store various programs and data required for the operation of the electronic device 40. The processor 41, ROM 42, and RAM 43 are interconnected via a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.
[0221] Multiple components in electronic device 40 are connected to I / O interface 45, including: input unit 46, such as keyboard, mouse, etc.; output unit 47, such as various types of monitors, speakers, etc.; storage unit 48, such as disk, optical disk, etc.; and communication unit 49, such as network card, modem, wireless transceiver, etc. Communication unit 49 allows electronic device 40 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0222] Processor 41 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 41 performs the various methods and processes described above, such as counting methods:
[0223] Quaternion calculations are performed on acceleration and gyroscope data to obtain four-dimensional spatial attitude signals.
[0224] The peak position sequence or trough position sequence corresponding to each dimension is determined based on the intensity of the four-dimensional spatial attitude signal.
[0225] The four-dimensional spatial attitude signal is partitioned according to the peak position sequence or the trough position sequence to obtain the interval signal corresponding to each dimension;
[0226] Determine the target motion feature vector based on the interval signal;
[0227] The action count value is determined based on the target motion feature vector.
[0228] In some embodiments, the counting method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 48. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 40 via ROM 42 and / or communication unit 49. When the computer program is loaded into RAM 43 and executed by processor 41, one or more steps of the counting method described above may be performed. Alternatively, in other embodiments, processor 41 may be configured to execute the counting method by any other suitable means (e.g., by means of firmware).
[0229] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0230] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0231] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0232] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0233] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0234] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0235] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0236] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A counting method, characterized in that, include: Quaternion calculations were performed on the acceleration and gyroscope data to obtain the four-dimensional spatial attitude signal. The peak position sequence or trough position sequence corresponding to each dimension is determined based on the intensity of the four-dimensional spatial attitude signal. The four-dimensional spatial attitude signal is partitioned according to the peak position sequence or the trough position sequence to obtain the interval signal corresponding to each dimension; Determine the target motion feature vector based on the interval signal; The action count value is determined based on the target motion feature vector; Determining the action count value based on the motion feature vector includes: If the overlap ratio between the motion feature vector and the target action fingerprint vector is greater than or equal to a ratio threshold, then the action corresponding to the target action fingerprint vector is counted.
2. The method according to claim 1, characterized in that, Quaternion calculations are performed on the acceleration and gyroscope data to obtain a four-dimensional attitude signal, including: Acquire acceleration and gyroscope data; The acceleration data is windowed to obtain the acceleration data within the window; Quaternion calculations are performed on the acceleration data and gyroscope data within the window to obtain a four-dimensional spatial attitude signal.
3. The method according to claim 2, characterized in that, Determining the peak position sequence or trough position sequence corresponding to each dimension based on the intensity of the four-dimensional spatial attitude signal includes: The four-dimensional spatial attitude signal is windowed to obtain the four-dimensional spatial attitude signal within the window; Obtain the maximum and minimum values of the intensity of the four-dimensional spatial attitude signal within the window; The height difference reference value corresponding to the window is determined based on the maximum and minimum values of the intensity of the four-dimensional spatial attitude signal within the window; The peak position sequence or trough position sequence corresponding to each dimension is determined based on the height difference reference value corresponding to each window.
4. The method according to claim 3, characterized in that, Based on the height difference reference value corresponding to each window, determine the peak position sequence or trough position sequence for each dimension, including: The target set is determined based on the height difference reference value corresponding to each window, wherein the target set includes: peak position information and trough position information; The amplitude difference between adjacent peaks and troughs is determined based on the peak and trough location information. The location information to be deleted is determined based on the amplitude difference between adjacent peaks and troughs, wherein the location information to be deleted includes: pseudo-peak location information and / or pseudo-trough location information; Based on the target set and the location information to be deleted, determine the peak position sequence or trough position sequence corresponding to each dimension.
5. The method according to claim 4, characterized in that, Determining the target motion feature vector based on the interval signal includes: Obtain the confidence level of signals in adjacent intervals; The mean value of the motion feature vector of each interval signal in the target space attitude signal is determined as the target motion feature vector, wherein the target space attitude signal includes a preset number of consecutive adjacent interval signals with a confidence level greater than a confidence threshold.
6. The method according to claim 5, characterized in that, Obtain the confidence level of signals in adjacent intervals, including: Obtain the duration of signals in adjacent intervals and the cross-correlation coefficient of signals in adjacent intervals; The confidence level of the adjacent interval signal is determined based on the duration of the adjacent interval signal and the cross-correlation coefficient of the adjacent interval signal.
7. The method according to claim 5, characterized in that, Before determining the mean of the motion feature vector of each interval signal in the target space attitude signal as the target motion feature vector, the following steps are also included: Obtain the 90th and 10th percentile values of each interval of the target space attitude signal; The motion feature vector of each interval signal in the target space attitude signal is determined based on the 90th and 10th percentile values of each interval signal in the target space attitude signal.
8. The method according to claim 5, characterized in that, The mean value of the motion feature vector of each interval signal in the target space attitude signal is determined as the target motion feature vector, including: If there are at least two target space attitude signals, then obtain the salience factor for each target space attitude signal; The mean value of the motion feature vector of each interval signal in the target space attitude signal with the largest significance factor among the at least two target space attitude signals is determined as the target motion feature vector.
9. The method according to claim 8, characterized in that, Obtain the saliency factor of each target spatial attitude signal, including: Obtain the difference between the 75th percentile and the 25th percentile of each interval signal in the spatial attitude signal of each target; The sum of the differences between the 75th percentile and the 25th percentile of the interval signal in the target space attitude signal is determined as the significance factor of the target space attitude signal.
10. A counting device, characterized in that, include: The calculation module is used to perform quaternion calculations on acceleration data and gyroscope data to obtain four-dimensional spatial attitude signals; The first determining module is used to determine the peak position sequence or trough position sequence corresponding to each dimension based on the intensity of the four-dimensional spatial attitude signal. The partitioning module is used to partition the four-dimensional spatial attitude signal according to the peak position sequence or the trough position sequence to obtain the interval signal corresponding to each dimension. The second determining module is used to determine the target motion feature vector based on the interval signal; The third determining module is used to determine the action count value based on the target motion feature vector; Specifically, the third determining module is used for: If the overlap ratio between the motion feature vector and the target action fingerprint vector is greater than or equal to a ratio threshold, then the action corresponding to the target action fingerprint vector is counted.
11. An electronic device, characterized in that, include: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the processors implement the counting method as described in any one of claims 1-9.
12. A computer-readable storage medium containing a computer program, wherein the computer program is stored thereon, characterized in that, When the program is executed by one or more processors, it implements the counting method as described in any one of claims 1-9.
Citation Information
Patent Citations
Motion counting method and device, electronic equipment and computer storage medium
CN113902084A
Sports training method and system
CN114053679A
Golf swing analyzing method and apparatus
WO2015083990A1