Skyline analysis method based on three-dimensional graphics simulation and storage medium

By constructing a 3D scene, using color buffers and iterative algorithms, and combining local search and feature color comparison, the problem of model holes was solved, achieving efficient and accurate skyline extraction. It is suitable for multiple platforms and real-time display, enhancing the technical support for urban planning and landscape protection.

CN121353575BActive Publication Date: 2026-03-20上海秉匠信息科技有限公司 +2
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511913489.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-18
Publication Date
2026-03-20
Estimated Expiration
2045-12-18

AI Technical Summary

Technical Problem

Existing technologies fail to effectively address the issue of holes in models when extracting skylines, leading to incorrect extraction and requiring multiple interface operations and screenshots, which increases memory usage and operational complexity.

Method used

By constructing a 3D scene, copying scene cache information, processing with a color buffer and iterative algorithms, combining local search and feature color comparison, performing pixel-by-pixel analysis, removing hole and crack features, and drawing skyline boundary information, the number of screenshots and interface operations is reduced.

Benefits of technology

It improves the accuracy and efficiency of skyline extraction, simplifies the operation process, lowers the technical threshold, is applicable to multiple platforms, supports real-time calculation and display, and enhances the application value for urban planning and landscape protection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121353575B_ABST
    Figure CN121353575B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of digital graphic modeling, and discloses a skyline analysis method based on three-dimensional graphic simulation and a storage medium. The method comprises the following steps: loading image data and scene data; taking the color buffer after the light of the scene in a rendering process as a first input buffer and taking the color buffer of a current frame as a second input buffer; obtaining three-dimensional scene information; replacing a building or a terrain area with a first feature color to obtain an output buffer; taking the output buffer as input buffer information and comparing and analyzing the output buffer with the color buffer of a previous frame; if there is a difference in pixels, outputting a second feature color; otherwise, outputting the first feature color; updating the output buffer according to the feature color; removing a hollow feature and a crack feature in the output buffer; performing local search to obtain a skyline of a screen drawing area; drawing boundary information of the skyline; and improving the accuracy of extracting the skyline.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of digital graphic modeling, in particular to a skyline analysis method based on three-dimensional graphic simulation and a storage medium. BACKGROUND

[0002] Three-dimensional skyline technology belongs to the intersection field of three-dimensional geographic information system and urban space analysis, and specifically relates to technical directions such as digital land surface modeling, building information modeling and virtual city simulation. The core goal is to analyze the influence of urban space form on visual environment through visualization and quantitative means. It has important reference significance for building a humanistic and friendly city.

[0003] In the prior art method of extracting the skyline, the target scene currently displayed by the 3D earth engine is first screenshot to obtain an initial image, then the background color of the sky in the 3D earth engine is modified twice and the corresponding images are intercepted to obtain a first image and a second image, and finally the skyline is determined in the initial image according to the pixel color of the image pixel in the first image and the pixel color of the image pixel in the second image.

[0004] The above scheme extracts the skyline pixel by modifying the background color of the 3D earth engine and taking screenshots, breaks away from the dependence on the map engine interface, and reduces the technical threshold of the user. However, it needs to be operated through multiple interfaces and takes screenshots three times, and does not fully consider the model hole problem, which leads to incorrect extraction of the skyline. SUMMARY

[0005] In order to fully consider the model hole problem and improve the accuracy of extracting the skyline, the present application provides a skyline analysis method based on three-dimensional graphic simulation and a storage medium.

[0006] In the first aspect, the present application provides a skyline analysis method based on three-dimensional graphic simulation, which adopts the following technical scheme:

[0007] A skyline analysis method based on three-dimensional graphic simulation, comprising the following steps:

[0008] Constructing a three-dimensional scene to be displayed and loading image data and scene data;

[0009] Copying scene cache information, taking the color buffer after the scene is illuminated in the rendering process as a first input buffer, taking the color buffer of the current frame as a second input buffer, obtaining three-dimensional scene information with sky box information; wherein a preset first feature color is used to replace buildings or terrain areas to obtain an output buffer;

[0010] The information of the output buffer is taken as input buffer information and compared with the color buffer of the previous frame pixel by pixel, if there is a difference in the compared pixels, a second feature color is output, otherwise a first feature color is output; the output buffer is updated according to the output feature color;

[0011] According to a preset iterative algorithm, the hole features and crack features in the output buffer are iteratively processed and removed;

[0012] The horizon in the two-dimensional display image in the screen drawing area is obtained by locally searching the output buffer;

[0013] The boundary information of the horizon is drawn.

[0014] By adopting the technical scheme, the three-dimensional scene to be displayed is constructed, and image data and scene data are loaded, thereby laying a precise scene foundation for horizon analysis; the scene cache information is copied, the color buffer after lighting is taken as the first input buffer, the current frame color buffer is taken as the second input buffer, the three-dimensional scene with skybox information is combined, the first feature color is used to replace the building or terrain area to obtain the output buffer, this mechanism realizes precise distinction between the scene area and the sky area, and provides reliable data support for subsequent processing; the output buffer is compared with the color buffer of the previous frame pixel by pixel, the second feature color is output for the different pixels, otherwise the first feature color is output and the output buffer is updated, this process precisely captures the scene dynamic difference through the feature color change; the preset iterative algorithm is adopted for iterative processing, thereby effectively removing the hole features and crack features in the output buffer, and the model hole problem is solved in a targeted manner; the output buffer is locally searched to obtain the horizon and draw the boundary information of the horizon, the whole process does not need to take screenshots multiple times, through the synergistic effect of a series of technical means, the accuracy of horizon extraction is greatly improved, and the operation is more efficient.

[0015] Optionally, the step of obtaining the output buffer further includes the following sub-steps:

[0016] Pixels are traversed one by one;

[0017] If the color value of the pixel in the first input buffer is not equal to 0, the pixel in the second input buffer is valued, it is judged whether the pixel is an invalid pixel, if not, the corresponding pixel in the output buffer is assigned as the first feature color;

[0018] If the color value of the pixel in the first input buffer is equal to 0, the color value of the pixel in the second input buffer is taken and assigned to the corresponding pixel in the output buffer.

[0019] By adopting the technical scheme, the area division deviation caused by pixel attribute misjudgment is reduced, the initial data quality of the output buffer is optimized through linkage verification of the first input buffer and the second input buffer, the iteration cost of subsequent hole and crack processing is reduced, and the basic precision of the skyline extraction is indirectly improved.

[0020] Optionally, the step of iteratively processing to remove the hole features and the crack features in the output buffer according to the preset iteration algorithm further includes the following substeps:

[0021] The output buffer is converted into a gray image buffer, and the hole features and the crack features in the gray image buffer are iteratively processed according to a preset iteration algorithm;

[0022] The gray image buffer is further converted into the output buffer.

[0023] By adopting the technical scheme, the gray image buffer is converted, the gray image single-channel characteristics can strengthen the pixel value difference contrast, and the iteration processing is more likely to converge to the target features.

[0024] Optionally, the iteration algorithm includes:

[0025] Two buffers with the same size as the input cache and in the R8 format are applied, the first input cache is taken as a target buffer, and the input is a gray image buffer;

[0026] A unit step is determined, the initial value is one pixel, and the maximum value is the diagonal line of the length and width of the frame cache size;

[0027] The coordinate value of the current pixel is uniformly increased by a set threshold color value, and is projected into the coordinate system of the display screen; the screen coordinate obtained after the modification is subtracted from the current screen coordinate to obtain an upward display vector;

[0028] Each pixel is traversed, the pixel values of 8 steps are addressed according to the upward display vector of the current pixel and the unit step and the upward display vector of the current pixel according to the upward display vector, and the maximum value in the pixel value is assigned to the current pixel;

[0029] The maximum value of the current pixel and the pixel corresponding to the last rendering target is obtained, and the maximum value is assigned to the target pixel;

[0030] The target pixel in the previous step is taken as the input buffer texture, the second cache is taken as the target buffer, and the loop iteration is performed;

[0031] The unit step is enlarged by 8 times, and when the unit step is less than the preset maximum step value, the rendering target of this time is taken as the texture input;

[0032] The maximum value in the pixel value is assigned to the current pixel in a loop, and the termination condition is that the step is greater than the diagonal line length of the display screen.

[0033] By adopting the above technical solutions, the pixel information of the skyline difference is expanded, and the efficient data flow is achieved through the dual R8 buffer design. The dynamic unit step size from 1 pixel to the length of the screen diagonal realizes an 8-fold progressive amplification mechanism. The maximum value sampling strategy can accurately fill the hole area, and the logic of iteratively taking the maximum pixel value can effectively close the crack. The progressive elimination of defect features is achieved through multiple rounds of rendering target iteration, which improves the algorithm efficiency while ensuring the integrity of hole and crack processing.

[0034] Optionally, the method further includes the following steps:

[0035] The step of calculating the upward display vector and copying it to the current pixel is processed in parallel using the GPU.

[0036] The amount of parallel processing tasks on the GPU is adjusted in a positive correlation with the screen size; the larger the screen size, the more tasks are processed, and the smaller the screen size, the fewer tasks are processed.

[0037] By adopting the above technical solution, the parallel processing of GPUs to calculate the upward display vector and copy steps significantly improves the computing speed of this step; the workload is dynamically adjusted according to the image size to adapt to the processing needs of screens of different sizes.

[0038] Optionally, the local search step further includes the following sub-steps:

[0039] Using a 3x3 grid with structured elements, the calculation is performed by sliding across the input buffer. The difference value of the 3x3 grid is calculated pixel by pixel. If the difference value is greater than a preset difference threshold, the pixel is determined to be a boundary pixel. The set of boundary pixels is the skyline.

[0040] By adopting the above technical solution, boundary information is extracted based on the differences in the nine-square grid. It does not rely on the ground feature information in the three-dimensional scene and does not require complex calculations, thus enabling the rapid extraction of the skyline in the scene.

[0041] Optionally, the step of drawing the boundary information of the skyline further includes the following sub-steps:

[0042] Calculate twice the weighted average of the transparency of the nine pixels in the 3x3 grid and assign it to the Alpha value.

[0043] Optionally, the step of drawing the boundary information of the skyline further includes the following sub-steps:

[0044] The Alpha value is constrained to be between [0.0, 1.0].

[0045] Secondly, this application provides a storage medium, which adopts the following technical solution:

[0046] A storage medium having stored therein a program which, when executed by a processor, implements the steps of the skyline analysis method based on three-dimensional graphics simulation according to any one of the preceding embodiments.

[0047] In summary, the present application has at least one of the following beneficial technical effects: compared with the prior art, by presetting an iterative algorithm for iterative processing, the holes and cracks in the output buffer can be effectively removed, the problem of incorrect skyline extraction caused by model holes is solved, and the extraction accuracy is greatly improved. At the same time, without multiple interface operations for three screenshots, by constructing a three-dimensional scene, copying cache information, and comparing pixels, the operation process is simplified, the interface interaction is reduced, and the skyline extraction efficiency is improved. In addition, based on three-dimensional graphics simulation, combined with color buffer processing, feature color comparison, and local search, the skyline extraction is more in line with the actual situation of the three-dimensional scene, the drawn skyline boundary information is more accurate, and more reliable technical support is provided for city space form analysis and humanistic care friendly city construction, thereby enhancing the application value of three-dimensional skyline technology in the field of city planning. BRIEF DESCRIPTION OF DRAWINGS

[0048] Figure 1 is a method flow diagram of a skyline analysis method based on three-dimensional graphics simulation.

[0049] Figure 2 is a schematic diagram of the first input buffer, the second input buffer and the output buffer of the ground scene.

[0050] Figure 3 is a schematic diagram of the first input buffer, the second input buffer and the output buffer of the building scene.

[0051] Figure 4 is a schematic diagram of the comparison analysis of the ground scene.

[0052] Figure 5 is a schematic diagram of the comparison analysis of the building scene.

[0053] Figure 6 is a schematic diagram of the difference pixel information of the extended skyline of the ground scene and the building scene.

[0054] Figure 7 is a schematic diagram of the display of the skyline of the ground scene and the building scene in the two-dimensional display diagram.

[0055] Figure 8 is a schematic diagram of the drawing of the skyline boundary information of the ground scene and the building scene.

[0056] Figure 9 is a schematic diagram of the effect instance of the ground scene and the building scene. DETAILED DESCRIPTION

[0057] Embodiments of the present application are described below in detail, examples of which are shown in the accompanying drawings.

[0058] In the description of the present specification, the description referring to the terms "certain embodiments", "one embodiment", "some embodiments", "illustrative embodiments", "example", "specific example" or "some examples" means that the particular feature, structure, material or characteristic being described in connection with the embodiment or example is included in at least one embodiment or example of the present application. The illustrative representations of the above terms in the present specification do not necessarily refer to the same embodiment or example. Also, the particular feature, structure, material or characteristic being described can be combined in any one or more embodiments or examples in a suitable manner.

[0059] Three-dimensional skyline has a variety of uses. In terms of urban planning, it is used to evaluate the impact of development projects on the city skyline, formulate building height limit policies, and optimize public space layout to ensure the transparency of landmark building views. In terms of landscape protection, it is used to analyze the visual coordination of natural landscapes and urban buildings to avoid excessive development that destroys historical and cultural features. In terms of disaster assessment, it is used to predict the potential damage of disasters such as floods and fires to the city skyline in combination with three-dimensional models. In terms of real estate and tourism, it is used to quantify the viewing value of high-rise buildings to support commercial real estate pricing, and to design city viewing routes to enhance the tourism experience.

[0060] The prior art with Chinese Publication No. CN119741275A discloses a skyline analysis method, device, equipment and storage medium. The scheme first takes a screenshot of the target scene currently displayed by the 3D earth engine to obtain an initial image, then modifies the background color of the sky in the 3D earth engine twice and intercepts the corresponding images to obtain a first image and a second image, and finally determines the skyline in the initial image according to the pixel color of the image pixels in the first image and the pixel color of the image pixels in the second image. The skyline is determined by only analyzing and processing the image. In the process of determining the skyline, it does not rely on the related necessary interfaces provided by the map engine, and users also do not need to have experience in processing 3D scenes, the technical threshold is low, the use conditions are relaxed, and it is suitable for most occasions, solving the technical problem that the use conditions are relatively strict when analyzing the skyline in the prior art. Although the background color of the 3D earth engine is modified and the skyline pixels are extracted by taking screenshots, the dependence on the interfaces of the map engine is eliminated, and the technical threshold of the user is reduced. However, through multiple interface operations, three screenshots need to be taken and loaded into the memory for analysis and processing, which increases the memory occupation; the problem of incorrect extraction of the skyline caused by not fully considering the model hole problem; scene switching cannot be done in real time.

[0061] The prior art with Chinese Publication No. CN115345896A also discloses a three-dimensional scene skyline fast extraction method, system, storage medium and equipment, constructs a three-dimensional scene to be displayed, and loads image data and scene data. The edge of the scene graph displayed on the browser is detected according to the depth value of the pixel, and the edge pixel is extracted. If the depth value of the pixel is greater than or equal to the preset sky area depth threshold value, the corresponding pixel is a sky pixel, otherwise it is a ground area pixel. If the pixel on the scene graph displayed by the browser is both an edge pixel and a sky pixel, it is set as an initial skyline pixel. The initial skyline pixel is locally searched to obtain the skyline in the two-dimensional display graph of the screen rendering area. The method does not depend on the ground object information in the three-dimensional scene, has no complex calculation, and can quickly extract the skyline in the scene. Although the depth value of the browser scene graph and the edge detection algorithm are used to distinguish the sky and ground pixels; real-time processing is supported on the browser side, and complex three-dimensional engines are not required. However, the model hole problem is not fully considered, which leads to incorrect extraction of the skyline; the cross-platform problem is not fully considered, and the patent only supports the browser side.

[0062] The embodiment of the present application discloses a skyline analysis method based on three-dimensional graphic simulation, referring to Figure 1 , comprising the following steps:

[0063] Constructing a three-dimensional scene to be displayed, and loading image data and scene data;

[0064] Copying the scene cache information, taking the color buffer after the lighting of the scene in the rendering process as the first input buffer, denoted as input buffer 1, and taking the color buffer of the current frame as the second input buffer, denoted as input buffer 2; obtaining three-dimensional scene information with skybox information; wherein, a preset first feature color is used to replace the building or terrain area to obtain an output buffer. Referring to Figure 2 and Figure 3 , the first feature color is opaque black. The step of obtaining the output buffer includes: traversing pixel by pixel.

[0065] If the color value of the pixel in the first input buffer is not equal to 0; the value of the pixel in the second input buffer is taken, and it is judged whether the pixel is an invalid pixel; if it is not an invalid pixel, the corresponding pixel in the output buffer is assigned as the first feature color. If the color value of the pixel in the first input buffer is equal to 0, the color value of the pixel in the second input buffer is taken and assigned to the corresponding pixel in the output buffer. The region division deviation caused by the pixel attribute misjudgment is reduced, the initial data quality of the output buffer is optimized through the linkage verification of the first input buffer and the second input buffer, the iteration cost of the subsequent hole and crack processing is reduced, and the basic precision of the skyline extraction is indirectly improved.

[0066] Specifically, in the process of traversing pixel by pixel, if the pixel z value in the input buffer 1 is not equal to 0, i.e. there is a color value; then the pixel in the input buffer 2 is taken as a value, and it is judged whether the pixel is an invalid pixel, i.e. 0x0, if it is not an invalid pixel, then the pixel in the output buffer with the UV coordinate is assigned a value as a pure black color. If the pixel z value in the input buffer 1 is equal to 0, the pixel color information in the input buffer 2 is directly taken as a value and assigned to the pixel in the output buffer with the corresponding UV coordinate;

[0067] The information of the output buffer is taken as input buffer information, and is compared and analyzed with the color buffer of the previous frame pixel by pixel. If the compared pixels are different, a second characteristic color is output, the second characteristic color is red, otherwise a first characteristic color is output; the output buffer is updated according to the output characteristic color. The information of the output buffer is taken as input buffer information, such as the input buffer 2 in Figure 4 and Figure 5 , and is compared and analyzed with the color buffer of the previous frame pixel by pixel. If the two pixels are different, red is output, otherwise black is output. The buffer format is R8, which can save memory space.

[0068] The output buffer is converted into a grayscale buffer, and the grayscale buffer is iteratively processed according to a preset iteration algorithm to remove hole features and crack features in the grayscale buffer, and then the grayscale buffer is converted into the output buffer. The grayscale buffer is converted, and the grayscale single-channel feature can strengthen the contrast of pixel value difference, so that the iteration processing is more easily converged to the target feature. The hole features and crack features in the output buffer are iteratively processed according to the preset iteration algorithm. The iteration algorithm includes: two buffers with the same size as the input cache and in the R8 format are applied, the first input cache is taken as a target buffer, and the input is the grayscale buffer. A unit step is determined, and the initial value is one pixel, and the maximum value is the diagonal line of the length and width of the frame cache size. The coordinate value of the current pixel is uniformly increased by a certain threshold color value, and is projected into the coordinate system of the display screen. The screen coordinate obtained after the modification is subtracted from the current screen coordinate to obtain an upward display vector. Each pixel is traversed, and according to the unit step and the upward display vector of the current pixel, the pixel values of 8 steps are addressed according to the upward display vector, and the maximum value in the pixel value is assigned to the current pixel. The maximum value of the current pixel and the pixel corresponding to the last rendering target is obtained, and the maximum value is assigned to the target pixel. The target pixel in the last step is taken as the input buffer texture, and the second cache is taken as the target buffer, and the iteration is circular. The unit step is enlarged by 8 times, and when the unit step is less than the preset maximum step, the rendering target of this time is taken as the texture. The maximum value in the pixel value is assigned to the current pixel in a loop; the termination condition is that the step is greater than the diagonal line length of the display screen. The sky line difference pixel information is expanded, the dynamic unit step from 1 pixel to the diagonal line length of the screen realizes the 8 times progressive amplification mechanism through the double R8 buffer design, the maximum value sampling strategy can accurately fill the hole area, and the logic of iteratively taking the maximum value of the pixel can effectively bridge the cracks, and the progressive elimination of the defect features is realized through multiple rendering target iterations, so that the algorithm efficiency is improved while the integrity of the hole and crack processing is ensured.

[0069] Specifically, step one: two buffers with the same size as the input cache and in the R8 format are applied, and the first cache is taken as the target buffer, and the input is the grayscale buffer output in step three.

[0070] Step two: the distance of the unit step is determined, and the initial value is one pixel, and the maximum value is the diagonal line of the length and width of the frame cache size.

[0071] Step three: the coordinate value of the current pixel is uniformly increased by a certain value of z, and is projected into the screen coordinate system. The screen coordinate obtained after the modification is subtracted from the current screen coordinate to obtain an upward vector.

[0072] Step four: each pixel is traversed, and according to the step and the upward vector of the current pixel, the pixel values of 8 steps are addressed according to the upward direction vector, and the maximum value of the pixel is assigned to the current pixel.

[0073] Step five: get the maximum value of the current pixel and the pixel of the last rendering target, and assign the value to the target pixel.

[0074] Step six: take the target pixel of the last step as the input buffer texture, the second buffer as the target buffer, and iterate.

[0075] Step seven: step * 8 times, and when it is less than the maximum value, take the rendering target of this time as the texture input.

[0076] Step eight: repeat steps one to five. The termination condition is that the unit step is greater than the diagonal length.

[0077] Steps three to five are GPU parallel processing. The calculation of the up display vector and the copying step to the current pixel use GPU parallel processing. The task amount of GPU parallel processing is adjusted according to the positive correlation of the size of the screen. The larger the size of the screen, the more the task amount, and the smaller the size of the screen, the less the task amount. The practical GPU parallel processing calculates the up display vector and the copying step, which greatly improves the operation speed of this link; the task amount is dynamically adjusted according to the image size, which adapts to the processing needs of different size screens.

[0078] The pseudo code is as follows:

[0079]

[0080] The processing effect is shown in Figure 6 .

[0081] Local search is performed on the output buffer to obtain the horizon line in the two-dimensional display image in the screen drawing area;

[0082] The boundary information of the horizon line is drawn.

[0083] The three-dimensional scene to be displayed is constructed, and image data and scene data are loaded, thereby laying a precise scene foundation for the horizon analysis; scene cache information is copied, the color buffer after lighting is taken as a first input buffer, the current frame color buffer is taken as a second input buffer, the three-dimensional scene with sky box information is combined, a first characteristic color is used to replace a building or a terrain region to obtain an output buffer, this mechanism realizes precise distinction between a scene region and a sky region, and provides reliable data support for subsequent processing; the second output buffer is compared with a last frame color buffer pixel by pixel, a second characteristic color is output for different pixels, otherwise, a first characteristic color is output and the output buffer is updated, this process precisely captures scene dynamic differences through characteristic color changes; a preset iteration algorithm is used for iteration processing, thereby effectively removing hole features and crack features in the output buffer, and the model hole problem is solved in a targeted manner; the output buffer is subjected to local search to obtain a horizon and draw boundary information thereof, the entire process does not need multiple screenshots, through the synergistic effect of a series of technical means, the accuracy of horizon extraction is greatly improved, and the operation is more efficient.

[0084] A nine-square grid with a structural element as content is used to slide and calculate on the input buffer, the difference value of the nine-square grid is calculated pixel by pixel, if the difference value is greater than a preset difference threshold, it is determined that the pixel is a boundary pixel, and the set of boundary pixels is the horizon. The weighted average value of the transparency of the nine pixels in the nine-square grid is calculated twice, and the Alpha value is assigned. The Alpha value is constrained between [0.0, 1.0]. Specifically, as shown in Figure 7 The initial horizon pixels are subjected to local search to obtain the horizon in the two-dimensional display graph of the screen drawing region. This method does not depend on the information of the features in the three-dimensional scene, has no complex calculation, and can quickly extract the horizon in the scene. The boundary information is extracted according to the difference of the nine-square grid. Specifically, a nine-square grid called a structural element (or kernel) is used to slide on the input image, the difference of the nine-square grid is calculated pixel by pixel, and it is determined as a boundary if there is a difference and the difference is greater than a threshold. As shown in Figure 8 The horizon boundary information is drawn, the weighted average value of the transparency of the average of nine pixels is assigned to the Alpha value, and the Alpha value is ensured to be between [0.0, 1.0]. As shown in Figure 9 The boundary information is extracted according to the difference of the nine-square grid, which does not depend on the information of the features in the three-dimensional scene, has no complex calculation, and can quickly extract the horizon in the scene.

[0085] First, the target scene currently displayed by the 3D earth engine is captured to obtain an initial image, then the background color of the sky in the 3D earth engine is modified twice and the corresponding images are captured to obtain a first image and a second image, and finally the horizon is determined in the initial image according to the pixel color of the image pixels in the first image and the pixel color of the image pixels in the second image. The horizon is determined by the method of analyzing and processing the image, and in the process of determining the horizon, the related necessary interfaces provided by the map engine are not relied on, and the user does not need to have experience in processing 3D scenes, the technical threshold is low, and the method is suitable for most occasions, and the technical problem that the use conditions are relatively harsh when analyzing the horizon in the prior art is solved.

[0086] The method can have the following advantages: (1) cross-platform, such as IOS, browser, PC, and signal creation platform, glsl language is used for writing, and then the method can be converted into SPIR-V, HLSL, and MSL languages without loss through a tool; (2) real-time calculation and display, without delay or lag, and related problems such as color, transparency, and visibility can be controlled in real time; with the development of twin cities and the metaverse, it is necessary to simulate the construction of cities and communities in the computer world, which leads to the problem that real-time calculation and display of the horizon must be solved, instead of post-processing the scene, adjusting the model, and then displaying; (3) all time-consuming calculations are performed in the GPU; in the extraction process of the horizon, most of the operations are image processing and require the same operation on a large number of pixels, and the GPU has a large-scale parallel architecture with hundreds or thousands of computing cores such as CUDA cores, which can simultaneously process a large number of independent tasks, and the parallelism of the GPU can significantly improve efficiency.

[0087] The application further discloses a storage medium, which stores a program, and the program is executed by a processor to realize the steps of the horizon analysis method based on three-dimensional graphic simulation.

[0088] Although the embodiments of the application have been shown and described above, it should be understood that the above embodiments are exemplary and should not be construed as limiting the application, and those skilled in the art can make changes, modifications, replacements and variations to the above embodiments within the scope of the application.

Claims

1. A skyline analysis method based on three-dimensional graphics simulation, characterized in that, Includes the following steps: Construct the 3D scene to be displayed and load image data and scene data; Copy scene cache information, use the color buffer after the scene is lit during the rendering process as the first input buffer, and use the color buffer of the current frame as the second input buffer; obtain 3D scene information with skybox information; among them, use the preset first feature color to replace buildings or terrain areas to obtain the output buffer; The information in the output buffer is compared and analyzed pixel by pixel with the color buffer of the previous frame. If there is a difference between the compared pixels, the second feature color is output; otherwise, the first feature color is output. The output buffer is updated according to the output feature color. The output buffer is iteratively processed according to a preset iterative algorithm to remove hole and crack features. The iterative algorithm includes: applying for two buffers of the same size as the input buffer and formatted as R8, using the first input buffer as the target buffer and the input as a grayscale image buffer; determining the unit step size, with an initial value of one pixel and a maximum value equal to the diagonal of the frame buffer size; uniformly increasing the coordinate value of the current pixel by a set threshold color value and projecting it onto the coordinate system of the display screen; subtracting the current screen coordinates from the modified screen coordinates to obtain the upward display vector; traversing each pixel according to the unit step size. The algorithm iterates through the following steps: First, it uses the up-display vector of the current pixel to address pixel values ​​within an 8-step range and assigns the maximum value to the current pixel. Second, it retrieves the maximum value between the current pixel and the pixel corresponding to the previous rendering target and assigns this maximum value to the target pixel. Third, it uses the target pixel from the previous step as the input buffer texture and the second buffer as the target buffer, iterating continuously. Fourth, it increases the unit step size by a factor of 8. When the unit step size is less than the preset maximum step size, it passes the current rendering target as the texture. Fifth, it iterates through the process of assigning the maximum value of the pixel values ​​to the current pixel. Sixth, it terminates when the step size is greater than the diagonal length of the display screen. A local search is performed on the output buffer to obtain the skyline in the two-dimensional display image within the screen drawing area; Draw the boundary information of the skyline.

2. The skyline analysis method based on three-dimensional graphics simulation according to claim 1, characterized in that, The step of obtaining the output buffer also includes the following sub-steps: Traverse pixel by pixel; If the color value of a pixel in the first input buffer is not equal to 0, then the corresponding pixel in the second input buffer is evaluated to determine whether the pixel is invalid; if it is not invalid, then the corresponding pixel in the output buffer is assigned the first feature color. If the color value of a pixel in the first input buffer is equal to 0, take the color value of the pixel in the second input buffer and assign it to the corresponding pixel in the output buffer.

3. The skyline analysis method based on three-dimensional graphics simulation according to claim 2, characterized in that, The step of iteratively removing hole and crack features from the output buffer according to a preset iterative algorithm further includes the following sub-steps: The output buffer is converted into a grayscale image buffer, and the hole and crack features in the grayscale image buffer are removed by iterative processing according to a preset iterative algorithm. The grayscale image buffer is then converted into the output buffer.

4. The skyline analysis method based on three-dimensional graphics simulation according to claim 3, characterized in that, The method also includes the following steps: The step of calculating the upward display vector and copying it to the current pixel is processed in parallel using the GPU. The amount of parallel processing tasks on the GPU is adjusted in a positive correlation with the screen size; the larger the screen size, the more tasks are processed, and the smaller the screen size, the fewer tasks are processed.

5. The skyline analysis method based on three-dimensional graphics simulation according to claim 4, characterized in that, The local search step also includes the following sub-steps: Using a 3x3 grid with structured elements, the calculation is performed by sliding across the input buffer. The difference value of the 3x3 grid is calculated pixel by pixel. If the difference value is greater than a preset difference threshold, the pixel is determined to be a boundary pixel. The set of boundary pixels is the skyline.

6. The skyline analysis method based on three-dimensional graphics simulation according to claim 5, characterized in that, The step of drawing the boundary information of the skyline also includes the following sub-steps: Calculate twice the weighted average of the transparency of the nine pixels in the 3x3 grid and assign it to the Alpha value.

7. The skyline analysis method based on three-dimensional graphics simulation according to claim 6, characterized in that, The step of drawing the boundary information of the skyline also includes the following sub-steps: The Alpha value is constrained to be between [0.0, 1.0].

8. A storage medium, characterized in that, The storage medium stores a program that, when executed by a processor, implements the steps of the skyline analysis method based on three-dimensional graphics simulation as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Skyline analysis method and device, equipment and storage medium

    CN119741275A

  • Skyline extraction method and system

    CN110807787A

  • Three-dimensional scene skyline rapid extraction method and system, storage medium and equipment

    CN115345896A