Ground line generation method, device and equipment, readable storage medium and product

By obtaining the depth map and texture mapping coordinates in a three-dimensional scene, building a curve, calculating the target frequency in the frequency domain map, and dynamically adjusting the coordinate point interpolation, the problem of low efficiency of three-dimensional line ground drawing in the existing technology is solved, and efficient drawing and grounding compliance is improved.

CN120236022APending Publication Date: 2025-07-01HANGZHOU HIKVISION SYST TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311849895.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-28
Publication Date
2025-07-01

Smart Images

  • Figure CN120236022A_ABST
    Figure CN120236022A_ABST
Patent Text Reader

Abstract

The invention provides a ground line generation method and device, equipment, a readable storage medium and a product, and the method comprises the steps: obtaining a three-dimensional scene, a depth map after the rendering of the three-dimensional scene, and coordinates of at least two points in the three-dimensional scene, the depth map being used for representing the depth information of each element in the three-dimensional scene; determining at least two vertexes in the at least two points, and converting coordinates of the vertexes to obtain texture mapping coordinates; based on the texture mapping coordinates of the at least two vertexes, constructing a curve connecting the two vertexes; obtaining the number of target frequencies meeting a preset condition in a frequency domain graph obtained through conversion based on the depth map in the curve range; based on the number of the target frequencies, inserting a target number of coordinate points between every two vertexes of the curve; and connecting the at least two points and the inserted coordinate points in sequence to obtain the ground line. According to the technical scheme, the calculation amount during ground line drawing can be reduced, and the drawing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of 3D graphics technology, and particularly to a method, device, equipment, readable storage medium and product for generating ground-hugging lines. Background Art

[0002] The 3D line ground-hugging drawing is a technology that uses terrain data and geographical information for drawing. Its purpose is to draw lines or curves on the actual terrain of the earth's surface to achieve a more realistic and accurate display of geographical information. This technology has a wide range of applications in fields such as map making, urban planning, traffic planning, and environmental monitoring.

[0003] In the prior art, the 3D line ground-hugging drawing is usually obtained by curve fitting based on the geometric information of the terrain surface to generate ground-hugging lines.

[0004] However, this existing method often involves a large amount of data calculation in the fitting process, resulting in a very low drawing efficiency of the ground-hugging lines. Summary of the Invention

[0005] This application provides a method, device, equipment, readable storage medium and product for generating ground-hugging lines, which is used to solve the problem of low drawing efficiency of the ground-hugging lines drawn in the prior art.

[0006] In a first aspect, an embodiment of this application provides a method for generating ground-hugging lines, including:

[0007] Obtain a 3D scene, a depth map after rendering the 3D scene, and the coordinates of at least two points in the 3D scene, where the depth map is used to represent the depth information of each element in the 3D scene;

[0008] Determine at least two vertices among the at least two points, and convert the coordinates of the vertices to texture mapping coordinates;

[0009] Based on the texture mapping coordinates of at least two vertices, construct a curve connecting the two vertices;

[0010] Obtain the number of target frequencies that meet the preset conditions in the frequency domain map obtained by converting the depth map within the range of the curve;

[0011] Based on the number of target frequencies, insert a target number of coordinate points between every two vertices of the curve;

[0012] Connect the at least two points and the inserted coordinate points in sequence to obtain a ground-hugging line.

[0013] In a possible design of the first aspect, the obtaining the number of target frequencies that meet the preset conditions in the frequency domain map obtained by converting the depth map within the range of the curve includes:

[0014] Sample at least one sampling point on the curve;

[0015] Convert the depth map within the range of the curve to obtain a frequency domain map, and obtain the frequency of each known point on the curve in the frequency domain space, where the known points include the sampling points and the vertices;

[0016] Obtain the number of target known points whose frequencies in the frequency domain space satisfy the preset conditions among all known points, and use it as the number of the target frequencies.

[0017] In another possible design of the first aspect, the sampling at least one sampling point on the curve includes:

[0018] Construct the point-slope equation of the curve based on the texture mapping coordinates of the at least two vertices;

[0019] Determine the sampling step according to the texture mapping coordinate values of the at least two vertices;

[0020] Use the coordinates of any vertex on the curve as the starting point, and calculate at least one sampling coordinate based on the point-slope equation and the sampling step, as the coordinates of the at least one sampling point.

[0021] In yet another possible design of the first aspect, the inserting the target number of coordinate points between every two vertices of the curve based on the number of the target frequencies includes:

[0022] Obtain the ratio of the target frequency based on the number of the target frequencies and the total number of all known points;

[0023] Calculate the target number according to the ratio of the target frequency and the preset mapping relationship, where the preset mapping relationship represents the corresponding relationship between the ratio of the target frequency and the target number;

[0024] Uniformly insert the coordinate points of the target number between the vertices of the curve.

[0025] In yet another possible design of the first aspect, there is a positive correlation between the ratio of the target frequency and the target number of the inserted coordinate points.

[0026] In yet another possible design of the first aspect, the method further includes:

[0027] Configure the number of computing pipelines of the Web graphical processor based on the number of the vertices;

[0028] When two-by-two connection of the vertices forms two or more curves, each computing pipeline is used to calculate the equation of one curve, the depth map within the range of the curve, the ratio of the target frequency, and the coordinates of the target number of coordinate points.

[0029] In a second aspect, an embodiment of the present application provides a ground contact line generation device, including:

[0030] An image acquisition module, configured to acquire a three-dimensional scene, the depth map after rendering of the three-dimensional scene, and the coordinates of at least two points in the three-dimensional scene, where the depth map is used to represent the depth information of each element in the three-dimensional scene;

[0031] A coordinate acquisition module, configured to determine at least two vertices from the at least two points, and convert the coordinates of the vertices to obtain texture mapping coordinates;

[0032] A curve acquisition module, configured to construct a curve connecting the two vertices based on the texture mapping coordinates of at least two vertices;

[0033] A quantity acquisition module, configured to acquire the quantity of target frequencies that meet a preset condition in a frequency domain map converted from the depth map within the range of the curve;

[0034] A coordinate point determination module, configured to insert the coordinates of the target number of coordinate points between the vertices of the curve based on the quantity of the target frequency;

[0035] A ground contact line type formation module, configured to connect the at least two points and the inserted coordinate points in sequence to obtain a ground contact line.

[0036] In a third aspect, an embodiment of the present application provides an electronic device, including: a processor, and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the method as described above.

[0037] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where computer-executable instructions are stored in the computer-readable storage medium, and when the computer-executable instructions are executed by a processor, they are used to implement the method as described above.

[0038] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the method as described above.

[0039] The method, device, equipment, readable storage medium and product for generating a ground line provided by the embodiments of the present application can dynamically adjust the number of coordinate points inserted between two vertices of a curve by using the number of target frequencies that meet the preset conditions in the frequency domain graph within the curve range, making the drawing of the ground line more flexible, reducing unnecessary calculation amounts, and improving the drawing efficiency of the ground line. Brief Description of the Drawings

[0040] The drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application;

[0041] Figure 1 It is a schematic diagram of the drawing scenario of the ground line provided by the embodiments of the present application;

[0042] Figure 2 It is a schematic flowchart of the method for generating a ground line provided by the embodiments of the present application;

[0043] Figure 3 It is a schematic diagram of the generation of a depth map provided by the embodiments of the present application;

[0044] Figure 4 It is a schematic flowchart of the process for obtaining the curve equation provided by the embodiments of the present application;

[0045] Figure 5 It is a schematic diagram of the formation process of the ground line provided by the embodiments of the present application;

[0046] Figure 6 It is a schematic diagram of the WebGPU computing pipeline configuration provided by the embodiments of the present application;

[0047] Figure 7 It is a schematic diagram of the formation of the ground line provided by the embodiments of the present application;

[0048] Figure 8 It is a schematic flowchart of the method for generating a ground line provided by another embodiment of the present application;

[0049] Figure 9 It is a schematic diagram of the structure of the device for generating a ground line provided by the embodiments of the present application;

[0050] Figure 10 It is a schematic diagram of the structure of the electronic device provided by the embodiments of the present application.

[0051] Through the above drawings, the specific embodiments of the present application have been shown, and there will be more detailed descriptions hereinafter. These drawings and textual descriptions are not intended to limit the scope of the concept of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. Detailed Embodiments

[0052] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the following will clearly and completely describe the technical solutions in the embodiments of this application with reference to the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are some, but not all, of the embodiments of this application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of this application without creative efforts fall within the scope of protection of this application.

[0053] Three-dimensional line ground-drawing is a technology that uses terrain data and geographic information for drawing. Its purpose is to draw lines or curves on the actual terrain of the earth's surface to achieve a more realistic and accurate display of geographic information. This technology has a wide range of applications in fields such as map making, urban planning, transportation planning, and environmental monitoring. In related three-dimensional line ground-drawing technologies, first, terrain data needs to be obtained (the elevation data of the earth's surface can be obtained using technologies such as lidar, satellite remote sensing, and digital elevation models), and then, through methods such as fixed interpolation and curve fitting, the ground elevation of each point on the line or curve is calculated to achieve ground-drawing.

[0054] Among them, the fixed interpolation method refers to inputting a fixed threshold, interpolating between the vertices of the line according to the threshold, extracting the height of the terrain or model according to the ray method after interpolation, and then recursively processing all points in turn until the last point of the line is processed. The curve fitting method refers to using a curve fitting algorithm, such as a Bezier curve or a spline curve, to fit the curve on the terrain surface. This can be achieved by projecting the control points of the curve onto the terrain surface and then using the fitting algorithm to generate a smooth curve. According to the path of the fitting curve and the geometric information of the terrain surface, the curve is interpolated and the height is extracted to ensure a smooth connection between the curve and the terrain surface. However, the R & D personnel found that there are still some problems with the above-mentioned ground-drawing methods. For example, the computational complexity is relatively high, the ground-drawing compliance is low, a large amount of calculation is required for interpolation and curve fitting, especially when dealing with large-scale terrain data, the computational complexity will be even higher, resulting in a slower drawing speed.

[0055] In view of the above problems, the inventor has proposed a method for drawing ground-hugging lines that can improve the drawing speed and at the same time ensure the ground-hugging compliance. It mainly calculates the number of target frequencies that meet the preset conditions within the curve range when converting the depth map into a frequency domain map. Based on the number of target frequencies, the interpolation number of coordinate points between two vertices is dynamically adjusted, making the drawing of ground-hugging lines more flexible, reducing unnecessary calculation amounts, and improving the drawing efficiency of ground-hugging lines. In addition, by configuring the preset conditions, all target frequencies can be high frequencies. In this way, through the number of high frequencies within the curve range, the undulations of various elements in the three-dimensional scene can be reflected, so that more undulation detail information is retained when drawing ground-hugging lines in the three-dimensional scene, improving the ground-hugging effect and making the ground-hugging lines better fit the undulations of the three-dimensional object surface.

[0056] Exemplarily, Figure 1 FIG. is a schematic diagram of the drawing scenario of the ground-hugging line provided by the embodiment of the present application. As Figure 1 shown, taking a three-dimensional scene composed of buildings in a city as an example, there are usually undulating terrains in the three-dimensional scene. During the process of drawing three-dimensional line ground-hugging, on the one hand, the drawing rate needs to be ensured, and on the other hand, the ground-hugging compliance also needs to be ensured, that is, the ground-hugging line can follow the terrain undulations as much as possible and overlap on the building surface.

[0057] It should be noted that the above Figure 1 is only a schematic scenario for drawing ground-hugging lines. In practical applications, the ground-hugging line drawing technology can be widely applied to technical fields such as computer graphics, geographic information systems, virtual reality, and game development. Specifically, this technology is applicable to scenarios that require efficient drawing of large-scale terrain scenes. For example, it has application prospects in map making, virtual reality, game development, etc. These technical fields have special requirements for terrain drawing, virtual scene production, and game development, etc. The ground-hugging line drawing method provided by the present application can meet the actual needs of these technical fields and efficiently generate ground-hugging lines that meet the requirements.

[0058] Specifically, the ground line drawing method provided by this application can be applied to the fields of 3D modeling and visualization, used to draw curves and achieve a smooth drawing effect of the curves on the ground, which can be used for creating realistic scenes, virtual reality applications, game development, etc. For another example, the ground line drawing method provided by this application can also be applied to terrain generation and rendering. By dynamically adjusting the number of coordinate point interpolations to achieve ground line drawing, it can more accurately simulate the undulations and details of the terrain, improving the realism and visual effect of the terrain. For another example, the ground line drawing method provided by this application can also be applied to the fields of virtual navigation and path planning. By dynamically adjusting the number of coordinate point interpolations to achieve ground line drawing, it can generate smooth path segments in a virtual environment for the visualization and optimization of navigation and path planning algorithms. For another example, the ground line drawing method provided by this application can also be applied to the fields of computer-aided design and visualization. By drawing a ground line and achieving a smooth drawing effect of the ground line on the ground, it can be used in fields such as architectural design, engineering simulation, product design, etc., providing a more realistic visualization effect and interactive experience.

[0059] Next, the technical solutions of this application will be described in detail through specific embodiments. It should be noted that these specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.

[0060] Figure 2 is a schematic flowchart of the ground line generation method provided by the embodiments of this application. This method can be applied to electronic devices (such as computers, personal notebooks, tablet computers, etc.). As Figure 2 shown, this method can specifically include the following steps:

[0061] Step S201, obtain a 3D scene, a depth map after rendering the 3D scene, and the coordinates of at least two points in the 3D scene. Among them, the depth map is used to represent the depth information of each element in the 3D scene.

[0062] In this embodiment, in order to facilitate the electronic device to execute the ground line generation method, it is necessary to first perform scene rendering to draw a 3D scene map and input it into the electronic device. For example, obtain the real terrain data of a certain area through satellite remote sensing and render it into a 3D scene map. Or directly construct a virtual 3D scene in the graphics drawing software in the electronic device. After rendering and drawing the 3D scene map, a coordinate system can be established in the 3D scene map, and then the user directly inputs the coordinates of points into the electronic device to obtain the coordinates of at least two points in the 3D scene. Among them, there are vertices among these coordinate points. For example, taking the user input of three points as an example, the three points can be connected in sequence to form a straight line, and the two points at the head and tail of the straight line can be regarded as vertices. In addition, if the three points are connected to form a triangle, then all three points can be regarded as vertices.

[0063] Among them, the three-dimensional scene graph contains various different elements, such as houses, mountains, winding roads, etc. From the perspective of an observer (such as a satellite), these elements present a undulating shape. The depth map is an image used to record the distance of each object or element in the scene from the observer. In computer graphics, the depth map is usually used to record the distance or depth information of each pixel point from the camera. Usually, the depth map exists in the form of a grayscale image, and the grayscale value of each pixel point represents the distance of that point from the camera, usually represented by a floating-point number.

[0064] In this embodiment, after the three-dimensional scene is rendered, a depth map can be generated at the same time. The depth information of each pixel point in the depth map can be used to characterize the undulating situation of these elements in the three-dimensional scene. Specifically, taking a certain pixel point in the depth map as an example, this pixel point corresponds to a certain position point on the surface of a certain element in the three-dimensional scene, and the depth information of this pixel point can describe the height difference between this position point and the reference plane (such as the horizontal plane). Based on the different application technical fields, the elements in the three-dimensional scene graph are also different. For example, they can be virtual characters or houses, etc. After the three-dimensional scene is rendered, a depth map is generated at the same time, that is, the construction of the three-dimensional scene and the generation of the depth map are integrated, and the depth map is generated at the same time and the depth information of each pixel point (corresponding to the position point in the three-dimensional scene graph) is recorded, which can improve the drawing efficiency and reduce the additional calculation and memory overhead.

[0065] Exemplarily, Figure 3 is a schematic diagram of depth map generation provided by the embodiment of the present application. As Figure 3 shown, based on the three-dimensional elements (such as buildings) in the three-dimensional scene graph, a two-dimensional depth map can be constructed.

[0066] Among them, in the process of drawing the ground line, the user should at least give the coordinates of at least two points included in the drawn ground line, such as the starting point and the ending point of the ground line. That is, if the user only gives the coordinates of two points, then these two points can be used as the starting point and the ending point of the ground line. In the field of graphic drawing, the starting point and the ending point are usually called vertices.

[0067] Step S202, determine at least two vertices among at least two points, and convert the coordinates of the vertices to obtain texture mapping coordinates.

[0068] Among them, the texture mapping coordinates are the UV coordinates. The UV coordinates mean that all image files are two-dimensional planes. The horizontal coordinate is U, and the vertical coordinate is V. Any pixel on the image can be located through the UV coordinate system. Specifically, during the process of drawing a three-dimensional scene graph, there are various elements (mainly three-dimensional objects). When constructing the models of these three-dimensional elements, through texture mapping, a texture (that is, a picture) is adhered to the model surface to control the appearance of the model. Each vertex of the model has a UV coordinate, which defines the corresponding two-dimensional coordinate of the vertex in the texture. Through the UV coordinates, each point on the two-dimensional image can be accurately mapped to the surface of the three-dimensional model.

[0069] Exemplarily, the texture mapping coordinates can be obtained through the following steps: The three-dimensional coordinates of the vertex are transformed into clip space coordinates through the projection view transformation of the three-dimensional coordinates, and then the clip space coordinates are transformed into normalized device coordinates. Finally, the normalized device coordinates are subjected to range mapping to be transformed into texture mapping coordinates.

[0070] Among them, the normalized device coordinates (Normalized Device Coordinates, NDC) refer to in computer graphics, normalizing the screen coordinates to a standardized coordinate space, usually in the range of [-1, 1]. This standardized coordinate space can make the graphics rendering maintain a consistent ratio and position under different screen resolutions and ratios. NDC coordinates are often used in graphics APIs such as OpenGL and DirectX for graphics rendering.

[0071] Step S203, based on the texture mapping coordinates of at least two vertices, construct a curve connecting the two vertices.

[0072] Exemplarily, taking the texture mapping coordinates of the first vertex as (Du1, Dv1) and the texture mapping coordinates of the second vertex as (Du2, Dv2) as an example, a line segment can be formed by connecting the coordinates of these two points as the curve of these two vertices.

[0073] Exemplarily, Figure 4 is a schematic diagram of the acquisition process of the curve equation provided by the embodiment of the present application, as Figure 4 shown, which includes the following steps: Step S401, obtain line vertex data. Step S402, perform projection view transformation. Step S403, transform the three-dimensional coordinates into clip space coordinates. Step S404, transform the clip space coordinates into normalized device coordinates. Step S404, transform the normalized device coordinates into texture mapping coordinates. Step S406, obtain the curve equation according to the pairwise texture mapping coordinates. Among them, forming a curve based on the vertex texture coordinates enables the curve to more accurately describe the surface undulation of the three-dimensional element model.

[0074] In this embodiment, the coordinates of the vertices input by the user are three-dimensional. These vertices are usually position points on the surface of three-dimensional elements. By converting the three-dimensional vertex coordinates into texture mapping coordinates and then forming a curve based on the texture mapping coordinates of two vertices, the curve can more accurately describe the undulations of the surface of the three-dimensional element.

[0075] In this embodiment, when the number of vertices input by the user is two, the formed curve is in the form of a line segment; when the number of vertices input by the user is multiple, at least the starting point and the ending point of the curve should be included among these vertices, and at the same time, the connection order of each point (for example, it can be the order of each point input by the user to the electronic device) should also be included, that is, starting from the starting point, each point is connected in turn, and finally a curve is formed. This curve will be adjusted later to fit the undulations of the element surface, so as to form a ground contact line. Among them, since the drawn three-dimensional scene can be represented by a two-dimensional depth map (the depth information of each pixel point in the depth map can represent the height of the position point in the three-dimensional scene), for this reason, the above-mentioned curve can be formed in the depth map, so that it may be more intuitive to see the shape of the curve formed by the user input points.

[0076] In addition, it should be noted that when the number of vertices input by the user is multiple, after these vertices are connected in sequence, they can be regarded as forming a line segment, or this line segment can be divided into N sub-line segments. For example, when three vertices are connected in sequence to form a line segment, this line segment can actually be divided into two sub-line segments (the line segment between the first vertex and the second vertex is used as one sub-line segment, and the line segment between the second vertex and the third vertex is used as another sub-line segment). The advantage of dividing the sub-line segments is that these sub-line segments can be processed in parallel, and the insertion of coordinate points of each sub-line segment can be parallel, so that the drawing efficiency of the ground contact line can be significantly improved.

[0077] Step S204, obtain the number of target frequencies that meet the preset conditions in the frequency domain map converted from the depth map within the range of the curve.

[0078] In this embodiment, usually the depth map exists in the form of a grayscale image. The depth map is a two-dimensional space represented by pixel points, which contains a number of pixel points. The grayscale value of each pixel point can be understood as depth information, and the height of the position point is represented based on the grayscale value. The depth map is usually a spatial domain image. Among them, the spatial domain refers to the two-dimensional space represented by pixel points, while the frequency domain refers to the two-dimensional space represented by frequencies. In the frequency domain, the information of the image is presented in the form of frequency and phase, and is no longer presented in the form of pixel points.

[0079] Among them, the image frequency-domain transformation methods include Fourier Transform and Wavelet Transform. Briefly speaking, after the spatial-domain image is converted into a frequency-domain image, the pixel points in the original spatial-domain image are converted into the form of frequency and phase.

[0080] In this embodiment, in order to improve the conversion efficiency and reduce the calculation amount, the depth map can be cropped to crop out the area covered by the curve range in the depth map, converted to the frequency-domain space, and then the number of target frequencies that meet the preset conditions in this frequency-domain space is calculated. In other embodiments, the entire depth map can also be directly converted into a frequency-domain map, and then the number of target frequencies that meet the preset conditions in the entire frequency-domain map is calculated.

[0081] In this embodiment, after being converted into a frequency-domain map, the pixel points on the curve are converted into the form of frequency and phase, that is, each pixel point on the curve corresponds to a frequency, and the frequencies corresponding to these pixel points are high or low. Among them, a preset frequency threshold can be configured to distinguish target frequencies and non-target frequencies. For example, the preset condition can be that the frequency greater than the preset frequency threshold is regarded as a target frequency. In addition, the preset condition can also be that the frequency less than or equal to the preset frequency threshold is regarded as a target frequency.

[0082] It should be noted that in the frequency-domain map, the larger the ratio of high frequencies within the curve range, the more frequent the high and low undulations on the surface of the element in the corresponding three-dimensional scene map. For example, this range in the three-dimensional scene may be hilly or mountainous. If the ratio of high frequencies within the curve range in the frequency-domain map is smaller, the high and low undulations on the surface of the element in the corresponding three-dimensional scene map are gentle, and at this time it may be a plain.

[0083] Step S205, based on the number of target frequencies, insert the target number of coordinate points between every two vertices of the curve.

[0084] In this embodiment, a preset relational expression can be configured, with the number of target frequencies as the input of the preset relational expression and the number of inserted coordinate points as the output. Exemplarily, the preset relational expression is as follows:

[0085] y = k * x

[0086] In the above formula, y represents the number of inserted coordinate points, x represents the number of target frequencies, and k is a preset ratio coefficient.

[0087] Among them, after calculating the number N of inserted coordinate points (i.e., the target number), the electronic device can randomly generate N coordinate points between these two vertices in the three-dimensional scene map to achieve the insertion of coordinate points.

[0088] Step S206: Connect at least two points and the inserted coordinate points in sequence to obtain a ground-fitting line. The ground-fitting line is used to fit the undulations of the element surface.

[0089] Exemplarily, Figure 5 FIG. is a schematic diagram of the formation process of the ground-fitting line provided by an embodiment of the present application. As Figure 5 shown, taking the example that a user inputs two point coordinates (such as coordinate points X1 and X2) to form a line segment in a three-dimensional scene diagram, this line segment is obviously unable to fit the surface of the element in the three-dimensional scene. At this time, more coordinate points can be automatically inserted between these two coordinate points X1 and X2 (the coordinate values of each coordinate point can be random, as long as each coordinate point is located between coordinate points X1 and X2). After connecting all these coordinate points, a ground-fitting line is formed. Compared with the previous line segment, it fits the element surface better and can more accurately describe the undulations.

[0090] It should be noted that the above Figure 5 is only presented as an example. In practical applications, the number of inserted coordinate points can be more, so that the final ground-fitting line can fit the element surface better, and thus more accurately depict the undulations of the surfaces of various elements in the three-dimensional scene.

[0091] In the embodiment of the present application, by obtaining the number of target frequencies that meet the preset conditions in the frequency domain diagram, the number of coordinate points inserted between two vertices is calculated. In this way, when drawing the ground-fitting line, the number of coordinate point interpolations between the two vertices of the ground-fitting line can be dynamically and automatically adjusted, forming the ground-fitting line more flexibly and improving the drawing efficiency of the ground-fitting line.

[0092] In some other embodiments, the above step S204 can be specifically implemented through the following steps: sampling at least one sampling point on the curve; then converting the depth map within the curve range to obtain a frequency domain diagram, and obtaining the frequency of each known point on the curve in the frequency domain space; finally, obtaining the number of target known points whose frequencies in the frequency domain space meet the preset conditions among all known points as the number of target frequencies. The known points include sampling points and vertices.

[0093] In this embodiment, the curve is characterized based on the coordinates of two vertices. Since the depth map contains a large number of pixel points, there will be a large number of pixel points on the curve between the two vertices. If the depth map within the curve range is converted into a frequency domain map, each pixel point is converted into the form of frequency + phase. In this way, there are many values in the form of frequency + phase. It is very time-consuming to count the target frequencies that meet the preset conditions among all these values. For the purpose of reducing time consumption and improving efficiency, in the embodiment of the present application, sampling is first performed on the curve to determine at least one sampling point on the curve. Then, after the depth map within the curve range is converted into a frequency domain map, it is directly checked which of the values in the form of frequency + phase obtained by converting these sampling points can meet the preset conditions. In this way, the number of statistics is reduced and the efficiency can be improved.

[0094] Exemplarily, taking the curve including sampling point C1 and sampling point C2 as an example, after the depth map within the curve range is converted into a frequency domain map, in the frequency domain map, the frequency corresponding to sampling point C1 is P1, and the frequency corresponding to sampling point C2 is P2. Assuming that in the frequency domain map, the frequencies corresponding to the two vertices both meet the preset conditions, and the frequencies corresponding to sampling point C1 and sampling point C2 do not meet the preset conditions, then it can be determined that the target known points that meet the preset conditions are the two vertices, and the number of target frequencies is 2.

[0095] In this embodiment, random sampling can be performed on the curve. For example, N sampling points are randomly selected on the curve.

[0096] Further, on the basis of the above embodiment, in some other embodiments, the sampling points on the curve can also be sampled through the following steps: constructing the point-slope equation of the curve based on the texture mapping coordinates of at least two vertices; then determining the sampling step size according to the texture mapping coordinate values of at least two vertices; and finally, taking the coordinate of any vertex on the curve as the starting point, and calculating at least one sampling coordinate based on the point-slope equation and the sampling step size as the coordinate of at least one sampling point.

[0097] In this embodiment, taking the texture mapping coordinates of the first vertex as (Du1, Dv1) and the texture mapping coordinates of the second vertex as (Du2, Dv2) as an example, by using the point-slope equation, the straight line equation can be calculated, and all points on the curve fall on this straight line equation.

[0098] Among them, when determining the sampling step size, the sampling step size can be determined based on the difference between the texture mapping coordinate Du1 of the first vertex and the texture mapping coordinate Du2 of the second vertex. Specifically, the sampling step size can be calculated by the following formula: CY = (Du1 - Du2) / K, where K is a constant. After calculating the sampling step size, the first vertex can be used as the sampling starting point, and then the coordinates (CYu1, CYv1) of the first sampling point can be calculated. Among them, CYu1 = Du1 + CY. After obtaining the abscissa CYu1 of the first sampling point, the abscissa CYu1 is input into the straight line equation to calculate the ordinate CYv1 of the first sampling point. In this way, more sampling points can be obtained by repeating the process.

[0099] Of course, the sampling step size can also be calculated in the following way: CY = (Dv1 - Dv2) / K. After calculating the sampling step size, the first vertex can be used as the sampling starting point, and then the coordinates (CYu1, CYv1) of the first sampling point can be calculated. Among them, CYv1 = Dv1 + CY. After obtaining the ordinate CYv1 of the first sampling point, the ordinate CYv1 is input into the straight line equation to calculate the abscissa CYu1 of the first sampling point. In this way, more sampling points can be obtained by repeating the process.

[0100] In other embodiments, the sampling step size can also be: CY = (Dv1 - Dv2) / (Du1 - Du2). Similarly, after calculating the sampling step size, the coordinates of the sampling points can also be calculated in a similar way as above.

[0101] In the embodiment of the present application, by sampling on the curve, other sampling points on the curve except the two vertices are determined. After the depth map in the curve range is converted to the frequency domain map, only the target sampling points whose corresponding frequencies in the frequency domain satisfy the preset conditions among these sampling points need to be counted, which reduces the amount of data to be counted and improves the efficiency.

[0102] In some embodiments, in addition to the preset relational expression that can be configured as mentioned above, with the number of target frequencies as the input of the preset relational expression and the number of inserted coordinate points as the output to calculate the target number. In this embodiment, the target number can be specifically determined through the following steps: based on the number of target frequencies and the total number of all known points, obtain the ratio of the target frequency; then calculate the target number according to the ratio of the target frequency and the preset mapping relationship; finally, evenly insert the coordinate points of the target number between the vertices of the curve, and the preset mapping relationship represents the corresponding relationship between the ratio of the target frequency and the target number.

[0103] Among them, the number of all known points is the number of sampled points obtained from the above sampling plus 2 (i.e., the number of two vertices). The number of target frequencies is the number of target known points whose frequencies in the frequency domain space meet the preset conditions among all known points. The ratio of the target frequency = the number of target frequencies / the total number of all known points. For example, there are one hundred pixel points on the curve in the depth map. After the depth map is converted to a frequency-domain image, each of these one hundred pixel points has a corresponding frequency. Among them, 50 frequencies are greater than the preset frequency threshold, so the ratio of the target frequency is 50 / 100 = 0.5.

[0104] Among them, the preset condition can refer to a frequency greater than the preset frequency threshold, or a frequency less than or equal to the preset frequency threshold. In this embodiment, taking the preset condition as a frequency greater than the preset frequency threshold as an example, after calculating the ratio of the target frequency, the target quantity can be calculated through the following configured mapping relationship:

[0105] MS = ZB * b

[0106] Among them, MS is the target quantity, ZB is the ratio of the target frequency, and b is the maximum threshold of the coordinate points that can be inserted into this curve.

[0107] Exemplarily, in other embodiments, taking the preset condition as a frequency less than or equal to the preset frequency threshold as an example, after calculating the ratio of the target frequency, the target quantity can be calculated through the following configured mapping relationship:

[0108] MS = (1 - ZB) * b

[0109] Among them, MS is the target quantity, ZB is the ratio of the target frequency, and b is the maximum threshold of the coordinate points that can be inserted into this curve.

[0110] Among them, two methods for converting the depth map to the frequency map are mentioned above. That is, method (1) to improve the conversion efficiency, the depth map can be cropped to cut out the area covered by the curve range in the depth map, converted to the frequency domain space, and then the number of target frequencies that meet the preset conditions in this frequency domain space is calculated. Method (2) can directly convert the entire depth map into a frequency-domain map, and then calculate the number of target frequencies that meet the preset conditions in the entire frequency-domain map.

[0111] It can be understood that the number of target frequencies calculated by the above two methods is different. Therefore, in the embodiments of the present application, the ratio of the target frequency is defined. Among them, if method (2) is used to implement the conversion from the depth map to the frequency map and the number of target frequencies that meet the preset conditions is obtained, the number of target frequencies can be divided by the total number of all frequencies in the entire depth map to obtain the ratio of the target frequency. By defining the ratio of the target frequency, although the number of target frequencies calculated by the above two methods is different, but using method (1) and method (2), the same target number can be finally calculated.

[0112] In this embodiment, after calculating the target number, when inserting coordinate points, the average interpolation method can be used, that is, the coordinate points of the target number are evenly inserted between the two vertices of the curve. Specifically, the distance between the two vertices on the curve can be divided into N equal parts, and then a coordinate point is inserted every other distance. After finally completing the insertion of all coordinate points, the height of each coordinate point can be calculated to form a ground contact line.

[0113] In the embodiments of the present application, by obtaining the ratio of the target frequency in the frequency domain map within the curve range, the number of inserted coordinate points is dynamically calculated, and then these coordinate points are evenly inserted between the two vertices of the curve. In this way, based on the depth information in the three-dimensional scene, the drawing effect of the ground contact line can be accurately controlled, reducing artifacts and jagged phenomena in the drawing process, and improving the quality of graphics rendering.

[0114] Further, in some embodiments, in the frequency domain map, if the number of high frequencies within the curve range is larger, that is, when the preset condition is set as the frequency greater than the preset frequency threshold as the target frequency, the more the number of target frequencies, it indicates that there are frequent high and low fluctuations in the three-dimensional scene corresponding to the curve range, that is, the fluctuation frequency is higher. At this time, more coordinate points should be inserted between the two vertices of the curve, that is, there is a positive correlation between the ratio of the target frequency and the target number of inserted coordinate points. If the number of high frequencies within the curve equation range is smaller, it indicates that the high and low fluctuations in the three-dimensional scene corresponding to the curve range are relatively gentle. At this time, fewer coordinate points can be inserted between the two vertices of the curve, which can reduce the calculation amount and improve the drawing efficiency of the ground contact line at the same time.

[0115] Among them, the calculation process of dynamic interpolation and the insertion process of coordinate points can utilize the WebGPU rendering engine. By using the high performance and cross-platform characteristics of WebGPU, the drawing efficiency and performance can be further improved.

[0116] In some embodiments, efficient three-dimensional line dynamic interpolation ground-drawing can be achieved in a Web environment through Web Graphics Processing Unit (WebGPU) graphics rendering technology, providing a more realistic graphics rendering effect for Web applications. Specifically, based on the number of vertices, the number of computational pipelines of the WebGPU can be configured; then, when two vertices are connected in sequence to form more than two curves, each computational pipeline is used to calculate the equation of one curve, the depth map within the curve range, the ratio of the target frequency, and the coordinates of the target number of points.

[0117] In this embodiment, the number of vertices can be the same as the number of computational pipelines. Each two vertices form a curve, and each computational pipeline processes one curve respectively, for example, calculating the equation of the curve, the depth map within the curve range, the ratio of the target frequency on the curve, the coordinates of the target number corresponding to the curve, and completing the processing such as inserting the coordinate points. By connecting two vertices to form a curve and allocating it to a computational pipeline for processing, when the user inputs more than three vertices, parallel processing of multiple computational pipelines can be achieved.

[0118] Exemplarily, taking the case where the user inputs three vertices as an example, if the three vertices are connected in sequence to form a curve and processed by a single computational pipeline, it is very time-consuming. However, if this curve is split into two curves (i.e., a curve is formed between the first vertex and the second vertex, and a curve is formed between the second vertex and the third vertex), and then each curve is allocated a computational pipeline for processing, parallel processing is achieved, significantly improving the processing efficiency.

[0119] Among them, WebGPU is a new Web standard that can provide direct access to the GPU to achieve more efficient graphics and computing processing. WebGPU can enable Web applications to perform graphics rendering and computing faster, improving the performance and experience of the application.

[0120] In this embodiment, the user inputs the coordinates of at least two points. Each time the coordinates of a vertex are input, the electronic device records it once, and finally the total number of vertices input by the user is obtained. Exemplarily, the total number of vertices is correlated with the number of WebGPU computational pipelines generated. Generally, the more the total number of vertices, the more the number of WebGPU computational pipelines generated. In this way, by dynamically generating WebGPU computational pipelines for parallel computing, the parallel computing ability of the GPU can be fully utilized, improving the computing efficiency, and accelerating the dynamic calculation of the number of subsequently inserted coordinate points (the WebGPU computational pipeline can calculate the number of inserted coordinate points based on the ratio of the high frequency in the frequency domain graph. In this way, it is equivalent that the entire ground-drawing process can use the WebGPU computational pipeline, making the drawing process more real-time and fast, and suitable for dynamic scenarios and interactive applications).

[0121] Further, in the process of generating a WebGPU compute pipeline, it is necessary to determine the parameters and configurations of the compute pipeline, including the number of threads for parallel computing, memory allocation, etc. The specific steps are as follows: (1) Create a vertex buffer for the input data and a buffer for the output data, and calculate the size of the buffer. Among them, the buffer is used to implement data storage, and the input data and output data have corresponding buffers respectively. (2) Calculate the size of the compute pipeline thread workgroup and the number of workgroups based on the number of vertices. Among them, a mapping relationship between the number of vertices - the number of compute pipelines, a mapping relationship between the number of vertices - the thread size, and a mapping relationship between the number of vertices - the number of workgroups can be established in advance. Based on these mapping relationships, after determining the number of vertices, the number of compute pipelines, the input data buffer and the output data buffer, and the compute pipeline thread workgroup of the compute pipeline can be directly configured.

[0122] (3) Create a compute pipeline and a command encoder, configure the compute pipeline, enable the compute channel, submit the compute task, and perform calculations on the curve equation, the ratio of the target frequency, and the number of inserted coordinate points.

[0123] Exemplarily, Figure 6 is a schematic diagram of the WebGPU compute pipeline configuration provided by the embodiment of the present application. As Figure 6 shown, it includes the following steps: Step S601, obtain line vertex data. Step S602, count the number of vertices. Step S603, create input, output, and depth texture buffers. Step S604, calculate the number of compute pipeline thread workgroups and the workgroup size. Step S605, create a compute pipeline and a command encoder, enable the compute channel and submit the compute task.

[0124] By using the WebGPU graphics rendering technology, the embodiment of the present application can dynamically generate the ready-made number of WebGPU compute pipelines according to the number of vertices, and then each compute pipeline corresponds to processing a curve formed by two vertices to achieve parallel processing (specifically including processing such as converting each curve from the time domain space to the frequency domain space, counting the ratio of high-frequency information, and dynamically adjusting the number of interpolations), thereby improving the computing efficiency, accelerating the speed of subsequent coordinate point interpolation processing, and improving the real-time performance and interactivity of the ground line drawing.

[0125] Figure 7 is a schematic diagram of the formation of the ground line provided by the embodiment of the present application. As Figure 7As shown in the figure, it includes the following steps: Step S701, read the curve range and convert it to the frequency domain. Step S702, high-frequency statistics. Step S703, sample according to the depth map and the number of interpolations. Among them, after determining the number of interpolations, interpolation can be performed between two vertices (i.e., insert coordinate points), and then the three-dimensional coordinates are inversely calculated through the inverse matrix of the projection matrix. Finally, based on all the inversely calculated three-dimensional coordinate points, a ground line is formed.

[0126] In this embodiment, the ratio of the target frequency (i.e., the ratio of the high-frequency greater than the preset frequency threshold) in the depth map converted to the frequency domain can be calculated in the computing pipeline, and the number of interpolations (i.e., the number of coordinate points to be inserted between two vertices) is dynamically adjusted according to the ratio of the target frequency, so as to achieve a dynamic response to the undulation frequency of the depth map, realize the dynamic adjustment of the smooth drawing effect of the curve on the ground, and make the finally drawn ground line have a better ground-fitting effect.

[0127] Figure 8 It is a schematic flowchart of the ground line generation method provided by another embodiment of the present application. As Figure 8 shown, the method may specifically include the following steps: Step S801, draw each element in the scene and generate a depth map, and record the depth information of each pixel point. Step S802, dynamically generate the number of ready-made WebGPU computing pipelines according to the input point coordinates for subsequent parallel computing. Step S803, input the vertex data and the generated depth map into the computing pipeline, convert the input vertices to uv coordinates, and generate a curve equation according to the uv coordinates of two points. Step S804, convert the gray value range of the curve equation into the frequency domain space, calculate the ratio of the high-frequency in the depth map in the computing pipeline, and dynamically adjust the number of interpolations according to the ratio. Step S805, dynamically calculate the number of interpolations according to the ratio of the high-frequency in the depth map, so that the higher the undulation frequency of the depth value, the more interpolations, and the flatter the less interpolations.

[0128] The ground line drawing method provided by the embodiment of the present application can dynamically adjust the number of coordinate point interpolations according to the depth information in the three-dimensional scene, so as to achieve the smooth drawing effect of the curve on the ground, and is used to draw a curve in the scene and dynamically calculate the number of interpolations according to the frequency domain map to achieve the accurate and efficient drawing of the ground line.

[0129] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For the details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0130] Figure 9 It is a schematic structural diagram of the ground line generation device provided by the embodiment of the present application. As Figure 9As shown in the figure, the ground contact line generating device 900 includes an image acquisition module 910, a coordinate acquisition module 920, a curve acquisition module 930, a quantity acquisition module 940, a coordinate point determination module 950, and a ground contact line type formation module 960.

[0131] Among them, the image acquisition module 910 is used to acquire a three-dimensional scene, a depth map after rendering the three-dimensional scene, and the coordinates of at least two points in the three-dimensional scene. The depth map is used to represent the depth information of each element in the three-dimensional scene. The coordinate acquisition module 920 is used to determine at least two vertices from the at least two points and convert the coordinates of the vertices to obtain texture mapping coordinates. The curve acquisition module 930 is used to construct a curve connecting two vertices based on the texture mapping coordinates of the at least two vertices. The quantity acquisition module 940 is used to obtain the quantity of target frequencies that meet the preset conditions in the frequency domain map obtained by converting the depth map within the range of the curve. The coordinate point determination module 950 is used to insert the target quantity of coordinate points between the vertices of the curve based on the quantity of the target frequencies. The ground contact line type formation module 960 is used to connect the at least two points and the inserted coordinate points in sequence to obtain the ground contact line.

[0132] Optionally, the quantity acquisition module can specifically be used for: sampling on the curve to obtain at least one sampling point; converting the depth map within the range of the curve to obtain a frequency domain map, and obtaining the frequencies of each known point on the curve in the frequency domain space, where the known points include the sampling points and the vertices; obtaining the quantity of target known points whose frequencies in the frequency domain space meet the preset conditions among all the known points as the quantity of the target frequencies.

[0133] Optionally, the quantity acquisition module can specifically be used for: constructing the point-slope equation of the curve based on the texture mapping coordinates of the at least two vertices; determining the sampling step size according to the texture mapping coordinate values of the at least two vertices; using the coordinates of any vertex on the curve as the starting point, and calculating at least one sampling coordinate based on the point-slope equation and the sampling step size as the coordinates of the at least one sampling point.

[0134] Optionally, the coordinate point determination module can specifically be used for obtaining the ratio of the target frequency based on the quantity of the target frequencies and the total quantity of all known points; calculating the target quantity according to the ratio of the target frequency and the preset mapping relationship, where the preset mapping relationship represents the corresponding relationship between the ratio of the target frequency and the target quantity; and uniformly inserting the coordinate points of the target quantity between the vertices of the curve.

[0135] Optionally, there is a positive correlation between the ratio of the target frequency and the target quantity of the inserted coordinate points.

[0136] Optionally, it further includes a processing and calculation module, configured to configure the number of calculation pipelines of the Web graphical processor based on the number of vertices; when two vertices are connected in sequence to form two or more curves, each calculation pipeline is used to calculate the equation of one curve, the depth map within the curve range, the ratio of the target frequency, and the coordinates of the target number of points.

[0137] The device provided in the embodiment of the present application can be used to execute the method in the above embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here.

[0138] It should be noted that it should be understood that the division of each module of the above device is only a logical function division. In actual implementation, it can be fully or partially integrated into a physical entity, or physically separated. And these modules can all be implemented in the form of software called by a processing element; they can also all be implemented in the form of hardware; or some modules can be implemented in the form of software called by a processing element, and some modules can be implemented in the form of hardware. For example, the image acquisition module can be a separately established processing element, or can be integrated in a certain chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a certain processing element of the above device to perform the functions of the above image acquisition module. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together or independently implemented. Here, the processing element can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above modules can be completed by the integrated logic circuit in the processor element or the instruction in the form of software.

[0139] Figure 10 It is a schematic structural diagram of the electronic device provided in the embodiment of the present application. As Figure 10 shown, the electronic device 1000 includes: at least one processor 1001, a memory 1002, a bus 1003, and a communication interface 1004. Among them, the processor 1001, the communication interface 1104, and the memory 1002 communicate with each other through the bus 1003. The communication interface is used to communicate with other devices. The communication interface includes a communication interface for data transmission and a display interface or an operation interface for human-computer interaction, etc. The processor is used to execute the computer execution instructions stored in the memory, and specifically can execute the relevant steps in the method described in the above embodiment.

[0140] The processor may be a central processing unit, or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. One or more processors included in the electronic device may be of the same type of processor, such as one or more CPUs; or may be of different types of processors, such as one or more CPUs and one or more ASICs. The memory is used to store computer execution instructions. The memory may include high-speed RAM memory and may also include non-volatile memory, such as at least one disk memory.

[0141] This embodiment also provides a computer-readable storage medium. Computer instructions are stored in the readable storage medium. When at least one processor of the electronic device executes the computer instructions, the electronic device executes the ground line generation method provided by the above various embodiments.

[0142] This embodiment also provides a computer program product. The program product includes computer instructions, and the computer instructions are stored in the readable storage medium. At least one processor of the electronic device can read the computer instructions from the readable storage medium, and the execution of the computer instructions by at least one processor enables the electronic device to implement the ground line generation method provided by the above various embodiments.

[0143] In this application, "at least one" means one or more, and "a plurality" means two or more. "And / or" describes the association relationship of associated objects and indicates that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after; in a formula, the character " / " represents a "division" relationship between the associated objects before and after. "At least one (item)" or a similar expression thereof refers to any combination of these items, including any combination of single item (item) or plural items (items). For example, at least one (item) of a, b, or c can represent: a, b, c, a - b, a - c, b - c, or a - b - c, where a, b, and c can be single or multiple.

[0144] It can be understood that the various numerical numbers involved in the embodiments of this application are only for the convenience of description and are not used to limit the scope of the embodiments of this application. In the embodiments of this application, the magnitude of the sequence numbers of the above processes does not mean the sequence of execution. The execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of this application.

[0145] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than limiting them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for generating a ground contact line, characterized in that Including: Obtain a three-dimensional scene, a depth map after rendering the three-dimensional scene, and the coordinates of at least two points in the three-dimensional scene, where the depth map is used to represent the depth information of each element in the three-dimensional scene; Determine at least two vertices from the at least two points, and convert the coordinates of the vertices to obtain texture mapping coordinates; Based on the texture mapping coordinates of at least two vertices, construct a curve connecting the two vertices; Obtain the number of target frequencies that meet the preset conditions in the frequency domain map obtained by converting the depth map within the range of the curve; Based on the number of target frequencies, insert a target number of coordinate points between every two vertices of the curve; Connect the at least two points and the inserted coordinate points in sequence to obtain a ground contact line.

2. The method according to claim 1, wherein The obtaining the number of target frequencies that meet the preset conditions in the frequency domain map obtained by converting the depth map within the range of the curve includes: Sample at least one sampling point on the curve; Convert the depth map within the range of the curve to obtain a frequency domain map, and obtain the frequency of each known point on the curve in the frequency domain space, where the known points include the sampling points and the vertices; Obtain the number of target known points whose frequencies in the frequency domain space meet the preset conditions among all known points, and use it as the number of target frequencies.

3. The method according to claim 2, wherein The sampling at least one sampling point on the curve includes: Based on the texture mapping coordinates of the at least two vertices, construct the point-slope equation of the curve; Determine the sampling step size according to the texture mapping coordinate values of the at least two vertices; Use the coordinates of any vertex on the curve as the starting point, and based on the point-slope equation and the sampling step size, calculate at least one sampling coordinate as the coordinates of at least one sampling point.

4. The method according to claim 1, wherein The inserting a target number of coordinate points between every two vertices of the curve based on the number of target frequencies includes: Based on the number of target frequencies and the total number of all known points, obtain the ratio of the target frequencies; According to the ratio of the target frequencies and the preset mapping relationship, calculate the target number, where the preset mapping relationship represents the corresponding relationship between the ratio of the target frequencies and the target number; Uniformly insert the coordinate points of the target number between the vertices of the curve.

5. The method according to claim 1, wherein There is a positive correlation between the ratio of the target frequencies and the target number of the inserted coordinate points.

6. The method according to any one of claims 1-5, characterized in that, The method further includes: Configure the number of computing pipelines of the Web graphical processor based on the number of vertices; When two or more curves are formed by connecting the vertices in sequence, use each computing pipeline to calculate the equation of one curve, the depth map within the range of the curve, the ratio of the target frequencies, and the coordinate points of the target number respectively.

7. A ground line generating device, characterized in that, Including: An image acquisition module, configured to obtain a three-dimensional scene, a depth map after rendering the three-dimensional scene, and the coordinates of at least two points in the three-dimensional scene, where the depth map is used to represent the depth information of each element in the three-dimensional scene; A coordinate acquisition module, configured to determine at least two vertices from the at least two points, and convert the coordinates of the vertices to obtain texture mapping coordinates; A curve acquisition module, configured to construct a curve connecting the two vertices based on the texture mapping coordinates of at least two vertices; A quantity acquisition module, configured to acquire the quantity of target frequencies that meet a preset condition in a frequency domain graph converted from a depth map within the range of the curve; A coordinate point determination module, configured to insert a target quantity of coordinate points between every two vertices of the curve based on the quantity of the target frequencies; A ground contact line type formation module, configured to connect the at least two points and the inserted coordinate points in sequence to obtain a ground contact line.

8. An electronic device, characterized in that, Comprising: A processor, and a memory communicatively connected to the processor; The memory stores computer execution instructions; The processor executes the computer execution instructions stored in the memory to implement the method according to any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, Computer execution instructions are stored in the computer-readable storage medium, and when the computer execution instructions are executed by a processor, they are used to implement the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method according to any one of claims 1-6.