Panoramic image display method and device, electronic equipment and storage medium

文档序号:154538 发布日期:2021-10-26 浏览:26次 中文

阅读说明:本技术 全景图像展示方法、装置、电子设备及存储介质 (Panoramic image display method and device, electronic equipment and storage medium ) 是由 刘玉丹 龚四维 于 2021-07-27 设计创作,主要内容包括:本发明实施例提供了一种全景图像展示方法、装置、电子设备及存储介质,所述方法包括:确定全景图像中待替换纹理的材质,以及全景图像对应的目标纹理贴图;从预设的漫反射图层集合中,查找目标纹理贴图对应的目标漫反射图层;其中,移除全景图像中灯光,将材质对应的纹理贴图替换为候选纹理贴图并进行离线渲染,输出漫反射图层集合;从目标漫反射图层中截取相应区域,覆盖于全景图像的漫反射图层,得到新的漫反射图层;将新的漫反射图层、全景图像的全局光照图层以及混合图层进行合并,得到目标全景图像,并进行展示。通过离线渲染得到不依赖光照的漫反射图层集合,可以减少离线渲染消耗的渲染资源。(The embodiment of the invention provides a panoramic image display method, a panoramic image display device, electronic equipment and a storage medium, wherein the method comprises the following steps: determining the material of the texture to be replaced in the panoramic image and a target texture mapping corresponding to the panoramic image; searching a target diffuse reflection layer corresponding to the target texture mapping from a preset diffuse reflection layer set; removing light in the panoramic image, replacing texture maps corresponding to the materials with candidate texture maps, performing offline rendering, and outputting a diffuse reflection layer set; intercepting a corresponding area from the target diffuse reflection layer, and covering the corresponding area on the diffuse reflection layer of the panoramic image to obtain a new diffuse reflection layer; and combining the new diffuse reflection layer, the global illumination layer of the panoramic image and the mixed layer to obtain a target panoramic image, and displaying. And obtaining a diffuse reflection layer set independent of illumination through offline rendering, so that rendering resources consumed by offline rendering can be reduced.)

1. A panoramic image display method is characterized by comprising the following steps:

determining the material of the texture to be replaced in the panoramic image and a target texture mapping corresponding to the panoramic image;

searching a target diffuse reflection layer corresponding to the target texture mapping from a preset diffuse reflection layer set;

removing light in the panoramic image, replacing the texture maps corresponding to the materials with candidate texture maps, performing off-line rendering, and outputting the diffuse reflection layer set;

intercepting a corresponding area from the target diffuse reflection layer, and covering the corresponding area on the diffuse reflection layer of the panoramic image to obtain a new diffuse reflection layer;

and combining the new diffuse reflection layer, the global illumination layer of the panoramic image and the mixed layer to obtain a target panoramic image, and displaying.

2. The method according to claim 1, wherein the candidate texture map comprises any one of N candidate texture maps, where N is a positive integer, and a mapping relationship between the candidate texture map and a corresponding diffuse reflection layer in the diffuse reflection layer set is established;

searching a target diffuse reflection layer corresponding to the target texture mapping from a preset diffuse reflection layer set, wherein the searching comprises the following steps:

and searching a target diffuse reflection layer corresponding to the target texture mapping from a preset diffuse reflection layer set according to the mapping relation.

3. The method according to claim 1, wherein said intercepting a corresponding area from the target diffuse reflection layer to cover the diffuse reflection layer of the panoramic image to obtain a new diffuse reflection layer comprises:

intercepting a corresponding area from the target diffuse reflection layer;

and searching a target area from a diffuse reflection layer of the panoramic image, and covering the corresponding area in the target area to obtain a new diffuse reflection layer.

4. The method according to claim 3, wherein said truncating the corresponding area from the target diffuse reflection layer comprises:

intercepting a corresponding area from the target diffuse reflection layer according to the relative area of the material in the panoramic image;

the searching for the target area from the diffuse reflection layer of the panoramic image comprises the following steps:

and searching a target area from a diffuse reflection layer of the panoramic image according to the relative area of the material in the panoramic image.

5. The method of claim 4, wherein the relative area of the material in the panoramic image is determined by;

determining the output color of the material in the panoramic image, performing off-line rendering, and outputting a material element layer corresponding to the panoramic image;

determining, from the material element map layer, a relative area of the material in the panoramic image based on the output color of the material.

6. The method of claim 5, further comprising:

outputting a global illumination layer, a diffuse reflection layer and other element layers corresponding to the panoramic image;

and sequentially performing linear attenuation and superposition on the rest element layers to obtain a mixed layer corresponding to the panoramic image.

7. The method according to claim 1, wherein the merging the new diffuse reflection layer, the global illumination layer of the panoramic image, and the mixed layer to obtain a target panoramic image, and displaying the target panoramic image comprises:

positive film superposition is carried out on the new diffuse reflection image layer and the global illumination image layer of the panoramic image, and a new global illumination image layer is obtained;

and carrying out linear attenuation and combination on the new global illumination layer and the mixed layer of the panoramic image to obtain a target panoramic image, and displaying the target panoramic image.

8. A panoramic image presentation apparatus, characterized in that the apparatus comprises:

the texture and map determining module is used for determining the texture of the texture to be replaced in the panoramic image and the target texture map corresponding to the panoramic image;

the layer searching module is used for searching a target diffuse reflection layer corresponding to the target texture mapping from a preset diffuse reflection layer set;

the collection creation module is used for removing lamplight in the panoramic image, replacing the texture maps corresponding to the materials with candidate texture maps, performing off-line rendering, and outputting the diffuse reflection layer collection;

the layer covering module is used for intercepting a corresponding area from the target diffuse reflection layer and covering the corresponding area on the diffuse reflection layer of the panoramic image to obtain a new diffuse reflection layer;

and the layer merging module is used for merging the new diffuse reflection layer, the global illumination layer of the panoramic image and the mixed layer to obtain a target panoramic image and displaying the target panoramic image.

9. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;

a memory for storing a computer program;

a processor for implementing the method steps of any one of claims 1 to 7 when executing a program stored on a memory.

10. A storage medium on which a computer program is stored, which program, when being executed by a processor, carries out the method according to any one of claims 1 to 7.

Technical Field

The embodiment of the invention relates to the technical field of image processing, in particular to a panoramic image display method and device, electronic equipment and a storage medium.

Background

At present, if texture replacement needs to be performed on some specified materials in a panoramic image, corresponding texture maps need to be specified for some specified materials in the panoramic image, and the panoramic image is rendered in an off-line manner, so that a new panoramic image can be obtained and displayed at a panoramic display end.

Once the quantity of materials needing texture replacement and the quantity of texture maps needing replacement are increased, the quantity of combinations is multiplied geometrically, and the corresponding times of off-line rendering of the panoramic image are also multiplied geometrically, so that rendering resources consumed by off-line rendering are very large.

Disclosure of Invention

In order to solve the technical problems that once the quantity of materials needing texture replacement and the quantity of texture maps needing replacement are increased, the quantity of combinations of the materials is multiplied geometrically, and the number of times of offline rendering of a panoramic image is also multiplied geometrically, so that rendering resources consumed by offline rendering are very large, the embodiment of the invention provides a panoramic image display method and device, electronic equipment and a storage medium.

In a first aspect of the embodiments of the present invention, a method for displaying a panoramic image is provided, where the method includes:

determining the material of the texture to be replaced in the panoramic image and a target texture mapping corresponding to the panoramic image;

searching a target diffuse reflection layer corresponding to the target texture mapping from a preset diffuse reflection layer set;

removing light in the panoramic image, replacing the texture maps corresponding to the materials with candidate texture maps, performing off-line rendering, and outputting the diffuse reflection layer set;

intercepting a corresponding area from the target diffuse reflection layer, and covering the corresponding area on the diffuse reflection layer of the panoramic image to obtain a new diffuse reflection layer;

and combining the new diffuse reflection layer, the global illumination layer of the panoramic image and the mixed layer to obtain a target panoramic image, and displaying.

In an optional embodiment, the candidate texture map includes any candidate texture map of N candidate texture maps, where N is a positive integer, and a mapping relationship between the candidate texture map and a corresponding diffuse reflection layer in the diffuse reflection layer set is established;

searching a target diffuse reflection layer corresponding to the target texture mapping from a preset diffuse reflection layer set, wherein the searching comprises the following steps:

and searching a target diffuse reflection layer corresponding to the target texture mapping from a preset diffuse reflection layer set according to the mapping relation.

In an optional embodiment, the intercepting a corresponding area from the target diffuse reflection layer, and covering the corresponding area on the diffuse reflection layer of the panoramic image to obtain a new diffuse reflection layer includes:

intercepting a corresponding area from the target diffuse reflection layer;

and searching a target area from a diffuse reflection layer of the panoramic image, and covering the corresponding area in the target area to obtain a new diffuse reflection layer.

In an optional embodiment, the intercepting the corresponding area from the target diffuse reflection layer includes:

intercepting a corresponding area from the target diffuse reflection layer according to the relative area of the material in the panoramic image;

the searching for the target area from the diffuse reflection layer of the panoramic image comprises the following steps:

and searching a target area from a diffuse reflection layer of the panoramic image according to the relative area of the material in the panoramic image.

In an alternative embodiment, the relative area of the material in the panoramic image is specifically determined in the following manner;

determining the output color of the material in the panoramic image, performing off-line rendering, and outputting a material element layer corresponding to the panoramic image;

determining, from the material element map layer, a relative area of the material in the panoramic image based on the output color of the material.

In an optional implementation manner, outputting a global illumination layer, a diffuse reflection layer, and other element layers corresponding to the panoramic image;

and sequentially performing linear attenuation and superposition on the rest element layers to obtain a mixed layer corresponding to the panoramic image.

In an optional embodiment, the merging the new diffuse reflection layer, the global illumination layer of the panoramic image, and the mixed layer to obtain a target panoramic image, and displaying the target panoramic image includes:

positive film superposition is carried out on the new diffuse reflection image layer and the global illumination image layer of the panoramic image, and a new global illumination image layer is obtained;

and carrying out linear attenuation and combination on the new global illumination layer and the mixed layer of the panoramic image to obtain a target panoramic image, and displaying the target panoramic image.

In a second aspect of the embodiments of the present invention, there is provided a panoramic image presentation apparatus, including:

the texture and map determining module is used for determining the texture of the texture to be replaced in the panoramic image and the target texture map corresponding to the panoramic image;

the layer searching module is used for searching a target diffuse reflection layer corresponding to the target texture mapping from a preset diffuse reflection layer set;

the collection creation module is used for removing lamplight in the panoramic image, replacing the texture maps corresponding to the materials with candidate texture maps, performing off-line rendering, and outputting the diffuse reflection layer collection;

the layer covering module is used for intercepting a corresponding area from the target diffuse reflection layer and covering the corresponding area on the diffuse reflection layer of the panoramic image to obtain a new diffuse reflection layer;

and the layer merging module is used for merging the new diffuse reflection layer, the global illumination layer of the panoramic image and the mixed layer to obtain a target panoramic image and displaying the target panoramic image.

In a third aspect of the embodiments of the present invention, there is further provided an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;

a memory for storing a computer program;

and a processor, configured to implement the panoramic image display method according to the first aspect when executing the program stored in the memory.

In a fourth aspect of the embodiments of the present invention, there is also provided a storage medium, in which instructions are stored, and when the storage medium runs on a computer, the storage medium causes the computer to execute the panoramic image presentation method described in the first aspect.

In a fifth aspect of the embodiments of the present invention, there is also provided a computer program product containing instructions, which when run on a computer, causes the computer to execute the panoramic image presentation method described in the first aspect above.

According to the technical scheme provided by the embodiment of the invention, the material of the texture to be replaced in the panoramic image and the target texture map corresponding to the panoramic image are determined, the target diffuse reflection map layer corresponding to the target texture map is searched from a preset diffuse reflection map layer set, wherein light in the panoramic image is removed, the texture map corresponding to the material is replaced by the candidate texture map layer and offline rendering is carried out, the diffuse reflection map layer set is output, the corresponding area is intercepted from the target diffuse reflection map layer and covered on the diffuse reflection map layer of the panoramic image to obtain a new diffuse reflection map layer, and the new diffuse reflection map layer, the global illumination map layer of the panoramic image and the mixed map layer are combined to obtain the target panoramic image and display is carried out. By removing light in the panoramic image, replacing the texture maps corresponding to the materials with candidate texture maps and performing offline rendering, a diffuse reflection layer set independent of illumination is obtained, the diffuse reflection layer is cut and covered, the rendering effect of the same type of materials is restored by the layer merging technology, and rendering resources consumed by offline rendering can be reduced.

Drawings

The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.

Fig. 1 is a schematic flow chart of an implementation of a panoramic image display method shown in an embodiment of the present invention;

fig. 2 is a schematic diagram illustrating an area coverage of a diffuse reflection layer according to an embodiment of the present invention;

FIG. 3 is a schematic diagram illustrating an area coverage of another diffuse reflection layer according to an embodiment of the present invention;

fig. 4 is a schematic diagram illustrating layer merging according to an embodiment of the present invention;

fig. 5 is a schematic structural view of a panoramic image display apparatus according to an embodiment of the present invention;

fig. 6 is a schematic structural diagram of an electronic device shown in the embodiment of the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the scope of the present invention.

It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.

As shown in fig. 1, an implementation flow diagram of a panoramic image display method provided in an embodiment of the present invention is applied to a processor, and the method specifically includes the following steps:

s101, determining the material of the texture to be replaced in the panoramic image and the target texture mapping corresponding to the panoramic image.

When the panorama display end displays, a user can select a material of a texture to be replaced in the panorama image, and the user can select a corresponding target texture mapping for the material, wherein the target texture mapping is used for replacing the texture of the material with a target texture. For example, the user a may select a wood material of the texture to be replaced in the panoramic image, and select a corresponding target texture map for the wood material, where the target texture map is used to replace the cross grain of the wood material with the vertical grain.

Therefore, the method and the device for determining the texture mapping can determine the material of the texture to be replaced in the panoramic image selected by the user and determine the target texture mapping selected by the user for the material. For example, the embodiment of the present invention determines a wood material of a texture to be replaced in the panoramic image selected by the user a, determines a target texture map selected by the user a for the wood material, and may replace a horizontal grain of the wood material with a vertical grain.

It should be noted that the panoramic image may be a panoramic image corresponding to a bedroom scene in 3D design software, a panoramic image corresponding to a kitchen scene in 3D design software, or a panoramic image corresponding to a living room scene in 3D design software, which is not limited in the embodiment of the present invention. In addition, the material here may be a wood material, a metal material, a plastic material, and the like, which is not limited in the embodiment of the present invention.

S102, searching a target diffuse reflection layer corresponding to the target texture mapping from a preset diffuse reflection layer set.

In the embodiment of the invention, the light in the panoramic image is removed, the texture maps corresponding to the materials of the textures to be replaced in the panoramic image are replaced by the candidate texture maps, the offline rendering is carried out, and the diffuse reflection layer set is output. Therefore, the diffuse reflection layer set independent of illumination is obtained through off-line rendering, and a large amount of rendering resources can be saved.

Here, the candidate texture map includes any candidate texture map of N candidate texture maps, where N is a positive integer, that is, N may be 1, 2, 3, 4, or 5 … …, so that a mapping relationship between the candidate texture map and a corresponding diffuse reflection map layer in the diffuse reflection map layer set may be established, where the diffuse reflection map layers correspond to the candidate texture maps one to one.

For example, removing light in the panoramic image, replacing a cross grain map corresponding to a wood material in the panoramic image with a vertical grain map, performing offline rendering, outputting a diffuse reflection layer A, and establishing a mapping relation between the vertical grain map and the diffuse reflection layer A;

replacing the cross grain maps corresponding to the wood materials in the panoramic image with cloud-like texture maps, performing off-line rendering, outputting a diffuse reflection layer B, and establishing a mapping relation between the cloud-like texture maps and the diffuse reflection layer B;

replacing the cross grain maps corresponding to the wood materials in the panoramic image with tree grain maps, performing off-line rendering, outputting a diffuse reflection layer C, and establishing a mapping relation between the tree grain maps and the diffuse reflection layer C;

and performing cyclic processing, if the number of the candidate texture maps is N, performing offline rendering for N times to obtain N diffuse reflection layers, wherein rendering resources consumed by offline rendering can be saved because only the N diffuse reflection layers are obtained by offline rendering, and the N diffuse reflection layers can form a diffuse reflection layer set and correspondingly establish N mapping relations.

It should be noted that the mapping relationship established here may be in a specific form of a cross grain mapping, a vertical grain mapping, a diffuse reflection layer a corresponding to the wood material, and a cross grain mapping, a cloud-like grain mapping, a diffuse reflection layer B … … corresponding to the wood material, as shown in table 1 below.

TABLE 1

Therefore, through the steps, a diffuse reflection layer set can be output, and a target diffuse reflection layer corresponding to the target texture map can be obtained through query from the diffuse reflection layer set according to the established mapping relation.

For example, for the cloud flocculent texture map, according to the mapping relationship shown in table 1 above, a target diffuse reflection layer corresponding to the cloud flocculent texture map, that is, the diffuse reflection layer B shown in table 1 above, is searched from the diffuse reflection layer set.

And S103, intercepting a corresponding area from the target diffuse reflection layer, and covering the corresponding area on the diffuse reflection layer of the panoramic image to obtain a new diffuse reflection layer.

For the target diffuse reflection layer, in the embodiment of the present invention, a corresponding area is intercepted from the target diffuse reflection layer, and the corresponding area is covered on the diffuse reflection layer of the panoramic image, so that a brand new diffuse reflection layer can be obtained.

For example, for the DIFFUSE reflection layer B corresponding to the cloud-like texture map, in the embodiment of the present invention, a corresponding area is cut from the DIFFUSE reflection layer B, and is covered with a DIFFUSE reflection layer (DIFFUSE) of the panoramic image, so that a completely new DIFFUSE reflection layer (DIFFUSE-REPLACE) can be obtained.

And intercepting a corresponding area from the target diffuse reflection layer, searching a target area from the diffuse reflection layer of the panoramic image, and covering the corresponding area in the target area, so that a brand-new diffuse reflection layer can be obtained.

For example, a corresponding area is cut out from the DIFFUSE reflection layer B, a target area is searched from a DIFFUSE reflection layer (DIFFUSE) of the panoramic image, and the corresponding area is covered on the target area, so that a completely new DIFFUSE reflection layer (DIFFUSE-REPLACE) can be obtained.

The corresponding area can be intercepted from the target diffuse reflection layer according to the relative area of the texture to be replaced in the panoramic image, the target area can be searched from the diffuse reflection layer of the panoramic image according to the relative area of the texture to be replaced in the panoramic image, and the corresponding area is covered on the target area, so that a brand new diffuse reflection layer can be obtained.

For example, as shown in fig. 2, according to the relative area of the wood material in the panoramic image, the corresponding area is cut out from the DIFFUSE reflection layer B, and according to the relative area of the wood material in the panoramic image, a target area is searched from the DIFFUSE reflection layer (DIFFUSE) of the panoramic image, and the corresponding area is covered on the target area, so that a completely new DIFFUSE reflection layer (DIFFUSE-REPLACE) can be obtained.

It should be noted that the coordinates of the relative area, the corresponding area, and the target area are consistent, and the difference is that the coordinates correspond to different layers/images. Assuming that the relative area of the texture to be replaced in the panoramic image is the central area, the central area is also intercepted from the target DIFFUSE reflection layer, the central area is also searched from the DIFFUSE reflection layer (DIFFUSE) of the panoramic image, and the coordinates and the areas of the 3 central areas are consistent.

For the relative area of the texture to be replaced in the panoramic image, the relative area can be specifically determined in the following manner: determining the output color of the material of the texture to be replaced in the panoramic image, rendering, outputting a material element layer corresponding to the panoramic image, and determining the relative area of the material in the panoramic image based on the output color of the material in the material element layer.

For a material element layer (MATID), the layer can output a region of a specified material to layer data according to a preset mapping relation between the material and an output color, so that region information of the material in the panoramic image can be determined in the material element layer (MATID) according to the specified output color.

Based on the principle, for the material of the texture to be replaced in the panoramic image, the user can set a corresponding output color, the output color can be embodied in the material element layer (MATID), one-time off-line rendering is carried out, the material element layer (MATID) corresponding to the panoramic image is output, and the relative area of the material in the panoramic image can be determined based on the output color of the material in the material element layer (MATID).

For example, as shown in fig. 3, for a wood material in the panoramic image, a user may set a corresponding output color, where the output color is embodied in a material element layer (MATID), perform offline rendering once, output a material element layer (MATID) corresponding to the panoramic image, and from the material element layer (MATID), based on the output color of the material, may determine a relative area of the material in the panoramic image.

In addition, for wood materials in the panoramic image, a user can set corresponding output colors, the output colors can be embodied in a material element layer (MATID) to perform one-time off-line rendering, a global illumination layer, a diffuse reflection layer and other element layers corresponding to the panoramic image can also be output, and the other element layers are sequentially subjected to linear attenuation and superposition to obtain a mixed layer (MIX) corresponding to the panoramic image.

Here, the remaining element layers specifically include the following element layers: reflection coating (REFLECT), refraction coating (REFRACT), highlight coating (SPECULAR), scattering coating (SSS), caustic coating (CAUSTICS), fog coating (ATMOSPHERE), exterior coating (BACKGROUND), and self-luminescence coating (SELFILLUM).

It should be noted that, for the material of the texture to be replaced in the panoramic image, the user may set a corresponding output color, where the output color may be embodied in a material element layer (MATID), perform offline rendering once, output a material element layer (MATID), a global illumination layer, a diffuse reflection layer, and other element layers corresponding to the panoramic image, and thus divide the material texture region by rendering the material element layer.

And S104, combining the new diffuse reflection layer, the global illumination layer of the panoramic image and the mixed layer to obtain a target panoramic image, and displaying the target panoramic image.

And for a new DIFFUSE reflection layer (DIFFUSES-REPLACE), a global illumination layer (RAWGI) of the panoramic image and a mixed layer (MIX), combining the three layers to obtain a target panoramic image (COLOR-REPLACE), and displaying the target panoramic image (COLOR-REPLACE).

Specifically, a new DIFFUSE reflection layer (DIFFUSE-REPLACE) and a global illumination layer (RAWGI) of the panoramic image are subjected to positive superposition, so that a completely new global illumination layer (GI) with DIFFUSE reflection can be obtained; and then, carrying out linear attenuation and combination on the new global illumination layer (GI) and the mixed layer (MIX) of the panoramic image to obtain a target panoramic image (COLOR-REPLACE), and displaying at a panoramic display end.

Therefore, the rendering effect of the similar materials can be restored by cutting and covering the DIFFUSE reflection layer and combining the layers (a new DIFFUSE reflection layer (DIFFUSE-REPLACE), a global illumination layer (RAWGI) of the panoramic image and a mixed layer (MIX), and the three are combined). Therefore, on the premise of ensuring the drawing efficiency and the drawing quality, the quantity of materials needing texture replacement and the quantity of texture maps needing replacement can be improved, and rendering resources consumed by offline rendering are reduced.

For example, as shown in fig. 4, for the reflection layer (REFLECT), the refraction layer (refrac), the highlight layer (SPECULAR), the scattering layer (SSS), the caustic layer (CAUSTICS), the fog layer (ATMOSPHERE), the exterior view layer (backthrottle), and the self-luminescence layer (selllum), linear subtraction and superposition are sequentially performed to obtain the mixed layer (MIX) corresponding to the panoramic image.

Positive film superposition is carried out on the new DIFFUSE reflection layer (DIFFUSES-REPLACE) and the global illumination layer (RAWGI) of the panoramic image, so that a brand new global illumination layer (GI) with DIFFUSE reflection can be obtained; and then, carrying out linear attenuation and combination on the new global illumination layer (GI) and the mixed layer (MIX) of the panoramic image to obtain a target panoramic image (COLOR-REPLACE), and displaying at a panoramic display end.

According to the technical scheme provided by the embodiment of the invention, the material of the texture to be replaced in the panoramic image and the target texture map corresponding to the panoramic image are determined, the target diffuse reflection map layer corresponding to the target texture map is searched from the preset diffuse reflection map layer set, wherein the light in the panoramic image is removed, the texture map corresponding to the material is replaced by the candidate texture map layer and is subjected to off-line rendering, the diffuse reflection map layer set is output, the corresponding area is intercepted from the target diffuse reflection map layer and is covered on the diffuse reflection map layer of the panoramic image to obtain a new diffuse reflection map layer, and the new diffuse reflection map layer, the global illumination map layer of the panoramic image and the mixed map layer are combined to obtain the target panoramic image and are displayed.

Therefore, the texture region of the material is identified and divided by rendering the material element layer, a large amount of rendering resources are saved by rendering the diffuse reflection layer independent of illumination, and the rendering effect of the same type of material is restored by cutting and covering the diffuse reflection layer and the layer combination technology. On the premise of ensuring the plotting efficiency and the plotting quality, the quantity of materials needing texture replacement and the quantity of texture maps needing replacement can be improved, and rendering resources consumed by offline rendering are reduced.

Corresponding to the above method embodiment, an embodiment of the present invention further provides a panoramic image display apparatus, as shown in fig. 5, the apparatus may include a material, map determining module 510, a layer searching module 520, a set creating module 530, a layer covering module 540, and a layer merging module 550.

A material and map determining module 510, configured to determine a material of a texture to be replaced in a panoramic image and a target texture map corresponding to the panoramic image;

the layer searching module 520 is configured to search a target diffuse reflection layer corresponding to the target texture map from a preset diffuse reflection layer set;

a set creating module 530, configured to remove light from the panoramic image, replace the texture map corresponding to the material with a candidate texture map, perform offline rendering, and output the diffuse reflection layer set;

the layer covering module 540 is configured to intercept a corresponding area from the target diffuse reflection layer, and cover the corresponding area on the diffuse reflection layer of the panoramic image to obtain a new diffuse reflection layer;

and the layer merging module 550 is configured to merge the new diffuse reflection layer, the global illumination layer of the panoramic image, and the mixed layer to obtain a target panoramic image, and display the target panoramic image.

An embodiment of the present invention further provides an electronic device, as shown in fig. 6, including a processor 61, a communication interface 62, a memory 63, and a communication bus 64, where the processor 61, the communication interface 62, and the memory 63 complete mutual communication through the communication bus 64,

a memory 63 for storing a computer program;

the processor 61 is configured to implement the following steps when executing the program stored in the memory 63:

determining the material of the texture to be replaced in the panoramic image and a target texture mapping corresponding to the panoramic image; searching a target diffuse reflection layer corresponding to the target texture mapping from a preset diffuse reflection layer set; removing light in the panoramic image, replacing the texture maps corresponding to the materials with candidate texture maps, performing off-line rendering, and outputting the diffuse reflection layer set; intercepting a corresponding area from the target diffuse reflection layer, and covering the corresponding area on the diffuse reflection layer of the panoramic image to obtain a new diffuse reflection layer; and combining the new diffuse reflection layer, the global illumination layer of the panoramic image and the mixed layer to obtain a target panoramic image, and displaying.

The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.

The communication interface is used for communication between the electronic equipment and other equipment.

The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.

The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.

In another embodiment of the present invention, a storage medium is further provided, where instructions are stored, and when the instructions are executed on a computer, the instructions cause the computer to execute the panoramic image display method according to any one of the above embodiments.

In yet another embodiment, a computer program product containing instructions is provided, which when run on a computer causes the computer to perform the panoramic image display method described in any of the above embodiments.

In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a storage medium or transmitted from one storage medium to another, for example, from one website, computer, server, or data center to another website, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The storage medium may be any available medium that can be accessed by a computer or a data storage device including one or more available media integrated servers, data centers, and the like. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.

It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.

The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

16页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:重光照图像的生成方法、装置及电子设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!