Automatic building edge fusion transition method and device based on depth detection

By dividing the virtual scene into sub-regions, generating a mask image sequence and performing Gaussian blur processing, the problem of hard edge cutting of buildings is solved, achieving a natural transition effect and reducing computational overhead.

CN114581320BActive Publication Date: 2026-05-29FUJIAN SHUBO INFORMATION TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
FUJIAN SHUBO INFORMATION TECH CO LTD
Filing Date
2022-02-16
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Traditional simulations often feature hard-cut edges on building models, resulting in a lack of realism. Furthermore, in large scenes, the high resolution of the masking image leads to significant sampling overhead and computational redundancy.

Method used

By dividing the virtual scene into sub-regions, generating a mask image sequence, and performing Gaussian blur processing, the blending transition area is determined, and the final color value is calculated for automatic blending transition.

Benefits of technology

Achieve natural edge transitions, reduce texture sampling overhead, lower computational load, and enhance realism.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114581320B_ABST
    Figure CN114581320B_ABST
Patent Text Reader

Abstract

The application provides a building edge automatic fusion transition method and device based on depth detection, which comprises the following steps: dividing a virtual scene into a plurality of sub-regions and generating a mask image sequence; performing Gaussian blur processing according to the mask image sequence to determine a fusion transition region; when rendering a terrain material, determining a corresponding target mask image according to a position index of a current pixel point in the mask image sequence; and performing automatic fusion transition on a building edge according to a final color value obtained by mixing calculation of the fusion transition region and the target mask image, so that the mask image can be automatically generated, the building edge and the terrain can be mixed in material, a natural edge transition effect can be obtained, the sense of reality is enhanced, and the atlas sampling overhead is low and the calculation amount is small.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer image processing, and in particular to a method and apparatus for automatic blending and transition of building edges based on depth detection. Background Technology

[0002] Traditional simulations often suffer from hard-cut edges on building models, resulting in poor transitions between building edges and terrain, and a lack of realism.

[0003] Moreover, when the virtual simulation scene is too large, two problems will arise. The first problem is that in order to ensure the accuracy of the blending transition, the resolution of the mask texture will be very high, which will generate a large texture sampling overhead at runtime. The second problem is that when the scene is too large, some areas may have buildings added, modified or deleted, which will cause the rendering target to be updated frequently, while the buildings in most other areas remain unchanged, resulting in a huge amount of redundant calculation.

[0004] Therefore, there is a need for a method and device for automatic blending and transition of building edges based on depth detection, which can automatically generate masks and blend the building edges with the terrain to obtain a natural edge transition effect, enhance the realism, and have low texture sampling overhead and low computational cost. Summary of the Invention

[0005] (a) Technical problems to be solved

[0006] To address the aforementioned problems in the prior art, the present invention provides a method and apparatus for automatic blending and transition of building edges based on depth detection, which can automatically generate a mask and blend the building edges with the terrain materials to achieve a natural edge transition effect and enhance realism.

[0007] (II) Technical Solution

[0008] To achieve the above objectives, the present invention adopts the following technical solution:

[0009] An automatic blending transition method for building edges based on depth detection includes the following steps:

[0010] S1. Divide the virtual scene into several sub-regions and generate a masking image sequence;

[0011] S2. Perform Gaussian blur processing on the mask image sequence to determine the fusion transition region;

[0012] S3. When rendering terrain materials, the mask image sequence is indexed based on the position of the current pixel to determine the corresponding target mask image;

[0013] S4. The building edges are automatically blended and transitioned based on the final color value obtained after blending calculations of the blending transition area and the target mask map.

[0014] To achieve the above objectives, another technical solution adopted by the present invention is as follows:

[0015] An automatic blending transition device for building edges based on depth detection includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it performs the following steps:

[0016] S1. Divide the virtual scene into several sub-regions and generate a masking image sequence;

[0017] S2. Perform Gaussian blur processing on the mask image sequence to determine the fusion transition region;

[0018] S3. When rendering terrain materials, the mask image sequence is indexed based on the position of the current pixel to determine the corresponding target mask image;

[0019] S4. The building edges are automatically blended and transitioned based on the final color value obtained after blending calculations of the blending transition area and the target mask map.

[0020] (III) Beneficial Effects

[0021] The beneficial effects of this invention are as follows: by dividing the virtual scene into several sub-regions and generating a mask image sequence; by performing Gaussian blur processing on the mask image sequence to determine the blending transition region; when rendering terrain materials, the mask image sequence is indexed according to the position of the current pixel to determine the corresponding target mask image; the final color value obtained after mixing calculations based on the blending transition region and the target mask image is used to automatically blend the building edges, which can automatically generate a mask and mix the building edges with the terrain materials to obtain a natural edge transition effect, enhancing realism and reducing texture sampling overhead and computational load. Attached Figure Description

[0022] Figure 1 This is a flowchart of the automatic blending transition method for building edges based on depth detection, according to an embodiment of the present invention.

[0023] Figure 2 This is a schematic diagram of the overall structure of the device for the automatic blending transition method of building edges based on depth detection according to an embodiment of the present invention.

[0024] [Explanation of Labels in the Attached Image]

[0025] 1: An automatic blending transition device for building edges based on depth detection;

[0026] 2: Memory;

[0027] 3: Processor. Detailed Implementation

[0028] To better explain and facilitate understanding of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.

[0029] Example 1

[0030] Please refer to Figure 1 An automatic blending transition method for building edges based on depth detection includes the following steps:

[0031] S1. Divide the virtual scene into several sub-regions and generate a masking image sequence;

[0032] Step S1 includes:

[0033] S11. Divide the virtual scene into several sub-regions, each with its own rendering target;

[0034] Specifically, after dividing the virtual scene, when buildings in a certain sub-region are added, modified, or deleted, only the rendering target of that region is recalculated, without having to recalculate all proxy models in the scene, thus reducing the computational cost.

[0035] S12. Initialize each sub-region separately to generate the corresponding mask map. All the mask maps are combined into a mask map sequence.

[0036] Step S12 is as follows:

[0037] When calculating the rendering target, the proxy model is set to the rendering state of writing depth. The value of the rendering target in each sub-region is initialized to the first preset value, and the region of the proxy model is set to the second preset value. The corresponding mask map is generated, and all the mask maps are combined into a mask map sequence.

[0038] Specifically, the proxy model is used as a proxy for the blending transition. It only exists in the calculation process and will not be rendered in the final image. The proxy model only needs a simple low-poly model of the part where the building meets the ground, and does not need the details of the interior and upper part of the model.

[0039] The first preset value is (0,0,0,1), which is pure black, and the second preset value is (1,1,1,1), which is pure white. The generated mask image is a mask image in which the area with the proxy model is white and the rest of the area is black. The generated mask image represents the depth in the scene. The white areas are the areas with buildings. Edge detection is performed in this way with low computational cost and high efficiency.

[0040] S2. Perform Gaussian blur processing on the mask image sequence to determine the fusion transition region;

[0041] Step S2 is as follows:

[0042] Gaussian blurring is performed on the mask image sequence, and the fusion transition region is determined based on the blur radius.

[0043] Specifically, Gaussian blur processing does not need to be performed every frame; it is only triggered after the rendering target is updated. For example, when buildings in the area are added, modified, or deleted, a request to update the rendering model will be triggered.

[0044] S3. When rendering terrain materials, the mask image sequence is indexed based on the position of the current pixel to determine the corresponding target mask image;

[0045] S4. The building edges are automatically blended and transitioned based on the final color value obtained after blending calculations of the blending transition area and the target mask map.

[0046] Step S4 includes:

[0047] S41. Calculate the UV of the current region masking map based on the target masking map;

[0048] S42. Based on the UV values ​​of the target mask map and the current region mask map, calculate the mask value sampled at the current pixel point to obtain the mask sampling value a.

[0049] S43. Calculate the pixel color value color_terrain of the original terrain material of the current pixel and the color value color_building of the material surrounding the original building of the current pixel, and mix them with the sampled value a of the mask to obtain the final color value.

[0050] S44. Automatically blend and transition the building edges according to the final color value.

[0051] The final color value = color_building*a + color_terrain*(1-a).

[0052] Specifically, through hybrid calculations, a very natural transition can be achieved between the building edge and the terrain, avoiding the appearance of hard cut edges.

[0053] The building is located in the center, and the building is surrounded by a building edge material, such as cement and sand. The ground material (topography) of the original construction site is around the edge material. The problem to be solved by this invention is the transition between the building edge material and the ground material of the original construction site.

[0054] Example 2

[0055] Please refer to Figure 2 The automatic blending transition device 1 for building edges based on depth detection includes a memory 2, a processor 3, and a computer program stored in the memory 2 and run on the processor 3. When the processor 3 executes the program, it implements the various steps in Embodiment 1.

[0056] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method for automatic blending and transition of building edges based on depth detection, characterized in that, Including the following steps: S1. Divide the virtual scene into several sub-regions and generate a masking image sequence; S2. Perform Gaussian blur processing on the mask image sequence to determine the fusion transition region; S3. When rendering terrain materials, the mask image sequence is indexed based on the position of the current pixel to determine the corresponding target mask image; S4. Automatically blend the building edges based on the final color value obtained after blending calculations using the blending transition area and the target mask map. Step S1 includes: S11. Divide the virtual scene into several sub-regions, each with its own rendering target; S12. Initialize each sub-region separately to generate the corresponding masking map. All the masking maps are combined into a masking map sequence. Step S12 is as follows: When calculating the rendering target, the proxy model is set to the rendering state of writing depth, the value of the rendering target in each sub-region is initialized to the first preset value, the region of the proxy model is set to the second preset value, and the corresponding mask map is generated. All the mask maps are combined into a mask map sequence. The first preset value is pure black, and the second preset value is pure white; Step S4 includes: S41. Calculate the UV of the current region masking map based on the target masking map; S42. Based on the UV values ​​of the target mask map and the current region mask map, calculate the mask value sampled at the current pixel point to obtain the mask sampling value a. S43. Calculate the pixel color value color_terrain of the original terrain material of the current pixel and the color value color_building of the material surrounding the original building of the current pixel, and mix them with the sampled value a of the mask to obtain the final color value. S44. Automatically blend and transition the building edges according to the final color value.

2. The automatic blending transition method for building edges based on depth detection according to claim 1, characterized in that, Step S2 is as follows: Gaussian blurring is performed on the mask image sequence, and the fusion transition region is determined based on the blur radius.

3. The automatic blending transition method for building edges based on depth detection according to claim 1, characterized in that, The final color value = color_building × a + color_terrain × (1-a).

4. An automatic blending transition device for building edges based on depth detection, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it performs the following steps: S1. Divide the virtual scene into several sub-regions and generate a masking image sequence; S2. Perform Gaussian blur processing on the mask image sequence to determine the fusion transition region; S3. When rendering terrain materials, the mask image sequence is indexed based on the position of the current pixel to determine the corresponding target mask image; S4. Automatically blend the building edges based on the final color value obtained after mixing calculations using the blending transition area and the target mask map; Step S1 includes: S11. Divide the virtual scene into several sub-regions, each with its own rendering target; S12. Initialize each sub-region separately to generate the corresponding masking map. All the masking maps are combined into a masking map sequence. Step S12 is as follows: When calculating the rendering target, the proxy model is set to the rendering state of writing depth, the value of the rendering target in each sub-region is initialized to the first preset value, the region of the proxy model is set to the second preset value, and the corresponding mask map is generated. All the mask maps are combined into a mask map sequence. The first preset value is pure black, and the second preset value is pure white; Step S4 includes: S41. Calculate the UV of the current region masking map based on the target masking map; S42. Based on the UV values ​​of the target mask map and the current region mask map, calculate the mask value sampled at the current pixel point to obtain the mask sampling value a. S43. Calculate the pixel color value color_terrain of the original terrain material of the current pixel and the color value color_building of the material surrounding the original building of the current pixel, and mix them with the sampled value a of the mask to obtain the final color value. S44. Automatically blend and transition the building edges according to the final color value.

5. The automatic blending transition device for building edges based on depth detection according to claim 4, characterized in that, The final color value = color_building × a + color_terrain × (1-a).