Multi-view visual field measuring and calculating method and system based on Cesium
The multi-view visual range measurement method and system on Cesium uses GPU parallel processing to generate depth maps and calculate visibility indices, addressing the challenges of multi-viewpoint analysis in complex three-dimensional scenes, achieving fast and accurate results for urban and military applications.
Patent Information
- Application Number
- CN202411690565.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-11-25
AI Technical Summary
Existing multi-viewpoint viewshed analysis in three-dimensional scenes faces challenges in accuracy and efficiency, particularly in complex areas with multiple viewpoints, necessitating improved algorithms for faster and more reliable visibility calculations.
A multi-view visual range measurement method and system based on Cesium, utilizing GPU parallel processing to generate depth maps and calculate visibility indices, enabling fast and accurate analysis through shadow maps, and incorporating cumulative view area indices for real-time results.
The method and system achieve real-time or near real-time multi-viewpoint visibility analysis with enhanced accuracy and reliability, suitable for urban planning, environmental assessment, tourism route planning, and military target positioning.
Smart Images

Figure CN119205482A_ABST
Abstract
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: A multi-view visual range measurement method and system based on Cesium, comprising the following steps: 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; 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.
[0006] 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.
[0007] The specific steps of step A of the aforementioned multi-view visual range measurement method based on Cesium 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, 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 ; 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, 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), (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.
[0008] 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: 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: 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 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 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), (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 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), (3) in, and 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 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 ).
[0009] 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.
[0010] The specific steps of step C of the aforementioned multi-view visual range measurement method based on Cesium 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, solving 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), (4) in, 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 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; 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). (5); 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), (6); 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: 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), (7) in, is the regional RGB value; Step C42, divide the area into two visible levels, where 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), (8).
[0011] 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.
[0012] 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.
[0013] 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.
[0014] 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.
[0015] 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
[0016] Figure 1 It is a flow chart of a multi-viewpoint visual range measurement method based on Cesium of the present invention. DETAILED DESCRIPTION
[0017] The present invention will be further described below in conjunction with the accompanying drawings.
[0018] 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: 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: 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, 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 ; 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, 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), (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.
[0019] 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 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: 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 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 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), (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 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), (3) in, and 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 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 ).
[0020] 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, solving 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), (4) in, 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 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; 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). (5); 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), (6); 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: 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), (7) in, is the regional RGB value; Step C42, divide the area into two visible levels, where 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), (8).
[0021] 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.
[0022] 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.
[0023] Specifically, the specific generation process of the depth map generation module includes constructing a transformation frustum and generating a depth map.
[0024] 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.
[0025] 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.
[0026] 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; 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.
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, 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 ; 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, 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), (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. According to claim 3, a multi-view visual range measurement method based on Cesium is characterized in that: 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 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: 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 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 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), (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 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 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), (3) in, and 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 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 ).
5. According to claim 4, a multi-view visual range measurement method based on Cesium is characterized in that: 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, which specifically includes extracting and comparing depth values, calculating the view index, aggregating the cumulative view index and outputting the view measurement result.
6. According to the Cesium-based multi-view visual range measurement method of claim 5, it is characterized by: The specific steps of step C 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, solving 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), (4) in, 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 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; 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). (5); 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), (6); 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: 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), (7) in, is the regional RGB value; Step C42, divide the area into two visible levels, where 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), (8)。 7. 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 6, 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.
8. The multi-view visual range measurement system based on Cesium according to claim 7, 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.
9. The multi-view visual range measurement system based on Cesium according to claim 7, characterized in that: The specific generation process of the depth map generation module includes constructing a transformation frustum and generating a depth map.
10. The multi-view visual range measurement system based on Cesium according to claim 7, 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
Three-dimensional scene rendering-based viewpoint-independent multi-channel video fusion method and system
CN117560578A
Polygonal visual field analysis method and device in Cesium three-dimensional scene and storage medium
CN117893702A
Method and apparatus for truncation and compensation
CN1504960A
Cited By
Method and device for searching window for specific landscape
CN120219636A
Method and apparatus for finding a window for a specific landscape
CN120219636B
