Ground culvert point cloud boundary extraction method and device, electronic equipment and storage medium
By using a ground-culvert point cloud boundary extraction method and automated processing of sonar data, the blind spots and manual dependence of traditional detection methods are solved, achieving efficient and high-precision 3D structure extraction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- POWERCHINA WATER ENVIRONMENT GOVERANCE
- Filing Date
- 2025-03-21
- Publication Date
- 2026-07-21
Smart Images

Figure CN120411148B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of culvert detection technology, and in particular to a method, apparatus, electronic device, and storage medium for extracting the boundary of culvert point cloud. Background Technology
[0002] Culverts are an important component of water conservancy, drainage, and transportation infrastructure. However, culverts are prone to problems such as siltation and debris accumulation. Over long-term use, silt buildup can reduce the culvert's flow capacity, potentially leading to overflows and structural damage, affecting the safety and operation of hydraulic facilities. Traditional pipeline inspection methods, such as manual measurement and closed-circuit television (CCTV) inspection, while mature, have blind spots when applied to culverts with complex geometries, and can only provide two-dimensional images, failing to fully reflect the three-dimensional structure. Furthermore, manual measurement often relies on the experience and skills of the surveyors, making the results susceptible to subjective influence. Manual measurement is not only inefficient but also prone to errors due to personnel fatigue, lack of experience, or complex environments. While CCTV inspection technically achieves direct recording and real-time transmission of the pipeline's internal conditions, the analysis and interpretation of the results still heavily depend on manual labor. For example, the large amount of image and video data collected by the CCTV inspection system requires professional personnel to analyze frame by frame to identify the type and extent of defects inside the pipeline. This manual interpretation process is not only time-consuming and labor-intensive but also easily influenced by subjective judgment, leading to biased results. It is evident that these methods rely on manual interpretation, which is cumbersome, inefficient, and lacks intelligence and automation, making it difficult to meet the high-efficiency and high-precision requirements of modern engineering. Summary of the Invention
[0003] This application aims to address at least one of the technical problems existing in the prior art. To this end, this application proposes a method, apparatus, electronic device, and storage medium for extracting the boundary of culvert point clouds, which can automatically extract the boundary of culvert point clouds, thereby improving the efficiency and accuracy of culvert point cloud boundary extraction.
[0004] In a first aspect, embodiments of this application provide a method for extracting the boundary of a ground-culvert point cloud, including:
[0005] Acquire initial sonar data of the target culvert; wherein, the initial sonar data is: intensity information of the cross-section of multiple frames with different scanning sections;
[0006] The intensity information of each frame section is subjected to coordinate transformation processing to obtain the cross-sectional point cloud data Pi corresponding to the intensity information of each frame section;
[0007] Statistical filtering is performed on the cross-sectional point cloud data Pi of each frame to obtain smooth target point cloud data Ai.
[0008] The concave hull boundary is extracted from the target point cloud data Ai to obtain the boundary feature points Bi of the target point cloud data Ai;
[0009] The minimum bounding rectangle is calculated based on the boundary feature point Bi. The boundary information of the overall point cloud data is preserved and the boundary features are optimized based on the minimum bounding rectangle to obtain the boundary of the culvert point cloud.
[0010] According to some embodiments of this application, the step of performing statistical filtering on each frame of the cross-sectional point cloud data Pi to obtain smooth target point cloud data Ai includes:
[0011] Iterate through each point in the cross-sectional point cloud data Pi and calculate the average distance between each point and its k neighboring points;
[0012] Traverse each point in the cross-sectional point cloud data Pi, and calculate the average distance μ from each point to any other point based on the mean calculation formula;
[0013] The target mean range is determined based on the distance to the average value μ, the preset standard deviation multiple std, and the number of neighboring points k.
[0014] The average distance of each point is compared with the target mean range. Points whose average distance is within the target mean range are identified as valid points, and points whose average distance is outside the target mean range are identified as outliers.
[0015] The outliers are deleted, and the remaining valid points are determined as the target point cloud data Ai.
[0016] According to some embodiments of this application, the formula for calculating the mean is as follows:
[0017]
[0018] Where i represents the i-th point in the cross-sectional point cloud data Pi; Si represents the Euclidean distance between the i-th point and any other point; and n is the number of points in the cross-sectional point cloud data Pi.
[0019] The Euclidean distance between any two points Pn(Xn, Yn, Zn) and Pm(Xm, Ym, Zm) in the point cloud data is expressed as:
[0020]
[0021] According to some embodiments of this application, the step of performing concave hull boundary extraction processing on the target point cloud data Ai to obtain the boundary feature points Bi of the target point cloud data Ai includes:
[0022] The Delaunay triangulation of the target point cloud data Ai is calculated by iteratively and incrementally inserting points or recursively dividing regions, resulting in a set of triangles T.
[0023] Calculate the circumradius of each triangle in the triangle set T;
[0024] A set of valid triangles A is generated based on the triangles whose circumcircle radius is less than a preset boundary threshold. α (P); where the preset boundary threshold is the reciprocal of the preset boundary control parameter α;
[0025] For the set of valid triangles A α (P) Eliminate internal duplicate edges and remove isolated edges that do not form a closed contour to obtain boundary feature points B. i .
[0026] According to some embodiments of this application, the step of calculating the minimum bounding rectangle based on the boundary feature point Bi includes:
[0027] Based on the boundary feature point Bi, determine the first direction vector of each edge and the second direction vector of each edge that is perpendicular to the first direction vector.
[0028] The process involves iterating through all edges on the boundary, performing vertex projection based on the first direction vector and the second direction vector, candidate rectangle determination, and rectangle area calculation on each edge to obtain the candidate rectangle corresponding to each edge and the rectangle area of each candidate rectangle.
[0029] The candidate rectangle with the smallest area is determined as the minimum bounding rectangle.
[0030] According to some embodiments of this application, the step of performing vertex projection processing based on the first direction vector and the second direction vector, candidate rectangle determination processing, and rectangle area calculation processing on each edge to obtain the candidate rectangle corresponding to each edge and the rectangle area of all the candidate rectangles includes:
[0031] Identify the edge to be detected;
[0032] Project all vertices onto the first direction vector containing the edges to obtain the horizontal projection lengths of all vertices;
[0033] Project all vertices onto the second direction vector perpendicular to the edge to obtain the vertical projection length of all vertices;
[0034] Determine the maximum and minimum horizontal projection values from the horizontal projection lengths of all vertices;
[0035] Determine the maximum and minimum vertical projection values from the vertical projection lengths of all vertices;
[0036] Based on the maximum horizontal projection value, the minimum horizontal projection value, the maximum vertical projection value, and the minimum vertical projection value, four rectangle vertices are determined; based on the four rectangle vertices, a candidate rectangle is determined.
[0037] The rectangular area of the candidate rectangle is calculated based on the maximum horizontal projection value, the minimum horizontal projection value, the maximum vertical projection value, and the minimum vertical projection value.
[0038] According to some embodiments of this application, calculating the rectangular area of the candidate rectangle based on the maximum horizontal projection value, the minimum horizontal projection value, the maximum vertical projection value, and the minimum vertical projection value includes:
[0039] Subtracting the maximum horizontal projection value from the minimum horizontal projection value yields the horizontal side length of the candidate rectangle.
[0040] Subtracting the maximum vertical projection value from the minimum vertical projection value yields the vertical side length of the candidate rectangle.
[0041] The area of the candidate rectangle is obtained by multiplying the length of its horizontal side by the length of its vertical side.
[0042] Secondly, embodiments of this application provide a culvert point cloud boundary extraction device, including at least one processor and a memory for communicatively connecting to the at least one processor; the memory stores instructions executable by the at least one processor, which are executed by the at least one processor to enable the at least one processor to perform the culvert point cloud boundary extraction method as described in any of the embodiments of the first aspect.
[0043] Thirdly, embodiments of this application provide an electronic device, including the ground culvert point cloud boundary extraction device as described in the second aspect embodiment.
[0044] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions for causing a computer to perform the ground culvert point cloud boundary extraction method as described in any of the embodiments of the first aspect.
[0045] This application embodiment includes: First, by utilizing a culvert point cloud boundary extraction device, initial sonar data of the target culvert to be measured is acquired; wherein, the initial sonar data is: intensity information of cross sections from multiple frames of different scan sections; second, coordinate transformation processing is performed on the intensity information of each frame of cross section to obtain cross section point cloud data Pi corresponding to the intensity information of each frame of cross section; this lays the data foundation for subsequent data processing; then, statistical filtering processing is performed on each frame of cross section point cloud data Pi to obtain smooth target point cloud data Ai; large-scale noise reduction is achieved through statistical filtering processing, which is beneficial to improving data quality and accuracy, reducing the interference of outliers on boundary detection, and improving the accuracy and reliability of boundary extraction. Then, concave hull boundary extraction processing is performed on the target point cloud data Ai to obtain boundary feature points Bi of the target point cloud data Ai; finally, the minimum bounding rectangle is calculated based on the boundary feature points Bi, and the boundary information of the overall point cloud data is preserved and the boundary features are optimized based on the minimum bounding rectangle to obtain the culvert point cloud boundary. Thus, the culvert point cloud boundary is automatically extracted based on the initial sonar data, replacing the tedious process of manual interpretation, improving the efficiency and accuracy of culvert point cloud boundary extraction, thereby greatly improving the efficiency of engineering projects. In other words, the embodiments of this application can automatically extract culvert point cloud boundaries, which is beneficial to improving the efficiency and accuracy of culvert point cloud boundary extraction.
[0046] Other features and advantages of this application will be set forth in the following description and will be apparent in part from the description or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the description and the accompanying drawings. Attached Figure Description
[0047] Figure 1 This is a flowchart illustrating the steps of a method for extracting the boundary of a ground culvert point cloud according to an embodiment of this application;
[0048] Figure 2 This is a schematic diagram of a frame of cross-sectional point cloud data obtained after decoding, provided in one embodiment of this application;
[0049] Figure 3 This is a schematic diagram illustrating the specific process of calculating the minimum bounding rectangle based on boundary feature points according to an embodiment of this application;
[0050] Figure 4 This is a schematic diagram of the hardware structure of a ground culvert point cloud boundary extraction device provided in one embodiment of this application. Detailed Implementation
[0051] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments.
[0052] It should be understood that in the description of this application, the orientation descriptions, such as up, down, front, back, left, right, etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application.
[0053] It should be noted that although a logical order is shown in the flowcharts in this application, in some cases, the steps shown or described may be performed in a different order than that shown in the flowcharts. In the description of this application, "several" means one or more, and "more" means two or more. The terms "first" and "second" are used only to distinguish technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of technical features indicated, or implicitly indicating the order in which the technical features are indicated.
[0054] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0055] This application provides a method, device, electronic device, and computer-readable storage medium for extracting culvert point cloud boundaries, relating to the field of culvert detection technology. The method includes: acquiring initial sonar data of the target culvert; the initial sonar data consists of intensity information of multiple frames of different scan sections; performing coordinate transformation on the intensity information of each frame to obtain the corresponding section point cloud data Pi; performing statistical filtering on the section point cloud data Pi to obtain smoothed target point cloud data Ai; performing concave hull boundary extraction on the target point cloud data Ai to obtain boundary feature points Bi of the target point cloud data Ai; calculating the minimum bounding rectangle based on the boundary feature points Bi; and preserving boundary information and optimizing boundary features of the overall point cloud data based on the minimum bounding rectangle to obtain the culvert point cloud boundary. This method can automatically extract culvert point cloud boundaries, which is beneficial for improving the efficiency and accuracy of culvert point cloud boundary extraction.
[0056] The embodiments of this application will be further described below with reference to the accompanying drawings.
[0057] Firstly, such as Figure 1 As shown, the method for extracting the boundary of the culvert cloud may include, but is not limited to, steps S110 to S150.
[0058] Step S110: Obtain the initial sonar data of the target culvert to be tested; wherein, the initial sonar data is: intensity information of the cross section of multiple frames with different scanning sections.
[0059] Step S120: Perform coordinate transformation on the intensity information of each frame section to obtain the section point cloud data Pi corresponding to the intensity information of each frame section.
[0060] Step S130: Perform statistical filtering on each frame of cross-sectional point cloud data Pi to obtain smooth target point cloud data Ai.
[0061] Step S140: Perform concave hull boundary extraction processing on the target point cloud data Ai to obtain the boundary feature points Bi of the target point cloud data Ai.
[0062] Step S150: Calculate the minimum bounding rectangle based on the boundary feature points Bi, and preserve the boundary information and optimize the boundary features of the overall point cloud data based on the minimum bounding rectangle to obtain the boundary of the culvert point cloud.
[0063] Through steps S110 to S150, using the culvert point cloud boundary extraction device, firstly, the initial sonar data of the target culvert to be measured is acquired; wherein, the initial sonar data is: intensity information of the cross-sections of multiple frames with different scan sections; secondly, coordinate transformation processing is performed on the intensity information of each frame of cross-sections to obtain the cross-section point cloud data Pi corresponding to the intensity information of each frame of cross-sections; this lays the data foundation for subsequent data processing; then, statistical filtering processing is performed on each frame of cross-section point cloud data Pi to obtain smooth target point cloud data Ai; large-scale noise reduction is achieved through statistical filtering processing, which is beneficial to improving the quality and accuracy of data, reducing the interference of outliers on boundary detection, and improving the accuracy and reliability of boundary extraction. Then, concave hull boundary extraction processing is performed on the target point cloud data Ai to obtain the boundary feature points Bi of the target point cloud data Ai; finally, the minimum bounding rectangle is calculated based on the boundary feature points Bi, and the boundary information of the overall point cloud data is preserved and the boundary features are optimized based on the minimum bounding rectangle to obtain the culvert point cloud boundary. Thus, the culvert point cloud boundary is automatically extracted based on the initial sonar data, replacing the tedious process of manual interpretation, improving the efficiency and accuracy of culvert point cloud boundary extraction, thereby greatly improving the efficiency of engineering projects. Therefore, the embodiments of this application can automatically extract culvert point cloud boundaries, which is beneficial to improving the efficiency and accuracy of culvert point cloud boundary extraction.
[0064] Further explanation of steps S110 to S120: Steps S110 to S120 specifically include: First, acquiring the initial sonar data to be interpreted within the target culvert collected by the sonar device, wherein the initial sonar data is a sonar format data; the initial sonar data is: intensity information of cross sections from multiple frames of different scan sections; then, interpreting the initial sonar data to obtain cross section point cloud data Pi; the interpretation process is: performing coordinate transformation processing on the intensity information of each frame of cross section to obtain the cross section point cloud data Pi corresponding to the intensity information of each frame of cross section. This lays the data foundation for subsequent data processing. Specifically, in this embodiment, the cross section point cloud data obtained by interpreting a frame of initial sonar data according to the sonar device's acquisition principle is as follows... Figure 2 As shown.
[0065] According to some embodiments of this application, step S130 is further described. Step S130: Statistical filtering is performed on each frame of cross-sectional point cloud data Pi to obtain smooth target point cloud data Ai, including but not limited to steps S131 to S134.
[0066] Step S131: Traverse each point in the cross-sectional point cloud data Pi and calculate the average distance between each point and its k neighboring points.
[0067] Step S132: Traverse each point in the cross-sectional point cloud data Pi, and calculate the average distance μ between each point and any other point based on the mean calculation formula.
[0068] Step S133: Determine the target mean range based on the average distance μ, the preset standard deviation multiple std, and the number of neighboring points k.
[0069] Step S134: Compare the average distance of each point with the preset target mean range, and determine the points whose average distance is within the target mean range as valid points, and determine the points whose average distance is outside the target mean range as outliers.
[0070] Step S135: Delete outliers and determine the remaining valid points as the target point cloud data Ai.
[0071] Further explaining step S131, the average distance between a point and its k neighboring points is calculated using the Euclidean distance formula. Specifically, first, the number of neighboring points k (i.e., k neighboring points) is determined; then, the Euclidean distance value Si between the point and each of the k neighboring points is calculated using the Euclidean distance formula, resulting in k Euclidean distance values Si; finally, the calculated k Euclidean distance values Si are added together and divided by k to obtain the average distance between the point and its k neighboring points. This process is repeated to obtain the average distance L between each point and its k neighboring points.
[0072] Further explanation of the specific method for calculating the Euclidean distance in step S131. It can be understood that, assuming the coordinates of the nth point in the point cloud are Pn(Xn, Yn, Zn), then the Euclidean distance between point Pn(Xn, Yn, Zn) and any point Pm(Xm, Ym, Zm) is:
[0073]
[0074] Specifically, in the actual algorithm implementation, the neighborhood size k is set to 100.
[0075] Further explaining step S132, according to some embodiments of this application, specifically, the formula for calculating the mean is as follows:
[0076]
[0077] Where i represents the i-th point in the cross-sectional point cloud data Pi; Si represents the Euclidean distance between the i-th point and any other point; and n is the number of points in the cross-sectional point cloud data Pi.
[0078] Let the coordinates of the nth point in the point cloud be Pn(Xn, Yn, Zn), and the Euclidean distance between this point Pn(Xn, Yn, Zn) and any point Pm(Xm, Ym, Zm) be:
[0079]
[0080] Further explanation of step S133. It is understood that, by performing statistical analysis on the area of each store, the distances of all points in the point cloud are assumed to follow a Gaussian distribution, the shape of which is determined by the mean distance μ and the standard deviation σ. This is achieved by calculating the mean distance μ and the Euclidean distance S between a single point and any other point in step S132. i Next, calculate the corresponding standard deviation σ. The formula for calculating the standard deviation is:
[0081]
[0082] In the actual algorithm implementation, a standard deviation factor *std* is set; specifically, the standard deviation factor *std* is set to 0.2. Based on the average distance *μ*, the standard deviation *σ*, and the standard deviation factor *std*, the first and second endpoints of the preset target mean range are determined, where the second endpoint is greater than the first endpoint. Specifically, the first endpoint of the target mean range is: *μ-σ·std*; the second endpoint of the target mean range is: *μ+σ·std*; therefore, the target mean range is: [*μ-σ·std*, *μ+σ·std*]. When the average distance *L* between a point and its k neighboring points falls within the target mean range [*μ-σ·std*, *μ+σ·std*], the point is considered a valid point and is retained; conversely, when the average distance *L* between a point and its k neighboring points does not fall within the target mean range [*μ-σ·std*, *μ+σ·std*], the point is considered an outlier and is removed. All retained valid points constitute the smoothed target point cloud data *Ai*.
[0083] Through steps S131 to S135, large-scale noise reduction is achieved through statistical filtering. Outliers are removed from the cross-sectional point cloud data Pi of each frame, resulting in smooth target point cloud data Ai. This improves data quality and accuracy and reduces the interference of outliers on boundary detection. Furthermore, statistical filtering can retain important geometric features of the data as much as possible while removing noise. Thus, after noise removal through statistical filtering, boundary features become more apparent, which helps improve the accuracy and reliability of boundary extraction.
[0084] According to some embodiments of this application, step S140 is further described. Step S140: The concave hull boundary is extracted from the target point cloud data Ai to obtain the boundary feature points Bi of the target point cloud data Ai, including but not limited to steps S141 to S144.
[0085] Step S141: Calculate the Delaunay triangulation of the target point cloud data Ai by iteratively inserting points or recursively dividing the region, and obtain the triangle set T.
[0086] Step S142: Calculate the circumcircle radius for each triangle in the triangle set T.
[0087] Step S143: Generate a set A of valid triangles based on triangles whose circumcircle radius is less than a preset boundary threshold. α (P); where the preset boundary threshold is the reciprocal of the preset boundary control parameter α.
[0088] Step S144: For the set of valid triangles A α (P) Eliminate internal duplicate edges and remove isolated edges that do not form a closed contour to obtain boundary feature points B. i .
[0089] Steps S141 to S144 involve extracting boundary feature points B from the obtained smooth target point cloud data Ai using a concave hull boundary extraction algorithm. i The specific process of the principle of steps S141 to S144 will be further explained.
[0090] First, the Delaunay triangulation of the target point cloud data Ai is calculated by iteratively inserting points or recursively dividing the region, resulting in a triangle set T. Next, for each triangle t in the triangle set T, the circumcircle radius r(t) of triangle t is calculated. The formula for calculating the circumcircle radius is:
[0091] Where a, b, and c are the lengths of the three sides of triangle t, and A is the area of triangle t.
[0092] Based on the calculated circumcircle radius r(t) of each triangle t, the Alpha Shape is calculated.
[0093] Specifically, Alpha Shape is a method for extracting boundaries from Delaunay triangulation, defined as:
[0094]
[0095] Among them, A α (P) is the set of valid triangles that meet the filtering criteria, i.e., the set of valid triangles; D(P) is the Delaunay triangulation set of the point set P, and r(t) is the circumradius of triangle t; α is the boundary control parameter, which determines the complexity of the boundary. Specifically, the boundary control parameter α is an important parameter for controlling the shape of the boundary. When the boundary control parameter α is larger, the extracted boundary is more compact; when the boundary control parameter α is smaller, the boundary becomes looser, which is beneficial for capturing the shape of the overall contour. In the embodiment of this application, the boundary control parameter α is 0.1.
[0096] Based on the boundary control parameter α, triangles that meet the selection criteria are selected:
[0097]
[0098] For the obtained set of valid triangles, the geometry of its edges needs to be filtered to ensure the integrity of the boundaries. Specifically, through set operations or a marking mechanism, internal duplicate edges are first eliminated, then isolated edges that do not form a closed contour are removed, and finally the boundary feature points Bi are obtained.
[0099] Through steps S141 to S144, the target point cloud data Ai is automatically processed based on the concave hull boundary extraction algorithm to extract the boundary feature points B.i This lays the data foundation for subsequent calculations of the minimum bounding rectangle.
[0100] According to some embodiments of this application, in conjunction with Figure 3 Further explanation of step S150: The minimum bounding rectangle is calculated based on the boundary feature point Bi, including but not limited to steps S151 to S153.
[0101] Step S151: Based on the boundary feature point Bi, determine the first direction vector of each edge and the second direction vector of each edge that is perpendicular to the first direction vector.
[0102] Step S152: Iterate through all edges on the boundary in sequence, and perform vertex projection processing based on the first direction vector and the second direction vector, candidate rectangle determination processing, and rectangle area calculation processing for each edge to obtain the candidate rectangle corresponding to each edge and the rectangle area of each candidate rectangle.
[0103] Step S153: Determine the candidate rectangle with the smallest area as the smallest bounding rectangle.
[0104] Further explanation of step S151. For the already obtained boundary feature point B... i Extract each edge e i The first direction vector:
[0105] e i =p i+1 ,i∈[1,m],p m+1 =p1 (6)
[0106] Where m is the number of vertices in the boundary shape. The edges of the boundary contour are defined by sequentially adjacent vertices.
[0107] For ease of calculation, the first direction vector is represented as: e i =(x i y i The second direction vector, which is perpendicular to the first direction vector, is represented as: This facilitates subsequent vertex projection processing based on the first and second direction vectors.
[0108] According to some embodiments of this application, step S152 is further described. Step S152: For each edge, vertex projection processing based on the first direction vector and the second direction vector, candidate rectangle determination processing, and rectangle area calculation processing are performed to obtain the candidate rectangle corresponding to each edge and the rectangle area of all candidate rectangles, including but not limited to steps S1531 to S1537.
[0109] Step S1531: Determine the edge to be detected.
[0110] Step S1532: Project all vertices onto the first direction vector where the edges are located to obtain the horizontal projection length of all vertices.
[0111] Step S1533: Project all vertices onto the second direction vector perpendicular to the edge to obtain the vertical projection length of all vertices.
[0112] Step S1534: Determine the maximum and minimum horizontal projection values from the horizontal projection lengths of all vertices.
[0113] Step S1535: Determine the maximum and minimum vertical projection values from the vertical projection lengths of all vertices.
[0114] Step S1536: Determine four rectangle vertices based on the maximum horizontal projection value, minimum horizontal projection value, maximum vertical projection value, and minimum vertical projection value; determine a candidate rectangle based on the four rectangle vertices.
[0115] Step S1537: Calculate the rectangular area of the candidate rectangle based on the maximum horizontal projection value, minimum horizontal projection value, maximum vertical projection value, and minimum vertical projection value.
[0116] Specifically, in this embodiment of the application, vertex projection processing based on the first direction vector and the second direction vector is implemented through steps S1531 to S1535; candidate rectangle determination processing is implemented through step S1536; and rectangle area calculation processing is implemented through step S1537.
[0117] To illustrate further, we will provide an example of the vertex projection processing implemented in steps S1531 to S1535 of the embodiments of this application.
[0118] Determine the edge to be detected, and assign a vertex p to it. j Projecting onto the first direction vector of the edge, we obtain vertex p. j The horizontal projection length is: Let a vertex p j Projecting onto the second direction vector perpendicular to the edge, we obtain vertex p. j The vertical projection length is: Further, determine vertex p j The projected coordinates are: By analogy, the horizontal projection length, vertical projection length, and projection coordinates of all vertices can be obtained.
[0119] Where, p j,|| Able to determine the horizontal boundary of the candidate rectangle, p j,⊥ It can determine the vertical boundary of the candidate rectangle.
[0120] After obtaining the horizontal and vertical projection lengths of all vertices, the maximum horizontal projection value, maxp, is selected. || Minimum horizontal projection value minp || Maximum vertical projection value minp ⊥ Minimum vertical projection value minp ⊥ The vertices of the rectangle are represented as:
[0121]
[0122] The horizontal and vertical boundaries of a candidate rectangle can be determined by the four vertices of the rectangle, thus identifying a candidate rectangle.
[0123] By analogy, all edges on the boundary are traversed in turn, and vertex projection processing based on the first direction vector and the second direction vector is performed on each edge as shown in steps S1531 to S1535 to obtain the candidate rectangle corresponding to each edge.
[0124] Then, the area of the candidate rectangle can be calculated for each rotation state.
[0125] According to some embodiments of this application, step S1537 is further described. Step S1537: Calculating the rectangular area of the candidate rectangle based on the maximum horizontal projection value, the minimum horizontal projection value, the maximum vertical projection value, and the minimum vertical projection value includes the following steps: subtracting the maximum horizontal projection value from the minimum horizontal projection value to obtain the horizontal side length of the candidate rectangle; subtracting the maximum vertical projection value from the minimum vertical projection value to obtain the vertical side length of the candidate rectangle; and multiplying the horizontal side length and the vertical side length of the candidate rectangle to obtain the rectangular area of the candidate rectangle.
[0126] Here's an example to further illustrate how to calculate the area of a rectangle.
[0127] The maximum horizontal projection value maxp || With minimum horizontal projection value minp || Subtracting the two values gives the length of the horizontal side of the candidate rectangle; the formula for calculating the horizontal side length is: Δp || =maxp || -minp || (10).
[0128] The maximum vertical projection value maxp ⊥ With the minimum vertical projection value minp ⊥ Subtracting the two values gives the length of the vertical side of the candidate rectangle; the formula for calculating the vertical side length is: Δp ⊥ =maxp ⊥ -minp ⊥ (11).
[0129] The area of the candidate rectangle is calculated based on formulas (10) and (11); the formula for calculating the area S of the rectangle is: S = Δp || ·Δp ⊥ (12).
[0130] Through steps S151 to S153, the minimum bounding rectangle is automatically calculated based on the boundary feature point Bi, so that the boundary information of the overall point cloud data can be preserved and the boundary features optimized based on the minimum bounding rectangle to obtain the culvert point cloud boundary; this is beneficial to improving the accuracy and efficiency of extracting the culvert point cloud boundary.
[0131] Specifically, the culvert point cloud boundary extraction method based on the embodiments of this application can achieve automatic batch processing. After processing, all denoising results of full-water culverts are automatically saved to the target directory, and multiple culvert point cloud boundary extraction results can be displayed simultaneously on the terminal interface. Thus, by processing the culvert point cloud boundary extraction method according to the embodiments of this application, a batch of underground culvert siltation depth result maps are obtained, which can greatly improve work efficiency and reduce labor costs.
[0132] In summary, to address the significant manual boundary extraction required for sonar detection data, this application proposes a method for extracting and fitting the boundary of underground culvert point clouds based on concave hull boundary extraction and minimum bounding rectangle. This method enables automated processing of sonar detection data for underground culverts under full water conditions. It demonstrates excellent performance in automated batch processing, rapidly interpreting sonar-acquired data into multi-frame cross-sectional point cloud data. After a series of automated processes, boundary features are extracted, significantly improving the data processing efficiency for sonar detection of underground culverts under full water conditions and reducing manual labor costs.
[0133] like Figure 4 As shown in the figure, this application embodiment also provides a ground culvert point cloud boundary extraction device, including:
[0134] The processor 401 can be implemented using a general-purpose central processing unit (CPU), microprocessor, application specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.
[0135] The memory 402 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 402 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 402 and called and executed by the processor 401 to execute the ground culvert point cloud boundary extraction method of the embodiments of this application.
[0136] Input / output interface 403 is used to implement information input and output;
[0137] The communication interface 404 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0138] Bus 405 transmits information between various components of the device (e.g., processor 401, memory 402, input / output interface 403, and communication interface 404);
[0139] The processor 401, memory 402, input / output interface 403 and communication interface 404 are connected to each other within the device via bus 405.
[0140] Those skilled in the art will understand that the system structure shown in the figures does not constitute a limitation on the embodiments of this application, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0141] The system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0142] It will be understood by those skilled in the art that the system architecture and application scenarios described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. It is known by those skilled in the art that with the evolution of system architecture and the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0143] This application also provides an electronic device, including the ground culvert point cloud boundary extraction device described above.
[0144] This application embodiment also provides a storage medium, which is a computer-readable storage medium, storing a computer program that, when executed by a processor, implements the above-described method for extracting the boundary of culvert point clouds.
[0145] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof. The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separate, and may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0146] It will be understood by those skilled in the art that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically include computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0147] The above provides a detailed description of the preferred embodiments of this application. However, this application is not limited to the above-described embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of this application. All such equivalent modifications or substitutions are included within the scope defined by this application.
Claims
1. A method for extracting the boundary of a ground-culvert point cloud, characterized in that, include: Acquire initial sonar data of the target culvert; wherein, the initial sonar data is: intensity information of multiple frames of different scan sections; The intensity information of each frame section is subjected to coordinate transformation processing to obtain the cross-sectional point cloud data Pi corresponding to the intensity information of each frame section; Statistical filtering is performed on the cross-sectional point cloud data Pi of each frame to obtain smooth target point cloud data Ai. The concave hull boundary is extracted from the target point cloud data Ai to obtain the boundary feature points Bi of the target point cloud data Ai; The minimum bounding rectangle is calculated based on the boundary feature point Bi. The boundary information of the overall point cloud data is preserved and the boundary features are optimized based on the minimum bounding rectangle to obtain the boundary of the culvert point cloud. The step of performing statistical filtering on each frame of the cross-sectional point cloud data Pi to obtain smooth target point cloud data Ai includes: Iterate through each point in the cross-sectional point cloud data Pi and calculate the average distance between each point and its k neighboring points; Iterate through each point in the cross-sectional point cloud data Pi, and calculate the average distance between each point and any other point based on the mean calculation formula. ; Based on average distance The target mean range is determined by the preset standard deviation multiple std and the number of neighboring points k; The average distance of each point is compared with the target mean range. Points whose average distance is within the target mean range are identified as valid points, and points whose average distance is outside the target mean range are identified as outliers. The outliers are deleted, and the remaining valid points are determined as the target point cloud data Ai. The step of performing concave hull boundary extraction processing on the target point cloud data Ai to obtain the boundary feature points Bi of the target point cloud data Ai includes: The Delaunay triangulation of the target point cloud data Ai is calculated by iteratively and incrementally inserting points or recursively dividing regions, resulting in a set of triangles T. Calculate the circumradius of each triangle in the triangle set T; A set of valid triangles is generated based on the triangles whose circumcircle radius is less than a preset boundary threshold. Wherein, the preset boundary threshold is a preset boundary control parameter. The reciprocal of; For the set of valid triangles Eliminate internal duplicate edges and remove isolated edges that do not form a closed contour to obtain boundary feature points. ; The step of calculating the minimum bounding rectangle based on the boundary feature point Bi includes: Based on the boundary feature point Bi, determine the first direction vector of each edge and the second direction vector of each edge that is perpendicular to the first direction vector. The process involves iterating through all edges on the boundary, performing vertex projection based on the first direction vector and the second direction vector, candidate rectangle determination, and rectangle area calculation on each edge to obtain the candidate rectangle corresponding to each edge and the rectangle area of each candidate rectangle. The candidate rectangle with the smallest area is determined as the minimum bounding rectangle; The process of performing vertex projection processing based on the first direction vector and the second direction vector, candidate rectangle determination processing, and rectangle area calculation processing on each edge to obtain the candidate rectangle corresponding to each edge and the rectangle area of all the candidate rectangles includes: Identify the edge to be detected; Project all vertices onto the first direction vector containing the edges to obtain the horizontal projection lengths of all vertices; Project all vertices onto the second direction vector perpendicular to the edge to obtain the vertical projection length of all vertices; Determine the maximum and minimum horizontal projection values from the horizontal projection lengths of all vertices; Determine the maximum and minimum vertical projection values from the vertical projection lengths of all vertices; Based on the maximum horizontal projection value, the minimum horizontal projection value, the maximum vertical projection value, and the minimum vertical projection value, four rectangle vertices are determined; based on the four rectangle vertices, a candidate rectangle is determined. The rectangular area of the candidate rectangle is calculated based on the maximum horizontal projection value, the minimum horizontal projection value, the maximum vertical projection value, and the minimum vertical projection value.
2. The method for extracting the boundary of a ground-culvert point cloud according to claim 1, characterized in that, The formula for calculating the mean is: ; Where i represents the i-th point in the cross-sectional point cloud data Pi; Si represents the Euclidean distance between the i-th point and any other point; and n is the number of points in the cross-sectional point cloud data Pi. The Euclidean distance between any two points Pn(Xn, Yn, Zn) and Pm(Xm, Ym, Zm) in the point cloud data is expressed as: 。 3. The method for extracting the boundary of a ground-culvert point cloud according to claim 1, characterized in that, The step of calculating the rectangular area of the candidate rectangle based on the maximum horizontal projection value, the minimum horizontal projection value, the maximum vertical projection value, and the minimum vertical projection value includes: Subtracting the maximum horizontal projection value from the minimum horizontal projection value yields the horizontal side length of the candidate rectangle. Subtracting the maximum vertical projection value from the minimum vertical projection value yields the vertical side length of the candidate rectangle. The area of the candidate rectangle is obtained by multiplying the length of its horizontal side by the length of its vertical side.
4. A device for extracting the boundary of a ground culvert point cloud, characterized in that, It includes at least one processor and a memory for communicatively connecting to the at least one processor; the memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to perform the ground culvert point cloud boundary extraction method as described in any one of claims 1 to 3.
5. An electronic device, characterized in that, Includes the ground culvert point cloud boundary extraction device as described in claim 4.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions for causing a computer to perform the ground culvert point cloud boundary extraction method as described in any one of claims 1 to 3.