A method for multi-radar detection range visualization in space based on grid shader
Through a GPU mesh shader-based method, voxel mapping and optimization processing are used to solve the shortcomings of traditional radar detection range visualization methods in efficiency and accuracy, and realize efficient and accurate multi-radar detection range visualization.
Patent Information
- Application Number
- CN202411682698.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-10-14
- Estimated Expiration
- 2044-11-22
AI Technical Summary
Existing radar detection range visualization methods have deficiencies in efficiency and accuracy, especially when the detection ranges of multiple radars overlap. In addition, traditional methods cannot effectively express the detection probability distribution.
A GPU mesh shader-based method is adopted, which utilizes the voxel concept of volume rendering. Voxels are used as the task unit of the mesh shader. The radar detection range is calculated in parallel and rendered in the form of a point cloud. The voxels are mapped to a two-dimensional Boolean matrix through the mesh shader for optimization processing. The edge detail enhancement and neighboring voxel calculation are combined to improve the rendering efficiency and accuracy.
It achieves high-precision and high-efficiency multi-radar detection range drawing, can accurately express the detection probability distribution, and clearly express the detection range and intersection of each radar when the detection ranges of multiple radars overlap, improving drawing efficiency and visual effects.
Smart Images

Figure CN119693525B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer graphics and visualization, and in particular relates to a method for visualizing multiple radar detection ranges in space based on a grid shader. Background Art
[0002] Visualizing the detection ranges of multiple radars in space is a key technology in computer graphics and visualization. It helps operators clearly and intuitively understand the overall detection coverage of multiple radar deployments in real life, promptly identify blind spots, and assist in simulating the detection ranges of unbuilt radar stations, thus providing a basis for siting decisions for new radars.
[0003] Traditional radar detection range visualization methods mainly include patch-based rendering methods and volume rendering-based rendering methods, which can, to a certain extent, represent the detection range under multi-radar layout.
[0004] The patch-based rendering method calculates the concave hull of the radar detection probability range, then approximates the concave hull with a combination of multiple patches. This combination of patches is then rendered to represent the outer envelope of the radar's detection range. In practice, this method often randomly generates a discrete point cloud on a two-dimensional plane. The point set that will be detected by the radar is then probabilistically retained. The approximate concave hull polygon for this point set is then calculated. Finally, using methods such as the geometry shader on the GPU, the two-dimensional concave hull polygon is converted into a three-dimensional concave hull polyhedron for visualization of the radar detection range. The advantage of this method is its high rendering efficiency, requiring only a small number of patches to effectively represent the shape. However, its disadvantages are the lack of a description of the detection probability distribution within the envelope polyhedron and poor rendering quality when multiple radar detection ranges overlap.
[0005] The rendering method based on volume rendering is to generate a set of radar detection points on a two-dimensional plane, directly rotate it around the coordinate axis, and map it to a voxel in three-dimensional space: each voxel is a unit regular hexahedron in space. By recording whether the voxel contains a point detected by the radar, it is approximated to determine whether the voxel space range can be detected by the radar. During rendering, the voxel space is set to a certain transparency. The voxel group is traversed by the ray marching method, and the voxel color on the ray path is mixed, that is, the intensity information of the radar detection range on the ray path can be obtained. The results of a plurality of ray marching are integrated to obtain the visualization result of the entire radar detection range. The advantage of this method is that the intersection of multiple radars can be highlighted by marking the voxels with different colors, and the overall detection range under the layout of multiple radars can be more clearly presented, and the intensity of the radar detection can be revealed through the transparency. The disadvantage is that volume rendering will bring high performance overhead, causing frame freezing when the viewing angle changes; and the resolution of volume rendering is determined when the voxel group is calculated on the CPU, and there will be obvious square edges when zooming in for viewing, which is not aesthetic and has poor accuracy.
[0006] In recent years, a new rendering method based on GPU grid shader has begun to emerge in the field of visualization and rendering. As provided in the patent application with publication number CN115830201A, a clustering-based particle system optimization rendering method. In the traditional rendering pipeline, the vertex shader and the geometry shader are executed in units of vertices or primitives. This processing method does not fully utilize the rendering performance of the GPU when processing a large number of geometries. The grid shader method uses a task-based parallel processing model, which can subdivide a large geometry or scene into many small tasks, each containing a small amount of vertices and primitives. The GPU can process these small task units in parallel, and then combine them into the final large geometry or scene, thereby better utilizing the parallel computing power of the GPU and improving rendering efficiency.
[0007] One of the potential advantages of this new GPU rendering method is the use of grid shaders for efficient rendering of large-scale regular point clouds. Traditional point cloud rendering methods require pre-computing the positions of all points on the CPU and submitting them to the GPU for rendering. This method does not fully utilize the advantages of GPU parallel computing, but instead consumes more CPU-to-GPU communication bandwidth and GPU memory. When faced with large-scale point clouds, the efficiency is low. Using grid shaders can utilize the divide-and-conquer idea to distribute the calculation of regular point clouds to multiple small tasks and directly generate rendering data on the GPU for rendering. This "divide and conquer" idea not only improves efficiency, but also makes it possible to choose the rendering scale and accuracy of the point cloud in real time based on the camera state.
[0008] Based on the above technology, the application provides a multi-radar detection range visualization method based on a GPU grid shader and drawn in the form of a point cloud. SUMMARY
[0009] The application provides a multi-radar detection range visualization method in space using a GPU grid shader; a voxel is used as a task unit of the grid shader by using the voxel idea of volume rendering, and the radar detection range is calculated in parallel, and is drawn in the form of a point cloud instead of a ray step, so that multi-radar detection range drawing with high precision and high efficiency is realized.
[0010] The application adopts the following specific technical solutions:
[0011] A multi-radar detection range visualization method in space based on a grid shader, comprising:
[0012] Step (1), according to given radar parameters, a two-dimensional section of a probability detection range is calculated, an approximate concave hull of the section is calculated, and a two-dimensional Boolean matrix of the detection range is generated by using the concave hull;
[0013] Step (2), according to the camera distance, a suitable continuously changing LOD is selected for each radar in each frame, and a proper number of x*y*z grid shaders are dispatched;
[0014] Step (3), the task execution number (x, y, z) of each grid shader is mapped to a voxel in the radar space by using the grid shader; the voxel position is mapped to a two-dimensional Boolean matrix through projection transformation, and optimization processing is performed according to the radar detection range information in the matrix;
[0015] Step (4), according to the result of step (3), it is determined whether to draw the voxel as a basic unit of a point cloud, the coordinates of a proxy cube on a digital earth are calculated, and coloring is performed according to the radar number.
[0016] Preferably, in step (1), the concave hull range is converted into a 01 two-dimensional Boolean matrix represented by 0 and 1, and the observation camera position and the radar data are submitted to the GPU together for subsequent processing.
[0017] Further preferably, in the step (1), reading in radar parameter data, calculating radar detection range according to the set false alarm probability and detection probability, comprising: using the read-in radar parameters, combining environmental data and radar equation, calculating the propagation loss of radar detection at different altitudes to obtain the detection probability; then taking the radar as the coordinate origin, any horizontal direction as the positive direction of the x-axis, and vertically upward as the positive direction of the y-axis in the two-dimensional plane coordinate system, intercepting a two-dimensional section of the space where the radar is located; uniformly and densely setting sampling points on the section, calculating the detection probability of all sampling points, and thus obtaining the two-dimensional section of the radar detection range.
[0018] In step (1), the radar parameter data is read in, including the received power, antenna gain, wavelength, and reflection cross-sectional area.
[0019] In order to facilitate data storage and avoid repeated calculation each time, and also to support the drawing of the radar detection range in the form of a face sheet, the two-dimensional section of the radar detection range is converted into the form of a concave hull and a Boolean matrix and stored; further preferably, in the step (1), the method for calculating the approximate concave hull of the section and converting the data into a Boolean matrix is as follows:
[0020] The two-dimensional section of the detection range is taken as a point set, and the convex hull boundary is scanned and calculated; based on the convex hull boundary, the method of convex edge concave is used to find the nearest point in the non-boundary point set to the convex edge boundary point, and the nearest point set is stored; the nearest point set is de-duplicated and merged into the boundary point, and then all the boundary points are connected in order again; the above steps are repeated until the shortest side length of the concave hull is less than the tolerable range, and thus the approximate concave hull edge set of the section is obtained;
[0021] For the face sheet drawing of the approximate concave hull, the radar is taken as the coordinate origin, and the vertical direction is taken as the rotation axis. The concave hull edge set is rotated by 360 degrees, and the space swept by the rotation is the radar detection range. In order to improve efficiency, a geometry shader can be used to record the rotation process in actual drawing, and the boundary is rotated by a fixed step each time to obtain the new boundary position. Connecting the positions of the corresponding boundary in the rotation can obtain a simplified face sheet drawing model.
[0022] For the Boolean matrix of the radar detection range, each Boolean value in the matrix represents whether the place is within the two-dimensional section of the detection range, and the matrix is generated by traversing the sampling points. The size of the matrix transmitted to the GPU should be smaller than the size of the sampling points, and the size can be flexibly selected according to the specific drawing requirements.
[0023] For the data to be submitted to the GPU, including the above-mentioned detection range Boolean matrix, observation camera position, radar latitude and longitude position, and quantity information.
[0024] Preferably, in the step (2), the specific method for selecting the LOD is as follows:
[0025] According to the observation camera position and the radar group position, the distance between the radar group and the camera is calculated, and the size of the grid shader to be distributed and the size of each voxel representing the actual volume are calculated; the size of the grid shader (x, y, z) should be negatively correlated with the distance of the radar camera; the farther the distance, the smaller the size of the grid shader, and the larger the volume and the fewer the number of each voxel drawn, that is, the continuous change LOD effect is completed;
[0026] The LOD selection step is performed once for each radar in each frame, and the same radar uses the same level of LOD in the same frame, and different radars can use different levels of LOD.
[0027] Preferably, in the step (2), the specific method of distributing the grid shader of the plurality of radar groups is: according to the incoming radar number and position information, the position, color and distribution size of the grid shader of each group of radars are transmitted to the grid shader by using the payload mechanism of the task shader; according to the global radar group number, x*y*z grid shaders are respectively distributed in each group.
[0028] In a specific technical solution, according to the global radar group number, x*y*z grid shaders are respectively distributed in each group by using the EmitMeshTasksEXT function in the GL_EXT_mesh_shader extension. Among them, x, y, z are determined according to the selected LOD. For a fixed radar detection range size, the higher the LOD level, the larger the volume of each voxel, the fewer the number of voxels drawn, that is, the fewer the number of grid shaders allocated.
[0029] Preferably, the step (3) specifically includes:
[0030] Step (3.1), judging whether the corresponding numbered shader draws a voxel; linearly mapping the task number of the shader to a cube range to obtain the x, y, z coordinates of the shader in the cube; rotating the coordinates around the rotation axis passing through the radar and perpendicular to the ground to map them to a two-dimensional Boolean matrix plane, calculating the coordinates after mapping transformation, taking out the Boolean value of the coordinates in the two-dimensional Boolean matrix to judge whether to draw a voxel; each grid shader independently judges whether the corresponding voxel is drawn, and x*y*z grid shaders can respectively judge whether the corresponding voxel is drawn, and the combination obtains the whole radar detection range.
[0031] Step (3.2) calculates the voxel position and volume in radar space; inversely calculates the actual position of the voxel before scaling based on the scaling ratio of the radar information on each axis; scales the drawn voxels proportionally based on the size of the distributed mesh shader; uses the position of the voxel after texture filtering to form a cube with eight vertices and twelve triangular faces as a proxy expression for the voxel, forming a component of the point cloud; the length, width and height of the proxy cube need to be determined by the voxel volume calculated in the continuously changing LOD.
[0032] Since the voxel position in radar space is obtained by linear calculation, it is easy to have repeated texture patterns at certain viewing angles. Therefore, it is necessary to filter out repeated textures by adding a random perturbation of -0.5 to +0.5 voxel length to each dimension of the coordinate value of each voxel in radar space.
[0033] After determining the position of the voxel after texture filtering, a cube composed of eight vertices and twelve triangles is constructed as a proxy representation of the voxel, forming part of the point cloud. The length, width, and height of the proxy cube are determined by the voxel volume calculated in the continuously varying LOD. When using the neighboring voxel calculation method, a mesh shader may need to dispatch multiple such proxy cubes.
[0034] Preferably, the optimization process of step (3) includes:
[0035] Edge detail enhancement: Set a drawing scale factor, which roughly represents the proportion of drawn voxels to the total number of voxels; use the number (x, y, z) as a random seed in the mesh shader to generate a uniformly distributed random number in the range of 0-1; if the generated random number is less than the drawing scale factor, the voxel is drawn directly; otherwise, the voxel is determined to be at the boundary of the radar detection range by exploring whether the surrounding elements on the two-dimensional Boolean matrix are drawn. If the voxel is determined to be at the boundary, it is drawn; this can help concentrate most of the drawn voxels at the edge of the detection range, thereby improving the drawing accuracy of important parts.
[0036] Neighboring voxel calculation: Neighboring voxel calculation is to use one mesh shader to manage the drawing of multiple voxels, reduce the total number of mesh shaders, calculate the drawing status of multiple voxels in one mesh shader, and distribute the drawing information of multiple voxels to the downstream of the rendering pipeline, that is, use one mesh shader to replace the tasks previously completed by multiple mesh shaders to improve drawing efficiency.
[0037] In this invention, edge detail enhancement is a method that emphasizes the boundaries of the radar detection range and deemphasizes the internal space of the radar during rendering. Since users are more concerned about the detection boundaries when rendering the radar detection range, this method can specifically optimize the visual effect and reduce the rendering load.
[0038] The method of adjacent voxel calculation is adopted. In the foregoing method, the grid shader is in a one-to-one correspondence with the voxel. In actual operation, the operation performance of the grid shader method is related to the total number of distributed grid shaders and the drawing scale on a single shader. Too high or too low total number of grid shaders will reduce the performance, and too high drawing scale on a single shader will also reduce the performance. In this case, a large number of grid shaders need to be allocated for drawing the radar, but the drawing scale on each shader is small. Therefore, the performance bottleneck is the total number of grid shaders. Reducing the total number of grid shaders and correspondingly appropriately increasing the drawing scale on each shader can significantly improve the performance.
[0039] When the method of adjacent voxel calculation is adopted, a linear mapping relationship between a shader task number (x, y, z) and a plurality of voxels needs to be determined, and it is ensured that a voxel is not mapped to a plurality of different shaders for repeated calculation. After the mapping is completed, the coordinates on the two-dimensional Boolean matrix plane are still calculated according to the original method to determine whether to draw the voxel, and the primitive position and the number of distributed primitives are set according to the total number of voxels that need to be drawn.
[0040] Preferably, in the step (4), the method for calculating the drawing position of the radar is: converting the precision, latitude and altitude information in the radar coordinate information into (x, y, z) coordinates in the world space, and mapping the proxy cube coordinates distributed in the radar space in step (3) to the earth space according to the same mapping mode; performing matrix transformation on the proxy cube according to the camera position, orientation and perspective mode and the like information, and mapping to the corresponding position in the screen space.
[0041] Preferably, in the step (4), the background digital earth is drawn, and the radar point cloud is drawn to the corresponding position of the earth; different colors of proxy cubes are drawn according to different color information provided in a plurality of groups of shaders for different radars, so as to distinguish the detection ranges of different radars.
[0042] In the step (4), necessary post-processing can also be applied: for the drawn radar point cloud, noise reduction can be achieved by drawing the radar point cloud to the texture and then performing filtering post-processing on the texture. The filtering noise reduction can soften the sawtooth feeling of the radar detection range point cloud, so that the rendering effect is more beautiful.
[0043] The beneficial effects of the present application are:
[0044] 1) The present application can accurately express the detection probability distribution in the radar detection range, and can still accurately express the detection range and the staggered range of each radar when the detection ranges of multiple radars overlap. By using the edge detail enhancement algorithm, the drawing emphasis of each radar can be more clear, clear and beautiful, and a better visual effect than the traditional patch drawing method can be obtained.
[0045] 2) The GPU-based grid shader of the present application releases the CPU operation load. By using the adjacent voxel calculation method, the drawing efficiency of the radar is significantly improved, and the performance is better than the traditional volume rendering drawing method and the point cloud drawing method based on the vertex buffer, and the bandwidth and the video memory are saved.
[0046] 3) The task allocation and calculation of the present application are located on the GPU, which is more adaptable to other GPU Driven rendering pipelines, can freely modify and dispatch drawing information in the task shader stage, early eliminates the occluded voxels, and adaptively selects the continuously changing LOD without additional vertex data, has higher flexibility and stronger scalability. BRIEF DESCRIPTION OF DRAWINGS
[0047] Figure 1 A multi-radar detection range schematic diagram obtained by using a traditional patch drawing method;
[0048] Figure 2 A multi-radar detection range schematic diagram obtained by using a traditional volume rendering drawing method;
[0049] Figure 3 A multi-radar detection range schematic diagram provided by an embodiment of the present application;
[0050] Figure 4 A flowchart of the method of the present application. DETAILED DESCRIPTION
[0051] In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. However, it will be apparent to one skilled in the art that the present application can be practiced without the specific details given herein, and that the present application is not limited to the specific embodiments disclosed.
[0052] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, in which the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below are exemplary and are intended to explain the present application, and should not be understood as limiting the present application.
[0053] The method for visualizing multi-radar detection range in space based on a grid shader provided by the present application specifically comprises the following steps:
[0054] Step (1), according to given radar parameters, calculating the two-dimensional section of the probability detection range, calculating the approximate concave hull of the section, and generating a two-dimensional Boolean matrix of the detection range by using the concave hull;
[0055] Step (2), adaptively select a proper continuous change LOD for each radar in each frame according to the camera distance, and dispatch a proper number of x*y*z grid shaders;
[0056] Step (3), use the grid shader to map the task execution number (x, y, z) of each grid shader to a voxel in the radar space; map the voxel position to a two-dimensional Boolean matrix through a projection transformation, and perform optimization processing according to the radar detection range information in the matrix;
[0057] Step (4), according to the result of step (3), determine whether to draw the voxel as a basic unit of point cloud, calculate the coordinates of the proxy cube on the digital earth, and color according to the radar number.
[0058] Further combining with the accompanying drawings Figure 1-4 The method for visualizing the detection range of multiple radars in space using GPU grid shaders provided in the embodiment is described in detail as follows:
[0059] Step S1, read in the radar parameter data, including the received power, antenna gain, wavelength, and reflection cross-sectional area. Calculate the radar detection range according to the set false alarm probability and detection probability.
[0060] By inputting the received power P, antenna gain G, wavelength λ, and reflection cross-sectional area σ of the radar, defining the environmental variables of Boltzmann constant k, temperature T, noise bandwidth Bn, receiver noise coefficient F, and pulse count N in the program, and obtaining the loss value at any position from the input information, the radar detection probability at any three-dimensional coordinate with the radar as the coordinate axis origin is calculated according to the formula.
[0061]
[0062] Where S / N is the signal-to-noise ratio. According to the comparison of the signal-to-noise ratio and the detection probability, it can be determined whether a certain position is detected by the radar at a certain probability.
[0063] Step S2, calculate the cross-section approximate concave hull, and convert the data to a Boolean matrix.
[0064] At a certain distance interval, traverse each discrete point (x, y, z) in a large candidate area around the radar to obtain the probability of being detected at their positions, and compare it with the detection probability. If it is greater than the detection probability, the coordinates of the point are added to the detectable point cloud range. Thus, the detectable point cloud is obtained.
[0065] In order to present the radar detection range in a better form and improve the rendering runtime efficiency, an envelope patch is calculated for the point cloud. The user can modify the maximum angle, maximum length, minimum search range, maximum search range in the search parameters to change the concave hull algorithm properties in the envelope patch calculation to get a patch that is closer to the actual point cloud (correspondingly, the patch number overhead will be larger).
[0066] In the process of calculating the envelope patch, the convex hull algorithm is used. First, a convex hull is established. The Graham scan algorithm is used to calculate the convex hull. The leftmost and lowest point in the two-dimensional section of the detectable point cloud range is found as the starting point. This point is considered as a pole and is part of the convex hull. The other points are sorted according to the polar angle relative to the pole. The polar angle can be achieved by calculating the polar coordinates of each point relative to the pole. This ensures that the points are sorted in counterclockwise order so that there are no intersecting edges when constructing the convex hull.
[0067] The scan is started and the convex hull is constructed. From the third point, each point is considered in order. If the current point makes the boundary turn to the right instead of the left, it is not part of the convex hull. At this time, the previous point needs to be removed from the convex hull until the current point can make the boundary turn to the left. The convex hull is output, and the points remaining in the stack constitute the convex hull.
[0068] Next, the concave hull is generated from the convex hull. It should be noted that the conversion from the convex hull to the concave hull may not be unique. First, the edges of the convex hull are copied. The edges in the convex hull are traversed, and these edges are copied as the edges of the concave hull. Then, the edges of the convex hull are modified to form the concave hull. This involves adjusting the convex hull edges to form a concave polygon. Possible modifications include:
[0069] Change the direction of the edge. The direction of the edge is changed by swapping the vertices of the edge, so that the originally outward convex hull edge becomes an inward concave hull edge.
[0070] Delete the edge or add a new edge. Some convex hull edges can be deleted or new edges can be added to ensure the formation of a concave structure.
[0071] This process will continue to loop, and the edge modification process will be limited by the maximum angle, maximum length, minimum search range, and maximum search range in the search parameters. Finally, when the length of each edge is not greater than the maximum length, it means that the possible concave hull optimization space is small enough, and the envelope description of the point cloud by this concave hull is tight enough, so the loop of the concave hull algorithm ends.
[0072] A two-dimensional Boolean matrix of the detection range is generated using the concave hull. On the section, all points are traversed, and if they are within the detection range, the position is marked as true, otherwise as false.
[0073] Step S3, determine the LOD according to the view angle, and dispatch the grid shader of multiple groups of radars.
[0074] According to the observation camera position and the radar group position, the distance Dist between the radar group and the camera is calculated, and the size of the grid shader to be distributed is further calculated. First, a constant M describing the drawing accuracy needs to be determined, and then the size of the distributed grid shader can be calculated by the following formula WorkGroup :
[0075]
[0076] When distributing the grid shader, the EmitMeshTasksEXT function in the GL_EXT_mesh_shader extension needs to be used, and a GPU with Turing architecture is required. The parameters of the distribution function have three, which are the number of groups of the distributed grid shader in X\Y\Z dimensions. In order to facilitate calculation, (Size WorkGroup ,Size WorkGroup ,Size WorkGroup ) are taken as the task distribution parameters by default, that is, the grid shading task is executed for each voxel in the bounding cube of the radar detection range.
[0077] When distributing the task, the position, color and distribution size s of each group of radar are passed to the grid shader through the payload mechanism of the task shader. In the grid shader, the proportion r of each voxel occupying the bounding cube is calculated according to the distribution size Size WorkGroup passed by the payload.
[0078]
[0079] Where L m is the width of the two-dimensional Boolean matrix.
[0080] Step S4, judging whether the corresponding numbered shader draws the voxel, calculating the voxel position and volume in the radar space.
[0081] The task number gl_WorkGroupID of the shader is linearly mapped to a cube range to obtain the x, y, z coordinates of the shader in the cube, wherein the range of x is The range of y and z is [0, Size WorkGroup -1]. The coordinates are rotated around the axis of the radar to the two-dimensional Boolean matrix plane, the rotated coordinates are calculated, the Boolean value of the coordinates in the two-dimensional Boolean matrix is taken out, and it is judged whether to draw the voxel. In actual calculation, only the y value needs to be kept unchanged, and the x value is replaced with .
[0082] In order to highlight the radar detection range boundary, optimize the visual effect, and reduce the rendering load, edge detail enhancement needs to be performed. Specifically, for a to-be-rendered voxel within the radar detection range, first set a rendering scale factor The coarse representation is the proportion of the rendering voxel to the total number of voxels. Next, in the shader, use the voxel position as a seed to generate a uniformly distributed random number in the range of 0-1. One way to generate random numbers is to use some functions to transform the seed pseudo-randomly, and then map it to the 0-1 range. By default, the vector dot product, the sine function, and the large number to the decimal part method are used to obtain random numbers. If the generated random number is less than the rendering scale factor, it is determined that the voxel should be rendered; otherwise, continue to determine: randomly take a neighboring matrix element in any one direction of the current position on the two-dimensional Boolean matrix perimeter, and determine whether the obtained element is within the radar detection range. If it is within the range, it means that the current voxel is not on the boundary and should not be rendered; otherwise, the current voxel is on the boundary of the detection range and needs to be rendered.
[0083] In order to improve rendering efficiency, the neighboring voxel calculation method is used. Specifically, first, the linear mapping relationship between the shader task number and multiple voxels needs to be determined. Set the number of calculated voxels for each shader to N, where the number of calculations in any direction of X\Y\Z is k, which satisfies:
[0084] N = k 3
[0085] The new mesh shader dispatch size becomes:
[0086]
[0087] In each mesh shader, the current task number gl_WorkGroupID is linearly mapped to a range segment of the cube xyz coordinates, i.e. each mesh shader corresponds to a k*k*k small cube. After mapping, each voxel in the small cube is traversed, the corresponding coordinate on the two-dimensional Boolean matrix plane is calculated according to the original method to determine whether to render, and the number of primitives to be dispatched and the number of primitives are set according to the total number of voxels to be rendered.
[0088] According to the proportion r of each voxel occupying the surrounding cube calculated in step 3, the actual position (x*r, y*r, z*r) of the voxel before scaling is calculated. In order to filter the repeated texture, a random perturbation of -0.5 to +0.5 unit voxel length needs to be added to each dimension of the coordinate value of each voxel in the radar space.
[0089] After determining the position of the voxel after texture filtering, a cube composed of eight vertices and twelve triangles is constructed as a proxy representation of the voxel, forming part of the point cloud. The volume of the voxel proxy cube needs to be smaller than the voxel itself, and its length, width, and height must be multiplied by r to ensure that the voxel's visual size does not change when the LOD changes. When using the neighbor voxel calculation method, a mesh shader needs to dispatch multiple such proxy cubes.
[0090] Step S5: Calculate the radar's drawing position.
[0091] Based on the latitude lower limit, latitude upper limit, longitude lower limit, longitude upper limit, altitude lower limit, and altitude upper limit of each radar position, the corresponding X, Y, and Z coordinates in the world coordinate system are calculated, and the point cloud in the radar coordinate system is transferred to the world coordinate system. When longitude and latitude are entered, east longitude and north latitude are positive values, and west longitude and south latitude are negative values.
[0092]
[0093] Where lon and lat are the corresponding longitude and latitude, and h is the input altitude plus the radius of the Earth. After the transformation, the coordinates in the spatial coordinate system with the center of the Earth as the origin are obtained.
[0094] A digital globe is drawn in the background of the radar to show the radar's detection range at the actual geographical location. The globe is drawn by approximating a sphere with a polyhedron and using a map texture map.
[0095] When drawing multiple radar groups together, it's important to assign multiple drawing tasks to the task shader and pass the drawing parameters for each radar group separately using the payload. Different radar groups can be assigned different base colors for easy differentiation.
[0096] After the radar detection range is drawn, you can apply a filtering and noise reduction post-processing to the drawn texture to weaken the jaggedness and discreteness of the point cloud and obtain a more beautiful rendering effect. You can also perform color blending post-processing on the overlapping parts to highlight the areas where multiple radar detection ranges overlap.
[0097] The above description is only an example of a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for visualizing multi-radar detection ranges in space based on a mesh shader, characterized in that: include: Step (1), according to given radar parameters, calculating the two-dimensional cross section of the probabilistic detection range, calculating the approximate concave hull of the cross section, and using the concave hull to generate a two-dimensional Boolean matrix of the detection range; Step (2), adaptively select a suitable continuously changing LOD for each radar in each frame according to the camera distance, and dispatch an appropriate number of x*y*z mesh shaders; In step (2), the specific method of selecting LOD is: Based on the observation camera position and the radar group position, the distance between the radar group and the camera is calculated, as well as the scale of the mesh shader to be distributed and the size of the actual volume represented by each voxel. The scale (x, y, z) of the mesh shader should be negatively correlated with the distance from the radar camera. The farther the distance, the smaller the mesh shader scale, the larger the volume of each voxel drawn, and the fewer the number, thus achieving a continuously changing LOD effect. The LOD selection step is performed once for each radar in each frame. In the same frame, the same radar uses the same level of LOD, and different radars can use different levels of LOD. Step (3), using the mesh shader, mapping the task execution number (x, y, z) of each mesh shader to a voxel in the radar space; mapping the voxel position to a two-dimensional Boolean matrix through a projection transformation, and performing optimization processing based on the radar detection range information in the matrix; The optimization process of step (3) includes: Edge detail enhancement: Set a drawing scale factor, which roughly represents the ratio of the drawn voxels to the total number of voxels. In the mesh shader, use the number (x, y, z) as a random seed to generate a uniformly distributed random number in the range of 0-1. If the generated random number is less than the drawing scale factor, the voxel is drawn directly. Otherwise, the voxel is determined to be at the boundary of the radar detection range by exploring whether the surrounding elements in the two-dimensional Boolean matrix are drawn. If the voxel is determined to be at the boundary, it is drawn. Neighboring voxel calculation: Neighboring voxel calculation is to use one mesh shader to manage the drawing of multiple voxels, reducing the total number of mesh shaders, and calculating the drawing status of multiple voxels in one mesh shader, and distributing the drawing information of multiple voxels to the downstream of the rendering pipeline. That is, using one mesh shader to replace the tasks previously completed by multiple mesh shaders to improve drawing efficiency; Step (4): Based on the result of step (3), decide whether to draw voxels as the basic unit of the point cloud, calculate the coordinates of the proxy cube on the digital earth, and color it according to the radar number.
2. The method for visualizing multiple radar detection ranges in space based on a mesh shader according to claim 1, characterized in that: In step (1), the concave hull range is converted into a 01 two-dimensional Boolean matrix with 0 representing uncovered and 1 representing covered, and is submitted to the GPU together with the observation camera position and radar data for subsequent processing.
3. The method for visualizing multiple radar detection ranges in space based on a mesh shader according to claim 2, wherein: In step (1), radar parameter data is read in, and the radar detection range is calculated according to the set false alarm probability and detection probability, including: Using the read-in radar parameters, combined with environmental data and radar equations, the propagation loss of radar detection at different heights is calculated to obtain the detection probability; then, with the radar as the coordinate origin, any horizontal direction as the positive direction of the x-axis, and the vertical upward direction as the positive direction of the y-axis, a two-dimensional cross-section of the space where the radar is located is intercepted; sampling points are evenly and densely set on the cross-section, and the detection probability of all sampling points is calculated to obtain the two-dimensional cross-section of the radar detection range.
4. The method for visualizing multiple radar detection ranges in space based on a mesh shader according to claim 3, wherein: In step (1), the method for calculating the approximate concave hull of the cross section and converting the data into a Boolean matrix is: The convex hull boundary is scanned and calculated using the two-dimensional cross-section of the detection range as a point set. Based on the convex hull boundary, the convex edge concavity method is used to find the point closest to the convex edge boundary point among the non-boundary points and store it in the closest point set. Remove duplicates from the nearest point set, merge the boundary points, and then reconnect all boundary points in order; repeat the above steps until the shortest side length of the concave hull is less than the tolerable range, thus obtaining the approximate concave hull edge set of the cross section; For the approximate concave hull patch drawing, the radar is used as the coordinate origin and the vertical direction is used as the rotation axis. The concave hull edge set is rotated 360 degrees, and the space swept is the radar detection range. For the Boolean matrix of the radar detection range, each Boolean value in the matrix represents whether the location is within the two-dimensional cross-section of the detection range, and the matrix is generated by traversing the sampling points.
5. The method for visualizing multiple radar detection ranges in space based on a mesh shader according to claim 1, wherein: In step (2), the specific method of dispatching mesh shaders for multiple groups of radars is as follows: based on the number and position information of the incoming radars, the position, color, and distribution scale of the mesh shader of each group of radars are transmitted to the mesh shader using the payload mechanism of the task shader; and based on the global radar group number, x*y*z mesh shaders are dispatched to each group respectively.
6. The method for visualizing multiple radar detection ranges in space based on a mesh shader according to claim 1, wherein: The step (3) specifically includes: Step (3.1) determines whether the corresponding numbered shader draws the voxel; linearly map the shader's task number to a cube range to obtain the x, y, and z coordinates of the shader within the cube; rotate the coordinate around a rotation axis that passes through the radar and is perpendicular to the ground and map it to a two-dimensional Boolean matrix plane, calculate the coordinate after the mapping transformation, and take out the Boolean value of the coordinate in the two-dimensional Boolean matrix to determine whether the voxel is drawn; each mesh shader independently determines whether the voxel corresponding to it is drawn. A total of x*y*z mesh shaders can determine whether the corresponding voxel is drawn, and when combined, the entire radar detection range is obtained; Step (3.2) calculates the voxel position and volume in radar space; inversely calculates the actual position of the voxel before scaling based on the scaling ratio of the radar information on each axis; scales the drawn voxels proportionally based on the size of the distributed mesh shader; uses the position of the voxel after texture filtering to form a cube with eight vertices and twelve triangular faces as a proxy expression for the voxel, forming a component of the point cloud; the length, width and height of the proxy cube need to be determined by the voxel volume calculated in the continuously changing LOD.
7. The method for visualizing multiple radar detection ranges in space based on a mesh shader according to claim 1, wherein: In step (4), the method for calculating the drawing position of the radar is as follows: converting the accuracy, latitude, and altitude information in the radar coordinate information into (x, y, z) coordinates in the world space, and mapping the proxy cube coordinates distributed in the radar space in step (3) to the earth space according to the same mapping mode; performing a matrix transformation on the proxy cube according to the camera position, orientation, and perspective mode, and mapping it to the corresponding position in the screen space.
8. The method for visualizing multiple radar detection ranges in space based on a mesh shader according to claim 7, characterized in that: In the step (4), a background digital earth is drawn, and the radar point cloud is drawn to the corresponding position of the earth; for different radars, proxy cubes of different colors are drawn according to different color information provided in multiple groups of shaders, so as to distinguish the detection ranges of different radars.
Citation Information
Patent Citations
Particle system optimization rendering method and device based on clustering
CN115830201A
Typhoon mode cloud animation display method based on tessellation
CN106228594A
Method for instant rendering of voxels
CN114092613A