Virtual fence generation method, display method, and electronic device

By generating virtual ground and fences using ground detection models and positioning devices, and combining this with simulated raindrop patterns to alert users, the problems of virtual fence generation errors and immersion are solved, thus improving user experience and security.

CN116681865BActive Publication Date: 2026-08-04CHINA MOBILE COMM GRP TERMINAL +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210184201.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-23
Publication Date
2026-08-04
Estimated Expiration
2042-02-23

AI Technical Summary

Technical Problem

Existing virtual fence generation methods are complex to operate, have large measurement errors, and affect user safety and immersion. Furthermore, the visual warnings or obstacle display methods are not dynamic enough, which also affects the user experience.

Method used

The system uses a ground detection model to identify ground height, and combines this with a positioning device to generate a virtual ground and fence. It then uses a simulated raindrop pattern to prompt users to approach the fence and dynamically adjusts the flashing frequency to improve accuracy and immersion.

Benefits of technology

It improves the accuracy of virtual ground height, reduces errors, enhances the reliability and user experience of virtual fences, and avoids the impact of visual warnings on immersion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116681865B_ABST
    Figure CN116681865B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a virtual fence generation method, a display method and an electronic device. The virtual fence generation method comprises: acquiring a collected ground image; identifying the ground image by using a ground detection model to obtain a first ground height; if the first ground height is within a ground height range, generating a virtual ground at the first ground height; if the first ground height is not within the ground height range, positioning a positioning device when the positioning device is placed on an actual ground, obtaining a second ground height according to a positioning result, and generating a virtual ground at the second ground height; and generating a virtual fence based on the virtual ground, wherein the virtual fence is used to define a safety area on the virtual ground.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] This invention relates to the field of virtual reality technology, and in particular to a method for generating and displaying virtual fences, as well as an electronic device. [Background Technology]

[0002] VR (Virtual Reality) technology uses computers to fuse and reconstruct various types of information to generate a three-dimensional interactive virtual environment, providing users with an immersive experience. When users wear VR headsets and move around or wave controllers in limited indoor environments or spaces with obstacles such as tables and chairs, they are unable to see their surroundings and are therefore more likely to collide with obstacles, affecting their safety. Therefore, to ensure user safety, current technology allows users to draw a circle or square safety zone (or virtual fence) on the virtual ground to remind them to avoid exceeding this safety zone during virtual interactions.

[0003] However, in existing technologies, the height of the virtual ground is generally determined by manually measuring the height of the AR helmet from the ground. For users of different heights, the height of the virtual ground needs to be measured again and the safe area needs to be redrawn. This is not only complicated to operate, but also prone to measurement errors. Especially in complex scenarios such as uneven ground, the measurement error of the virtual ground height will be large, resulting in poor reliability of the safe area and a poor user experience.

[0004] In addition, current technologies either display visual warnings or obstacles when a user approaches a virtual fence. Visual warnings can affect the user's immersion, while displaying obstacles requires a camera to capture the scene and overlay it, which is both complex and affects the user's immersion. [Summary of the Invention]

[0005] In view of this, embodiments of the present invention provide a virtual fence generation method, a display method, and an electronic device, which can improve the accuracy of virtual ground height, reduce errors, thereby improving the reliability of virtual fences and enhancing user experience.

[0006] In a first aspect, embodiments of the present invention provide a virtual fence generation method, applied to a virtual reality system, the virtual reality system including a ground detection model and a positioning device, the method comprising:

[0007] Acquire the collected ground images;

[0008] The ground detection model is used to identify the ground image to obtain the first ground height;

[0009] If the first ground height is within the ground height range, then a virtual ground is generated at the first ground height;

[0010] If the first ground height is not within the range of the ground height, then when the positioning device is placed on the actual ground, the positioning device is positioned, the second ground height is obtained according to the positioning result, and a virtual ground is generated at the second ground height;

[0011] Based on the virtual ground, a virtual fence is generated, which is used to define a safe area on the virtual ground.

[0012] In one possible implementation, the virtual fence includes multiple layers of security zone points, and the generation of the virtual fence based on the virtual ground includes:

[0013] In response to the user's line-drawing operation, multiple initial safe zone points are collected, wherein the initial safe zone points are the first layer of safe zone points, and the user's line-drawing operation is used to indicate drawing a safe zone on the virtual ground;

[0014] The height of the first layer of safe zone points is increased to generate other layers of safe zone points, wherein the height of the safe zone points in adjacent layers differs by a preset first height.

[0015] In one possible implementation, after acquiring multiple initial safe zone points, the method further includes:

[0016] If multiple initial safe zone points do not form a closed region, a first prompt message is output;

[0017] If multiple initial safe regions form a closed region and the region area is less than the area threshold, then a second prompt message is output.

[0018] In one possible implementation, the method further includes:

[0019] Based on the multiple initial safe zone points, multiple layers of interval points are obtained;

[0020] Obtain the distance between the user's location and the point in the safe zone;

[0021] If the distance is less than or equal to a preset distance, then the multiple interval points are controlled to flash in a simulated raindrop pattern. The flashing interval points represent raindrops, and the simulated raindrop pattern indicates that the raindrop falls from the highest interval point to the lowest interval point, and then rises back from the raindrop's starting point to its ending point.

[0022] In one possible implementation, obtaining multiple layers of interval points based on the security area points includes:

[0023] Starting from the first initial safe zone point, multiple initial interval points are selected from the multiple initial safe zone points at preset intervals, wherein the initial interval points are the first layer of interval points;

[0024] The height of the first layer of interval points is increased to generate other layer interval points, wherein the interval points of adjacent layers differ in height by a preset second height.

[0025] In one possible implementation, controlling the plurality of interval points to blink according to a simulated raindrop pattern includes:

[0026] Based on the distance, the flashing frequency of the multiple interval points is adjusted, wherein the smaller the distance, the faster the flashing frequency.

[0027] Secondly, this application provides a display method applied to a virtual reality system, the method comprising:

[0028] Generate a virtual fence, which contains multiple initial safe zone points;

[0029] Based on the multiple initial safe zone points, multiple layers of interval points are obtained;

[0030] Obtain the distance between the user's location and the point in the safe zone;

[0031] If the distance is less than or equal to a preset distance, then the multiple interval points are controlled to flash in a simulated raindrop pattern. The flashing interval points represent raindrops, and the simulated raindrop pattern indicates that the raindrop falls from the highest interval point to the lowest interval point, and then rises back from the raindrop's starting point to its ending point.

[0032] Thirdly, this application provides a virtual reality system, which includes a ground detection model and a positioning device, and the system further includes:

[0033] The acquisition module is used to acquire the collected ground images;

[0034] The ground detection module is used to identify the ground image using the ground detection model to obtain a first ground height;

[0035] A virtual ground generation module is used to generate a virtual ground at the first ground height if the first ground height is within the ground height range; and if the first ground height is not within the ground height range, when the positioning device is placed on the actual ground, to locate the positioning device, obtain a second ground height based on the positioning result, and generate a virtual ground at the second ground height.

[0036] A virtual fence generation module is used to generate a virtual fence based on the virtual ground, and the virtual fence is used to define a safe area on the virtual ground.

[0037] Fourthly, embodiments of the present invention provide an electronic device, including: a memory and a processor:

[0038] The memory is used to store computer programs;

[0039] The processor is configured to execute a computer program stored in the memory to cause the electronic device to perform the method as described in the first aspect.

[0040] Fifthly, embodiments of the present invention provide a computer-readable storage medium including a program or instructions that, when the program or instructions are run on a computer, execute the method described in the first aspect.

[0041] Compared with the prior art, this technical solution has at least the following beneficial effects:

[0042] The virtual fence generation method, system, and electronic device disclosed in the embodiments of the present invention achieve at least the following beneficial effects:

[0043] 1. The ground detection model is used to identify the first ground height and determine whether the first ground height is within the ground height range. If it is, the first ground height is used as the virtual ground height. If not, a positioning device, such as a handle, is placed on the actual ground and the positioning device is used to obtain the second ground height. The second ground height is then used as the virtual ground height, thereby improving the accuracy of the virtual ground height, reducing errors, improving the reliability of the virtual fence, and enhancing the user experience.

[0044] 2. Users can draw irregularly shaped safe areas on the virtual ground, which helps to increase the user's activity area. Moreover, this application can also determine whether the safe area drawn by the user is appropriate, such as whether the safe area is closed or whether the area of ​​the safe area is less than the area threshold. If it is inappropriate, a prompt message will be issued, which helps to improve the user experience.

[0045] 3. This application can prompt users to approach a virtual fence by simulating the falling and rising of raindrops. This not only avoids affecting the user's immersion but also creates a sense of time travel, improving the user experience. Furthermore, the closer the user is to the virtual fence, the shorter the time interval between the simulated raindrop falling and rising, and the faster the speed. [Attached Image Description]

[0046] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0047] Figure 1 This is a schematic diagram of the virtual fence generation method provided in Embodiment 1 of the present invention;

[0048] Figure 2 This is a schematic diagram of the training process of the ground detection model in the virtual fence generation method provided in Embodiment 1 of the present invention;

[0049] Figure 3 This is a schematic diagram of the structure of the virtual fence in the virtual fence generation method provided in Embodiment 1 of the present invention;

[0050] Figure 4 This is a schematic diagram of the dynamic prompt process when a user approaches a virtual fence in the virtual fence generation method provided in Embodiment 1 of the present invention;

[0051] Figure 5 This is a schematic diagram of the display method provided in Embodiment 2 of the present invention;

[0052] Figure 6 This is a schematic diagram of the virtual reality system provided in Embodiment 3 of the present invention.

[0053] Figure label:

[0054] 110 - Data Acquisition Module; 120 - Ground Detection Module; 130 - Virtual Ground Generation Module; 140 - Virtual Fence Generation Module.

Detailed Implementation Methods

[0055] To better understand the technical solution of the present invention, the embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0056] It should be understood that the described embodiments are merely some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

[0057] The existing technology has at least the following drawbacks:

[0058] 1. Currently, many methods for determining safe zones involve drawing a circle or square on the ground. However, this regular area cannot accurately represent the size of the safe zone because it requires taking the minimum value of the diameter or side length, which reduces the user's activity area.

[0059] 2. The height of the virtual ground is determined by manually measuring the height of the AR helmet from the ground. For users of different heights, the height of the virtual ground needs to be measured again and the safe area needs to be redrawn. This is not only complicated to operate, but also prone to measurement errors. Especially in complex scenarios such as uneven ground, the height measurement error of the virtual ground will be large, resulting in poor reliability of the safe area and poor user experience.

[0060] 3. When a user approaches a virtual fence, either a visual warning or an obstacle is displayed. The prompts are not dynamic enough. Visual warnings affect the user's immersion, while displaying obstacles requires the camera to capture the scene and overlay it, which is both complicated and affects the user's immersion.

[0061] Therefore, this application provides a virtual fence generation method, a display method, and an electronic device, which can improve the accuracy of virtual ground height, reduce errors, thereby improving the reliability of the virtual fence and enhancing the user experience.

[0062] Example 1

[0063] Embodiment 1 of this invention proposes a method for generating virtual fences, such as... Figure 1 As shown, the above-mentioned virtual fence generation method is applied to a virtual reality system. The virtual reality system may include a ground detection model and a positioning device. The ground detection model is used to perform ground detection to obtain the ground height (such as a first ground height), and the positioning device can be used to locate the current spatial position, such as a controller or a helmet (such as an AP helmet).

[0064] Considering that deep learning methods require high computing power and are not suitable for deployment on mobile devices with low computing power, thus limiting their application, this embodiment adopts a feature-based detection method for ground detection. This method has lower computing power requirements and is universally applicable to various computing power platforms. Specifically, the ground detection model can include a strong classifier composed of multiple weak classifiers. This strong classifier can be obtained by combining multiple weak classifiers using an iterative algorithm (such as the AdaBoost algorithm). The weak classifier represents the feature-based detection algorithm, and the features can include, but are not limited to, color histogram features, directional histogram gradient features (Hog), corner features (SIFT), or edge features (Canny).

[0065] Specifically, the calculation method for color histogram features may include: the ratio of the number of pixels within a certain pixel value range to the total number of pixels, expressed by the formula:

[0066] s k =n k / n is calculated;

[0067] Where k = 0, 1, 2, 3, ..., L-1, s k For color histogram features, n k is the number of pixels at the current gray level, n is the total number of pixels, and L is the total number of gray levels in the image. In this embodiment, n is 640*480 and L is 256.

[0068] The calculation method for the directional histogram gradient feature can include: first, calculating the gradient in the horizontal and vertical directions for each pixel, using the formula:

[0069] G x (x,y)=G(x+1,y)-G(x-1,y)

[0070] G y (x,y) = G(x,y+1) - G(x,y-1) is calculated;

[0071] Among them, G x (x,y) represents the horizontal gradient, G y (x,y) represents the vertical gradient. G(x,y) is the gray value (0-255) of the image at points x and y. The range of x is 0-640, and the range of y is 0-480.

[0072] Then calculate the gradient magnitude at pixel x and y using the formula:

[0073] Calculated;

[0074] Where |G(x,y)| is the gradient magnitude.

[0075] Next, calculate the gradient direction using the formula:

[0076] Calculated;

[0077] Where θ(x,y) is the gradient direction.

[0078] Finally, the gradient direction histogram of each pixel is obtained. The gradient direction range is 0-180°. Divide the gradient direction into 10° (or other values) and calculate the gradient magnitude range of all pixels within each gradient direction range to obtain the gradient direction histogram.

[0079] It is understandable that the calculation methods for corner features or Canny features can refer to the relevant principles or calculation methods in the existing technology, and will not be elaborated here.

[0080] like Figure 1 As shown, the virtual fence generation method may include the following steps:

[0081] S101. Acquire the collected ground images.

[0082] Preferably, the virtual reality system may include a camera device, such as dual cameras, for capturing and acquiring image data of the real-world scene. For example, the camera device may be mounted on a helmet, allowing the user to operate the virtual reality system to control the camera device to capture and acquire ground images.

[0083] S102. The ground image is identified using a ground detection model to obtain the first ground height.

[0084] In this embodiment, the ground detection model can be obtained through model training methods, such as training multiple weak classifiers using training samples S to obtain a strong classifier, etc. Figure 2 As shown. Specifically, the model training method may include:

[0085] S201. Weight initialization, including but not limited to correct classification weights. Misclassification weights The sample weight λ = 1.

[0086] S202. Traverse all selectors and perform the following steps S2021 to S2024:

[0087] S2021. Iterate through all weak classifiers m, update the weak classifiers using the training samples S, and update the error. The calculation formula is as follows:

[0088]

[0089]

[0090] Among them, e n,m This is the error.

[0091] S2022. Select the weak classifier with the smallest error (not less than 1 / 2) as the chosen classifier, and calculate the voting weight using the following formula:

[0092]

[0093] Where, α n For voting weight.

[0094] The third step is to update the sample weights, calculated using the following formula:

[0095]

[0096] Where λ is the sample weight.

[0097] The fourth step is to construct a strong classifier by linearly combining all the weak classifiers. The calculation formula is as follows:

[0098]

[0099] Where H is the strong classifier and h is the weak classifier.

[0100] In step S102, the ground image is input into the trained ground detection model, and the first ground height is output. Therefore, it is not necessary to manually measure the height of the user wearing the AR helmet from the actual ground, which is convenient and helps to reduce errors.

[0101] S103. If the first ground height is within the ground height range, then a virtual ground is generated at the first ground height.

[0102] Preferably, the ground height range can be determined based on the height of the user wearing the AR helmet from the actual ground, or based on the user's historical data. For example, the virtual reality system can store user historical data, which may include the ground height range corresponding to the user's identity information. The corresponding ground height range can be extracted from the user's historical data using the current user identity information, so there is no need to measure the ground height range again.

[0103] If the first ground height is within the range of ground heights, it means that the actual deviation of the first ground height is small or within an acceptable range. Therefore, the first ground height can be used as the virtual ground height, and a virtual ground can be generated at that first ground height. For example, in the virtual world of a virtual reality system, a 10*10 meter virtual ground composed of crosses can be generated at the first ground height.

[0104] S104. If the first ground height is not within the range of the ground height, then when the positioning device is placed on the actual ground, the positioning device is positioned, the second ground height is obtained according to the positioning result, and a virtual ground is generated at the second ground height.

[0105] If the first ground height is not within the ground height range, it indicates a large deviation in the actual ground height. For example, in complex scenarios, the actual ground may be uneven, leading to a large deviation in the first ground height identified by the aforementioned ground detection model, making it unsuitable as the height of the virtual ground. In this case, the user can place a positioning device, such as a handle, on the actual ground, locate the handle's position, and calculate the second ground height based on that position. For example, when the handle is placed on the actual ground, locating its position reveals that the second ground height is 5 centimeters below the actual ground. This second ground height is then used as the virtual ground height, and a virtual ground is generated at this height. For instance, in the virtual world of a virtual reality system, a 10*10 meter virtual ground composed of crosses is generated at the second ground height.

[0106] In summary, in this embodiment, a ground detection model is used to identify the first ground height, and it is determined whether the first ground height is within the ground height range. If it is, the first ground height is used as the virtual ground height; otherwise, a positioning device, such as a handle, is placed on the actual ground, and the positioning device is used to obtain the second ground height, which is then used as the virtual ground height. This improves the accuracy of the virtual ground height, reduces errors, and thus improves the reliability of the virtual fence and enhances the user experience.

[0107] S105. Based on the virtual ground, generate a virtual fence, which is used to define a safe area on the virtual ground.

[0108] In this embodiment, the virtual fence may include multiple layers of security area points. Each layer of security area points may contain multiple security area points connected to form a closed security area line. The security area line can be used to define a closed planar security area, and the multiple layers of security area lines can be used to define a three-dimensional security area.

[0109] In one possible implementation, step S105 may include:

[0110] S301. In response to the user's line drawing operation, multiple initial safe area points are collected, wherein the initial safe area points are first-layer safe area points, and the user's line drawing operation is used to indicate drawing a safe area on the virtual ground.

[0111] S302. Increase the height of the first layer of safe area points to generate other layers of safe area points, wherein the height of the safe area points in adjacent layers differs by a preset first height.

[0112] In step S301, the user can operate the controller to draw a safe area on the virtual ground. Specifically, a ray is emitted from the controller's position as the starting point, and the intersection points of this ray with the virtual ground are obtained (e.g., by solving for the direction cosine). The user can perform the drawing operation by pressing a button on the controller and continuously changing the controller's pose (e.g., controller position, orientation, or height) to obtain multiple intersection points. These multiple intersection points are connected sequentially to form the boundary line of the safe area. When the user finishes the drawing operation, the multiple intersection points collected are saved (or partially saved, etc.) according to the drawing sequence. These multiple initial safe area points are the saved intersection points. Therefore, the user can draw irregularly shaped safe areas on the virtual ground, which helps to increase the user's activity area.

[0113] In step S302, the preset first height can be pre-set according to the actual application scenario, such as the preset first height being 20 centimeters. That is to say, keeping the planar coordinates (such as X and Z coordinates) of the first layer of safety zone points unchanged, the height (such as Y coordinate) is increased by the preset first height each time, from bottom to top, to obtain the second layer of safety zone points, the third layer of safety zone points, the fourth layer of safety zone points, and so on.

[0114] Furthermore, in this embodiment, the number of layers of the safe zone can be calculated based on the maximum height of the virtual fence and the aforementioned preset first height. For example, if the maximum height of the virtual fence is 6 meters, then the number of layers of the safe zone is 30. Figure 3 As shown, each layer of safe zone points are sequentially adjacent to form the boundary line 102 of safe zone 101. The multiple layers of safe zone boundary lines 102 constitute a three-dimensional safe zone network 103, which is a virtual fence.

[0115] In one possible implementation, the method may further include:

[0116] S401. If multiple initial safe zone points do not form a closed region, output the first prompt message;

[0117] S402. If multiple initial safe regions form a closed region and the region area is less than the area threshold, then output a second prompt message.

[0118] In other words, in this embodiment, steps S401 and S402 can be used to determine whether the safe area drawn by the user is appropriate, such as whether the safe area is closed or whether the area of ​​the safe area is less than the area threshold. If it is not appropriate, a prompt message (such as the first prompt message or the second prompt message mentioned above) is issued, which helps to increase the user's experience.

[0119] Specifically, in step S401, multiple initial safe area points are connected sequentially according to the drawing order. If the length of the connection between at least one adjacent initial safe area point is greater than or equal to a length threshold (such as a preset value), it indicates that a closed area has not been formed. The initial safe area point is then deleted, and a first prompt message is output, such as a voice prompt to the user that the safe area needs to be redrawn, or the virtual reality system provides animated guidance to the user on how to draw a closed safe area within the virtual world.

[0120] In step S402, if the length of the line connecting all adjacent initial safe area points is less than the length threshold, it indicates that a closed area has been formed. It is then determined whether the area of ​​the closed area enclosed by multiple lines is less than the area threshold (such as a preset value). If it is less, it indicates that the area of ​​the safe area is too small to be suitable for the user to perform virtual reality interaction (such as playing games). The initial safe area point is then deleted, and a second prompt message is output, such as a voice prompt to the user that the safe area needs to be redrawn, or the virtual reality system provides animation guidance to the user in the virtual world on how to draw a closed safe area.

[0121] When the length of the line connecting all adjacent initial safe area points is less than the length threshold, and the area of ​​the closed region enclosed by multiple lines is greater than or equal to the area threshold, it indicates that the closed region can be used as a safe area for users to interact with virtual reality, and the initial safe area point is saved.

[0122] In one possible implementation, the method may further include:

[0123] S501. Based on the multiple initial safe area points, obtain multi-layer interval points;

[0124] S502, Obtain the distance between the user's location and the safe zone point;

[0125] S503. If the distance is less than or equal to a preset distance, control the multiple interval points to flash according to the simulated raindrop pattern. The interval points in the flashing state are used to represent raindrops. The simulated raindrop pattern is used to indicate that the highest interval point is the raindrop starting point and the lowest interval point is the raindrop ending point. The raindrop falls from the raindrop starting point to the raindrop ending point and rises back from the raindrop ending point to the raindrop starting point.

[0126] In other words, in this embodiment, the user is prompted to approach the virtual fence by simulating raindrops falling and rising. This not only avoids affecting the user's immersion but also creates a sense of time travel, improving the user experience. The flashing intervals can include a flashing state and an off state. The flashing state indicates that a light spot is formed at that interval, and the off state indicates that the light spot is extinguished.

[0127] In this embodiment, in step S501, multiple interval points can be selected from the multiple security area points.

[0128] In one possible implementation, step S501 may include:

[0129] S601. Starting from the first initial safe zone point, select multiple initial interval points from the multiple initial safe zone points at preset intervals, wherein the initial interval points are the first layer of interval points;

[0130] S602. Increase the height of the first layer interval point to generate other layer interval points, wherein the interval points of adjacent layers differ in height by a preset second height.

[0131] To reduce computational difficulty, decrease the number of flashing points, and save energy, in step S601, following the user's line drawing order, starting from the first initial safe area point, an initial safe area point is selected as an initial interval point at every preset interval (e.g., the preset interval is greater than or equal to 20 centimeters), thereby selecting multiple interval points in the first layer (i.e., the first layer interval points).

[0132] In step S602, the planar coordinates (such as X and Z coordinates) of the first layer of interval points are kept unchanged, and the height (such as Y coordinate) is increased by the preset second height each time, from bottom to top, to obtain the second layer of interval points, the third layer of interval points, the fourth layer of interval points, and so on. Preferably, the preset second height can be equal to the preset first height. If the maximum height of the virtual fence is 6 meters and the preset second height is 20 centimeters, then the number of layers of interval points is 30.

[0133] In step S502, the user's position can be obtained by acquiring the helmet position or the handle position, etc., and the distance can include the minimum distance between the user's position and the safe zone point.

[0134] In step S503, if the minimum distance is less than or equal to a preset distance, the multiple interval points are controlled to flash in a simulated raindrop pattern. The preset distance can be pre-set according to the actual application scenario, such as a preset distance of 20 centimeters.

[0135] In step S503, raindrops fall from their starting point to their ending point (e.g., the falling speed is determined by controlling the flashing frequency of the interval points) at a certain speed. Every preset time interval (e.g., 10 seconds), the raindrops rise back from their ending point to their starting point, creating a sense of time travel. Optionally, the simulated raindrop mode may not include the process of the raindrops rising back from their ending point to their starting point; that is, it may use simulated raindrops to prompt the user to approach a virtual fence.

[0136] In one possible implementation, step S503 may include:

[0137] S603. Based on the distance, adjust the flashing frequency of the multiple interval points, wherein the smaller the distance, the faster the flashing frequency.

[0138] In other words, this distance is the minimum distance between the user's location and the safe zone point. The closer the user is to the virtual fence, the faster the flashing frequency of the multiple interval points, and the smaller and faster the time interval between the simulated raindrops falling and rising, thus indicating to the user how close they are to the boundary line of the safe zone.

[0139] In other alternative embodiments, such as Figure 4 As shown, the method may include the following steps:

[0140] S701. Obtain the user's location, such as the helmet or controller positioning location, and determine whether the user's location is close to the virtual fence, such as whether the minimum distance between the user's location and the safe zone point is less than or equal to the preset distance.

[0141] S702. If the minimum distance is less than or equal to the preset distance, issue a voice prompt; otherwise, return to step S701.

[0142] S703. The virtual fence adopts a breathing light mode, such as multiple safe zone points flashing breathing lights, and selects multiple data points (such as multiple safe zone points) on the virtual fence, connecting these multiple data points to form a prompt line. As the user's position decreases in distance from the virtual fence, the height or density of the prompt line increases.

[0143] S704. Determine whether the user's location exceeds the virtual fence, such as determining whether the user has crossed the boundary line of the safe zone.

[0144] S705. If the user's location exceeds the virtual fence, an AI robot will appear in the virtual world and indicate that the user has crossed the boundary line of the safe area; otherwise, return to step S701.

[0145] S706. When the user's location is outside the virtual fence, an AI robot appears in the virtual world about 1 meter away from the helmet and issues a voice warning to the user that they have crossed the boundary of the safe area.

[0146] In other words, in this embodiment, when a user approaches the virtual fence, a dynamic notification is provided, which not only avoids affecting the user's immersion but also helps to improve the user experience.

[0147] It is understood that some or all of the steps or operations in the above embodiments are merely examples, and other operations or variations thereof can be performed in the embodiments of this application. Furthermore, the steps may be performed in different orders as presented in the above embodiments, and it is not necessary to perform all the operations in the above embodiments.

[0148] Example 2

[0149] like Figure 5 As shown, this embodiment 2 provides a display method applied to a virtual reality system, the method comprising:

[0150] S801. Generate a virtual fence, wherein the virtual fence contains multiple initial safe zone points;

[0151] S802. Based on the multiple initial safe area points, obtain multi-layer interval points;

[0152] S803. Obtain the distance between the user's location and the safe zone point;

[0153] S804. If the distance is less than or equal to a preset distance, control the multiple interval points to flash according to the simulated raindrop pattern. The interval points in the flashing state are used to represent raindrops. The simulated raindrop pattern is used to indicate that the highest interval point is the raindrop starting point and the lowest interval point is the raindrop ending point. The raindrop falls from the raindrop starting point to the raindrop ending point and rises back from the raindrop ending point to the raindrop starting point.

[0154] In this embodiment, step S801 can refer to the above. Figure 1 Steps S101 to S105 of the virtual fence generation method shown are not repeated here. Steps S802 to S804 can be referred to the above. Figure 1 Steps S501 to S503 of the virtual fence generation method shown are not repeated here.

[0155] It is understood that some or all of the steps or operations in the above embodiments are merely examples, and other operations or variations thereof can be performed in the embodiments of this application. Furthermore, the steps may be performed in different orders as presented in the above embodiments, and it is not necessary to perform all the operations in the above embodiments.

[0156] Example 3

[0157] like Figure 6 As shown, Embodiment 3 of the present invention discloses a virtual reality system 100, which may include a ground detection model and a positioning device. The system 100 further includes:

[0158] Acquisition module 110 is used to acquire acquired ground images;

[0159] The ground detection module 120 is used to identify the ground image using the ground detection model to obtain a first ground height;

[0160] The virtual ground generation module 130 is used to generate a virtual ground at the first ground height if the first ground height is within the ground height range; and if the first ground height is not within the ground height range, to locate the positioning device when the positioning device is placed on the actual ground, obtain a second ground height based on the positioning result, and generate a virtual ground at the second ground height.

[0161] The virtual fence generation module 140 is used to generate a virtual fence based on the virtual ground, and the virtual fence is used to define a safe area on the virtual ground.

[0162] In one possible implementation, the virtual fence includes multiple layers of security zone points, and the virtual fence generation module 140 is further used for:

[0163] In response to the user's line-drawing operation, multiple initial safe zone points are collected, wherein the initial safe zone points are the first layer of safe zone points, and the user's line-drawing operation is used to indicate drawing a safe zone on the virtual ground;

[0164] The height of the first layer of safe zone points is increased to generate other layers of safe zone points, wherein the height of the safe zone points in adjacent layers differs by a preset first height.

[0165] In one possible implementation, the virtual reality system 100 is also used for:

[0166] If multiple initial safe zone points do not form a closed region, a first prompt message is output;

[0167] If multiple initial safe regions form a closed region and the region area is less than the area threshold, then a second prompt message is output.

[0168] In one possible implementation, the virtual reality system 100 is also used for:

[0169] Based on the multiple initial safe zone points, multiple layers of interval points are obtained;

[0170] Obtain the distance between the user's location and the point in the safe zone;

[0171] If the distance is less than or equal to a preset distance, then the multiple interval points are controlled to flash in a simulated raindrop pattern. The flashing interval points represent raindrops, and the simulated raindrop pattern indicates that the raindrop falls from the highest interval point to the lowest interval point, and then rises back from the raindrop's starting point to its ending point.

[0172] In one possible implementation, the virtual reality system 100 is also used for:

[0173] Starting from the first initial safe zone point, multiple initial interval points are selected from the multiple initial safe zone points at preset intervals, wherein the initial interval points are the first layer of interval points;

[0174] The height of the first layer of interval points is increased to generate other layer interval points, wherein the interval points of adjacent layers differ in height by a preset second height.

[0175] In one possible implementation, the virtual reality system 100 is also used for:

[0176] Based on the distance, the flashing frequency of the multiple interval points is adjusted, wherein the smaller the distance, the faster the flashing frequency.

[0177] Understandable Figure 6 The virtual reality system provided in the illustrated embodiment can be used to execute this application. Figure 1 or Figure 4 The implementation principle and technical effects of the method embodiment shown can be further referred to the relevant description in the method embodiment.

[0178] The above should be understood Figure 6The division of modules in the illustrated virtual reality system is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. These modules can be implemented entirely in software via processing elements; they can be fully implemented in hardware; or some modules can be implemented in software via processing elements, while others are implemented in hardware. For example, the virtual fence generation module can be a separate processing element or integrated into a chip in an electronic device. The implementation of other modules is similar. Furthermore, these modules can be fully or partially integrated together, or implemented independently. During implementation, each step of the above method or each of the above modules can be completed through integrated logic circuits in the hardware of the processor element or through software instructions.

[0179] For example, these modules can be one or more integrated circuits configured to implement the above methods, such as one or more Application Specific Integrated Circuits (ASICs), one or more Digital Signal Processors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs). Alternatively, these modules can be integrated together as a System-On-a-Chip (SOC).

[0180] Example 4

[0181] Embodiment 4 of the present invention provides an electronic device, including: a memory and a processor:

[0182] Memory, used to store computer programs;

[0183] A processor is used to execute a computer program stored in memory to cause an electronic device to perform the method as described in Embodiment 1 or Embodiment 2.

[0184] The processor and memory can communicate with each other through an internal connection path to transmit control and / or data signals. The memory is used to store computer programs, and the processor is used to call and run the computer programs from the memory.

[0185] The aforementioned memory may be a read-only memory (ROM), other types of static storage devices capable of storing static information and instructions, random access memory (RAM), or other types of dynamic storage devices capable of storing information and instructions. It may also be an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media, or other magnetic storage devices. Alternatively, it may be any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer.

[0186] Example 5

[0187] Embodiment 5 of the present invention provides a computer-readable storage medium including a program or instructions that, when the program or instructions are run on a computer, execute the method of Embodiment 1 or Embodiment 2.

[0188] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., high-density digital video discs (DVDs)), or semiconductor media (e.g., solid-state drives (SSDs)).

[0189] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for generating virtual fences, applied to a virtual reality system, characterized in that, The virtual reality system includes a ground detection model and a positioning device, and the method includes: Acquire the collected ground images; The ground detection model, trained by combining multiple weak classifiers, is used to identify the ground image to obtain the first ground height; If the first ground height is within the ground height range, then a virtual ground is generated at the first ground height; If the first ground height is not within the range of the ground height, then when the positioning device is placed on the actual ground, the positioning device is positioned, the second ground height is obtained according to the positioning result, and a virtual ground is generated at the second ground height; Based on the virtual ground, a virtual fence is generated, which is used to define a safe area on the virtual ground. The virtual fence contains multiple layers of security zone points. Based on the virtual ground, a virtual fence is generated, including: In response to the user's line-drawing operation, multiple initial safe zone points are collected, wherein the initial safe zone points are the first layer of safe zone points, and the user's line-drawing operation is used to indicate drawing a safe zone on the virtual ground; The height of the first layer of safe zone points is increased to generate other layers of safe zone points, wherein the height of the safe zone points in adjacent layers differs by a preset first height.

2. The virtual fence generation method according to claim 1, characterized in that, After acquiring multiple initial safe zone points, the method further includes: If multiple initial safe zone points do not form a closed region, a first prompt message is output; If multiple initial safe regions form a closed region and the region area is less than the area threshold, then a second prompt message is output.

3. The virtual fence generation method according to claim 1 or 2, characterized in that, The method further includes: Based on the multiple initial safe zone points, multiple layers of interval points are obtained; Obtain the distance between the user's location and the point in the safe zone; If the distance is less than or equal to a preset distance, then the multiple interval points are controlled to flash in a simulated raindrop pattern. The flashing interval points represent raindrops, and the simulated raindrop pattern indicates that the raindrop falls from the highest interval point to the lowest interval point, and then rises back from the raindrop's starting point to its ending point.

4. The virtual fence generation method according to claim 3, characterized in that, The process of obtaining multiple layers of interval points based on the security area points includes: Starting from the first initial safe zone point, multiple initial interval points are selected from the multiple initial safe zone points at preset intervals, wherein the initial interval points are the first layer of interval points; The height of the first layer of interval points is increased to generate other layer interval points, wherein the interval points of adjacent layers differ in height by a preset second height.

5. The virtual fence generation method according to claim 3, characterized in that, The control of multiple interval points to blink according to a simulated raindrop pattern includes: Based on the distance, the flashing frequency of the multiple interval points is adjusted, wherein the smaller the distance, the faster the flashing frequency.

6. A display method applied to a virtual reality system, characterized in that, The method includes: The method according to any one of claims 1-5 generates a virtual fence, wherein the virtual fence includes a plurality of initial safe zone points; Based on the multiple initial safe zone points, multiple layers of interval points are obtained; Obtain the distance between the user's location and the point in the safe zone; If the distance is less than or equal to a preset distance, then the multiple interval points are controlled to flash in a simulated raindrop pattern. The flashing interval points represent raindrops, and the simulated raindrop pattern indicates that the raindrop falls from the highest interval point to the lowest interval point, and then rises back from the raindrop's starting point to its ending point.

7. A virtual reality system, characterized in that, The virtual reality system includes a ground detection model and a positioning device, and the system also includes: The acquisition module is used to acquire the collected ground images; The ground detection module is used to identify the ground image using the ground detection model trained by combining multiple weak classifiers, and obtain the first ground height; A virtual ground generation module is used to generate a virtual ground at the first ground height if the first ground height is within the ground height range; and if the first ground height is not within the ground height range, when the positioning device is placed on the actual ground, to locate the positioning device, obtain a second ground height based on the positioning result, and generate a virtual ground at the second ground height. A virtual fence generation module is used to generate a virtual fence based on the virtual ground, the virtual fence being used to define a safe area on the virtual ground; The virtual fence contains multiple layers of security zone points, and the virtual fence generation module is specifically used for: In response to the user's line-drawing operation, multiple initial safe zone points are collected, wherein the initial safe zone points are the first layer of safe zone points, and the user's line-drawing operation is used to indicate drawing a safe zone on the virtual ground; The height of the first layer of safe zone points is increased to generate other layers of safe zone points, wherein the height of the safe zone points in adjacent layers differs by a preset first height.

8. An electronic device, characterized in that, include: Memory and processor: The memory is used to store computer programs; The processor is configured to execute a computer program stored in the memory to cause the electronic device to perform the method as described in any one of claims 1 to 5 or 6.

9. A computer-readable storage medium, characterized in that, Includes a program or instructions that, when run on a computer, execute the method as described in any one of claims 1 to 5 or 6.