Somatosensory game method based on swimming posture
By performing Kalman filtering and wave peak judgment on player posture data, the problem of low motion accuracy of IMU devices in somatosensory games is solved, and high-precision swimming posture recognition and game experience are achieved.
Patent Information
- Application Number
- CN202210667237.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-14
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2042-06-14
AI Technical Summary
The existing somatosensory game architecture is based on IMU equipment, which is prone to problems such as gyroscope drift, random angle wandering, rate machine wandering, and rate slope, resulting in low motion accuracy and misjudgment.
Using somatosensory game method based on swimming posture, Kalman filtering is performed by obtaining the original player's posture data, selecting the axis data matching the preset target axis as the target posture data, and determining whether the player has completed swimming based on the target posture data and the preset wave peak value Action, control the game characters to perform corresponding actions.
It improves the accuracy of players' swimming movements, reduces the delay of players' movements and game commands, and improves the gaming experience.
Smart Images

Figure CN114949839B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of somatosensory games, and in particular to a somatosensory game method and device based on swimming posture, and a computer-readable storage medium. Background Art
[0002] At present, the somatosensory game architecture on the market is usually based on the somatosensory action architecture of IMU (Inertial Measurement Unit). When playing games, players need to wear specific IMU devices, which can detect the user's motion posture data. The system can convert the motion posture data into action commands that the game can recognize, so that the objects in the game can perform basically the same actions as the user.
[0003] However, the problem with the IMU architecture is that during the game, problems such as gyroscope drift, angle random wandering, rate machine wandering, and rate slope are prone to occur, resulting in low action accuracy and easy misjudgment of player actions. Summary of the invention
[0004] The embodiment of the present application aims to improve the recognition accuracy of the player's swimming movements by providing a somatosensory gaming method based on swimming posture.
[0005] To achieve the above objectives, the present application provides a somatosensory gaming method based on swimming posture, comprising:
[0006] After the preset game-type somatosensory game is started, the original data of the player's posture detected by the somatosensory device is obtained;
[0007] Performing Kalman filtering on the raw data of the player's posture to estimate the player's real posture data;
[0008] Selecting axis data matching a preset target axis from the real posture data as target posture data;
[0009] Determine whether the player has completed the set swimming action based on the target posture data and the preset wave peak value;
[0010] If so, the player's game character is controlled to perform swimming actions.
[0011] In one embodiment, Kalman filtering is performed on the raw data of the player's gesture, including:
[0012] Performing primary filtering on the raw data of the player's posture to improve the smoothness of the data;
[0013] Kalman filter fusion is performed on the player's original posture data after primary filtering.
[0014] In one embodiment, primary filtering is performed on the raw data of the player's gesture to improve the smoothness of the data, including:
[0015] The player gesture raw data is primary filtered using a sliding average filter, wherein the output value of the sliding window of the sliding average filter is set to minimize the sum of the squares of each sample value in the window, and X satisfies the following formula:
[0016]
[0017] Among them, formula (2) is obtained by finding the limit of formula (1), where N is the filter order of the sliding window, X is the output value of the sliding window, and X is K is the sample value in the sliding window.
[0018] In one embodiment, before performing primary filtering on the raw data of the player's gesture to improve the smoothness of the data, the method further includes:
[0019] Performing the sliding average filtering of different filtering orders on the preset data set;
[0020] Generate a waveform graph after filtering a preset data set;
[0021] The filtering order when performing sliding average filtering on the player's posture raw data is determined according to the waveform diagram.
[0022] In one embodiment, performing Kalman filtering on the raw data of the player's posture further comprises:
[0023] Determine whether the signal-to-noise ratio of the player's posture raw data is not greater than a preset value;
[0024] If so, primary filtering is performed on the raw data of the player's posture.
[0025] In one embodiment, before selecting axis data matching a preset target axis from the real posture data as the target posture data, the method further includes:
[0026] According to a preset data set associated with the preset swimming type somatosensory game, an axis with the largest signal fluctuation is selected from the three-axis acceleration and the three-axis gyroscope as a preset target axis.
[0027] In one embodiment, judging whether the player has completed the set swimming action according to the target posture data and the preset peak value includes:
[0028] If the peak value of the target posture data is greater than the preset peak value, and the time interval between the peak value of the current target posture data and the peak value of the previous target posture data is greater than the preset time threshold, it is determined that the player has completed the set swimming action.
[0029] In one embodiment, controlling the game character of the player to perform a swimming action includes:
[0030] If it is determined that the player has completed the set swimming action, the preset counter counts up by one;
[0031] The player character is controlled to move to a preset target position, and the swimming animation of the player character is played.
[0032] To achieve the above-mentioned objectives, an embodiment of the present application also proposes a somatosensory gaming device based on swimming posture, comprising a memory, a processor, and a somatosensory gaming program based on swimming posture stored in the memory and executable on the processor, wherein when the processor executes the somatosensory gaming program based on swimming posture, a somatosensory gaming method based on swimming posture as described in any one of the above items is implemented.
[0033] To achieve the above-mentioned purpose, an embodiment of the present application also proposes a computer-readable storage medium, on which a somatosensory game program based on swimming posture is stored. When the somatosensory game program based on swimming posture is executed by a processor, a somatosensory game method based on swimming posture as described in any of the above items is implemented.
[0034] The somatosensory gaming method based on swimming posture of the present application estimates the real posture data of the player by performing Kalman filtering on the original signal of the player's posture, and then selects the axis data matching the preset target axis from the real posture data as the target posture data, and finally judges whether the player has completed the set swimming action according to the target posture data and the preset peak value. In this way, it can not only improve the recognition accuracy of the player's action, but also reduce the delay between the player's action and the game command, thereby improving the player's game experience. It can be seen that compared with the traditional somatosensory gaming method, the somatosensory gaming method of the present application has the advantages of high swimming posture recognition accuracy and good player game experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.
[0036] Figure 1 This is a module structure diagram of an embodiment of a somatosensory gaming device based on swimming posture according to the present invention;
[0037] Figure 2 It is a flow chart of an embodiment of a somatosensory gaming method based on swimming posture according to the present invention;
[0038] Figure 3 It is a flow chart of another embodiment of the somatosensory gaming method based on swimming posture of the present invention;
[0039] Figure 4 The figure is a flow chart of another embodiment of the somatosensory gaming method based on swimming posture of the present invention.
[0040] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0041] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0042] In order to better understand the above technical solution, exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0043] It should be noted that in the claims, any reference symbols placed between brackets shall not be constructed as limitations to the claims. The presence of "comprising" in the text does not exclude the presence of components or steps not listed in the claims. The quantifier "one" or "an" preceding a component does not exclude the presence of a plurality of such components. The present invention can be implemented by means of hardware comprising several different components and by means of appropriately programmed computers. In a unit claim that lists several means, several of these means may be embodied by the same hardware item. The use of "first", "second", and "third" etc. does not indicate any order, and these words may be interpreted as names.
[0044] like Figure 1 As shown, Figure 1 It is a structural diagram of a server 1 (also called a somatosensory gaming device based on swimming posture) in a hardware operating environment involved in an embodiment of the present invention.
[0045] The server of the embodiment of the present invention is a device with display function, such as "Internet of Things devices", smart air conditioners, smart lights, smart power supplies with networking functions, AR / VR devices with networking functions, smart speakers, self-driving cars, PCs, smart phones, tablet computers, e-book readers, portable computers, etc.
[0046] like Figure 1 As shown, the server 1 includes: a memory 11, a processor 12 and a network interface 13.
[0047] The memory 11 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of the server 1, such as a hard disk of the server 1. In other embodiments, the memory 11 may also be an external storage device of the server 1, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card, etc., equipped on the server 1.
[0048] Furthermore, the memory 11 may also include an internal storage unit of the server 1 and an external storage device. The memory 11 may be used not only to store application software and various data installed on the server 1, such as the code of the somatosensory game program 10 based on swimming posture, but also to temporarily store data that has been output or is to be output.
[0049] In some embodiments, the processor 12 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor or other data processing chip, used to run program codes or process data stored in the memory 11, such as executing a somatosensory game program 10 based on swimming posture.
[0050] The network interface 13 may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), and is generally used to establish a communication connection between the server 1 and other electronic devices.
[0051] The network may be the Internet, a cloud network, a wireless fidelity (Wi-Fi) network, a personal area network (PAN), a local area network (LAN), and / or a metropolitan area network (MAN). Various devices in the network environment may be configured to connect to the communication network according to various wired and wireless communication protocols. Examples of such wired and wireless communication protocols may include, but are not limited to, at least one of the following: Transmission Control Protocol and Internet Protocol (TCP / IP), User Datagram Protocol (UDP), Hypertext Transfer Protocol (HTTP), File Transfer Protocol (FTP), ZigBee, EDGE, IEEE 802.11, Light Fidelity (Li-Fi), 802.16, IEEE 802.11s, IEEE 802.11g, multi-hop communication, wireless access point (AP), device-to-device communication, cellular communication protocol, and / or Bluetooth (Blue Tooth) communication protocol or a combination thereof.
[0052] Optionally, the server may further include a user interface, which may include a display, an input unit such as a keyboard, and an optional user interface may further include a standard wired interface and a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device, etc. The display may also be referred to as a display screen or a display unit, which is used to display information processed in the server 1 and to display a visual user interface.
[0053] Figure 1 Only the server 1 having components 11-13 and the somatosensory game program 10 based on swimming posture is shown. It can be understood by those skilled in the art that Figure 1 The structure shown does not constitute a limitation on the server 1, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0054] In this embodiment, the processor 12 can be used to call the somatosensory game program based on swimming posture stored in the memory 11, and perform the following operations:
[0055] After the preset game-type somatosensory game is started, the original data of the player's posture detected by the somatosensory device is obtained;
[0056] Performing Kalman filtering on the raw data of the player's posture to estimate the player's real posture data;
[0057] Selecting axis data matching a preset target axis from the real posture data as target posture data;
[0058] Determine whether the player has completed the set swimming action based on the target posture data and the preset wave peak value;
[0059] If so, the player's game character is controlled to perform swimming actions.
[0060] In one embodiment, the processor 12 may be used to call a somatosensory game program based on swimming posture stored in the memory 11, and perform the following operations:
[0061] Performing primary filtering on the raw data of the player's posture to improve the smoothness of the data;
[0062] Kalman filter fusion is performed on the player's original posture data after primary filtering.
[0063] In one embodiment, the processor 12 may be used to call a somatosensory game program based on swimming posture stored in the memory 11, and perform the following operations:
[0064] The player gesture raw data is primary filtered using a sliding average filter, wherein the output value of the sliding window of the sliding average filter is set to minimize the sum of the squares of each sample value in the window, and X satisfies the following formula:
[0065]
[0066]
[0067] Among them, formula (2) is obtained by finding the limit of formula (1), where N is the filter order of the sliding window, X is the output value of the sliding window, and X is K is the sample value in the sliding window.
[0068] In one embodiment, the processor 12 may be used to call a somatosensory game program based on swimming posture stored in the memory 11, and perform the following operations:
[0069] Performing the sliding average filtering of different filtering orders on the preset data set;
[0070] Generate a waveform graph after filtering a preset data set;
[0071] The filtering order when performing sliding average filtering on the player's posture raw data is determined according to the waveform diagram.
[0072] In one embodiment, the processor 12 may be used to call a somatosensory game program based on swimming posture stored in the memory 11, and perform the following operations:
[0073] Determine whether the signal-to-noise ratio of the player's posture raw data is not greater than a preset value;
[0074] If so, primary filtering is performed on the raw data of the player's posture.
[0075] In one embodiment, the processor 12 may be used to call a somatosensory game program based on swimming posture stored in the memory 11, and perform the following operations:
[0076] According to a preset data set associated with the preset swimming type somatosensory game, an axis with the largest signal fluctuation is selected from the three-axis acceleration and the three-axis gyroscope as a preset target axis.
[0077] In one embodiment, the processor 12 may be used to call a somatosensory game program based on swimming posture stored in the memory 11, and perform the following operations:
[0078] If the peak value of the target posture data is greater than the preset peak value, and the time interval between the peak value of the current target posture data and the peak value of the previous target posture data is greater than the preset time threshold, it is determined that the player has completed the set swimming action.
[0079] In one embodiment, the processor 12 may be used to call a somatosensory game program based on swimming posture stored in the memory 11, and perform the following operations:
[0080] If it is determined that the player has completed the set swimming action, the preset counter counts up by one;
[0081] The player character is controlled to move to a preset target position, and the swimming animation of the player character is played.
[0082] Based on the hardware architecture of the somatosensory gaming device based on swimming posture, an embodiment of the somatosensory gaming method based on swimming posture of the present invention is proposed. The somatosensory gaming method based on swimming posture of the present invention aims to improve the recognition accuracy of the swimming action of the player.
[0083] Reference Figure 2 , Figure 2 This is an embodiment of a somatosensory gaming method based on swimming posture of the present invention, and the somatosensory gaming method based on swimming posture comprises the following steps:
[0084] S10. After the preset game-type somatosensory game is started, the original data of the player's posture detected by the somatosensory device is obtained.
[0085] Among them, game-type motion sensing games refer to games that imitate real swimming movements, such as breaststroke motion sensing games that imitate breaststroke movements, freestyle motion sensing games that imitate freestyle movements, and other motion sensing games that imitate butterfly stroke, backstroke and other swimming movements, which are not listed here one by one.
[0086] Furthermore, the preset swimming-type somatosensory game is run on a terminal, which may be a desktop computer, a laptop computer, a game console, a portable game console, a smart phone, a tablet computer, a smart watch, a smart TV, etc.
[0087] Among them, the somatosensory device refers to a device that can detect the player's posture data. Usually, the somatosensory device is configured to include a six-axis IMU sensor, which includes a three-axis accelerometer and a three-axis gyroscope. The six-axis IMU sensor detects the player's posture data by detecting the changes in the player's three-axis acceleration and three-axis angular velocity. Specifically, the somatosensory device is configured to be wearable, and its form includes but is not limited to the following: bracelets, gloves, watches, headscarves, hats, vests, fitness rings, and game controllers.
[0088] Furthermore, before the game, the somatosensory device needs to establish a communication connection with the terminal, wherein a wired connection or a wireless connection can be established between the somatosensory device and the terminal. Exemplarily, when the somatosensory device establishes a wired connection with the terminal, it can be based on at least one of the USB2.0 protocol, USB3.0 protocol, Thunderbolt 3 protocol, and Thunderbolt 4 protocol; and when the somatosensory device establishes a wireless connection with the terminal, it can be based on at least one of the Bluetooth protocol, WiFi protocol, infrared protocol, 2.4G communication protocol, and NFC protocol. After the somatosensory device establishes a communication connection with the terminal and the preset swimming-type somatosensory game is started, the somatosensory device will send the detected original signal of the player's posture to the terminal through at least one of the above-mentioned communication protocols. Among them, the original signal refers to the unfiltered three-axis acceleration signal and three-axis gyroscope signal detected by the somatosensory device.
[0089] S20: Perform Kalman filtering on the original data of the player's posture to estimate the player's real posture data.
[0090] Among them, Kalman filtering is an algorithm that uses the linear system state equation to optimally estimate the system state through the system input and output observation data. Since the observation data includes the influence of noise and interference in the system, the optimal estimation can also be regarded as a filtering process. That is to say, Kalman filtering the player's original posture data can reduce the noise in the player's original posture data, and then obtain posture data that is closer to the player's real action posture. It can be understood that through this real posture data, the terminal can more accurately determine whether the player is swimming.
[0091] Specifically, the Kalman filter algorithm can be fixed in the somatosensory game, so that the Kalman filter can be performed on the raw data of the player's posture when the raw data of the player's posture is received.
[0092] S30: Select axis data matching a preset target axis from the real posture data as target posture data.
[0093] It is worth noting that the raw data of the player's posture transmitted from the somatosensory device usually includes data of six axes, including three-axis acceleration data and three-axis gyroscope data. The preset target axis refers to the axis whose signal / data can best experience the player's swimming posture among the above six axes. In other words, the terminal can determine whether the player performs relevant swimming movements based only on the data of the preset target axis. Among them, the preset target axis matches the swimming-type somatosensory game currently running on the terminal, so that the preset target can most accurately reflect the player's swimming movements.
[0094] Specifically, when the terminal runs a preset swimming-type somatosensory game, the terminal can determine the preset target axis that matches the current swimming-type somatosensory game according to the swimming posture required by the current game-type somatosensory game. After performing Kalman filtering on the player's original posture data to obtain the real posture data, the terminal directly selects the posture data associated with the preset target axis from the real posture data as the target data. For example, if the preset target axis is the Y axis of the three-axis accelerometer, the data of the Y axis of the accelerometer is obtained from the real player posture data as the target data.
[0095] It can be understood that the above method can reduce the amount of data, which in turn helps reduce the amount of calculation of the terminal and is beneficial to improving the terminal's judgment speed on the player's swimming posture, thereby reducing the delay from player action to game action and improving the player's gaming experience.
[0096] S40: judging whether the player has completed the set swimming action according to the target posture data and the preset peak value.
[0097] The set swimming action refers to the swimming action that matches the current swimming type somatosensory game. For example, a breaststroke somatosensory game requires the player to complete the breaststroke action, and a freestyle somatosensory game requires the player to complete the freestyle action.
[0098] Specifically, after obtaining the target posture data, the target posture data can be converted into a waveform graph, and then the peak value of the waveform graph is obtained and compared with the preset peak value to determine whether the player has completed the set swimming action. Specifically, if the maximum peak value of the waveform in the waveform graph converted from the target data is greater than the preset peak value, it can be determined that the player has completed the set swimming action. It is worth noting that the waveform graph itself is a manifestation of the data. When determining whether the player has completed the set swimming action, the peak value can be directly calculated from the original data according to a specific data mapping relationship.
[0099] It can be understood that by judging whether the player has completed the set swimming action in the above manner, the terminal's calculation amount can be reduced while ensuring the accuracy of judging the player's action, which is conducive to improving the speed of judging the player's action, thereby reducing the delay from the player's action to the game action and improving the player's gaming experience.
[0100] S50: If yes, control the game character of the player to perform swimming action.
[0101] Among them, the game character refers to the character image of the player in the game, which can adopt the first-person perspective or the third-person perspective. In addition, this application does not limit the game character, which can be adaptively adjusted according to the game content and type.
[0102] Specifically, after determining that the player has correctly completed the set swimming action, the terminal controls the player's game character to perform the set swimming action to complete the mapping of the player's somatosensory action to the game operation command. For example, when the player is playing a breaststroke somatosensory game, if the player completes the breaststroke action that meets the standard, the game character in the terminal will also perform the corresponding breaststroke action and move towards the target direction (usually forward).
[0103] It can be understood that the somatosensory gaming method based on swimming posture of the present application estimates the real posture data of the player by performing Kalman filtering on the original signal of the player's posture, and then selects the axis data matching the preset target axis from the real posture data as the target posture data, and finally judges whether the player has completed the set swimming action according to the target posture data and the preset peak value. In this way, it can not only improve the recognition accuracy of the player's action, but also reduce the delay between the player's action and the game command, thereby improving the player's game experience. It can be seen that compared with the traditional somatosensory gaming method, the somatosensory gaming method of the present application has the advantages of high swimming posture recognition accuracy and good player game experience.
[0104] like Figure 3 As shown, in some embodiments, Kalman filtering is performed on the raw data of the player's posture, including:
[0105] S21. Perform primary filtering on the original data of the player's posture to improve the smoothness of the data.
[0106] Specifically, improving the smoothness of data means that the waveform of the filtered raw data of the player's posture is smoother than the waveform of the original data. Its essence is to filter out obviously abnormal data in the raw data of the player's posture through primary filtering, thereby improving the smoothness of the waveform.
[0107] Exemplarily, the sliding average method, variance method, and normalization method may be used to perform primary filtering on the player's posture raw data.
[0108] S22, performing Kalman filter fusion on the player's original posture data after primary filtering.
[0109] Specifically, after primary filtering of the raw data of the player's posture, Kalman filtering can be performed on the raw data of the player's posture.
[0110] It can be understood that by performing primary filtering on the original data of the player's posture, the credibility of the original data of the player's posture detected by the somatosensory device can be improved. In this way, after Kalman filtering, the matching degree between the real data of the player's posture and the player's real swimming posture can be improved.
[0111] In some embodiments, primary filtering is performed on the raw data of the player's gesture to improve the smoothness of the data, including:
[0112] The player gesture raw data is primary filtered using a sliding average filter, wherein the output value of the sliding window of the sliding average filter is set to minimize the sum of the squares of each sample value in the window, and X satisfies the following formula:
[0113]
[0114]
[0115] Among them, formula (2) is obtained by finding the limit of formula (1), where N is the filter order of the sliding window, X is the output value of the sliding window, and X is K is the sample value in the sliding window.
[0116] Specifically, sliding average filtering means setting a sliding window to slide on the data along the time direction, outputting a value as the filtered value each time, and sliding only one sampling value each time. Among them, the filtering order of the sliding window can also be understood as the length of the window, that is, the number of sampling values that the window can cover, and the sampling value refers to the original data of the player's posture.
[0117] Usually, the output value of the sliding window is the average value of each sample value in the window, while in the technical solution of the present application, it is required that the output value of the sliding window and the sum of the squares of each sample value in the window be minimized. In this way, compared with the method of outputting the average value, it can be closer to the true value, that is, the filtering effect of noise in the data is better.
[0118] It can be understood that the above method can be used to generate an effective and stable waveform for the player's posture raw data. Of course, the design of the present application is not limited to this. In other embodiments, the player's posture raw data can also be primary filtered by a conventional sliding average method.
[0119] like Figure 4 As shown, in some embodiments, before performing primary filtering on the player gesture raw data to improve the smoothness of the data, the method further includes:
[0120] S110, performing the sliding average filtering of different filtering orders on the preset data set.
[0121] Among them, the preset data set refers to a data set established by collecting posture data of players when performing set swimming movements.
[0122] S120, generating a waveform diagram of the filtered preset data set.
[0123] Specifically, after filtering is completed, we can generate a corresponding waveform graph for each filtered data, wherein the horizontal axis of the waveform graph is time and the vertical axis is the amplitude of the wave.
[0124] S130, confirming the filter order when performing sliding average filtering on the player's posture raw data according to the waveform diagram.
[0125] Specifically, before primary filtering the player's posture raw data, we can use the same filtering method (i.e., sliding average filtering) to filter the preset data set, but when filtering the preset data set, we use sliding windows of multiple filtering orders at the same time. Since the preset data set is a known data set, we can observe the waveform after filtering to determine which sliding window of filtering order can achieve the best smoothing effect and avoid overfitting of the filtering result.
[0126] It can be understood that the best filtering order can be obtained through the above method, thereby obtaining the best primary filtering effect.
[0127] In some embodiments, performing Kalman filtering on the raw data of the player's posture further includes:
[0128] Determine whether the signal-to-noise ratio of the player's gesture raw data is not greater than a preset value; if so, perform primary filtering on the player's gesture raw data.
[0129] Among them, the signal-to-noise ratio can indicate the proportion of noise in the data. The larger the signal-to-noise ratio, the less noise there is in the data. Conversely, the smaller the signal-to-noise ratio, the more noise there is in the data.
[0130] Specifically, the player's posture raw data usually includes valid information (i.e., accurate information) and invalid information (i.e., noise). So, if we use S i Indicates valid information, using C i represents invalid information, then the sum of valid information is:
[0131]
[0132] The sum of invalid information is:
[0133]
[0134] By taking the arithmetic average of the sum of the above valid information and the sum of the invalid information, we can get the signal-to-noise ratio after arithmetic average:
[0135]
[0136] In this way, after obtaining the signal-to-noise ratio of the player's original data in the above manner, the signal-to-noise ratio can be compared with the preset value. If the signal-to-noise ratio is less than or equal to (i.e., not greater than) the preset value, it means that there is a lot of noise in the player's posture data. At this time, the player's posture original data needs to be primary filtered. On the contrary, if the signal-to-noise ratio is not greater than the preset value, it means that there is less noise in the player's posture data. At this time, the player's posture original data may not be primary filtered to save the terminal's calculation amount and calculation time.
[0137] It can be understood that by determining whether to perform primary filtering on the player's posture data in the above manner, the terminal can adaptively perform primary filtering on the player's posture raw data, thereby being able to take into account both data accuracy and terminal calculation speed, avoiding unnecessary waste of computing power, and improving the speed of judging the player's swimming movements.
[0138] In some embodiments, before selecting axis data matching a preset target axis from the real posture data as the target posture data, the method further includes:
[0139] According to a preset data set associated with the preset swimming type somatosensory game, an axis with the largest signal fluctuation is selected from the three-axis acceleration and the three-axis gyroscope as a preset target axis.
[0140] It is worth noting that although the three-axis accelerometer and the three-axis gyroscope can generate signals on a total of six axes when the player makes a swimming action, there will inevitably be one axis whose signal intensity fluctuates most violently. The signal associated with the axis with the largest signal intensity fluctuation can best reflect the player's swimming posture among the six axis signals, so the player's swimming posture can be identified based on the signal of this axis alone. Among them, the preset data set associated with the preset swimming-type somatosensory game refers to a data set established by collecting the player's posture data when the player performs the set swimming action. The preset data set is a known data set with label information. By converting the data of each axis in the known data set into a waveform graph, and then observing the waveform graph of each axis, it can be determined which axis has the largest signal fluctuation in a complete swimming action. Among them, the intensity of the waveform change can be determined based on the maximum amplitude of the wave and the duration of the maximum amplitude. Generally speaking, the larger the maximum amplitude of a certain axis and the longer the duration of the maximum amplitude, the greater the signal change intensity of the axis.
[0141] In some embodiments, judging whether the player has completed the set swimming action according to the target posture data and the preset peak value includes:
[0142] If the peak value of the target posture data is greater than the preset peak value, and the time interval between the peak value of the current target posture data and the peak value of the previous target posture data is greater than the preset time threshold, it is determined that the player has completed the set swimming action.
[0143] Among them, the current target posture data refers to the posture data of the player who is currently judging the sports posture, and the previous target posture data refers to the posture data when it is determined that the player has completed a swimming action. In other words, the current target posture data and the previous target posture data can be understood as the posture data matched by two adjacent swimming actions.
[0144] Specifically, after obtaining the target posture data, the target posture data can be converted into a waveform graph, and then the peak value of the waveform graph is obtained and compared with the preset peak value. If the peak value of the waveform in the waveform graph converted from the target data is greater than the preset peak value, and the time interval between the current peak value and the previous peak value is greater than the preset time threshold, it can be determined that the player has currently completed the set swimming action. The preset time threshold is set to ensure the recognition accuracy of the player's swimming posture, which can further prevent the player's other misoperations from interfering with the player's swimming posture.
[0145] It can be understood that the above method can enhance the accuracy of judging the player's swimming posture.
[0146] In some embodiments, controlling the player's game character to perform a swimming action includes:
[0147] S210: If it is determined that the player has completed the set swimming action, the preset counter counts up by one.
[0148] Specifically, the preset counter refers to a counter for counting the number of times the player completes swimming actions. The counter can be used to calculate the total number of swimming actions completed by the player, and based on the total number of swimming actions, it can be determined whether the player has completed the swimming goal. Specifically, when the value of the counter is equal to the preset number of times, it can be determined that the player has completed the swimming goal.
[0149] S220, controlling the player character to move to a preset target position, and playing a swimming animation of the player character.
[0150] Specifically, when the counter counts +1, it is considered that the player has completed the set swimming action. At this time, the player character can be controlled to move to a preset target position and the swimming animation of the player character can be played. The preset target position is usually the end position set in the game. Among them, playing the swimming animation of the player character can make the game action consistent with the player action to enhance the player's gaming experience.
[0151] In addition, the embodiment of the present invention also proposes a computer-readable storage medium, which can be any one or any combination of a hard disk, a multimedia card, an SD card, a flash memory card, an SMC, a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a portable compact disk read-only memory (CD-ROM), a USB memory, etc. The computer-readable storage medium includes a somatosensory game program 10 based on swimming postures. The specific implementation of the computer-readable storage medium of the present invention is roughly the same as the specific implementation of the somatosensory game method based on swimming postures and the server 1, which will not be repeated here.
[0152] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0153] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0154] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0155] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0156] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0157] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A somatosensory gaming method based on swimming posture, It is characterized in that include: After the preset swimming-type motion sensing game is started, the original data of the player's posture detected by the motion sensing device is obtained; Performing Kalman filtering on the raw data of the player's posture to estimate the player's real posture data; Selecting axis data matching a preset target axis from the real posture data as target posture data; Determining whether the player has completed the set swimming action according to the target posture data and the preset peak value, wherein determining whether the player has completed the set swimming action according to the target posture data and the preset peak value includes: if the peak value of the target posture data is greater than the preset peak value, and the time interval between the peak value of the current target posture data and the peak value of the previous target posture data is greater than the preset time threshold, then determining that the player has completed the set swimming action; If so, control the player's game character to perform swimming actions; Performing Kalman filtering on the raw data of the player's posture includes: Performing primary filtering on the raw data of the player's posture to improve the smoothness of the data; Perform Kalman filter fusion on the player's original posture data after primary filtering; The player's posture raw data is subjected to primary filtering to improve the smoothness of the data, including: The player gesture raw data is primary filtered using a sliding average filter, wherein the output value of the sliding window of the sliding average filter is set to minimize the sum of the squares of each sample value in the window, and X satisfies the following formula: ……(1); ……(2); Among them, formula (2) is obtained by finding the limit of formula (1), where N is the filter order of the sliding window, X is the output value of the sliding window, is the sampling value in the sliding window; Before performing primary filtering on the raw data of the player's posture to improve the smoothness of the data, the method further includes: Performing the sliding average filtering of different filtering orders on the preset data set; Generate a waveform graph after filtering a preset data set; The filtering order when performing sliding average filtering on the player's posture raw data is determined according to the waveform diagram.
2. The somatosensory gaming method based on swimming posture as claimed in claim 1, It is characterized in that Performing Kalman filtering on the player's original posture data also includes: Determine whether the signal-to-noise ratio of the player's posture raw data is not greater than a preset value; If so, primary filtering is performed on the raw data of the player's posture.
3. The somatosensory gaming method based on swimming posture as claimed in claim 1, It is characterized in that Before selecting axis data matching a preset target axis from the real posture data as target posture data, the method further includes: According to a preset data set associated with the preset swimming type somatosensory game, an axis with the largest signal fluctuation is selected from the three-axis acceleration and the three-axis gyroscope as a preset target axis.
4. The somatosensory gaming method based on swimming posture as claimed in claim 1, It is characterized in that Control the player's game character to perform swimming actions, including: If it is determined that the player has completed the set swimming action, the preset counter counts up by one; The game character of the player is controlled to move to a preset target position, and a swimming animation of the game character of the player is played.
5. A somatosensory gaming device based on swimming posture, It is characterized in that It includes a memory, a processor, and a somatosensory game program based on swimming posture stored in the memory and executable on the processor. When the processor executes the somatosensory game program based on swimming posture, the somatosensory game method based on swimming posture as described in any one of claims 1 to 4 is implemented.
6. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a somatosensory game program based on swimming posture, and when the somatosensory game program based on swimming posture is executed by a processor, the somatosensory game method based on swimming posture as described in any one of claims 1-4 is implemented.
Citation Information
Patent Citations
Human body action identification system
CN106325527A
Step counting method capable of recognizing movement types, mobile terminal and storage medium
CN107016384A
Storage medium, information processing system, information processing apparatus, and information processing method
CN112169307A
