Anti-jitter method for gesture recognition in VR scene and related equipment
By obtaining the user's hand position in the VR environment, calculating the average moving speed of the object and dynamically adjusting the filter size, the problem of hand position jitter in the VR environment is solved, and a smoother user interaction experience is achieved.
Patent Information
- Application Number
- CN202510184224.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-19
- Publication Date
- 2025-06-10
AI Technical Summary
In VR environment, due to the high speed and complexity of hand movement, the capture and presentation of hand positions often have problems such as jitter and non-smoothing, which seriously affects the user's immersion and interactive experience.
By obtaining the hand position of the user wearing VR device, calculating the average moving speed of the object, dynamically adjusting the size of the position filter, and performing position smoothing processing on the hand position, achieving smooth presentation of the hand position.
It improves the smoothness of hand position, reduces jitter, and improves the user experience and interactive realism in VR scenes.
Smart Images

Figure CN120122809A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of virtual reality technology, and particularly to a method for preventing jitter in gesture recognition in a VR scene and related devices. Background Art
[0002] With the rapid development of virtual reality (VR) technology, gesture interaction has become one of the key technologies to enhance the user experience. However, in a VR environment, due to the high speed and complexity of hand movements, there are often problems of jitter and unevenness in the capture and presentation of hand positions, which seriously affect the user's immersion and interaction experience. Although there are some smoothing algorithms in the existing technology, when dealing with hand movements at different speeds, they often cannot take into account both smoothness and response speed at the same time, resulting in a poor user experience in the VR scene. Summary of the Invention
[0003] This application provides a method for preventing jitter in gesture recognition in a VR scene and related devices, which can solve the problem of poor user experience in the VR scene.
[0004] In a first aspect, an embodiment of this application provides a method for preventing jitter in gesture recognition in a VR scene. The method for preventing jitter in gesture recognition in the VR scene includes:
[0005] Obtain the hand positions of a user wearing a VR device at T moments; the T-th moment is the current moment;
[0006] For each hand position respectively, determine the object position of the virtual object corresponding to the user's hand in the VR scene at the current moment based on the hand position;
[0007] Calculate the average moving speed of the objects according to all the object positions, and calculate the initial size of the position filter according to the average moving speed of the objects. Adjust the initial size based on the size of the position filter at the previous moment of the current moment to obtain the filter size of the position filter at the current moment;
[0008] Perform position smoothing on all the object positions according to the filter size at the current moment to obtain the smoothed object positions at the current moment.
[0009] Optionally, calculating the average moving speed of the objects according to all the object positions includes:
[0010] For each two adjacent moments among the T moments, calculate the distance between the object positions at the two adjacent moments, and calculate the speed according to the distance and the time difference between the two adjacent moments;
[0011] Average all the speeds to obtain the average moving speed of the objects.
[0012] Optionally, calculating the initial size of the position filter according to the average moving speed of the object, including:
[0013] Dividing the average moving speed of the object by the maximum speed threshold to obtain a size factor;
[0014] Calculating the initial size of the position filter according to the size factor.
[0015] Optionally, calculating the initial size of the position filter according to the size factor, including:
[0016] Through the formula:
[0017] EILTER_SIZE
[0018] =CLAMP(INT(MIN_FILTER_SIZE+SIZE_FACTOR*(MAX_FILTER_SIZE-MIN_FILTER_SIZE)),MAX_FILTER_SIZE,MIN_FILTER_SIZE)
[0019] Calculating the initial size FILTER_SIZE;
[0020] Where, CLAMP represents interval limitation, INT represents taking an integer, MIN_FILTER_SIZE represents the minimum size threshold, SIZE_FACTOR represents the size factor, and MAX_FILTER_SIZE represents the maximum size threshold.
[0021] Optionally, adjusting the initial size based on the size of the position filter at the previous moment of the current moment to obtain the filter size of the position filter at the current moment, including:
[0022] If the initial size of the position filter is greater than the size at the previous moment of the current moment, adding 1 to the initial size to obtain the filter size of the position filter at the current moment;
[0023] If the initial size of the position filter is less than the size at the previous moment of the current moment, subtracting 1 from the initial size to obtain the filter size of the position filter at the current moment;
[0024] If the initial size of the position filter is equal to the size at the previous moment of the current moment, using the initial size as the filter size of the position filter at the current moment.
[0025] Optionally, performing position smoothing on all object positions according to the filter size at the current moment to obtain the smoothed object positions at the current moment, including:
[0026] Adding the object positions at all moments to the filter queue in sequence according to the order of all moments;
[0027] Determine whether the length of the filter queue is greater than the filter size at the current moment;
[0028] If so, remove the first n object positions in the filter queue, and use all the remaining object positions in the filter queue as the target object positions; n is the difference between the filter size and the number of object positions;
[0029] Otherwise, use all the object positions in the filter queue as the target object positions;
[0030] Average all the target object positions to obtain the smoothed object position at the current moment.
[0031] Optionally, averaging all the target object positions to obtain the smoothed object position at the current moment includes:
[0032] For each target object position, use the position number of the target object position in the filter queue as the weight of the target object position;
[0033] Perform weighted averaging on all the target object positions according to all the weights to obtain the smoothed object position at the current moment.
[0034] In a second aspect, the present application provides a method and apparatus for anti-shake gesture recognition in a VR scene, including:
[0035] An acquisition module, configured to acquire the hand positions of a user wearing a VR device at T moments; the T-th moment is the current moment;
[0036] A determination module, configured to, for each hand position, determine the object position of the virtual object corresponding to the user's hand in the VR scene at the current moment based on the hand position;
[0037] A calculation module, configured to calculate the average moving speed of the object according to all the object positions, calculate the initial size of the position filter according to the average moving speed of the object, and adjust the initial size based on the size of the position filter at the previous moment of the current moment to obtain the filter size of the position filter at the current moment;
[0038] A position smoothing module, configured to perform position smoothing on all the object positions according to the filter size at the current moment to obtain the smoothed object position at the current moment.
[0039] In a third aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the anti-shake method for gesture recognition in the VR scene described above is implemented.
[0040] Fourthly, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which when executed by a processor implements the above-mentioned anti-shake method for gesture recognition in a VR scenario.
[0041] The above solution of the present application has the following beneficial effects:
[0042] In the embodiment of the present application, by obtaining the hand positions of the user wearing the VR device at T moments, and then for each hand position, determining the object position of the virtual object corresponding to the user's hand in the VR scenario at the current moment based on the hand position, then calculating the average moving speed of the object according to all object positions, and calculating the initial size of the position filter according to the average moving speed of the object, and adjusting the initial size based on the size of the position filter at the previous moment of the current moment to obtain the filter size of the position filter at the current moment, and then smoothing all object positions according to the filter size at the current moment to obtain the smoothed object position at the current moment. Among them, calculating the initial size according to the average moving speed of the object and adjusting the initial size based on the size of the position filter at the previous moment realizes the dynamic adjustment of the filter size at the current moment according to the actual hand movement condition and the size at the previous moment, improves the practicality and accuracy of the filter size, and at the same time reduces the instability of the filter size in time series. Smoothing the position according to the filter size can improve the smoothness of the hand position and reduce jitter, and enhance the user experience in the VR scenario.
[0043] Other beneficial effects of the present application will be described in detail in the subsequent specific implementation part. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0045] Figure 1 It is a flowchart of the anti-shake method for gesture recognition in a VR scenario provided by an embodiment of the present application;
[0046] Figure 2 It is a specific process schematic diagram of the anti-shake method for gesture recognition in a VR scenario provided by an embodiment of the present application;
[0047] Figure 3 It is a structural schematic diagram of the anti-shake device for gesture recognition in a VR scenario provided by an embodiment of the present application;
[0048] Figure 4 This is a schematic structural diagram of a terminal device provided by an embodiment of the present application. Detailed implementation manners
[0049] In the following description, specific details such as specific system architectures and technologies are presented for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present application. However, those skilled in the art should clearly understand that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from interfering with the description of the present application.
[0050] It should be understood that when used in the specification and claims of the present application, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.
[0051] It should also be understood that the term "and / or" as used in the specification and claims of the present application refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0052] As used in the specification and claims of the present application, the term "if" can be interpreted as "when", "once", "in response to determining", or "in response to detecting" depending on the context. Similarly, the phrase "if determined" or "if detecting [the described condition or event]" can be interpreted as meaning "once determined", "in response to determining", "once detecting [the described condition or event]", or "in response to detecting [the described condition or event]" depending on the context.
[0053] In addition, in the description of the specification and claims of the present application, the terms "first", "second", "third", etc. are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance.
[0054] The reference to "an embodiment" or "some embodiments" etc. described in the specification of the present application means that a specific feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, the statements "in an embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments", etc. that appear in different places in this specification do not necessarily all refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "comprising", "including", "having", and their variants all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0055] In view of the problem of poor user experience in the existing VR scenarios, an embodiment of the present application provides a method for preventing hand gesture recognition jitter in a VR scenario. The method for preventing hand gesture recognition jitter in the VR scenario obtains the hand positions of a user wearing a VR device at T moments, and then for each hand position, determines the object position of the virtual object corresponding to the user's hand in the VR scenario at the current moment based on the hand position. Then, calculates the average object movement speed according to all the object positions, and calculates the initial size of the position filter according to the average object movement speed. Adjusts the initial size based on the size of the position filter at the previous moment of the current moment to obtain the filter size of the position filter at the current moment. Then, performs position smoothing on all the object positions according to the filter size at the current moment to obtain the smoothed object position at the current moment. Among them, calculating the initial size according to the average object movement speed and adjusting the initial size based on the size of the position filter at the previous moment realizes the dynamic adjustment of the filter size at the current moment according to the actual hand movement condition and the size at the previous moment, improves the practicality and accuracy of the filter size, and at the same time reduces the instability of the filter size in time series. Smoothing the position according to the filter size can improve the smoothness of the hand position and reduce jitter, thus enhancing the user experience in the VR scenario.
[0056] Next, an exemplary description is given of the method for preventing hand gesture recognition jitter in the VR scenario provided by the present application.
[0057] As Figure 1 shown, the method for preventing hand gesture recognition jitter in the VR scenario provided by the present application includes the following steps:
[0058] Step 11, obtain the hand positions of a user wearing a VR device at T moments.
[0059] The above-mentioned T-th moment is the current moment. For example, if the current moment is 10 seconds past 5 minutes and T = 5, then the T moments can be 8 seconds past 5 minutes, 8.5 seconds past 5 minutes, 9 seconds past 5 minutes, 9.5 seconds past 5 minutes, and 10 seconds past 5 minutes. In the VR interaction scenario, the time difference between two moments can be set to 0.5 seconds. The hand position is the position of the user's left or right hand in the real space in the VR scenario. The VR device can be a hand-tracking glove, etc.
[0060] In some embodiments of the present application, the hand position can be obtained by using a position capture device (such as an infrared sensor, an optical tracking device) in the VR scenario.
[0061] Step 12, for each hand position, determine the object position of the virtual object corresponding to the user's hand in the VR scenario at the current moment based on the hand position.
[0062] Exemplarily, a VR device (such as a camera or a sensor device, such as a hand-tracking glove, etc.) can be used to map the hand position of the user in the real scene to the VR scene, so as to obtain the object position of the virtual object (such as a virtual hand) corresponding to the user's hand.
[0063] Step 13: Calculate the average moving speed of the object according to all object positions, calculate the initial size of the position filter according to the average moving speed of the object, and adjust the initial size based on the size of the position filter at the previous moment of the current moment to obtain the filter size of the position filter at the current moment.
[0064] The above-mentioned position filter is a filter deployed in a program on a VR device for processing object positions.
[0065] In some embodiments of the present application, the steps of calculating the average moving speed of the object according to all object positions, calculating the initial size of the position filter according to the average moving speed of the object, and adjusting the initial size based on the size of the position filter at the previous moment of the current moment to obtain the filter size of the position filter at the current moment are specifically as follows:
[0066] The first step: Calculate the average moving speed of the object according to all object positions.
[0067] Specifically, for each two adjacent moments among T moments, calculate the distance between the object positions at the two adjacent moments, calculate the speed according to the distance and the time difference between the two adjacent moments; average all the speeds to obtain the average moving speed of the object.
[0068] It should be noted that the distance between object positions can be the Euclidean distance, and the speed can be calculated according to the distance and the time difference through the speed calculation formula.
[0069] The second step: Divide the average moving speed of the object by the maximum speed threshold to obtain a size factor.
[0070] The above-mentioned size factor is used to adjust the size of the filter. The maximum speed threshold corresponds to the maximum size of the filter, so using this size factor can map the current average speed to between the minimum size (MinFilterSize) and the maximum size (MaxFilterSize) of the filter, so as to obtain a filter size value (CurFilterSize) suitable for the current speed.
[0071] It should be noted that the maximum speed threshold is set according to the actual hand movement condition. It is assumed that the hand movement speed will not exceed a certain reasonable value (the maximum speed threshold), such as 1.3 m / s.
[0072] The third step: Calculate the initial size of the position filter according to the size factor.
[0073] Through the formula:
[0074] EILTER_SIZE
[0075] = CLAMP(INT(MIN_FILTER_SIZE + SIZE_FACTOR * (MAX_FILTER_SIZE - MIN_FILTER_SIZE)), MAX_FILTER_SIZE, MIN_FILTER_SIZE)
[0076] Calculate the initial size FILTER_SIZE.
[0077] Where, CLAMP represents interval limitation, INT represents taking an integer, MIN_FILTER_SIZE represents the minimum size threshold, SIZE_FACTOR represents the size factor, and MAX_FILTER_SIZE represents the maximum size threshold.
[0078] It should be noted that the minimum size threshold and the maximum size threshold are preset values. For example, the minimum size threshold is 5 and the maximum size threshold is 15.
[0079] Step 4: Adjust the initial size based on the size of the position filter at the previous moment of the current moment to obtain the filter size of the position filter at the current moment.
[0080] If the initial size of the position filter is greater than the size at the previous moment of the current moment, add 1 to the initial size to obtain the filter size of the position filter at the current moment;
[0081] If the initial size of the position filter is less than the size at the previous moment of the current moment, subtract 1 from the initial size to obtain the filter size of the position filter at the current moment;
[0082] If the initial size of the position filter is equal to the size at the previous moment of the current moment, use the initial size as the filter size of the position filter at the current moment.
[0083] Exemplarily, in order to avoid frequent updates of the filter size, an inspection interval can be set. Only when the time difference between the update moment of the previous filter size and the current moment is greater than or equal to the inspection interval, this step is used to calculate the filter size at the current moment. Otherwise, use the filter size at the previous moment as the filter size at the current moment.
[0084] It should be noted that when the current moment is the 1st moment, the filter size at the current moment is the preset initial size.
[0085] It is worth mentioning that adjusting the initial size at the current moment according to the size at the previous moment can improve the stability of the filter size. When the initial size is greater than or less than the filter size at the previous moment, in order to avoid drastic changes in the filter size leading to significant changes in the accuracy of position smoothing, the initial size is adjusted by the method described above, effectively improving the stability of the filter size.
[0086] Step 14, perform position smoothing on all object positions according to the filter size at the current moment to obtain the smoothed object positions at the current moment.
[0087] In some embodiments of the present application, the step of performing position smoothing on all object positions according to the filter size at the current moment to obtain the smoothed object positions at the current moment includes:
[0088] The first step is to add the object positions at all moments to the filter queue in sequence according to the order of all moments.
[0089] Specifically, add all object positions to the filter queue in the order from the earliest to the latest moment. The earlier the moment corresponding to the object position, the more forward the sorting in the filter queue.
[0090] The second step is to determine whether the length of the filter queue is greater than the filter size at the current moment.
[0091] If so, remove the first n object positions in the filter queue, and use the remaining object positions in the filter queue as the target object positions; n is the difference between the filter size and the number of object positions.
[0092] Otherwise, use all object positions in the filter queue as the target object positions.
[0093] Average all target object positions to obtain the smoothed object positions at the current moment.
[0094] Specifically, for each target object position, use the position number of the target object position in the filter queue as the weight of the target object position; perform weighted averaging on all target object positions according to all weights to obtain the smoothed object positions at the current moment.
[0095] It should be noted that the smoothed object positions at the current moment can also be obtained by linearly averaging all target object positions, that is, summing all target object positions and then dividing by the number of target object positions. After obtaining the smoothed object positions, use the VR device to move the corresponding objects in the VR scene to these smoothed object positions to achieve the interaction between the user and the VR scene.
[0096] It is worth mentioning that obtaining the positions of multiple target objects according to the filter size can dynamically adjust the number of target object positions, effectively smooth the position data during hand movement, and reduce the jitter phenomenon. In addition, determining the weight of the target object position according to its number in the queue ensures that the latest target object position has the highest weight, further improving the accuracy of position smoothing.
[0097] Exemplarily, the pseudo-code for implementing the above steps 13 - 14 is as follows:
[0098] / / Initialize parameters
[0099] MAX_FILTER_SIZE = 15
[0100] MIN_FILTER_SIZE = 5
[0101] LEFT_FILTER_SIZE = 5 / / Initial left hand filter size, which will be dynamically adjusted according to speed
[0102] MAX_SPEED_THRESHOLD = 1.3f / / Maximum speed threshold
[0103] SPEED_CHECK_INTERVAL = 0.5f
[0104] CURRENT_SPEED_CHECK_TIME = 0
[0105] FILTER_SPEED_SUM = 0 / / Used to calculate the average speed within a certain period of time
[0106] FILTER_AVG_SPEED_COUNT = 0
[0107] / / Function to update the hand root position
[0108] FUNCTION UPDATE_HAND_ROOT_POS(LEFT_POS):
[0109] LEFT_VELOCITY = (LEFT_POS - LAST_LEFT_ROOT_HAND_POS) / DELTA_TIME
[0110] LAST_LEFT_ROOT_HAND_POS = LEFT_POS
[0111] LEFT_SPEED = MAGNITUDE(LEFT_VELOCITY)
[0112] IF ENABLE_FILTER_WINDOW_CHANGE:
[0113] LEFT_FILTER_SIZE = CALCULATE_FILTER_SIZE(LEFT_SPEED, LEFT_FILTER_SIZE)
[0114] LEFT_POSITION_QUEUE.ENQUEUE(LEFT_POS)
[0115] WHILE LEFT_POSITION_QUEUE.COUNT > LEFT_FILTER_SIZE:
[0116] LEFT_POSITION_QUEUE.DEQUEUE()
[0117] LEFT_SUM = VECTOR3_ZERO
[0118] FOR EACH POS IN LEFT_POSITION_QUEUE:
[0119] LEFT_SUM += POS
[0120] LEFT_FILTERED_POSITION = LEFT_SUM / LEFT_POSITION_QUEUE.COUNT
[0121] / / Method for calculating FILTER_SIZE based on speed
[0122] FUNCTION CALCULATE_FILTER_SIZE(SPEED, CUR_FILTER_SIZE):
[0123] IF CURRENT_SPEED_CHECK_TIME > SPEED_CHECK_INTERVAL:
[0124] CURRENT_SPEED_CHECK_TIME = 0
[0125] AVG_SPEED = FILTER_SPEED_SUM / FILTER_AVG_SPEED_COUNT
[0126] FILTER_SPEED_SUM = 0
[0127] FILTER_AVG_SPEED_COUNT = 0
[0128] SIZE_FACTOR = AVG_SPEED / MAX_SPEED_THRESHOLD
[0129] FILTER_SIZE = CLAMP(INT(MIN_FILTER_SIZE + SIZE_FACTOR *
[0130] (MAX_FILTER_SIZE - MIN_FILTER_SIZE)), MIN_FILTER_SIZE, MAX_FILTER_SIZE)
[0131] IF FILTER_SIZE > CUR_FILTER_SIZE:
[0132] RETURN CLAMP(CUR_FILTER_SIZE + 1, MIN_FILTER_SIZE, MAX_FILTER_SIZE)
[0133] ELSE IF FILTER_SIZE < CUR_FILTER_SIZE:
[0134] RETURN CLAMP(CUR_FILTER_SIZE - 1, MIN_FILTER_SIZE, MAX_FILTER_SIZE)
[0135] ELSE:
[0136] RETURN CUR_FILTER_SIZE
[0137] ELSE:
[0138] FILTER_SPEED_SUM += SPEED
[0139] FILTER_AVG_SPEED_COUNT++
[0140] CURRENT_SPEED_CHECK_TIME += DELTA_TIME
[0141] RETURN CUR_FILTER_SIZE
[0142] The following is an exemplary description of the method of the present application in combination with a specific example.
[0143] The specific process of the method provided by the present application is as Figure 2As shown, after starting, initialize the filter size (i.e., dimension) and speed parameters (i.e., parameters such as the maximum speed threshold that need to be preset in advance), and then determine whether the current inspection time is greater than the inspection interval. If so, dynamically adjust the filter size according to the speed, calculate the size factor SIZE_FACTOR, and then calculate the new initial size FILTER_SIZE. Compare FILTER_SIZE with the current filter (i.e., the filter size at the previous moment of the current moment). If FILTER_SIZE is greater than the current filter size, the filter size is incremented by 1. If they are equal, the filter size remains unchanged. If it is less, the filter size is decremented by 1. Then add the latest position to the queue. If the current inspection time is less than or equal to the inspection interval, directly accumulate the speed and update the speed count, keep the current filter size, add the latest position to the queue, and determine whether the queue size exceeds the filter size. If so, remove the earliest position in the queue, and then calculate the average value of the positions as the filtered position. Otherwise, directly calculate the average value of the positions as the filtered position, and end.
[0144] It is worth mentioning that calculating the initial size according to the average moving speed of the object and adjusting the initial size based on the filter size of the previous moment realizes the dynamic adjustment of the filter size at the current moment according to the actual hand movement condition and the filter size of the previous moment, improves the practicality and accuracy of the filter size, and at the same time reduces the temporal instability of the filter size. Smoothing the hand position according to the filter size can improve the smoothness of the hand position and reduce jitter, enhancing the user experience in the VR scenario.
[0145] In addition, the beneficial effects of this application are also reflected in:
[0146] Improve smoothness: By dynamically adjusting the queue length of the filter, it can effectively smooth the position data when the hand moves quickly, reducing the jitter phenomenon.
[0147] Improve response speed: When the hand moves slowly, reduce the filter queue length to improve the response speed of the position data.
[0148] Enhance user experience: By optimizing the smoothing process of hand movements, it significantly enhances the interaction realism and experience fluency of users in the VR environment.
[0149] Next, an exemplary description will be given of the anti-jitter device for gesture recognition in the VR scenario provided by this application.
[0150] As Figure 3 shown, the embodiment of this application provides an anti-jitter device for gesture recognition in the VR scenario. The anti-jitter device 300 for gesture recognition in the VR scenario includes:
[0151] An acquisition module 301, configured to acquire the hand positions of a user wearing a VR device at T moments; the T-th moment is the current moment;
[0152] A determination module 302, configured to respectively for each hand position, determine the object position of the virtual object corresponding to the user's hand in the VR scene at the current moment based on the hand position;
[0153] A calculation module 303, configured to calculate the average object movement speed according to all object positions, calculate the initial size of the position filter according to the average object movement speed, and adjust the initial size based on the size of the position filter at the previous moment of the current moment to obtain the filter size of the position filter at the current moment;
[0154] A position smoothing module 304, configured to perform position smoothing on all object positions according to the filter size at the current moment to obtain the smoothed object positions at the current moment.
[0155] It should be noted that for the information interaction, execution process, etc. between the above-mentioned devices / units, since they are based on the same concept as the method embodiments of the present application, their specific functions and the technical effects brought about can be specifically referred to the method embodiment part, and will not be elaborated here.
[0156] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the above-mentioned division of each functional unit and module is used as an example. In actual applications, the above-mentioned functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of the present application. The specific working processes of the units and modules in the above-mentioned system can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated here.
[0157] As Figure 4 shown, an embodiment of the present application provides a terminal device. The terminal device D10 in this embodiment includes: at least one processor D100 ( Figure 4 only one processor is shown in the figure), a memory D101, and a computer program D102 stored in the memory D101 and executable on at least one processor D100. When the processor D100 executes the computer program D102, the steps in any of the above-mentioned method embodiments are implemented.
[0158] Specifically, when the processor D100 executes the computer program D102, it obtains the hand positions of the user wearing the VR device at T moments, and then for each hand position, it determines the object positions of the virtual objects corresponding to the user's hands in the VR scene at the current moment based on the hand positions. Then, it calculates the average object movement speed according to all the object positions, and calculates the initial size of the position filter based on the average object movement speed. The initial size is adjusted based on the size of the position filter at the previous moment of the current moment to obtain the filter size of the position filter at the current moment. Then, it performs position smoothing on all the object positions according to the filter size at the current moment to obtain the smoothed object positions at the current moment. Among them, calculating the initial size based on the average object movement speed and adjusting the initial size based on the size of the position filter at the previous moment realizes the dynamic adjustment of the filter size at the current moment according to the actual hand movement condition and the size at the previous moment, improves the practicality and accuracy of the filter size, and at the same time reduces the instability of the filter size in time series. Smoothing the position according to the filter size can improve the smoothness of the hand position and reduce jitter, enhancing the user experience in the VR scene.
[0159] The so-called processor D100 may be a central processing unit (CPU, Central Processing Unit), and this processor D100 may also be other general-purpose processors, digital signal processors (DSP, Digital Signal Processor), application specific integrated circuits (ASIC, Application Specific Integrated Circuit), off-the-shelf programmable gate arrays (FPGA, Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or this processor may also be any conventional processor, etc.
[0160] In some embodiments, the memory D101 may be an internal storage unit of the terminal device D10, such as a hard disk or memory of the terminal device D10. In some other embodiments, the memory D101 may also be an external storage device of the terminal device D10, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the terminal device D10. Further, the memory D101 may also include both the internal storage unit and the external storage device of the terminal device D10. The memory D101 is used to store an operating system, application programs, a boot loader, data, and other programs, such as program codes of the computer program. The memory D101 may also be used to temporarily store data that has been output or will be output.
[0161] An embodiment of the present application also provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the steps in the foregoing method embodiments can be implemented.
[0162] An embodiment of the present application provides a computer program product, and when the computer program product runs on a terminal device, the terminal device can implement the steps in the foregoing method embodiments when executed.
[0163] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, all or part of the processes in the foregoing method embodiments of the present application can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps in the foregoing method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, an executable file, or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying the computer program code to the gesture recognition anti-shake method device / terminal device in the VR scenario, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk, or an optical disc. In some jurisdictions, according to legislation and patent practice, the computer-readable medium may not be an electrical carrier signal and a telecommunication signal.
[0164] In the above embodiments, the descriptions of the various embodiments each have their own focuses. For parts not described in detail or recorded in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0165] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. A professional technician can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0166] The above is the preferred implementation manner of this application. It should be noted that for those of ordinary skill in the art of this technology, without departing from the principle described in this application, several improvements and refinements can still be made, and these improvements and refinements should also be regarded as the protection scope of this application.
Claims
1. A gesture recognition anti-shake method in a VR scene, characterized in that: include: Get the hand position of the user wearing the VR device at T moments; the Tth moment is the current moment; For each of the hand positions, determine the object position of the virtual object corresponding to the user's hand in the VR scene at the current moment based on the hand position; Calculating an average moving speed of the objects according to the positions of all objects, and calculating an initial size of a position filter according to the average moving speed of the objects, and adjusting the initial size based on a size of the position filter at a previous moment at the current moment to obtain a filter size of the position filter at the current moment; The positions of all objects are smoothed according to the filter size at the current moment to obtain the smoothed object positions at the current moment.
2. The method for stabilizing hand gesture recognition in a VR scene according to claim 1, characterized in that: The calculating the average moving speed of the object according to the positions of all objects comprises: For each two adjacent moments in the T moments, respectively, calculate the distance between the positions of the object at the two adjacent moments, and calculate the speed according to the distance and the time difference between the two adjacent moments; Averaging all the velocities gives the average speed at which the object is moving.
3. The method for stabilizing hand gesture recognition in a VR scene according to claim 1, characterized in that: The calculating the initial size of the position filter according to the average moving speed of the object comprises: Divide the average moving speed of the object by the maximum speed threshold to obtain a size factor; An initial size of the position filter is calculated based on the size factor.
4. The method for stabilizing hand gesture recognition in a VR scene according to claim 3, characterized in that: The calculating the initial size of the position filter according to the size factor comprises: By formula: FILTER_SIZE=CLAMP(INT(MIN_FILTER_SIZE+SIZE_FACTOR*(MAX_FILTER_SIZE-MIN_FILTER_SIZE)),MAX_FILTER_SIZE,MIN_FILTER_SiZE) Calculate the initial size FILTER_SIZE; Among them, CLAMP represents the interval limit, INT represents integer, MIN_FILTER_SIZE represents the minimum size threshold, SIZE_FACTOR represents the size factor, and MAX_FILTER_SIZE represents the maximum size threshold.
5. The method for stabilizing hand gesture recognition in a VR scene according to claim 1, characterized in that: The adjusting the initial size based on the size of the position filter at the previous moment of the current moment to obtain the filter size of the position filter at the current moment includes: If the initial size of the position filter is larger than the size at the previous moment before the current moment, then the initial size is increased by 1 to obtain the filter size of the position filter at the current moment; If the initial size of the position filter is smaller than the size at the previous moment before the current moment, subtract 1 from the initial size to obtain the filter size of the position filter at the current moment; If the initial size of the position filter is equal to the size at the previous moment before the current moment, the initial size is used as the filter size of the position filter at the current moment.
6. The method for stabilizing hand gesture recognition in a VR scene according to claim 1, characterized in that: The step of smoothing the positions of all objects according to the filter size at the current moment to obtain the smoothed object position at the current moment includes: Add the object positions at all times to the filter queue in the order of all times; Determine whether the length of the filter queue is greater than the filter size at the current moment; If yes, remove the first n object positions in the filter queue and use the remaining object positions in the filter queue as the target object positions; n is the difference between the filter size and the number of object positions; Otherwise, all object positions in the filter queue are taken as the target object positions; The positions of all target objects are averaged to obtain the smoothed object position at the current moment.
7. The method for stabilizing hand gesture recognition in a VR scene according to claim 6, characterized in that: The averaging of all target object positions to obtain the smoothed object position at the current moment includes: For each target object position, the position number of the target object position in the filter queue is used as the weight of the target object position; The positions of all target objects are weighted averaged according to all weights to obtain the smoothed object position at the current moment.
8. A method and device for anti-shake of gesture recognition in a VR scene, comprising: An acquisition module is used to obtain the hand position of a user wearing a VR device at T moments; The Tth moment is the current moment; A determination module, for determining, for each of the hand positions, an object position of a virtual object corresponding to the user's hand in the VR scene at a current moment based on the hand position; A calculation module, used to calculate an average moving speed of the objects according to the positions of all objects, and calculate an initial size of the position filter according to the average moving speed of the objects, and adjust the initial size based on the size of the position filter at a previous moment at the current moment to obtain a filter size of the position filter at the current moment; The position smoothing module is used to perform position smoothing on all object positions according to the filter size at the current moment to obtain the smoothed object position at the current moment.
9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method for anti-shake of gesture recognition in a VR scene is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for stabilizing gesture recognition in a VR scene as described in any one of claims 1 to 7 is implemented.