Three-dimensional model dynamic rendering method, device, electronic device and storage medium
By obtaining the spatial coordinates of the three-dimensional model and real-time acquisition of video stream images for cutting operations, and combining the three-dimensional background scene for synthesis, the problems of spatial limitations and high cost in the existing technology are solved, and the effects of stable cutout and real-time rendering are achieved.
Patent Information
- Application Number
- CN202011304727.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-19
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2040-11-19
AI Technical Summary
The existing pinching technology requires the construction of a special three-dimensional space, which has spatial limitations and is costly.
By obtaining the spatial coordinates of the three-dimensional model to be rendered, generating the three-dimensional model rendering image, and collecting and operating the video stream image in real time for cutting operations, combining the three-dimensional background scene for synthesis, realizing stable cutting and real-time rendering.
It realizes stable cutout and real-time rendering in various environments, reduces layout and maintenance costs, and is suitable for a variety of scenarios.
Smart Images

Figure CN112446939B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of virtual reality technology, and in particular to a method, device, electronic equipment and storage medium for dynamic rendering of a three-dimensional model. Background Art
[0002] Virtual reality technology is a computer simulation system that can create and experience a virtual world. It uses computers to generate a simulated environment. It is a system simulation of interactive three-dimensional dynamic vision and entity behavior that integrates multi-source information, allowing users to immerse themselves in the environment. Virtual reality is a combination of multiple technologies, among which the real-shot subject can be extracted separately through the cutout technology, and then the real-shot picture can be synthesized with the virtual scene, and the synthesized three-dimensional dynamic vision can be interactively displayed, making the expression more flexible and rich.
[0003] Currently, the main method of matting is to use a blue screen or a green screen as the background image. This method requires building a special three-dimensional space for the user, and then placing the object to be matted on the blue or green background and matting it, so it has great spatial limitations. Summary of the invention
[0004] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the embodiment of the present invention proposes a three-dimensional model dynamic rendering method, which can achieve stable cutout and real-time rendering, is easy to arrange, debug and maintain, is applicable to various environments, and saves costs.
[0005] The embodiment of the present invention also provides a three-dimensional model dynamic rendering device.
[0006] An embodiment of the present invention further provides an electronic device.
[0007] The present invention also provides a computer-readable storage medium.
[0008] A three-dimensional model dynamic rendering method according to a first aspect of an embodiment of the present invention includes:
[0009] Acquire spatial coordinates corresponding to the three-dimensional model to be rendered, and obtain a three-dimensional model rendering image of the three-dimensional model to be rendered according to the spatial coordinates;
[0010] Collect and output an operation video stream image of the three-dimensional model to be rendered according to the three-dimensional model rendering image;
[0011] Performing a cutout operation on the operation video stream image to obtain a three-dimensional model physical area corresponding to the three-dimensional model to be rendered;
[0012] Get the three-dimensional background scene;
[0013] The three-dimensional model physical area is synthesized with the three-dimensional background scene to obtain a rendering result of the three-dimensional model to be rendered.
[0014] The three-dimensional model dynamic rendering method according to the first aspect of the embodiment of the present invention has at least the following beneficial effects: first, a three-dimensional model rendering image of the three-dimensional model to be rendered is obtained through the spatial coordinates of the three-dimensional model to be rendered; secondly, an operation video stream image of the three-dimensional model to be rendered is acquired and output according to the three-dimensional model rendering image; then, a cutout operation is performed on the operation video stream image to obtain a three-dimensional model physical area corresponding to the three-dimensional model to be rendered; finally, the three-dimensional model physical area is superimposed on the three-dimensional background scene to obtain a rendering result of the three-dimensional model to be rendered, which can achieve stable cutout and real-time rendering, is easy to arrange, debug and maintain, is suitable for various environments, and saves costs.
[0015] According to some embodiments of the present invention, obtaining the three-dimensional model rendering image of the three-dimensional model to be rendered according to the spatial coordinates includes: extracting preset acquisition coordinates according to the spatial coordinates; performing image acquisition on the three-dimensional model to be rendered according to the preset acquisition coordinates to obtain multiple pictures to be rendered; and rendering the multiple pictures to be rendered to obtain the three-dimensional model rendering image.
[0016] According to some embodiments of the present invention, rendering the multiple pictures to be rendered to obtain the three-dimensional model rendering image includes: setting the image portion other than the three-dimensional model to be rendered in the multiple pictures to be rendered to a transparent color, and rendering the image portion of the three-dimensional model to be rendered in the multiple pictures to be rendered to obtain the three-dimensional model rendering image.
[0017] According to some embodiments of the present invention, the real-time acquisition and output of the operation video stream image of the three-dimensional model to be rendered based on the three-dimensional model rendering image includes: obtaining the operation video stream obtained by operating the three-dimensional model to be rendered; obtaining the image resolution corresponding to the three-dimensional model rendering image; encoding and outputting the operation video stream according to the image resolution to obtain the operation video stream image.
[0018] According to some embodiments of the present invention, before obtaining the spatial coordinates corresponding to the three-dimensional model to be rendered, the method further includes: obtaining a semi-physical operating table and a preset modeling ratio; and generating the three-dimensional model to be rendered by using the semi-physical operating table according to the preset modeling ratio.
[0019] According to some embodiments of the present invention, obtaining the spatial coordinates corresponding to the three-dimensional model to be rendered includes: obtaining the relative coordinates of the semi-physical operating table relative to a preset locator; and obtaining the spatial coordinates corresponding to the three-dimensional model to be rendered based on the relative coordinates.
[0020] According to some embodiments of the present invention, after synthesizing the three-dimensional model physical area with the three-dimensional background scene to obtain the rendering result of the three-dimensional model to be rendered, the method further includes: outputting and displaying the rendering result.
[0021] A three-dimensional model dynamic rendering device according to a second aspect of an embodiment of the present invention includes:
[0022] A first acquisition module is used to acquire the space coordinates corresponding to the three-dimensional model to be rendered, and obtain a three-dimensional model rendering image of the three-dimensional model to be rendered according to the space coordinates;
[0023] An acquisition module, used for acquiring and outputting an operation video stream image of the 3D model to be rendered in real time according to the 3D model rendering image;
[0024] A calculation module, used for performing a cutout operation on the operation video stream image to obtain a three-dimensional model physical area corresponding to the three-dimensional model to be rendered;
[0025] A second acquisition module is used to acquire a three-dimensional background scene;
[0026] The synthesis module is used to synthesize the physical area of the three-dimensional model with the three-dimensional background scene to obtain a rendering result of the three-dimensional model to be rendered.
[0027] The three-dimensional model dynamic rendering device according to the second aspect of the embodiment of the present invention has at least the following beneficial effects: by executing the three-dimensional model dynamic rendering method of the first aspect of the present invention, stable cutout and real-time rendering can be achieved, which is convenient for layout, debugging and maintenance, suitable for various environments, and saves costs.
[0028] According to an embodiment of the third aspect of the present invention, the electronic device comprises: at least one processor, and a memory communicatively connected to the at least one processor; wherein the memory stores instructions, and the instructions are executed by the at least one processor so that the three-dimensional model dynamic rendering method described in the first aspect is implemented when the at least one processor executes the instructions.
[0029] The electronic device according to the embodiment of the present invention has at least the following beneficial effects: by executing the three-dimensional model dynamic rendering method of the first aspect of the present invention, stable cutout and real-time rendering can be achieved, which is convenient for layout, debugging and maintenance, suitable for various environments, and saves costs.
[0030] According to the computer-readable storage medium of the fourth aspect of the embodiment of the present invention, the storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the three-dimensional model dynamic rendering method described in the first aspect.
[0031] The interactive display storage medium according to the fourth aspect of the embodiment of the present invention has at least the following beneficial effects: by executing the three-dimensional model dynamic rendering method of the first aspect of the present invention, stable cutout and real-time rendering can be achieved, which is convenient for layout, debugging and maintenance, suitable for various environments, and saves costs.
[0032] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0034] Figure 1 A schematic diagram of a flow chart of a method for dynamic rendering of a three-dimensional model according to an embodiment of the present invention;
[0035] Figure 2 This is a schematic diagram of the structure of a picture to be rendered according to an embodiment of the present invention;
[0036] Figure 3 A schematic diagram of the structure of a three-dimensional model dynamic rendering device according to an embodiment of the present invention;
[0037] Figure 4 4 is a functional module diagram of an electronic device according to an embodiment of the present invention.
[0038] Reference numerals:
[0039] The image part 210 of the three-dimensional model to be rendered, the image part 220 outside the three-dimensional model to be rendered, the first acquisition module 300, the acquisition module 310, the calculation module 320, the second acquisition module 330, the synthesis module 340, the processor 400, the memory 410, the data transmission module 420, the camera 430, and the display screen 440. DETAILED DESCRIPTION
[0040] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0041] In the description of the present invention, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above terms in the present invention based on the specific content of the technical solution.
[0042] Virtual reality technology is a computer simulation system that can create and experience a virtual world. It uses computers to generate a simulated environment. It is a system simulation of interactive three-dimensional dynamic vision and entity behavior that integrates multi-source information, allowing users to immerse themselves in the environment. Virtual reality is a combination of multiple technologies, among which the real-shot subject can be extracted separately through the cutout technology, and then the real-shot picture can be synthesized with the virtual scene, and the synthesized three-dimensional dynamic vision can be interactively displayed, making the expression more flexible and rich.
[0043] Currently, the main method of matting is to use a blue screen or a green screen as the background image. This method requires building a special three-dimensional space for the user, and then placing the object to be matted on the blue or green background and matting it, so it has great spatial limitations.
[0044] Based on this, the embodiments of the present invention provide a three-dimensional model dynamic rendering method, device, electronic device and storage medium, which can achieve stable cutout and real-time rendering, facilitate layout, debugging and maintenance, be suitable for various environments, and save costs.
[0045] Reference Figure 1 , according to the three-dimensional model dynamic rendering method of the first embodiment of the present invention, comprising:
[0046] Step S100, obtaining the space coordinates corresponding to the three-dimensional model to be rendered, and obtaining a three-dimensional model rendering image of the three-dimensional model to be rendered according to the space coordinates.
[0047] Among them, the three-dimensional model can be a polygonal representation of an object, and the object displayed by the three-dimensional model can be a real-world entity or a fictional object; the three-dimensional model to be rendered can be a three-dimensional model that needs to be rendered; the spatial coordinates can be the three-dimensional spatial coordinate information corresponding to the three-dimensional model to be rendered; the three-dimensional model rendering image can be a digital image obtained by photographing and rendering the three-dimensional model to be rendered from different angles, and there can be multiple three-dimensional model rendering images. Optionally, assuming that the physical object corresponding to the three-dimensional model to be rendered can be a semi-physical driving console, the semi-physical driving console can be constructed according to a preset proportion through a three-dimensional rendering engine (i.e., a collection of algorithms that abstract various materials in reality in the form of various curves or polygons and then output the final image through a computer) to obtain the three-dimensional model to be rendered, that is, a virtual driving console; then a VR locator (VR locator, i.e., virtual reality locator, is used to determine the absolute spatial position of participants in the experience hall in the venue, and feed it back to all players participating in the VR experience and the VR server, and then execute various control logics required for the VR experience) can be used to obtain the position information of the semi-physical operating console in the real space. For example, a coordinate system can be established based on the semi-physical driving console to obtain the position of the semi-physical driving console in the real space, so that the spatial coordinates of the virtual driving console corresponding to the semi-physical driving console in the virtual space can be analyzed. According to the spatial coordinates, the camera on a VR headset (virtual reality head-mounted display device, referred to as VR headset, is a head-mounted display device that blocks people's vision and hearing to the outside world, guiding users to have a feeling of being in a virtual environment. The display principle of the VR headset is that the left and right eye screens display the images of the left and right eyes respectively, and the human eye obtains this different information and creates a three-dimensional sense in the mind) can be used to observe the changes of the three-dimensional model to be rendered from different perspectives, so that multiple pictures of the three-dimensional model to be rendered can be collected and these pictures can be rendered to obtain multiple three-dimensional model rendering images.
[0048] Step S110 , collecting and outputting an operation video stream image of the 3D model to be rendered according to the 3D model rendering image.
[0049] The operation video stream image may be a video image recording corresponding operations on the three-dimensional model to be rendered. Optionally, a high-definition camera mounted on a VR head display may be used to collect the user's operations on the semi-physical driving console in real time, such as collecting the user's driving operations on the semi-physical driving console, and synchronizing the collected driving operation records to the three-dimensional model to be rendered in the virtual space, so as to obtain a video of the user's driving operations on the three-dimensional model to be rendered, and finally encode and output the video to obtain an operation video stream image, such as outputting an image with the same resolution as the three-dimensional model rendering image, so as to obtain an operation video stream image with the same resolution as the three-dimensional model rendering image.
[0050] Step S120, performing a cutout operation on the operation video stream image to obtain a three-dimensional model physical area corresponding to the three-dimensional model to be rendered.
[0051] Among them, the cutout operation can be an operation process of separating a certain part of the operation video stream image from the operation video stream image into a separate layer; the three-dimensional model practical area can be the image part of the operation video stream image that contains the three-dimensional model to be rendered. Since the operation video stream image can include the image of the three-dimensional model to be rendered and the background image, the operation video stream image can be subjected to a cutout operation, so that an image including only the area of the three-dimensional model to be rendered can be obtained. Optionally, the three-dimensional model rendering image can be used as a reference, and the three-dimensional model rendering image and the operation video stream image can be respectively corresponded to the spatial coordinates of the three-dimensional model to be rendered, and the operation video stream image can be subjected to a pixel-by-pixel cutout operation frame by frame, and the image part corresponding to the three-dimensional model to be rendered is retained, so that the three-dimensional model physical area corresponding to the three-dimensional model to be rendered can be obtained.
[0052] In some specific embodiments, the following steps can be used to implement the cutout operation of the operating video stream image: (1) for a certain pixel point of the operating video stream image, calculate the HSV value (HSV is Hue, Saturation, Value, which is a color space based on the intuitive characteristics of color, also known as the hexagonal pyramid model. The color parameters in this model are: hue (H), saturation (S), and brightness (V)) corresponding to the RGB value of the current pixel point (RGB color mode is a color standard in the industry. RGB represents the colors of the three channels of red, green, and blue. The RGB value refers to its brightness and has a value range of 0 to 250) to obtain the three HSV components; (2) set the weights of the three HSV components, and calculate the Euclidean distance from the HSV value of the current pixel point to the HSV value of the given background color based on the obtained weights; (3) smooth the calculated Euclidean distance using smoothstep (smoothstep function, used to solve the spline interpolation between two values) and set the result to 0.5 The following current pixel points are filtered out; (4) the operation video stream image and the 3D model rendering image are mixed with a smooth value. Through the above steps, the 3D model real object area to be rendered can be obtained.
[0053] Step S130, obtaining a three-dimensional background scene.
[0054] Among them, the three-dimensional background scene can be a background scene corresponding to the virtual three-dimensional model to be rendered, and the three-dimensional background scene can be set according to user needs. After the three-dimensional model physical area corresponding to the three-dimensional model to be rendered is obtained, the three-dimensional background scene corresponding to the three-dimensional model physical area can be obtained. For example, the three-dimensional background scene can be a game background, a virtual image, a virtual animation, a three-dimensional virtual space, and other scenes. Optionally, assuming that the three-dimensional model to be rendered is a virtual driving platform, the corresponding three-dimensional background scene can be a driving road scene, thereby obtaining the three-dimensional background scene corresponding to the three-dimensional model to be rendered.
[0055] Step S140, synthesizing the physical area of the three-dimensional model with the three-dimensional background scene to obtain a rendering result of the three-dimensional model to be rendered.
[0056] Optionally, an image containing only the three-dimensional model to be rendered (i.e., the physical area of the three-dimensional model) and its corresponding background scene (i.e., the three-dimensional background scene) can be superimposed and synthesized to obtain a complete rendering result of the three-dimensional model to be rendered, that is, a complete rendered image containing both the physical area of the three-dimensional model and the three-dimensional background scene, thereby completing real-time immersive virtual reality interaction of the relevant three-dimensional model to be rendered.
[0057] The above-mentioned 3D model dynamic rendering method first obtains the 3D model rendering image of the 3D model to be rendered through the spatial coordinates of the 3D model to be rendered, and secondly, collects and outputs the operation video stream image of the 3D model to be rendered according to the 3D model rendering image, and then performs a cutout operation on the operation video stream image to obtain the 3D model physical area corresponding to the 3D model to be rendered, and finally superimposes the 3D model physical area with the 3D background scene to obtain the rendering result of the 3D model to be rendered. It can achieve stable cutout and real-time rendering, is easy to arrange, debug and maintain, is suitable for various environments, and saves costs.
[0058] In some embodiments of the present invention, obtaining a three-dimensional model rendering image of a to-be-rendered three-dimensional model according to spatial coordinates includes:
[0059] The preset acquisition coordinates are extracted according to the spatial coordinates. The preset acquisition coordinates may be pre-set coordinate points for acquiring the three-dimensional model rendering image, and the preset acquisition coordinates may be set according to requirements. Optionally, multiple coordinate points may be selected in the spatial coordinate system corresponding to the three-dimensional model to be rendered, so as to achieve observation and shooting from multiple angles to obtain the three-dimensional model rendering image corresponding to the three-dimensional model to be rendered. Specifically, the camera on the VR headset may be used to acquire the three-dimensional model rendering image. For example, according to the changes in the three-dimensional model to be rendered observed by the user from different perspectives, multiple shooting points may be set in the spatial coordinate system where the three-dimensional model to be rendered is located, so as to obtain multiple preset acquisition coordinates.
[0060] The image of the 3D model to be rendered is captured according to the preset acquisition coordinates to obtain multiple images to be rendered. The image to be rendered may be an image to be rendered obtained after taking a photo of the 3D model to be rendered, and there may be multiple images to be rendered. Optionally, the 3D model to be rendered may be photographed from multiple preset acquisition coordinates to obtain multiple images to be rendered, that is, multiple images to be rendered.
[0061] Render multiple images to be rendered to obtain a 3D model rendering image. Optionally, multiple images to be rendered can be rendered, for example, images of the 3D model to be rendered at different angles with a transparent background can be rendered, that is, a 3D model rendering image containing only the 3D model to be rendered can be obtained. By presetting the acquisition coordinates to acquire and render 3D model rendering images with transparent backgrounds at different angles, the background of the 3D model to be rendered can be directly removed, saving the hardware cost of setting up the background curtain.
[0062] In some embodiments of the present invention, rendering a plurality of pictures to be rendered to obtain a three-dimensional model rendering image includes:
[0063] The image parts other than the 3D model to be rendered in the multiple images to be rendered are set to transparent color, and the image parts of the 3D model to be rendered in the multiple images to be rendered are rendered to obtain a 3D model rendering image. Figure 2 , Figure 2 is a schematic diagram of a picture to be rendered. The picture to be rendered may include an image portion 210 of a 3D model to be rendered and an image portion 220 outside the 3D model to be rendered. The image portion 210 of the 3D model to be rendered may be located in the middle and lower part of the picture to be rendered. The image portion 220 outside the 3D model to be rendered may be Figure 2 The blank part remaining after the image part 210 of the three-dimensional model to be rendered is removed, that is, the background image part. Optionally, the image part 220 outside the three-dimensional model to be rendered in each picture to be rendered can be set to a transparent color, and the image part 210 of the three-dimensional model to be rendered in each picture to be rendered can be rendered, that is, the background of each picture to be rendered is set to transparent, and only the image part 210 of the three-dimensional model to be rendered is retained, so that multiple three-dimensional model rendering images can be obtained. By removing the image part of the three-dimensional model to be rendered and setting the image part outside the three-dimensional model to be rendered to a transparent color, the part of the three-dimensional model to be rendered in the actual shot is extracted separately through the corresponding technology, without the need to build a blue / green background curtain, thereby solving the problem that the blue / green background curtain blocks the audience's line of sight and causes the audience to be unable to see the presenter's operation in real time, enhancing the user's viewing experience, simple installation, and low ambient light requirements.
[0064] In some embodiments of the present invention, real-time acquisition and output of an operation video stream image of a 3D model to be rendered according to a 3D model rendering image includes:
[0065] Obtain an operation video stream obtained by operating the three-dimensional model to be rendered. The operation video stream may be video data obtained by real-time shooting of corresponding operations on the three-dimensional model to be rendered. Optionally, the operation performed on the three-dimensional model to be rendered may be a human-computer interaction action performed by a user on the three-dimensional model to be rendered. For example, assuming that the three-dimensional model to be rendered is a virtual driving console, the human-computer interaction action performed by the user on the three-dimensional model to be rendered may be a driving operation performed by the user on the virtual driving console. The driving operation performed by the user on the virtual driving console may be obtained in real time through a high-definition camera installed on a VR headset to obtain a corresponding operation video stream.
[0066] Get the image resolution corresponding to the 3D model rendering image. The image resolution may be the number of pixels contained in the 3D model rendering image per inch. Optionally, the number of horizontal pixels and the number of vertical pixels of the 3D model rendering image may be obtained, and then the resolution of the 3D model rendering image may be obtained by calculating the number of horizontal pixels × the number of vertical pixels. The image resolution corresponding to the 3D model rendering image may be set as required to ensure the user's viewing experience.
[0067] The operation video stream is encoded and output according to the image resolution to obtain the operation video stream image. Optionally, the operation video stream can be encoded and output by an encoder based on the image resolution to obtain the operation video stream image with the same resolution as the 3D model rendering image. By encoding and outputting the operation video stream video according to the image resolution corresponding to the 3D model rendering image, it can be ensured that the obtained operation video stream image has the same resolution as the 3D model rendering image, so that the operation video stream image can be cut out according to the 3D model rendering image to achieve stable cutout.
[0068] In some embodiments of the present invention, before obtaining the space coordinates corresponding to the three-dimensional model to be rendered, the method further includes:
[0069] Obtain a semi-physical operating console and a preset modeling ratio. The semi-physical operating console may be a control device that uses half a virtual object and the other half a physical object, that is, an operating tool directly controlled by a user, such as a semi-physical driving console, i.e., a semi-physical driving console; the preset modeling ratio may be a ratio between a pre-set semi-physical operating console and a three-dimensional model to be rendered. Optionally, assuming that the semi-physical operating console is a semi-physical driving console, and assuming that the preset modeling ratio is 1:1, the semi-physical driving console and the preset modeling ratio may be obtained respectively.
[0070] The semi-physical operating console is used to generate a 3D model to be rendered according to a preset modeling ratio. Optionally, a 3D model to be rendered corresponding to the semi-physical operating console can be established in a 3D rendering engine according to a preset modeling ratio. Specifically, assuming that the semi-physical operating console is a semi-physical driving console and the preset modeling ratio is 1:1, modeling can be performed in the 3D rendering engine to obtain a virtual driving console in a 1:1 ratio with the semi-physical driving console, that is, to obtain a 3D model to be rendered.
[0071] By modeling the semi-physical operating table according to a preset modeling ratio, a three-dimensional model to be rendered corresponding to the semi-physical operating table can be obtained, and a 1:1 precise spatial superposition of the three-dimensional model to be rendered and the semi-physical operating table can be achieved, thereby obtaining a more realistic three-dimensional model to be rendered and enhancing the user experience.
[0072] In some embodiments of the present invention, obtaining the space coordinates corresponding to the three-dimensional model to be rendered includes:
[0073] Obtain the relative coordinates of the semi-physical operating table relative to the preset locator. The preset locator may be a pre-set instrument for locating the spatial position of the semi-physical operating table, such as a VR locator; the relative coordinates may be the coordinate information of the semi-physical operating table relative to the preset locator. Optionally, assuming that the preset locator is a VR locator, the VR locator may be fixed on the semi-physical operating table, and then the VR locator may be used to perform 1:1 three-dimensional spatial positioning of the semi-physical operating table, thereby obtaining the real spatial coordinates of the semi-physical operating table relative to the preset locator, that is, obtaining the relative coordinates.
[0074] The spatial coordinates corresponding to the three-dimensional model to be rendered are obtained based on the relative coordinates. Since the ratio between the three-dimensional model to be rendered and the semi-physical operating table is 1:1, the spatial coordinates of the semi-physical operating table correspond to the spatial coordinates of the three-dimensional model to be rendered, so the spatial coordinates corresponding to the three-dimensional model to be rendered can be directly obtained according to the spatial position of the semi-physical operating table, that is, the corresponding spatial coordinates of the three-dimensional model to be rendered are obtained according to the relative coordinates. Through the 1:1 precise spatial superposition of the three-dimensional model to be rendered and the semi-physical operating table, the spatial coordinates of the three-dimensional model to be rendered can be directly obtained through the real spatial coordinates of the semi-physical operating table, which can enhance the authenticity of the three-dimensional model to be rendered.
[0075] In some embodiments of the present invention, after synthesizing the physical area of the three-dimensional model with the three-dimensional background scene to obtain the rendering result of the three-dimensional model to be rendered, the method further includes:
[0076] Output the rendering results for display. Optionally, the final rendering results of the 3D model to be rendered can be sent to a VR headset for display, so that the user can watch the mixed reality rendering results of the 3D model to be rendered by wearing a VR headset, so that the rendering images viewed by the user through the VR headset are stable and reliable, and the display is better.
[0077] Reference Figure 3 , according to the three-dimensional model dynamic rendering device of the second embodiment of the present invention, comprising:
[0078] A first acquisition module 300 is used to acquire the space coordinates corresponding to the three-dimensional model to be rendered, and obtain a three-dimensional model rendering image of the three-dimensional model to be rendered according to the space coordinates;
[0079] The acquisition module 310 is used to acquire and output the operation video stream image of the 3D model to be rendered in real time according to the 3D model rendering image;
[0080] A calculation module 320 is used to perform a cutout operation on the operation video stream image to obtain a three-dimensional model physical area corresponding to the three-dimensional model to be rendered;
[0081] A second acquisition module 330, used to acquire a three-dimensional background scene;
[0082] The synthesis module 340 is used to synthesize the physical area of the three-dimensional model with the three-dimensional background scene to obtain a rendering result of the three-dimensional model to be rendered.
[0083] The above-mentioned three-dimensional model dynamic rendering device can achieve stable cutout and real-time rendering by executing the three-dimensional model dynamic rendering method of the first embodiment of the present invention, is easy to arrange, debug and maintain, is suitable for various environments, and saves costs.
[0084] Reference Figure 4 The third aspect of the present invention also provides an internal structure diagram of an electronic device, including: at least one processor 400, and a memory 410 communicatively connected to the at least one processor 400; it may also include a data transmission module 420, a camera 430, and a display screen 440.
[0085] The processor 400 is used to execute the three-dimensional model dynamic rendering method in the embodiment of the first aspect by calling the computer program stored in the memory 410.
[0086] The memory, as a non-transitory storage medium, can be used to store non-transitory software programs and non-transitory computer executable programs, such as the three-dimensional model dynamic rendering method in the first embodiment of the present invention. The processor implements the three-dimensional model dynamic rendering method in the first embodiment by running the non-transitory software programs and instructions stored in the memory.
[0087] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store the three-dimensional model dynamic rendering method executed in the first aspect embodiment. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0088] The non-transient software programs and instructions required to implement the three-dimensional model dynamic rendering method in the above-mentioned first aspect embodiment are stored in the memory, and when executed by one or more processors, the three-dimensional model dynamic rendering method in the above-mentioned first aspect embodiment is executed.
[0089] The fourth aspect of the present invention also provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the three-dimensional model dynamic rendering method in the first aspect of the present invention.
[0090] In some embodiments, the storage medium stores computer executable instructions, which are executed by one or more control processors, for example, by a processor in the electronic device of the third aspect embodiment, so that the one or more processors can execute the three-dimensional model dynamic rendering method in the first aspect embodiment.
[0091] The embodiments of the present invention are described in detail above in conjunction with the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge scope of ordinary technicians in the relevant technical field without departing from the purpose of the present invention.
[0092] It will be appreciated by those skilled in the art that all or some of the steps and systems in the disclosed method above may be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that may be used to store desired information and may be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0093] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0094] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
Claims
1. A three-dimensional model dynamic rendering method, characterized in that: include: Acquire spatial coordinates corresponding to the three-dimensional model to be rendered, and obtain a three-dimensional model rendering image of the three-dimensional model to be rendered according to the spatial coordinates; The step of obtaining a three-dimensional model rendering image of the three-dimensional model to be rendered according to the spatial coordinates includes: extracting preset acquisition coordinates according to the spatial coordinates; performing image acquisition on the three-dimensional model to be rendered according to the preset acquisition coordinates to obtain a plurality of images to be rendered; and rendering the plurality of images to be rendered to obtain the three-dimensional model rendering image. Collect and output an operation video stream image of the three-dimensional model to be rendered according to the three-dimensional model rendering image; Performing a cutout operation on the operation video stream image to obtain a three-dimensional model physical area corresponding to the three-dimensional model to be rendered; Get the three-dimensional background scene; The three-dimensional model physical area is synthesized with the three-dimensional background scene to obtain a rendering result of the three-dimensional model to be rendered.
2. The method according to claim 1, characterized in that The step of rendering the plurality of pictures to be rendered to obtain the three-dimensional model rendering image includes: The image portion other than the three-dimensional model to be rendered in the multiple pictures to be rendered is set to a transparent color, and the image portion of the three-dimensional model to be rendered in the multiple pictures to be rendered is rendered to obtain the three-dimensional model rendering image.
3. The method according to claim 1, characterized in that: The step of collecting and outputting the operation video stream image of the to-be-rendered 3D model in real time according to the 3D model rendering image comprises: Acquire an operation video stream obtained by operating the three-dimensional model to be rendered; Obtaining an image resolution corresponding to the three-dimensional model rendering image; The operation video stream is encoded and output according to the image resolution to obtain the operation video stream image.
4. The method according to claim 1, characterized in that: Before obtaining the space coordinates corresponding to the three-dimensional model to be rendered, the method further includes: Get a semi-physical operating table and preset modeling scale; The semi-physical operating table generates the three-dimensional model to be rendered according to the preset modeling ratio.
5. The method according to claim 4, characterized in that The obtaining of the spatial coordinates corresponding to the three-dimensional model to be rendered includes: Obtaining the relative coordinates of the semi-physical operating platform relative to a preset locator; The spatial coordinates corresponding to the three-dimensional model to be rendered are acquired based on the relative coordinates.
6. The method according to claim 1, characterized in that After synthesizing the three-dimensional model object area with the three-dimensional background scene to obtain the rendering result of the three-dimensional model to be rendered, the method further includes: The rendering result is output and displayed.
7. A three-dimensional model dynamic rendering device, characterized in that: include: A first acquisition module is used to acquire the space coordinates corresponding to the three-dimensional model to be rendered, and obtain a three-dimensional model rendering image of the three-dimensional model to be rendered according to the space coordinates; The step of obtaining a three-dimensional model rendering image of the three-dimensional model to be rendered according to the spatial coordinates includes: extracting preset acquisition coordinates according to the spatial coordinates; performing image acquisition on the three-dimensional model to be rendered according to the preset acquisition coordinates to obtain a plurality of images to be rendered; and rendering the plurality of images to be rendered to obtain the three-dimensional model rendering image. An acquisition module, used for acquiring and outputting an operation video stream image of the 3D model to be rendered in real time according to the 3D model rendering image; A calculation module, used for performing a cutout operation on the operation video stream image to obtain a three-dimensional model physical area corresponding to the three-dimensional model to be rendered; A second acquisition module is used to acquire a three-dimensional background scene; The synthesis module is used to synthesize the physical area of the three-dimensional model with the three-dimensional background scene to obtain a rendering result of the three-dimensional model to be rendered.
8. An electronic device, characterized in that include: at least one processor, and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions, and the instructions are executed by the at least one processor, so that the at least one processor implements the three-dimensional model dynamic rendering method as described in any one of claims 1 to 6 when executing the instructions.
9. A computer-readable storage medium, characterized in that The storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the three-dimensional model dynamic rendering method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Human body and virtual human body synthesis system and method based on VR experience cabin
CN108762508A
Method and device for synthesizing foreground figure shadow in virtual studio and storage medium
CN111371966A
Cited By
Dynamic drawing and rendering method based on three-dimensional model
CN115937381A