Game generation method and system based on virtual reality
By identifying and mapping objects in the real world to the virtual game world, the problem that the existing virtual reality car game entertainment system cannot interact with the real environment is solved, and the immersive interactive game experience for users during driving is realized.
Patent Information
- Application Number
- CN202310634686.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-31
- Publication Date
- 2024-12-03
AI Technical Summary
The existing virtual reality car gaming entertainment system cannot interact with the real world environment, and the user experience is single and lacks immersion.
By collecting image data around the vehicle, identifying and mapping real objects into the virtual game world, virtual objects and scenes are generated based on the virtual game scene selected by the user, allowing the user to play interactive games while driving.
It realizes the immersive virtual reality gaming experience of users in the real environment, enhancing the interactiveness and fun of the game.
Smart Images

Figure CN119056046A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of intelligent automobiles, and in particular relates to a game generation method and system based on virtual reality. Background Art
[0002] With the development of science and technology, cars are no longer just a means of transportation, but also need to meet the entertainment requirements of users. At present, conventional entertainment systems include car players and car games, but in the existing technology, users can only play games through smart terminals or car terminals. For game entertainment in the field of virtual reality, head mounted displays (HMD) are generally required for immersive experience. The content of the game needs to be designed in advance and is completely separated from the real world. This game mode has no interaction with the user's environment. Summary of the invention
[0003] In view of the above problems, the present invention provides a game generation method and system based on virtual reality, which models and plays games in the corresponding virtual game world according to the objects detected during driving, so that users can get a new game experience.
[0004] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0005] An embodiment of the present invention provides a method for generating a game based on virtual reality, comprising the following steps:
[0006] S10, collecting image data around the vehicle;
[0007] S20, performing target detection on the collected image data to identify the object in the image;
[0008] S30, calculating the relative position of the object relative to the position coordinates of the user;
[0009] S40, establishing a virtual object mapped with the object in the virtual world according to the virtual game scene selected by the user;
[0010] S50, combining the established virtual objects into a virtual game scene;
[0011] S60: The user plays the game according to the selected virtual game scene.
[0012] In a possible implementation, the object includes at least one of a vehicle, a non-motor vehicle, a pedestrian, a pet, a roadblock, and a building.
[0013] In a possible implementation, S40 specifically includes: first classifying the objects, and then mapping the classified objects into virtual objects of similar types.
[0014] In a possible implementation, S20 further includes: marking the identified object, and if the current object is detected repeatedly subsequently, performing deduplication processing on the identified object.
[0015] In a possible implementation, S40 further includes: pre-establishing a virtual object database, and selecting and rendering from the virtual database to generate a mapped virtual object.
[0016] Another aspect of an embodiment of the present invention provides a game generation system based on virtual reality, comprising the following steps:
[0017] An image data acquisition module, used for acquiring image data around the vehicle;
[0018] The object recognition module is used to perform target detection on the collected image data and identify the objects in the image;
[0019] A position calculation module, used to calculate the relative position of the object relative to the position coordinates of the user;
[0020] A virtual object creation module creates a virtual object mapped to an object in the virtual world according to a virtual game scene selected by a user;
[0021] A virtual game scene generation module, used to combine the established virtual objects into a virtual game scene;
[0022] The game running module is used for users to play games according to the selected virtual game scene.
[0023] In a possible implementation, the object includes at least one of a vehicle, a non-motor vehicle, a pedestrian, a pet, a roadblock, and a building.
[0024] In a possible implementation, establishing a virtual object mapped to an object in a virtual world according to a virtual game scene selected by a user specifically includes: first classifying the objects, and then mapping the classified objects into virtual objects of similar types.
[0025] In a possible implementation, the object recognition module is further configured to: mark the recognized object, and if the current object is detected repeatedly subsequently, perform deduplication processing on the recognized object.
[0026] In a possible implementation, the virtual object creation module is further configured to pre-create a virtual object database, and to generate mapped virtual objects by selecting and rendering from the virtual database.
[0027] The use of the present invention has the following beneficial effects: modeling is performed in a game scene in the virtual world based on real-world data collected during driving, allowing users to play games in this virtual scene based on reality, so that users can get a brand new game experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 A flowchart of the steps of a method for generating a game based on virtual reality according to an embodiment of the present invention;
[0029] Figure 2 It is a principle block diagram of a game generation system based on virtual reality according to an embodiment of the present invention. DETAILED DESCRIPTION
[0030] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0031] See also Figure 1 , which is a flowchart of a method for generating a game based on virtual reality according to an embodiment of the present invention, comprises the following steps:
[0032] S10, collecting image data around the vehicle;
[0033] S20, performing target detection on the collected image data to identify objects in the image; the objects include but are not limited to vehicles, non-motor vehicles, pedestrians, pets, roadblocks, buildings, shops, etc.
[0034] S30, calculating the relative position of the object relative to the position coordinates of the user;
[0035] S40, establishing virtual objects mapped to objects in the virtual world according to the virtual game scene selected by the user; for example, displaying a small tank at the position of a car, an armored vehicle at the position of a large SUV, zombies at the position of pedestrians, zombie dogs at the position of pets, obstacles at the position of roadblocks, buildings of similar size at the position of buildings, supply points at the position of stores, etc.
[0036] S50, combining the established virtual objects into a virtual game scene;
[0037] S60: The user plays the game according to the selected virtual game scene.
[0038] In practice, the game mode can be implemented in many specific ways. Taking a shooting game as an example, it can be run according to the following steps:
[0039] The user's position is used as the first-person perspective, and the villain in the game is generated based on the objects detected during driving;
[0040] Shoot different characters to get different points, and shoot supply points to get ammunition replenishment;
[0041] The player wins if he gets the agreed points within a certain period of time; the player loses if he fails to get the agreed points or if the ammunition is used up and not replenished.
[0042] After winning, you can enter the next level, and after losing, you can start over.
[0043] In one embodiment of the present invention, in S40, objects are first classified, and then the classified objects are mapped into virtual objects of similar types. For example, when generating virtual objects, vehicles are virtualized into combat vehicle virtual objects; and people and animals are virtualized into different types of zombie objects.
[0044] In one embodiment of the present invention, S20 further includes: marking the identified object, and if the current object is detected repeatedly in the future, deduplication processing is performed on the identified object. In the actual driving process, the content captured by the camera will change, the detected object will also change synchronously, and the object in the virtual world will also be generated synchronously when it is detected for the first time, but this object may have been destroyed during the game process, so it is necessary to track the detected object to ensure that the destroyed object will not reappear in the virtual world, and ensure the continuity of the game scene. That is, the virtual object A that is hit in the virtual world will disappear under certain conditions (for example, a virtual object is given a life value, and it will disappear when it is hit once, and it will disappear when it is reduced to 0). The object in the real world corresponding to the virtual object A is a, and a will not disappear. Therefore, in the next target detection process, if a is still within the detection range, it will still be detected. In this case, it is ensured that A in the virtual world will not appear again.
[0045] In one embodiment of the present invention, S40 further includes: pre-establishing a virtual object database, selecting and rendering from the virtual database to generate a mapped virtual object. Real-time modeling consumes a lot of performance for current hardware, so under current hardware conditions, common objects are selected for pre-modeling, and the most suitable 3D model is displayed by matching with the identified objects. When actually establishing the virtual object, the virtual object can be obtained by rendering the established object 3D model.
[0046] Through the above-mentioned game generation method based on virtual reality, users can play games in this virtual scene built on reality, so that users can get a brand new game experience.
[0047] Corresponding to the method embodiment, the present invention provides a game generation system based on virtual reality, including an image data acquisition module, an object recognition module, a position calculation module, a virtual object establishment module, a virtual game scene generation module and a game running module, wherein the image data acquisition module is used to collect image data around a vehicle; the object recognition module is used to perform target detection on the collected image data and identify the object in the image; wherein the object includes but is not limited to vehicles, non-motor vehicles, pedestrians, pets, roadblocks, buildings, shops, etc.; the position calculation module is used to calculate the relative position of the object relative to the user's position coordinates; the virtual object establishment module establishes a virtual object mapped with the object in the virtual world according to the virtual game scene selected by the user; for example, a small tank is displayed at the position of a car, an armored vehicle is displayed at the position of a large SUV, a zombie is displayed at the position of a pedestrian, a zombie dog is displayed at the position of a pet, an obstacle is displayed at the position of a roadblock, a building of similar size is displayed at the position of a building, a supply point is displayed at the position of a shop, etc.; the virtual game scene generation module is used to combine the established virtual objects into a virtual game scene; the game running module is used for the user to play the game according to the selected virtual game scene.
[0048] In the embodiment of the present invention, the game mode can be implemented in a variety of specific ways in practice. Taking a shooting game as an example, the game mode can be run according to the following steps:
[0049] The user's position is used as the first-person perspective, and the villain in the game is generated based on the objects detected during driving;
[0050] Shoot different characters to get different points, and shoot supply points to get ammunition replenishment;
[0051] The player wins if he gets the agreed points within a certain period of time; the player loses if he fails to get the agreed points or if the ammunition is used up and not replenished.
[0052] After winning, you can enter the next level, and after losing, you can start over.
[0053] In one embodiment of the present invention, the virtual object creation module first classifies the objects, and then maps the classified objects into virtual objects of similar types. For example, when generating virtual objects, vehicles are virtualized into combat vehicle virtual objects; people and animals are virtualized into different types of zombie objects.
[0054] In one embodiment of the present invention, the object recognition module further includes: marking the recognized object, and if the current object is detected repeatedly in the future, deduplication processing is performed on the recognized object. In the actual driving process, the content captured by the camera will change, the detected object will also change synchronously, and the object in the virtual world will also be generated synchronously when it is detected for the first time, but this object may have been destroyed during the game process, so it is necessary to track the detected object to ensure that the destroyed object will not reappear in the virtual world, and ensure the continuity of the game scene. That is, the virtual object A that is hit in the virtual world will disappear under certain conditions (for example, a virtual object is given a life value, and it will disappear when it is hit once, and it will disappear when it is reduced to 0). The object in the real world corresponding to the virtual object A is a, and a will not disappear. Therefore, in the next target detection process, if a is still within the detection range, it will still be detected. In this case, it is ensured that A in the virtual world will not appear again.
[0055] In one embodiment of the present invention, the virtual object creation module further includes: pre-establishing a virtual object database, selecting from the virtual database and rendering to generate a mapped virtual object. Real-time modeling consumes a lot of performance for current hardware, so under current hardware conditions, common objects are selected for pre-modeling, and the most suitable 3D model is displayed by matching with the identified objects. When actually creating a virtual object, the virtual object can be obtained by rendering the established object 3D model.
[0056] Through the above-mentioned virtual reality-based game generation system, users can play games in this virtual scene built on reality, so that users can get a brand new game experience.
[0057] It should be understood that the exemplary embodiments described herein are illustrative rather than restrictive. Although one or more embodiments of the present invention have been described in conjunction with the accompanying drawings, it should be understood by those skilled in the art that various changes in form and detail may be made without departing from the spirit and scope of the present invention as defined by the appended claims.
Claims
1. A game generation method based on virtual reality, characterized in that: The following steps are involved: S10, collecting image data around the vehicle; S20, performing target detection on the collected image data to identify the object in the image; S30, calculating the relative position of the object relative to the position coordinates of the user; S40, establishing a virtual object mapped with the object in the virtual world according to the virtual game scene selected by the user; S50, combining the established virtual objects into a virtual game scene; S60: The user plays the game according to the selected virtual game scene.
2. The method for generating a game based on virtual reality according to claim 1, characterized in that: The object includes at least one of a vehicle, a non-motor vehicle, a pedestrian, a pet, a roadblock, and a building.
3. The method for generating a game based on virtual reality according to claim 1, wherein: S40 specifically includes: first classifying the objects, and then mapping the classified objects into virtual objects of similar types.
4. The method for generating a game based on virtual reality according to claim 1, wherein: S20 further includes: marking the identified object, and if the current object is detected repeatedly later, performing deduplication processing on the identified object.
5. The method for generating a game based on virtual reality according to claim 1, wherein: S40 further includes: pre-establishing a virtual object database, and selecting and rendering from the virtual database to generate a mapped virtual object.
6. A game generation system based on virtual reality, characterized in that: The following steps are involved: An image data acquisition module, used for acquiring image data around the vehicle; The object recognition module is used to perform target detection on the collected image data and identify the objects in the image; A position calculation module, used to calculate the relative position of the object relative to the position coordinates of the user; A virtual object creation module creates a virtual object mapped to an object in the virtual world according to a virtual game scene selected by a user; A virtual game scene generation module, used to combine the established virtual objects into a virtual game scene; The game running module is used for users to play games according to the selected virtual game scene.
7. The virtual reality based game generation system according to claim 6, characterized in that: The object includes at least one of a vehicle, a non-motor vehicle, a pedestrian, a pet, a roadblock, and a building.
8. The virtual reality based game generation system according to claim 6, characterized in that: Establishing virtual objects mapped with objects in the virtual world according to the virtual game scene selected by the user specifically includes: first classifying the objects, and then mapping the classified objects into virtual objects of similar types.
9. The virtual reality based game generation system according to claim 6, characterized in that: The object recognition module is further configured to mark the recognized object, and if the current object is subsequently detected repeatedly, deduplicate the recognized object.
10. The virtual reality based game generation system according to claim 6, characterized in that: The virtual object creation module is further used to pre-create a virtual object database, and to generate mapped virtual objects by rendering after selecting from the virtual database.
