A multi-view visual range measurement method and system based on Cesium

Through the multi-view visual field calculation method and system based on Cesium, GPU parallel processing and depth map calculation are used to solve the accuracy and efficiency problems in complex visual field analysis, and achieve fast and accurate visual field analysis, which is suitable for Multiple application areas.

CN119205482BActive Publication Date: 2025-02-25NANJING HYDRAULIC RES INST +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411690565.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-02-25
Estimated Expiration
2044-11-25

AI Technical Summary

Technical Problem

The prior art has shortcomings in dealing with complex vision areas composed of multiple viewpoints, and multi-point vision analysis requires improving the accuracy and efficiency of the algorithm, especially in three-dimensional scenarios.

Method used

Using Cesium-based multi-view visual field calculation method and system, the parallel processing capability of the graphics processing unit GPU is used to achieve fast and accurate visual field analysis by generating depth maps and calculating visual field indexes.

Benefits of technology

The calculation time of visual field analysis is greatly shortened, making real-time or near-real-time analysis possible, improving the accuracy and reliability of analysis results, and is suitable for areas such as urban planning, environmental assessment, tourism path planning and military goal positioning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119205482B_ABST
    Figure CN119205482B_ABST
Patent Text Reader

Abstract

The present invention discloses a multi-view visual area measurement method and system based on Cesium. The method comprises the following steps: firstly, the spatial coordinates and the number of observation points are set, and then the viewpoint layout is obtained according to user requirements. Then, a depth map is generated based on the spatial coordinates and the number of observation points and the viewpoint layout. Then, a visual area index is calculated for the depth map and the visual area index of each observation point is obtained. Then, the visual area index of each observation point is aggregated and the visual area measurement operation for the entire scene is completed. The present invention realizes a function of performing fast and accurate visual area analysis by utilizing the parallel processing capability of a graphics processing unit (GPU), and greatly shortens the calculation time of the visual area analysis by GPU acceleration based on a shadow map, thereby making real-time or near real-time analysis possible. Meanwhile, the application of multi-viewpoint analysis and cumulative visual area index improves the accuracy and reliability of the analysis result, and the method is suitable for being widely promoted and applied.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of viewshed calculation, and in particular to a multi-viewpoint viewshed calculation method and system based on Cesium. Background Art

[0002] Viewshed analysis plays a key role in geographic information systems (GIS). It quantitatively describes the area visible from one or more viewpoints, providing strong technical support for spatial cognition research. With the rapid advancement of geographic information and computer technology, the processing of three-dimensional visibility issues has become increasingly common. Modern viewshed analysis can not only quantitatively evaluate the visibility of the landscape, but also clearly reveal the three-dimensional spatial structure and geographic information. It is widely used in urban planning, environmental assessment, site selection analysis, tourism route planning, military positioning and other fields.

[0003] At present, viewpoint analysis still has shortcomings in dealing with complex views composed of multiple viewpoints, and multi-point viewpoint analysis combines multiple views to obtain a wider visible area, which puts higher requirements on the accuracy and efficiency of the algorithm. In order to improve the efficiency of the algorithm, existing methods have proposed a variety of optimization strategies including improving the view combination method and calculating the candidate viewpoint view in blocks; however, multi-viewpoint analysis in three-dimensional scenes is still a challenge, which requires considering a variety of visual situations in complex areas formed by multiple viewpoints; therefore, it is necessary to design a multi-viewpoint viewpoint measurement method and system based on Cesium. Summary of the invention

[0004] The purpose of the present invention is to overcome the deficiencies of the prior art, in order to better and effectively solve the current viewpoint analysis still has deficiencies in processing complex view areas composed of multiple viewpoints, and multi-point view area analysis combines multiple view areas to obtain a wider visible area, which puts higher requirements on the accuracy and efficiency of the algorithm, and in order to improve the efficiency of the algorithm, the existing method proposes a variety of optimization strategies including improving the view area combination method and calculating the candidate view area in blocks; however, multi-view area analysis in a three-dimensional scene is still a challenge, which requires consideration of the problem of multiple visual situations in a complex area formed by multiple viewpoints, and provides a multi-view view area measurement method and system based on Cesium, which realizes the function of fast and accurate view area analysis with the parallel processing capability of a graphics processing unit GPU, and greatly shortens the calculation time of the view area analysis through GPU acceleration based on shadow maps, thereby making real-time or near real-time analysis possible, and at the same time, the application of multi-view point analysis and cumulative view area index improves the accuracy and reliability of the analysis results.

[0005] In order to achieve the above object, the technical solution adopted by the present invention is:

[0006] A multi-view visual range measurement method and system based on Cesium, comprising the following steps:

[0007] Step A, setting the spatial coordinates and number of observation points, and then obtaining the viewpoint layout according to user needs;

[0008] Step B, generating a depth map based on the spatial coordinates and number of observation points and the viewpoint layout;

[0009] Step C, calculate the view index of the depth map and obtain the view index of each observation point, then aggregate the view index of each observation point and complete the view measurement of the entire scene.

[0010] The aforementioned multi-view visual domain measurement method based on Cesium, step A, sets the spatial coordinates and number of observation points, and then obtains the viewpoint layout according to user needs, which specifically includes setting observation points, setting field of view parameters, initializing the GPU computing environment, calculating the field of view range, loading the scene building model and verifying the adjustment parameters.

[0011] The specific steps of step A of the aforementioned multi-view visual range measurement method based on Cesium are as follows:

[0012] Step A1, setting the observation point, specifically, using the Cartesian coordinate system (x, y, z) in the three-dimensional geographic information system GIS to set the position of the observation point and obtain the position of each viewpoint in the virtual scene, then constructing the viewpoint data structure and encapsulating the spatial coordinates, field of view parameters and computing resource pointer of the viewpoint;

[0013] Step A2, setting the field of view parameters, the specific steps are as follows:

[0014] Step A21, setting the field of view parameters for each observation point, wherein the field of view parameters include the horizontal field of view angle, the vertical field of view angle and the visible distance, wherein the horizontal field of view angle and the vertical field of view angle are used to define the maximum range that the observation point can observe, and the visible distance is used to define the farthest distance that the observation point can observe.

[0015] Step A22, set the coordinates (x, y, z) of the observation point O in the world coordinate system, the field of view radius r of the observation point O, and the height angle of the observer The radian angle from the observer , then take the observation point O as the origin and establish a local coordinate system, and then calculate the coordinates of the four vertices of the bottom surface of the cone in the local coordinate system , , and ;

[0016] Step A23, setting the horizontal and vertical viewing angles of each observation point, and then setting the opening size of the viewing cone, and then setting the maximum viewing distance of the observation point, and using the maximum viewing distance of the observation point as the viewing distance threshold, and then using the viewing distance threshold to limit the spatial range of the visual field analysis;

[0017] Step A3, initializing the GPU computing environment, specifically using the parallel computing capability of the GPU to initialize the GPU computing environment, the GPU computing environment includes computing resource allocation and shader program initialization, the computing resource allocation specifically allocates video memory and computing units on the graphics processing unit GPU, the shader program initialization specifically loads vertex shader and fragment shader programs;

[0018] Step A4, loading a scene building model, specifically loading 3D scene data including the building model, then indexing, simplifying and hierarchical detail management of the building model, and then dynamically adjusting the geometric details of the model according to the distance between the viewpoint and the model;

[0019] Step A5, calculate the field of view, specifically, based on the position of the observation point and the field of view parameters, draw a cone field of view in the local coordinate system with O, A, B, C and D as vertices , and then use matrix calculation to transform the view frustum from the local coordinate system of the observation point to the world coordinate system , as shown in formula (1),

[0020] (1);

[0021] Step A6, verifying and adjusting parameters, specifically adjusting the position of the observation point, the viewing angle, and the viewing distance according to the analysis requirements and scene characteristics.

[0022] The aforementioned multi-view visual range measurement method based on Cesium, step B, generates a depth map based on the spatial coordinates and number of observation points and the viewpoint layout, specifically including constructing a transformation frustum and generating a depth map. The specific steps are as follows:

[0023] Step B1, construct the transformation frustum, specifically according to the number of observation points N obtained, each observation point O i (x i ,y i , z i )、The center point of the field of view O i ´(x i ´,y i ´, z i ´), radian angle And the field of view in the world coordinate system Construct a viewing cone, the vertex of which is located at the observation point, and the bottom of which covers the field of view of the observation point. The specific steps are as follows:

[0024] Step B11, using a perspective projection matrix to transform the view frustum from the local coordinate system of the observation point to the world coordinate system according to the viewing angle and position of the observation point, and then creating a two-dimensional texture for each observation point, wherein the two-dimensional texture is used to store the shadow mapping of the point;

[0025] Step B12, at observation point O i Set the spotlight source point spotLighti at the location and set the cone angle of the spotlight source point to , and then calculate the light direction , thereby determining the distance from the observation point to the center point of the field of view O i A vector of

[0026] Step B13, based on the field of view of the i-th observation point The five vertices of the cone are used to construct the bounding box, and then the model transformation matrix is ​​used , projection transformation matrix and the viewport transformation matrix The screen coordinates of the building model Convert to world coordinates , as shown in formula (2),

[0027] (2);

[0028] Step B2, generating a depth map, specifically using the parallel rendering capability of the GPU to generate a depth map for each observation point, the depth map stores the shortest distance from the observation point to each visible point in the scene, the specific steps are as follows,

[0029] Step B21, render the four sides and one top of the frustum into the depth map respectively, and then use the depth test to determine the depth value of each pixel, where the vertex shader is used to process the transformation of the frustum vertices, and the fragment shader is used to calculate the depth value and update the depth map. Specifically, the world coordinates are converted to Input the vertex shader stage in the GPU shading pipeline, and then use the ray intersection method to determine whether the sampling point is within the field of view formed by the observation point. If the sampling point is within the range, the sampling point is stored in , and calculate the world coordinates of the vertices within the field of view Corresponding texture coordinates , as shown in formula (3),

[0030] (3)

[0031] in, and They are the observation matrix and projection matrix in the observation point coordinate system respectively;

[0032] Step B22, translate and scale the texture coordinates so that the texture coordinates can adapt to the standard range [0, 1] of the depth map texture value, and then Input GPU fragment shader to generate scene depth map in light source coordinate system , output the depth map of each observation point and the corresponding texture coordinates ).

[0033] The aforementioned multi-viewpoint visible area measurement method based on Cesium, step C, calculates the visible area index of the depth map and obtains the visible area index of each observation point, then aggregates the visible area index of each observation point and completes the visible area measurement operation of the entire scene, specifically including extracting and comparing depth values, calculating the visible area index, aggregating the cumulative visible area index and outputting the visible area measurement result.

[0034] The specific steps of step C of the aforementioned multi-view visual range measurement method based on Cesium are as follows:

[0035] Step C1, extracting and comparing depth values, specifically, comparing the depth value of each pixel in the depth map with the expected depth value of the corresponding point in the scene to determine whether the sampling point is in a visible state. The specific steps are as follows:

[0036] Step C11, solve the depth map for N observation points [i] and ), and then access it in the GPU's fragment shader [i] and calculate [i] The scene depth value in the light source coordinate system corresponding to each sampling point [i], as shown in formula (4),

[0037] (4)

[0038] in, is a function that samples pixel values ​​from a two-dimensional texture according to a given UV coordinate;

[0039] Step C12, calculate the depth value of the sampling point in normal scene rendering, and then Take the third component from the texture coordinates , the third component The depth value obtained for the second depth rendering, then compare the depth map information and calculate the visible index of each independent view, and then compare and Determine whether the sampling point is visible and establish a visibility index Record the visibility of each sampling point, if visible, it is recorded as 1, if not visible, it is recorded as 0;

[0040] Step C2, calculate the visual area index, specifically, calculate the visual area index of each observation point using the comparison result of the depth value, the visual area index is used to describe the visibility from a specific observation point to each sampling point in the scene, and by comparing and Determine whether the sampling point is visible to establish a binary visibility index , and record the visibility of each sampling point. If the sampling point is visible, the visibility index of the sampling point is 1. If the sampling point is not visible, the visibility index of the sampling point is 0, as shown in formula (5).

[0041] (5);

[0042] Step C3, aggregate the cumulative viewshed index, specifically, combine the viewshed indexes of multiple observation points into one cumulative viewshed index , as shown in formula (6),

[0043] (6);

[0044] Step C4: Output the visual area measurement result, specifically using the obtained cumulative visual area index The visual level of the area within the field of view is divided, and then the color of the screen pixels in the area is set according to different level division standards and converted into the visual domain measurement result. The specific steps are as follows:

[0045] Step C41, divide the area into three visible levels, where the completely invisible area is marked in red, the partially visible area is marked in blue, and the completely visible area is marked in green, and the transparency of the color is set to 0.7, as shown in formula (7),

[0046] (7)

[0047] in, is the regional RGB value;

[0048] Step C42, divide the area into two visible levels, wherein the completely invisible area is marked in red and the visible area is marked in green, and the transparency of the color is set to 0.7, as shown in formula (8),

[0049] (8).

[0050] A multi-viewpoint visible area measurement system based on Cesium, comprising a viewpoint layout acquisition module, a depth map generation module and a visible area index calculation module, wherein the viewpoint layout acquisition module is used to set the spatial coordinates and number of observation points, and then obtain the viewpoint layout according to user requirements; the depth map generation module is used to generate a depth map based on the spatial coordinates and number of observation points and the viewpoint layout; the visible area index calculation module is used to calculate the visible area index of the depth map and obtain the visible area index of each observation point, and then aggregate the visible area index of each observation point to complete the visible area measurement operation of the entire scene.

[0051] The aforementioned multi-viewpoint visible area measurement system based on Cesium, the specific acquisition process of the viewpoint layout acquisition module includes setting the observation point, setting the field of view parameters, initializing the GPU computing environment, calculating the field of view range, loading the scene building model and verifying the adjustment parameters.

[0052] In the aforementioned multi-view visual range measurement system based on Cesium, the specific generation process of the depth map generation module includes constructing a transformation frustum and generating a depth map.

[0053] In the aforementioned multi-viewpoint visible area measurement system based on Cesium, the specific calculation process of the visible area index calculation module includes extracting and comparing depth values, calculating the visible area index, aggregating the cumulative visible area index and outputting the visible area measurement result.

[0054] The beneficial effects of the present invention are as follows: a multi-view visual area measurement method and system based on Cesium of the present invention first sets the spatial coordinates and number of observation points, then obtains the viewpoint layout according to user needs, then generates a depth map based on the spatial coordinates and number of observation points and the viewpoint layout, then calculates the visual area index of the depth map and obtains the visual area index of each observation point, and then aggregates the visual area index of each observation point to complete the visual area measurement operation of the entire scene; effectively realizes that the measurement method and system have the function of using the parallel processing capability of a graphics processing unit GPU to perform fast and accurate visual area analysis, and greatly shortens the calculation time of the visual area analysis through GPU acceleration based on shadow maps, thereby making real-time or near real-time analysis possible, and at the same time, the application of multi-viewpoint analysis and cumulative visual area index improves the accuracy and reliability of the analysis results, which is not only suitable for urban planning and environmental assessment, but also can be extended to the fields of tourism route planning and military target positioning, so that by combining GPU parallel computing and modern GIS technology, efficient, accurate and intuitive multi-point visual area analysis is achieved, which has broad application prospects and significant practical value. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 It is a flow chart of a multi-viewpoint visual range measurement method based on Cesium of the present invention. DETAILED DESCRIPTION

[0056] The present invention will be further described below in conjunction with the accompanying drawings.

[0057] like Figure 1 As shown, a multi-view visual range measurement method and system based on Cesium of the present invention comprises the following steps:

[0058] Step A, set the spatial coordinates and number of observation points, and then get the viewpoint layout according to user needs, which specifically includes setting observation points, setting field of view parameters, initializing the GPU computing environment, calculating the field of view range, loading the scene building model and verifying the adjustment parameters. The specific steps are as follows:

[0059] Step A1, setting the observation point, specifically, using the Cartesian coordinate system (x, y, z) in the three-dimensional geographic information system GIS to set the position of the observation point and obtain the position of each viewpoint in the virtual scene, then constructing the viewpoint data structure and encapsulating the spatial coordinates, field of view parameters and computing resource pointer of the viewpoint;

[0060] Step A2, setting the field of view parameters, the specific steps are as follows:

[0061] Step A21, setting the field of view parameters for each observation point, wherein the field of view parameters include the horizontal field of view angle, the vertical field of view angle and the visible distance, wherein the horizontal field of view angle and the vertical field of view angle are used to define the maximum range that the observation point can observe, and the visible distance is used to define the farthest distance that the observation point can observe.

[0062] Step A22, set the coordinates (x, y, z) of the observation point O in the world coordinate system, the field of view radius r of the observation point O, and the height angle of the observer The radian angle from the observer , then take the observation point O as the origin and establish a local coordinate system, and then calculate the coordinates of the four vertices of the bottom surface of the cone in the local coordinate system , , and ;

[0063] Step A23, setting the horizontal and vertical viewing angles of each observation point, and then setting the opening size of the viewing cone, and then setting the maximum viewing distance of the observation point, and using the maximum viewing distance of the observation point as the viewing distance threshold, and then using the viewing distance threshold to limit the spatial range of the visual field analysis;

[0064] Step A3, initializing the GPU computing environment, specifically using the parallel computing capability of the GPU to initialize the GPU computing environment, the GPU computing environment includes computing resource allocation and shader program initialization, the computing resource allocation specifically allocates video memory and computing units on the graphics processing unit GPU, the shader program initialization specifically loads vertex shader and fragment shader programs;

[0065] Step A4, loading a scene building model, specifically loading 3D scene data including the building model, then indexing, simplifying and hierarchical detail management of the building model, and then dynamically adjusting the geometric details of the model according to the distance between the viewpoint and the model;

[0066] Step A5, calculate the field of view, specifically, based on the position of the observation point and the field of view parameters, draw a cone field of view in the local coordinate system with O, A, B, C and D as vertices , and then use matrix calculation to transform the view frustum from the local coordinate system of the observation point to the world coordinate system , as shown in formula (1),

[0067] (1);

[0068] Step A6, verifying and adjusting parameters, specifically adjusting the position of the observation point, the viewing angle, and the viewing distance according to the analysis requirements and scene characteristics.

[0069] Step B, generating a depth map based on the spatial coordinates and number of observation points and the viewpoint layout, specifically includes constructing a transformation frustum and generating a depth map. The specific steps are as follows:

[0070] Step B1, construct the transformation frustum, specifically according to the number of observation points N obtained, each observation point O i (x i ,y i , z i )、The center point of the field of view O i ´(x i ´,y i ´, z i ´), radian angle And the field of view in the world coordinate system Construct a viewing cone, the vertex of which is located at the observation point, and the bottom of which covers the field of view of the observation point. The specific steps are as follows:

[0071] Step B11, using a perspective projection matrix to transform the view frustum from the local coordinate system of the observation point to the world coordinate system according to the viewing angle and position of the observation point, and then creating a two-dimensional texture for each observation point, wherein the two-dimensional texture is used to store the shadow mapping of the point;

[0072] Step B12, at observation point O i Set the spotlight source point spotLighti at the location and set the cone angle of the spotlight source point to , and then calculate the light direction , thereby determining the distance from the observation point to the center point of the field of view O i A vector of

[0073] Step B13, based on the field of view of the i-th observation point The five vertices of the cone are used to construct the bounding box, and then the model transformation matrix is ​​used , projection transformation matrix and the viewport transformation matrix The screen coordinates of the building model Convert to world coordinates , as shown in formula (2),

[0074] (2);

[0075] Step B2, generating a depth map, specifically using the parallel rendering capability of the GPU to generate a depth map for each observation point, the depth map stores the shortest distance from the observation point to each visible point in the scene, the specific steps are as follows,

[0076] Step B21, render the four sides and one top of the frustum into the depth map respectively, and then use the depth test to determine the depth value of each pixel, where the vertex shader is used to process the transformation of the frustum vertices, and the fragment shader is used to calculate the depth value and update the depth map. Specifically, the world coordinates are converted to Input the vertex shader stage in the GPU shading pipeline, and then use the ray intersection method to determine whether the sampling point is within the field of view formed by the observation point. If the sampling point is within the range, the sampling point is stored in , and calculate the world coordinates of the vertices within the field of view Corresponding texture coordinates , as shown in formula (3),

[0077] (3)

[0078] in, and They are the observation matrix and projection matrix in the observation point coordinate system respectively;

[0079] Step B22, translate and scale the texture coordinates so that the texture coordinates can adapt to the standard range [0, 1] of the depth map texture value, and then Input GPU fragment shader to generate scene depth map in light source coordinate system , output the depth map of each observation point and the corresponding texture coordinates ).

[0080] Step C, calculate the viewshed index of the depth map and obtain the viewshed index of each observation point, then aggregate the viewshed index of each observation point and complete the viewshed measurement operation of the entire scene, which specifically includes extracting and comparing depth values, calculating the viewshed index, aggregating the cumulative viewshed index and outputting the viewshed measurement result. The specific steps are as follows:

[0081] Step C1, extracting and comparing depth values, specifically, comparing the depth value of each pixel in the depth map with the expected depth value of the corresponding point in the scene to determine whether the sampling point is in a visible state. The specific steps are as follows:

[0082] Step C11, solve the depth map for N observation points [i] and ), and then access it in the GPU's fragment shader [i] and calculate [i] The scene depth value in the light source coordinate system corresponding to each sampling point [i], as shown in formula (4),

[0083] (4)

[0084] in, is a function that samples pixel values ​​from a two-dimensional texture according to a given UV coordinate;

[0085] Step C12, calculate the depth value of the sampling point in normal scene rendering, and then Take the third component from the texture coordinates , the third component The depth value obtained for the second depth rendering, then compare the depth map information and calculate the visible index of each independent view, and then compare and Determine whether the sampling point is visible and establish a visibility index Record the visibility of each sampling point, if visible, it is recorded as 1, if not visible, it is recorded as 0;

[0086] Step C2, calculate the visual area index, specifically, calculate the visual area index of each observation point using the comparison result of the depth value, the visual area index is used to describe the visibility from a specific observation point to each sampling point in the scene, and by comparing and Determine whether the sampling point is visible to establish a binary visibility index , and record the visibility of each sampling point. If the sampling point is visible, the visibility index of the sampling point is 1. If the sampling point is not visible, the visibility index of the sampling point is 0, as shown in formula (5).

[0087] (5);

[0088] Step C3, aggregate the cumulative viewshed index, specifically, combine the viewshed indexes of multiple observation points into one cumulative viewshed index , as shown in formula (6),

[0089] (6);

[0090] Step C4: Output the visual area measurement result, specifically using the obtained cumulative visual area index The visual level of the area within the field of view is divided, and then the color of the screen pixels in the area is set according to different level division standards and converted into the visual domain measurement result. The specific steps are as follows:

[0091] Step C41, divide the area into three visible levels, where the completely invisible area is marked in red, the partially visible area is marked in blue, and the completely visible area is marked in green, and the transparency of the color is set to 0.7, as shown in formula (7),

[0092] (7)

[0093] in, is the regional RGB value;

[0094] Step C42, divide the area into two visible levels, wherein the completely invisible area is marked in red and the visible area is marked in green, and the transparency of the color is set to 0.7, as shown in formula (8),

[0095] (8).

[0096] A multi-viewpoint visible area measurement system based on Cesium, comprising a viewpoint layout acquisition module, a depth map generation module and a visible area index calculation module, wherein the viewpoint layout acquisition module is used to set the spatial coordinates and number of observation points, and then obtain the viewpoint layout according to user requirements; the depth map generation module is used to generate a depth map based on the spatial coordinates and number of observation points and the viewpoint layout; the visible area index calculation module is used to calculate the visible area index of the depth map and obtain the visible area index of each observation point, and then aggregate the visible area index of each observation point to complete the visible area measurement operation of the entire scene.

[0097] Specifically, the viewpoint layout acquisition module includes setting the observation point, setting the field of view parameters, initializing the GPU computing environment, calculating the field of view range, loading the scene building model and verifying the adjustment parameters.

[0098] Specifically, the specific generation process of the depth map generation module includes constructing a transformation frustum and generating a depth map.

[0099] Specifically, the specific calculation process of the visible area index calculation module includes extracting and comparing depth values, calculating the visible area index, aggregating the cumulative visible area index and outputting the visible area measurement result.

[0100] In summary, the present invention provides a multi-view visual area measurement method and system based on Cesium, firstly sets the spatial coordinates and number of observation points, then obtains the viewpoint layout according to user needs, then generates a depth map based on the spatial coordinates and number of observation points and the viewpoint layout, then calculates the visual area index of the depth map and obtains the visual area index of each observation point, and then aggregates the visual area index of each observation point to complete the visual area measurement operation of the entire scene; effectively realizes that the measurement method and system have the function of using the parallel processing capability of the graphics processing unit GPU to perform fast and accurate visual area analysis, and greatly shortens the calculation time of the visual area analysis through GPU acceleration based on shadow map, thereby making real-time or near real-time analysis possible, and at the same time, the application of multi-viewpoint analysis and cumulative visual area index improves the accuracy and reliability of the analysis results, which is not only suitable for urban planning and environmental assessment, but also can be extended to the fields of tourism route planning and military target positioning, so that by combining GPU parallel computing and modern GIS technology, efficient, accurate and intuitive multi-point visual area analysis is achieved, which has broad application prospects and significant practical value.

[0101] The above shows and describes the basic principles, main features and advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.

Claims

1. A multi-view visual range measurement method based on Cesium, characterized by: The following steps are included: Step A, setting the spatial coordinates and number of observation points, and then obtaining the viewpoint layout according to user needs; Step B, generating a depth map based on the spatial coordinates and number of observation points and the viewpoint layout, specifically includes constructing a transformation frustum and generating a depth map. The specific steps are as follows: Step B1, construct the transformation frustum, specifically according to the number of observation points N obtained, each observation point O i (x i ,y i , z i ), the center point of the field of view O i ′(x i ′,y i ′,z i ′), radian angle rad and field of view V in the world coordinate system i-world Construct a viewing cone, the vertex of which is located at the observation point, and the bottom of which covers the field of view of the observation point. The specific steps are as follows: Step B11, using a perspective projection matrix to transform the view frustum from the local coordinate system of the observation point to the world coordinate system according to the viewing angle and position of the observation point, and then creating a two-dimensional texture for each observation point, wherein the two-dimensional texture is used to store the shadow mapping of the point; Step B12, at observation point O i Set the spotlight source point spotLighti at the position and set the cone angle of the spotlight source point to rad, and then calculate the lighting direction Thus, the distance from the observation point to the center point of the field of view O is determined. i A vector of Step B13, based on the field of view V of the i-th observation point i-world The five vertices of the cone are used to construct the bounding box, and then the model transformation matrix M is used i-View , projection transformation matrix M i-Proj and the viewport transformation matrix M i-Win Set the screen coordinates V of the building model i-screen Convert to world coordinates V i-world , as shown in formula (2), In i-world =(M i-View ×M i-Proj ×M i-Win ) -1 ×V i-screen (2); Step B2, generating a depth map, specifically using the parallel rendering capability of the GPU to generate a depth map for each observation point, the depth map stores the shortest distance from the observation point to each visible point in the scene, the specific steps are as follows, Step B21, render the four sides and one top surface of the frustum into the depth map respectively, and then use the depth test to determine the depth value of each pixel. The vertex shader is used to process the transformation of the frustum vertices, and the fragment shader is used to calculate the depth value and update the depth map. Specifically, the world coordinate V i-world Input the vertex shader stage in the GPU shading pipeline, and then use the ray intersection method to determine whether the sampling point is within the field of view formed by the observation point. If the sampling point is within the range, the sampling point is stored in V i-worldinView , and calculate the world coordinates V of the vertices within the field of view i-inView The corresponding texture coordinate V i-tex , as shown in formula (3), Among them, M ObserView and M ObserProj They are the observation matrix and projection matrix in the observation point coordinate system respectively; Step B22, translate and scale the texture coordinates so that the texture coordinates can adapt to the standard range [0, 1] of the depth map texture value, and then convert the obtained texture coordinates V i-tex Input the GPU fragment shader to generate the scene depth map depthmap[i] in the light source coordinate system, and output the depth map depthmap[i] and the corresponding texture coordinates V of each observation point i-tex ; Step C, calculate the viewshed index of the depth map and obtain the viewshed index of each observation point, then aggregate the viewshed index of each observation point and complete the viewshed measurement operation of the entire scene, which specifically includes extracting and comparing depth values, calculating the viewshed index, aggregating the cumulative viewshed index and outputting the viewshed measurement result. The specific steps are as follows: Step C1, extracting and comparing depth values, specifically, comparing the depth value of each pixel in the depth map with the expected depth value of the corresponding point in the scene to determine whether the sampling point is in a visible state. The specific steps are as follows: Step C11, solve the depth map depthmap[i] and V for N observation points i-tex , then access shadowmap[i] in the GPU fragment shader and calculate the scene depth value Depth[i] in the light source coordinate system corresponding to each sampling point of depthmap[i], as shown in formula (4), Depth[i]=texture2D(depthmap[i],V i-tex )r (4) Where texture2D is a function that samples pixel values ​​from a two-dimensional texture according to a given UV coordinate; Step C12, calculate the depth value of the sampling point in normal scene rendering, and then i-tex Take the third component V from the texture coordinates tex[i] .z, the third component V tex[i] .z is the depth value obtained by the second depth rendering. Then, the depth map information is compared and the visual index of each independent view is calculated. Then, V tex[i] .z and Depth[i] determine whether the sampling point is visible and establish a visible index visibleIndex to record the visibility of each sampling point. If it is visible, it is recorded as 1, and if it is not visible, it is recorded as 0; Step C2, calculate the visual area index, specifically, calculate the visual area index of each observation point using the comparison result of the depth value, the visual area index is used to describe the visibility from the observation point to each sampling point in the scene, and by comparing V tex[i] .z and Depth[i] determine whether the sampling point is visible, thereby establishing a binary visible index visibleIndex, and recording the visibility of each sampling point. If the sampling point is visible, the visible index of the sampling point is 1; if the sampling point is not visible, the visible index of the sampling point is 0, as shown in formula (5). Step C3, aggregate the cumulative viewshed index, specifically, combine the viewshed indexes of multiple observation points into a cumulative viewshed index totalVisible, as shown in formula (6): totalVisible=sum(visibleIndex[i])i∈[1,N](6); Step C4, outputting the visual area measurement result, specifically, using the obtained cumulative visual area index totalVisible to divide the regional visual level within the visual field, and then setting the color of the screen pixels in the area according to different level division standards and converting it into the visual area measurement result. The specific steps are as follows: Step C41, divide the area into three visible levels, where the completely invisible area is marked in red, the partially visible area is marked in blue, and the completely visible area is marked in green, and the transparency of the color is set to 0.7, as shown in formula (7), Among them, out_FragColor.rgba is the regional RGB value; Step C42, divide the area into two visible levels, wherein the completely invisible area is marked in red and the visible area is marked in green, and the transparency of the color is set to 0.7, as shown in formula (8), 2. According to the Cesium-based multi-view visual range measurement method of claim 1, it is characterized by: Step A, setting the spatial coordinates and number of observation points, and then obtaining the viewpoint layout according to user needs, specifically includes setting observation points, setting field of view parameters, initializing the GPU computing environment, calculating the field of view range, loading the scene building model and verifying the adjustment parameters.

3. According to the Cesium-based multi-view visual range measurement method of claim 2, it is characterized by: The specific steps of step A are as follows: Step A1, setting the observation point, specifically, using the Cartesian coordinate system (x, y, z) in the three-dimensional geographic information system GIS to set the position of the observation point and obtain the position of each viewpoint in the virtual scene, then constructing the viewpoint data structure and encapsulating the spatial coordinates, field of view parameters and computing resource pointer of the viewpoint; Step A2, setting the field of view parameters, the specific steps are as follows: Step A21, setting the field of view parameters for each observation point, wherein the field of view parameters include the horizontal field of view angle, the vertical field of view angle and the visible distance, wherein the horizontal field of view angle and the vertical field of view angle are used to define the maximum range that the observation point can observe, and the visible distance is used to define the farthest distance that the observation point can observe. Step A22, set the coordinates (x, y, z) of the observation point O in the world coordinate system, the field of view radius r of the observation point O, the observer's altitude angle elev and the observer's radian angle rad, then use the observation point O as the origin and establish a local coordinate system, and then calculate the coordinates of the four vertices of the bottom surface of the viewing cone in the local coordinate system and Step A23, setting the horizontal and vertical viewing angles of each observation point, and then setting the opening size of the viewing cone, and then setting the maximum viewing distance of the observation point, and using the maximum viewing distance of the observation point as the viewing distance threshold, and then using the viewing distance threshold to limit the spatial range of the visual field analysis; Step A3, initializing the GPU computing environment, specifically using the parallel computing capability of the GPU to initialize the GPU computing environment, the GPU computing environment includes computing resource allocation and shader program initialization, the computing resource allocation specifically allocates video memory and computing units on the graphics processing unit GPU, the shader program initialization specifically loads vertex shader and fragment shader programs; Step A4, loading a scene building model, specifically loading 3D scene data including the building model, then indexing, simplifying and hierarchical detail management of the building model, and then dynamically adjusting the geometric details of the model according to the distance between the viewpoint and the model; Step A5, calculating the field of view, specifically, drawing a cone field of view V in the local coordinate system based on the position of the observation point and the field of view parameters and taking O, A, B, C and D as vertices local , and then use matrix calculation to transform the view frustum from the local coordinate system of the observation point to the world coordinate system V world , as shown in formula (1), Step A6, verifying and adjusting parameters, specifically adjusting the position of the observation point, the viewing angle, and the viewing distance according to the analysis requirements and scene characteristics.

4. A multi-view visual range calculation system based on Cesium, wherein the calculation process of the multi-view visual range calculation system is based on the multi-view visual range calculation method according to any one of claims 1 to 3, characterized in that: It includes a viewpoint layout acquisition module, a depth map generation module and a visual field index calculation module. The viewpoint layout acquisition module is used to set the spatial coordinates and number of observation points, and then obtain the viewpoint layout according to user needs; The depth map generation module is used to generate a depth map based on the spatial coordinates and number of observation points and the viewpoint layout; The visible area index calculation module is used to calculate the visible area index of the depth map and obtain the visible area index of each observation point, and then aggregate the visible area index of each observation point to complete the visible area measurement operation of the entire scene.

5. According to claim 4, a multi-view visual range measurement system based on Cesium is characterized in that: The specific acquisition process of the viewpoint layout acquisition module includes setting the observation point, setting the field of view parameters, initializing the GPU computing environment, calculating the field of view range, loading the scene building model and verifying the adjustment parameters.

6. According to claim 4, a multi-view visual range measurement system based on Cesium is characterized in that: The specific generation process of the depth map generation module includes constructing a transformation frustum and generating a depth map.

7. According to claim 4, a multi-view visual range measurement system based on Cesium is characterized in that: The specific calculation process of the visible area index calculation module includes extracting and comparing depth values, calculating the visible area index, aggregating the cumulative visible area index and outputting the visible area measurement result.

Citation Information

Patent Citations

  • Visual range analysis method and device based on WebGIS

    CN111325783A

  • Method for realizing visible range analysis in WebGL (Web Graphics Library)

    CN114494561A