A method for realizing virtual reality, electronic device and storage medium
By rendering the image captured by the binocular panoramic camera device as a texture to the inner spherical surface of the virtual reality device, the problem of lens distortion in the virtual reality device is solved, and simplified image generation and effect improvement are achieved.
Patent Information
- Application Number
- CN202210733673.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-24
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2042-06-24
AI Technical Summary
Due to the pincushion distortion problem caused by the lenses in existing virtual reality devices, the existing anti-distortion algorithm is complex and it is difficult to simplify the generation of left-eye images and right-eye images.
The left-eye panoramic image and the right-eye panoramic image are obtained through the binocular panoramic camera equipment, and are rendered as textures onto the inner spherical surfaces of the two spheres, thereby extracting and displaying the left-eye image and the right-eye image simultaneously to achieve barrel distortion. , reducing the distortion caused by the lens and simplifying the image generation process.
It effectively reduces the distortion caused by the lens, simplifies the generation of left-eye images and right-eye images, eliminates the need to use complex anti-distortion algorithms, and improves the display effect of virtual reality devices.
Smart Images

Figure CN115079826B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of virtual reality technology, and in particular to a method for implementing virtual reality, an electronic device, and a storage medium. Background Art
[0002] Virtual reality (VR) refers to the use of computers to create a virtual world that directly exposes visual, auditory, and tactile sensations to participants, allowing them to interactively observe and manipulate the world. With the development of VR technology, the emergence of VR devices has improved people's quality of life and is gaining increasing popularity and attention.
[0003] The display model of virtual reality devices is generally "human eye-lens-display screen." The presence of the lens allows for a greater sense of immersion, but it also inevitably introduces some side effects, one of which is distortion. Currently, to combat the pincushion distortion introduced by the lens (i.e., dedistortion), an inverse distortion is added to the original image, transforming it into a barrel distortion. This ultimately creates a normal image for the user. However, current dedistortion algorithms are relatively complex. Summary of the Invention
[0004] The main technical problem solved by this application is to provide a method for realizing virtual reality, an electronic device and a storage medium, which can effectively reduce distortion and simplify the generation method of left-eye images and right-eye images.
[0005] To solve the above technical problems, the first aspect of the present application provides a method for realizing virtual reality, comprising: obtaining a left-eye panoramic image and a right-eye panoramic image formed by shooting a target scene with a binocular panoramic camera device; rendering the left-eye panoramic image and the right-eye panoramic image as textures onto the inner spherical surfaces of two spheres respectively; and extracting the left-eye image and the right-eye image from the rendered inner spherical surfaces of the two spheres respectively, so that the virtual reality device can synchronously display the left-eye image and the right-eye image.
[0006] To solve the above technical problems, the second aspect of the present application provides an electronic device, which includes a memory and a processor coupled to each other, the memory is used to store program data, and the processor is used to execute the program data to implement the above method.
[0007] In order to solve the above technical problems, the third aspect of the present application provides a computer-readable storage medium, which stores program data. When the program data is executed by a processor, it is used to implement the above method.
[0008] The beneficial effect of the present application is as follows: different from the prior art, the present application obtains a left-eye panoramic image and a right-eye panoramic image formed by shooting a target scene with a binocular panoramic camera device, and then renders the left-eye panoramic image and the right-eye panoramic image as textures onto the inner spherical surfaces of two spheres respectively, and finally extracts the left-eye image and the right-eye image from the rendered inner spherical surfaces of the two spheres respectively, so that the left-eye image and the right-eye image can be synchronously displayed on a virtual reality device. Among them, by rendering the left-eye panoramic image and the right-eye panoramic image as textures onto the inner spherical surfaces of the two spheres respectively, the left-eye panoramic image and the right-eye panoramic image can be barrel distorted. The left-eye image and the right-eye image extracted from the inner spherical surfaces of the two spheres also have barrel distortion. Then, when the left-eye image and the right-eye image are synchronously displayed on the virtual reality device, the distortion caused by the lens can be effectively reduced. In addition, there is no need to use a complex anti-distortion algorithm to deform the left-eye panoramic image and the right-eye panoramic image, which simplifies the method of generating the left-eye image and the right-eye image. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions of this application, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be derived from these drawings without inventive effort. Among them:
[0010] Figure 1 This is a flow chart of an embodiment of a method for implementing virtual reality of the present application;
[0011] Figure 2 1 is a schematic structural diagram of an embodiment of a binocular panoramic camera device;
[0012] Figure 3 This is a schematic diagram of a panoramic image captured by a binocular panoramic camera device;
[0013] Figure 4 yes Figure 1 A schematic flow chart of an embodiment of step S13;
[0014] Figure 5 is a schematic diagram of a left-eye image and a right-eye image;
[0015] Figure 6 This is a scene diagram of an embodiment of a method for implementing virtual reality of the present application;
[0016] Figure 7 This is a flow chart of another embodiment of the method for implementing virtual reality of the present application;
[0017] Figure 8Schematic diagram of the comparison between the face image, the left eye panoramic image, and the right eye panoramic image before and after face restoration;
[0018] Figure 9 yes Figure 7 A schematic flow chart of an embodiment of step S25;
[0019] Figure 10 The left-eye image and the right-eye image corresponding to when the user's head is tilted to the left;
[0020] Figure 11 The left-eye image and the right-eye image corresponding to when the user's head is tilted to the right;
[0021] Figure 12 This is a schematic block diagram of the structure of an embodiment of the electronic device of the present application;
[0022] Figure 13 is a schematic structural block diagram of another embodiment of the electronic device of the present application;
[0023] Figure 14 This is a schematic structural block diagram of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0024] References to "embodiments" in this application mean that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0025] The terms "first" and "second" in this application are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.
[0026] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0027] See also Figures 1 to 3 , Figure 1 This is a flow chart of an embodiment of a method for implementing virtual reality in the present application. Figure 2 1 is a schematic structural diagram of an embodiment of a binocular panoramic camera device. Figure 3 This is a schematic diagram of a panoramic image captured by a binocular panoramic camera. The present application may be implemented by a virtual reality device, such as a head-mounted stereo display, three-dimensional virtual reality glasses, or other three-dimensional visual display devices. Three-dimensional virtual reality glasses may include, but are not limited to, split-type virtual reality glasses, integrated virtual reality glasses, and virtual reality glasses displayed on a mobile terminal (e.g., a mobile phone).
[0028] In this embodiment, the method may include the following steps:
[0029] Step S11: obtaining a left-eye panoramic image and a right-eye panoramic image formed by capturing a target scene with a binocular panoramic camera device.
[0030] Specifically, the binocular panoramic camera device can send the left-eye panoramic image and the right-eye panoramic image formed by photographing the target scene to the virtual reality device for display.
[0031] like Figure 2 As shown, the binocular panoramic camera device 10 includes two sets of panoramic camera modules (denoted as a first panoramic camera module 101 and a second panoramic camera module 102) arranged side by side and spaced apart along their optical axes. Each set of panoramic camera modules includes two panoramic cameras arranged opposite to each other along their respective optical axes. The distance between the first panoramic camera module 101 and the second panoramic camera module 102 is the same as the distance between the human eyes. The human here refers to a person using a virtual reality device that simultaneously displays the left and right eye images below, hereinafter referred to as a user.
[0032] Specifically, the first panoramic camera module 101 includes a first panoramic camera 1011 and a second panoramic camera 1012, which are disposed opposite to each other along their respective optical axes. The second panoramic camera module 102 includes a third panoramic camera 1021 and a fourth panoramic camera 1022, which are disposed opposite to each other along their respective optical axes. The optical axes of the first panoramic camera 1011 and the third panoramic camera 1021 are parallel, and the distance between the first panoramic camera 1011 and the third panoramic camera 1021 is the same as the distance between the user's eyes. The optical axes of the second panoramic camera 1012 and the fourth panoramic camera 1022 are parallel, and the distance between the second panoramic camera 1012 and the fourth panoramic camera 1022 is the same as the distance between the user's eyes.
[0033] Each panoramic camera has a viewing angle greater than 180 degrees. The images captured by the first and second panoramic cameras 1011, 1012 are stitched together to form a 360-degree panoramic image, simulating the user's left eye. The images captured by the third and fourth panoramic cameras 1021, 1022 are stitched together to form a 360-degree panoramic image, simulating the user's right eye. Due to the slight difference in position between the first and second panoramic camera modules 101, 102, the stitched panoramic images from these two sets of panoramic camera modules form a 3D image.
[0034] The target scene can be any scene and is not limited here. For example, the target scene can be a video conferencing scene. In the video conferencing scene, a user (e.g., Xiao Zhang) wears 3D virtual reality glasses, and a binocular panoramic camera captures a target person in the target scene. The captured panoramic image is processed and displayed on the 3D virtual reality glasses. This allows the user (Xiao Zhang) to feel as if they are in the scene where the conversation partner is, communicating face-to-face with the conversation partner, resulting in a strong sense of immersion and a good experience. In contrast, a target person (e.g., Xiao Li) in the target scene can also wear 3D virtual reality glasses. The binocular panoramic camera in Xiao Zhang's scene captures Xiao Zhang's scene, and the captured panoramic image is processed and displayed on the 3D virtual reality glasses worn by Xiao Li. Thus, both parties can use virtual reality to conduct a conversation in a 3D virtual space, achieving a strong sense of immersion and a good experience.
[0035] The binocular panoramic camera device can be located at a fixed position for shooting, or it can be used while moving. For example, the binocular panoramic camera device can be handheld or worn by the user (for example, the binocular panoramic camera device is set on 3D virtual reality glasses, or the user wears 3D virtual reality glasses). Alternatively, the binocular panoramic camera device can be set on a mobile device, such as a drone, and the mobile device can be moved to drive the binocular panoramic camera device to move.
[0036] In one specific embodiment, a binocular panoramic camera is mounted on a drone. When the drone is airborne, the binocular panoramic camera captures an aerial perspective, extending the capture range and enabling the recording of natural scenery. A pair of 3D virtual reality glasses on the other end captures the panoramic image captured by the binocular panoramic camera and, after processing, displays it on the binocular panoramic camera. This allows the user to view another scene in real time without leaving home. The above is merely an example; the target scene can also be other scenes that can be displayed using virtual reality technology, and this is not a limitation here.
[0037] Step S12: Rendering the left-eye panoramic image and the right-eye panoramic image as textures onto the inner spherical surfaces of the two spheres respectively.
[0038] Virtual reality is mostly based on a graphics engine, which is then encapsulated to build upper-layer application systems. Remarkable graphics engines include OGRE, OpenGVS, Vtree, and OSG. Specifically, based on the graphics engine, two spherical spaces can be created, and binocular panoramic images (left-eye panoramic image and right-eye panoramic image) can be rendered as textures onto the inner surfaces of the two spheres.
[0039] Step S13: extracting the left eye image and the right eye image from the inner spheres of the two rendered spheres respectively, so that the virtual reality device can synchronously display the left eye image and the right eye image.
[0040] Specifically, the image areas of the inner spheres of the two spheres in the preset directions can be intercepted as the left eye image and the right eye image respectively. The preset directions can be set and modified according to actual conditions. For example, the preset direction is the front.
[0041] The above scheme obtains a left-eye panoramic image and a right-eye panoramic image formed by capturing a target scene with a binocular panoramic camera device, then renders the left-eye panoramic image and the right-eye panoramic image as textures onto the inner spheres of two spheres, respectively. Finally, the left-eye image and the right-eye image are extracted from the rendered inner spheres of the two spheres, respectively, so that the left-eye image and the right-eye image are synchronously displayed on a virtual reality device. Particularly, by rendering the left-eye panoramic image and the right-eye panoramic image as textures onto the inner spheres of the two spheres, respectively, barrel distortion can be caused in the left-eye panoramic image and the right-eye panoramic image. The left-eye image and the right-eye image extracted from the inner spheres of the two spheres also have barrel distortion. Therefore, when the left-eye image and the right-eye image are synchronously displayed on the virtual reality device, the distortion caused by the lens can be effectively reduced. In addition, there is no need to use a complex anti-distortion algorithm to deform the left-eye panoramic image and the right-eye panoramic image, thereby simplifying the method for generating the left-eye image and the right-eye image.
[0042] Please see further Figure 4 and Figure 5 , Figure 4 yes Figure 1 A flow chart of an embodiment of step S13 is shown in FIG. Figure 5 It is a schematic diagram of the left-eye image and the right-eye image.
[0043] In some embodiments, step S13 includes sub-steps S131 to S132:
[0044] Step S131: Cones with vertices located at the centers of the two spheres and having predetermined cone angles are respectively set in the two spheres.
[0045] The predetermined cone angle of the cone may be 100 degrees to 120 degrees, for example, 110 degrees.
[0046] Step S132: using the inner spherical surface contents within the intersection area between the two cones and the inner spherical surfaces of their respective corresponding spheres as the left-eye image and the right-eye image.
[0047] like Figure 5 As shown, the image displayed on the left is the left eye image, and the image displayed on the right is the right eye view.
[0048] See also Figure 6 , Figure 6 This is a scene diagram of an embodiment of the virtual reality implementation method of the present application.
[0049] like Figure 6 As shown, the first virtual reality device 21 is a device that displays left-eye images and right-eye images. The first virtual reality device 21 is communicatively connected to the binocular panoramic camera device (11 or 12), and is used to obtain the left-eye panoramic image and the right-eye panoramic image from the binocular panoramic camera device, and render the left-eye panoramic image and the right-eye panoramic image as textures onto the inner spheres of two spheres, respectively. Then, the left-eye image and the right-eye image are extracted from the rendered inner spheres of the two spheres, respectively, so that the first virtual reality device can synchronously display the left-eye image and the right-eye image. The communication connection can be a wired connection, such as a data cable connection; or it can be a wireless connection, such as a connection via Bluetooth, WiFi, the Internet, or other network connection. The binocular panoramic camera device can be fixedly or detachably set on the first virtual reality device, or the binocular panoramic camera device and the first virtual reality device can be two independent devices.
[0050] In one embodiment, the binocular panoramic camera device is set on the first virtual reality device, that is, the first virtual reality device 21 and the binocular panoramic camera device 11 are both located in the same scene (recorded as scene A). At this time, the user of the first virtual reality device 21 can view scene A on the first virtual reality device.
[0051] In another embodiment, the binocular panoramic camera device is not provided on the first virtual reality device, and the binocular panoramic camera device and the first virtual reality device are located in different scenes (e.g. Figure 6 As shown, the second binocular panoramic camera device 12 is in scene B, and the first virtual reality device 21 is in scene A. The left-eye panoramic image and the right-eye panoramic image captured by the second binocular panoramic camera device 12 are transmitted back to the first virtual reality device 21, so that the user in scene A can view scene B through the first virtual reality device 21. In this embodiment, the binocular panoramic camera device also includes a first binocular panoramic camera device 11, which is disposed in the environment of the first virtual reality device 21. The second virtual reality device 22 can also obtain the left-eye panoramic image and the right-eye panoramic image captured by the first binocular panoramic camera device 11 to achieve virtual reality display.
[0052] like Figure 6 As shown, in one scene (scene A), there is a first virtual reality device 21 and a first binocular panoramic camera device 11, and in another scene (scene B), there is a second virtual reality device 22 and a second binocular panoramic camera device 12. The first virtual reality device 21 is connected to the second binocular panoramic camera device 12 through a network, and the second virtual reality device 22 is connected to the first binocular panoramic camera device 11 through a network.
[0053] Among them, the first virtual reality device 21 can obtain the left-eye panoramic image and the right-eye panoramic image formed by the second binocular panoramic camera device 12 shooting the scene B. Scene B includes the second target person (recorded as Xiao Li), and scene A includes the first target person (recorded as Xiao Zhang). Therefore, Xiao Zhang, the user of the first virtual reality device 21, can have a video conversation with Xiao Li through the first virtual reality device 21 in real time. At the same time, the second virtual reality device 22 can also obtain the left-eye panoramic image and the right-eye panoramic image formed by the first binocular panoramic camera device 21 shooting the scene A.
[0054] Among them, the distance between the two groups of panoramic camera modules of the second binocular panoramic camera device 12 is equal to the pupil distance of the user of the first virtual reality device 21, and the distance between the two groups of panoramic camera modules of the first binocular panoramic camera device 11 is equal to the pupil distance of the user of the second virtual reality device 22.
[0055] See also Figures 7 to 9 , Figure 7 This is a flow chart of another embodiment of the method for implementing virtual reality of the present application. Figure 8 This is a comparison diagram of the face image, the left eye panoramic image, and the right eye panoramic image before and after face restoration. Figure 9 yes Figure 7 Flow chart of step S25 in an implementation manner.
[0056] In this embodiment, the method may include the following steps:
[0057] Step S21: Obtaining the pupil distance of the user of the virtual reality device.
[0058] Since the interpupillary distance of different users may be different, before the two sets of panoramic camera modules capture images, the spacing distance between the two sets of panoramic camera modules can also be adjusted based on the interpupillary distance of the user of the virtual reality device.
[0059] In one embodiment, the virtual reality device may also obtain the interpupillary distance of the user of the virtual reality device upon startup. In other embodiments, the virtual reality device may obtain the interpupillary distance of the user at preset time intervals after startup. The preset time interval can be set or modified according to actual needs, such as 0.1 seconds, 1 minute, 1 hour, etc.
[0060] Specifically, the virtual reality device can capture an image of the user's eye area at startup or at preset time intervals thereafter, and then determine the interpupillary distance of the user of the virtual reality device through image analysis. Specifically, the method for determining the interpupillary distance based on image analysis is not limited. Specifically, before the user wears the virtual reality device, a binocular panoramic camera device in the scene where the user is located can be used to capture an image of the user's face, and an image of the user's eye area can be captured based on the facial image for analysis. Alternatively, if the virtual reality device has a shooting function, shooting can also be performed directly through the virtual reality device.
[0061] Step S22: adjusting the spacing between the two groups of panoramic camera modules based on the pupil distance.
[0062] The distance between the two panoramic camera modules can be adjusted. In some embodiments, the two panoramic camera modules can be connected by a slide rail, and the panoramic camera modules can slide on the slide rail to adjust the distance between the two panoramic camera modules. The slide rail has an adjustment range of 40mm to 80mm, which fully covers the range of interpupillary distance of the human eye. In other embodiments, the two panoramic camera modules can also be connected using other sliding methods, as long as the distance between the two panoramic camera modules can be adjusted.
[0063] Step S23: stitching the images captured by the two panoramic cameras located in the same panoramic camera module in the two groups of panoramic camera modules to obtain a left-eye panoramic image and a right-eye panoramic image.
[0064] like Figure 2As shown, specifically, the images captured by the first panoramic camera 1011 and the second panoramic camera 1012 in the first panoramic camera module 101 are stitched together to obtain a left-eye panoramic image; and the images captured by the third panoramic camera 1021 and the fourth panoramic camera 1022 in the second panoramic camera module 102 are stitched together to obtain a right-eye panoramic image.
[0065] Step S24: Acquire a facial image of a target person in the target scene.
[0066] like Figure 8 As shown in the left figure in the figure, the facial image can be an image of the target person before the target person wears the virtual reality device. Alternatively, the facial image can be an image of the target person in the target scene captured by a binocular panoramic camera device in the target scene before the target person wears the virtual reality device, and then sent to the virtual reality device.
[0067] Step S25: In response to the face of the target person being blocked, performing face repair on the target person in the left-eye panoramic image and the right-eye panoramic image based on the face image to remove the blocker.
[0068] The occluder can be a virtual reality device or other objects. The virtual reality device performs occluder detection on the target person in the left-eye panoramic image and the right-eye panoramic image. If an occluder is detected, it is determined that the target person's face is occluded.
[0069] In video conferences, when both or more parties need to wear VR devices, such as when friends and family are communicating in 3D real-world video, the target person's eyes or head are blocked. While the other person can see themselves and their surroundings through VR, the partial obstruction makes it difficult for them to see their entire face, hindering communication. Therefore, a face-swapping algorithm can be used to replace the face image of a person wearing VR with a face image of a person without VR.
[0070] The face-changing algorithm can be an algorithm based on deep learning, which may include a face-changing algorithm based on a 3D model (such as On Face Segmentation, Face Swapping and Face Perception), a face-changing algorithm based on a style transfer model (such as Fast Face-swap), a face-changing algorithm based on a generative model (such as Deepfake), and a face-changing algorithm based on the fusion of a 3D model and a GAN model (such as FSNet), etc.
[0071] like Figure 8As shown, the middle figure is a schematic diagram of the target person wearing three-dimensional virtual reality glasses, and a schematic diagram of the panoramic image before face restoration. The right figure is a schematic diagram of the panoramic image after face restoration. Among them, part of the target person's face in the middle figure is blocked by the three-dimensional virtual reality glasses. After face restoration, the occlusion is removed, making the target person's face in the panoramic image complete.
[0072] In some embodiments, step S25 further includes sub-steps S251 to S252:
[0073] Step S251: extracting the unobstructed actions and / or expressions of the target person from the facial image.
[0074] Actions may include but are not limited to: blinking, looking up, turning, looking down, etc. Expressions may include but are not limited to: happy, sad, calm, etc.
[0075] Step S252: adjusting the motion and / or expression of the occluder-removed area in the left-eye panoramic image and the right-eye panoramic image based on the unoccluded motion and / or expression.
[0076] After adjustment, the movements and / or expressions of the target person in the left-eye panoramic image and the right-eye panoramic image are not blocked, so that the user at the other end can see the movements and / or expressions of the user at the local end, making the communication more vivid.
[0077] like Figure 5 As shown, Figure 5 In a one-way panoramic scenario like remote VR banking, binocular panoramic cameras are placed in the bank. Customers wearing 3D virtual reality glasses (also known as VR glasses) can call and enter the remote bank metaverse to communicate with bank employees. Since bank employees do not need to wear VR glasses, facial image restoration is not required.
[0078] Step S26: Synchronously collect audio data within the target scene as the binocular panoramic camera device shoots.
[0079] Step S27: The audio data, the left-eye panoramic image, and the right-eye panoramic image are encoded and compressed, and then transmitted from the local end to the peer end in the form of a video stream.
[0080] In some embodiments, the binocular panoramic camera device also includes an audio acquisition module (such as a microphone) for collecting audio data in the target scene. After the binocular panoramic camera device collects the left-eye panoramic image, the right-eye panoramic image and the audio data, it encodes and compresses the audio data, the left-eye panoramic image and the right-eye panoramic image and transmits them from the local end to the other end in the form of a video stream.
[0081] In other embodiments, the target scene also includes an audio capture device, which is independent of the binocular panoramic camera device. After the binocular panoramic camera device captures the left-eye panoramic image and the right-eye panoramic image, and the audio capture device captures the audio data, the data can be encoded and compressed by a virtual reality device or other device in the target scene and then transmitted from the local end to the remote end in the form of a video stream. In the above, the remote end is, for example, a virtual reality device.
[0082] Step S28: Rendering the left-eye panoramic image and the right-eye panoramic image as textures onto the inner surfaces of the two spheres respectively.
[0083] Step S29: extracting the left eye image and the right eye image from the inner spheres of the two rendered spheres respectively, so that the virtual reality device can synchronously display the left eye image and the right eye image.
[0084] For the description of steps S28 and S29, please refer to the relevant positions in the above embodiment, which will not be repeated here.
[0085] like Figures 10 and 11 As shown, Figure 10 The left eye image and the right eye image corresponding to the user's head tilted to the left. Figure 11 are the left eye image and right eye image corresponding to when the user's head is tilted to the right. Figure 10 、 Figure 11 The left image is the left eye image, and the right image is the right eye image.
[0086] In some embodiments, the method may further include: obtaining a head rotation angle of a user wearing a virtual reality device, and then controlling the relative rotation of the sphere and the cone with the vertex of the cone as the rotation center based on the head rotation angle to obtain a left-eye image and a right-eye image based on the head rotation angle, so that the virtual reality device plays the image taken at the corresponding angle accordingly.
[0087] A virtual reality device may include a gyroscope for measuring the rotation angle of the virtual reality device, i.e., the user's head rotation angle. When the virtual reality device moves up, down, left, right, forward, or backward in three dimensions, the gyroscope calculates the rotation angle before and after the movement. Based on the head rotation angle, the sphere and cone are then controlled to rotate relative to each other, with the apex of the cone as the rotation center, so that the virtual reality device plays images captured at the corresponding angle. It is understood that in addition to a gyroscope, other possible sensors may be used to obtain the head rotation angle of a user wearing the virtual reality device, and this is not limited here.
[0088] Remote video conferencing is typically achieved through two main approaches: one uses a camera and microphone to capture data, transmits it over the network, and plays the image and voice information on the other party's device, such as a laptop or mobile phone, to achieve remote video conferencing. The other approach uses a 3D human body model / scene model, combined with human motion and expression capture technology, to achieve virtual reality conversations and communication within a 3D metaverse space. However, the first approach, using a camera-based remote video conferencing system, only captures 2D images and audio on the terminal. This lacks immersion, impacting the user experience and ultimately the effectiveness of the remote video conferencing. The second approach, using a 3D human body model / scene model combined with human motion and expression capture technology to achieve conversations and communication within a 3D metaverse space, suffers from high hardware costs and limited performance, resulting in less vivid and lifelike movements and expressions, which in turn impacts the overall quality of the conversation.
[0089] In order to solve the problems existing in the previous two remote conversation solutions, improve user experience, and enhance the effectiveness of remote conversation communication, this application provides a virtual reality implementation method with panoramic three-dimensional real-scene virtual reality conversation capabilities. When using this solution, users feel as if they are in the space where the conversation partner is located and communicating face to face with the conversation partner, with a strong sense of immersion and a good experience.
[0090] Compared with the existing solution based on 3D modeling and using motion and facial expression capture to conduct conversations in a virtual 3D space, this solution not only has the same 3D immersion, but the images captured by the camera are more realistic than those captured by motion capture equipment. The cost of the required supporting hardware equipment is much lower than that of the 3D modeling solution. It is simple and easy to use, and users can easily obtain related services.
[0091] See also Figure 12 , Figure 12 This is a schematic structural block diagram of an embodiment of the electronic device of the present application.
[0092] In this embodiment, the electronic device 100 includes an acquisition module 110, a rendering module 120, and a display module 130. The acquisition module 110 is configured to acquire a left-eye panoramic image and a right-eye panoramic image formed by a binocular panoramic camera device capturing a target scene; the rendering module 120 is configured to render the left-eye panoramic image and the right-eye panoramic image as textures onto the inner surfaces of two spheres; and the display module 130 is configured to extract the left-eye image and the right-eye image from the rendered inner surfaces of the two spheres, respectively, for synchronous display by a virtual reality device.
[0093] In some embodiments, the binocular panoramic camera device includes two groups of panoramic camera modules that are arranged side by side and at intervals in the direction of the optical axis, and each group of panoramic camera modules includes two panoramic cameras that are arranged back to back with each other along their respective optical axes. The step of obtaining a left-eye panoramic image and a right-eye panoramic image formed by the binocular panoramic camera device shooting the target scene includes: stitching the images taken by the two panoramic cameras located in the same panoramic camera module in the two groups of panoramic camera modules to obtain a left-eye panoramic image and a right-eye panoramic image.
[0094] In some embodiments, before the step of obtaining a left-eye panoramic image and a right-eye panoramic image formed by capturing a target scene with a binocular panoramic camera device, the method further includes: obtaining the pupil distance of a user of the virtual reality device; and adjusting the spacing distance between the two sets of panoramic camera modules based on the pupil distance.
[0095] In some embodiments, before the step of rendering the left-eye panoramic image and the right-eye panoramic image as textures onto the inner spheres of two spheres respectively, the step further includes: obtaining a facial image of a target person in the target scene; in response to the face of the target person being occluded, performing face repair on the target person on the left-eye panoramic image and the right-eye panoramic image based on the facial image to remove the occluder.
[0096] In some embodiments, in response to the face of the target person being occluded, the step of performing face repair on the target person in the left-eye panoramic image and the right-eye panoramic image based on the face image includes: extracting the unobstructed movements and / or expressions of the target person from the face image; adjusting the movements and / or expressions of the occluded area in the left-eye panoramic image and the right-eye panoramic image based on the unobstructed movements and / or expressions.
[0097] In some embodiments, before the step of rendering the left-eye panoramic image and the right-eye panoramic image as textures onto the inner surfaces of two spheres respectively, the step further includes: synchronously collecting audio data in the target scene as the binocular panoramic camera device shoots; encoding and compressing the audio data, the left-eye panoramic image, and the right-eye panoramic image and transmitting them from the local end to the opposite end in the form of a video stream.
[0098] In some embodiments, the steps of extracting the left eye image and the right eye image from the inner spherical surfaces of the two rendered spheres include: setting cones with vertices located at the centers of the two spheres and having predetermined cone angles in the two spheres respectively; and using the inner spherical surface contents in the intersection area between the two cones and the inner spherical surfaces of their respective corresponding spheres as the left eye image and the right eye image.
[0099] In some embodiments, the predetermined cone angle of the cone is 100 degrees to 120 degrees.
[0100] In some embodiments, the method further includes: obtaining a head rotation angle of a user wearing a virtual reality device; and controlling the relative rotation of the sphere and the cone with the vertex of the cone as the rotation center based on the head rotation angle.
[0101] See also Figure 13 , Figure 13 It is a schematic structural block diagram of another embodiment of the electronic device of the present application.
[0102] The electronic device 200 includes a memory 210 and a processor 220 coupled to each other. The memory 210 is used to store program data, and the processor 220 is used to execute the program data to implement the steps in any of the above method embodiments.
[0103] The electronic device 200 may include, but is not limited to, personal computers (e.g., desktops, laptops, tablets, PDAs, etc.), mobile phones, servers, wearable devices, augmented reality (AR), virtual reality (VR) devices, televisions, etc., without limitation here.
[0104] In some embodiments, the electronic device 200 is a virtual reality device, such as a three-dimensional visual display device such as a head-mounted stereoscopic display, three-dimensional virtual reality glasses, etc. Three-dimensional virtual reality glasses may include, but are not limited to, split-type virtual reality glasses, integrated virtual reality glasses, and virtual reality glasses that use a mobile terminal (e.g., a mobile phone) for display.
[0105] Specifically, the processor 220 is used to control itself and the memory 210 to implement the steps in any of the above method embodiments. The processor 220 can also be called a central processing unit (CPU). The processor 220 may be an integrated circuit chip with signal processing capabilities. The processor 220 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 220 can be implemented by multiple integrated circuit chips.
[0106] In addition, the present application also provides a virtual reality system, which includes at least one binocular panoramic camera device and at least one virtual reality device. The binocular panoramic camera device is used to shoot the target scene and form a left-eye panoramic image and a right-eye panoramic image. The virtual reality device is used to obtain the left-eye panoramic image and the right-eye panoramic image formed by the binocular panoramic camera device shooting the target scene, and then render the left-eye panoramic image and the right-eye panoramic image as textures onto the inner spherical surfaces of two spheres respectively, and then extract the left-eye image and the right-eye image from the rendered inner spherical surfaces of the two spheres respectively, so that the virtual reality device can synchronously display the left-eye image and the right-eye image.
[0107] See also Figure 14 , Figure 14 This is a schematic structural block diagram of an embodiment of a computer-readable storage medium of the present application.
[0108] The computer-readable storage medium 300 stores program data 310 . When the program data 310 is executed by a processor, it is used to implement the steps in any of the above method embodiments.
[0109] The computer-readable storage medium 300 can be a medium that can store computer programs, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk. It can also be a server that stores the computer program. The server can send the stored computer program to other devices for execution, or it can also execute the stored computer program itself.
[0110] In the several embodiments provided in this application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation methods described above are only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0111] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0112] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0113] 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 this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0114] The above description is merely an embodiment of the present application and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for realizing virtual reality, It is characterized in that The method comprises: Acquire a left-eye panoramic image and a right-eye panoramic image formed by photographing a target scene with a binocular panoramic camera device; Rendering the left-eye panoramic image and the right-eye panoramic image as textures onto inner spherical surfaces of two spheres respectively; Extracting a left eye image and a right eye image from the inner spherical surfaces of the two rendered spheres respectively, so that a virtual reality device can synchronously display the left eye image and the right eye image; Before the step of rendering the left-eye panoramic image and the right-eye panoramic image as textures onto the inner spherical surfaces of two spheres respectively, the method further comprises: Acquire a facial image of a target person in the target scene; In response to the face of the target person being blocked, performing face repair on the target person in the left-eye panoramic image and the right-eye panoramic image based on the face image to remove the blocker; Wherein, in response to the face of the target person being blocked, the step of performing face repair on the target person on the left-eye panoramic image and the right-eye panoramic image based on the face image comprises: Extracting unobstructed actions and / or expressions of the target person from the facial image; adjusting the motion and / or expression of the occluder removal area in the left-eye panoramic image and the right-eye panoramic image based on the unoccluded motion and / or expression; The step of respectively extracting the left eye image and the right eye image from the inner spherical surfaces of the two rendered spheres comprises: Cones with vertices located at the centers of the two spheres and having predetermined cone angles are respectively arranged in the two spheres; The inner spherical surface contents in the intersection area between the two cones and the inner spherical surfaces of the corresponding spheres are used as the left-eye image and the right-eye image.
2. The method according to claim 1, It is characterized in that The binocular panoramic camera device comprises two groups of panoramic camera modules arranged side by side and spaced apart in the direction of the optical axis, each group of the panoramic camera modules comprises two panoramic cameras arranged back to back in the direction of the respective optical axes, and the step of obtaining a left-eye panoramic image and a right-eye panoramic image formed by the binocular panoramic camera device photographing the target scene comprises: The images captured by the two panoramic cameras in the two groups of panoramic camera modules and located in the same panoramic camera module are stitched together to obtain the left-eye panoramic image and the right-eye panoramic image.
3. The method according to claim 2, It is characterized in that Before the step of obtaining a left-eye panoramic image and a right-eye panoramic image formed by shooting a target scene with a binocular panoramic camera device, the method further includes: Obtaining the pupil distance of a user of the virtual reality device; The spacing distance between the two groups of panoramic camera modules is adjusted based on the pupil distance.
4. The method according to claim 1, It is characterized in that Before the step of rendering the left-eye panoramic image and the right-eye panoramic image as textures onto the inner spherical surfaces of two spheres respectively, the method further comprises: As the binocular panoramic camera device is shooting, audio data in the target scene is synchronously collected; The audio data, the left-eye panoramic image and the right-eye panoramic image are encoded and compressed and then transmitted from the local end to the opposite end in the form of a video stream.
5. The method according to claim 1, It is characterized in that The predetermined cone angle of the cone is 100 degrees to 120 degrees.
6. The method according to claim 1, It is characterized in that The method further comprises: Acquire a head rotation angle of a user wearing the virtual reality device; Based on the head rotation angle, the sphere and the cone are controlled to rotate relative to each other with the vertex of the cone as the rotation center.
7. An electronic device, It is characterized in that The electronic device comprises a memory and a processor coupled to each other, the memory is used to store program data, and the processor is used to execute the program data to implement the method according to any one of claims 1-6.
8. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores program data, and when the program data is executed by a processor, it is used to implement the method according to any one of claims 1 to 6.
