A method, apparatus, device, and storage medium for generating wire vectors.
By generating an undirected weighted graph and performing wire fitting and vectorization processing, the problem of high accuracy and completeness requirements in wire vector generation is solved, and high-quality wire vector generation is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-19
- Publication Date
- 2026-03-13
AI Technical Summary
Existing methods for generating power line vectors have high requirements for the accuracy and completeness of power line point clouds, resulting in low accuracy of power line fitting and poor quality of vector generation.
By acquiring the position and height information of the wire nodes, an undirected weighted graph is generated. Based on the node connection relationship and weight, the wire fitting is vectorized to eliminate connection loops and improve fitting accuracy.
Without relying on high-precision and high-completeness wire point cloud data, it improves wire fitting accuracy and vector generation quality, reduces loop closure, and increases generation efficiency.
Smart Images

Figure CN115827923B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of surveying and mapping technology, and in particular to a method, apparatus, device and storage medium for generating power line vectors. Background Technology
[0002] Currently, the generation of power line vectors is generally based on the method of three-dimensional power line vectorization. This involves acquiring point cloud data from the field through radar mapping, extracting power line point clouds from the point cloud data through classification algorithms, segmenting all power line point clouds according to the height extreme points of the power line point clouds, fitting power lines to the segmented power line point clouds, and then vectorizing the fitted power lines.
[0003] However, the above-mentioned wire vector generation method has high requirements for the accuracy and completeness of the wire point cloud. When the accuracy or completeness of the wire point cloud is insufficient, it is impossible to accurately segment the wire point cloud, resulting in low wire fitting accuracy and poor wire vector generation quality. Summary of the Invention
[0004] This application provides a method, apparatus, device, and storage medium for generating wire vectors, in order to solve the technical problem that wire vector generation methods in related technologies tend to result in low wire fitting accuracy and poor wire vector generation quality, thereby effectively improving wire fitting accuracy and wire vector generation quality.
[0005] In a first aspect, embodiments of this application provide a method for generating wire vectors, comprising:
[0006] Obtain the location and height information of multiple wire nodes;
[0007] Based on the location information, determine the node connection relationship corresponding to multiple wire nodes, and generate an undirected graph based on the node connection relationship;
[0008] Based on the location information and the height information, the weight corresponding to each node connection relationship in the undirected graph is determined, and a first undirected weighted graph is generated based on the node connection relationship and the weight.
[0009] The first undirected weighted graph is subjected to wire fitting and vectorization processing to obtain wire vector information.
[0010] In a second aspect, embodiments of this application provide a wire vector generation device, including a node acquisition module, a node analysis module, a weight determination module, and a vector generation module, wherein:
[0011] The node acquisition module is used to acquire the location and height information of multiple wire nodes;
[0012] The node analysis module is used to determine the node connection relationship corresponding to multiple wire nodes based on the location information, and to generate an undirected graph based on the node connection relationship;
[0013] The weight determination module determines the weight corresponding to each node connection relationship in the undirected graph based on the location information and the height information, and generates a first undirected weighted graph based on the node connection relationship and the weight.
[0014] The vector generation module is used to perform wire fitting and vectorization processing on the first undirected weighted graph to obtain wire vector information.
[0015] In a third aspect, embodiments of this application provide a wire vector generation device, including: a memory and one or more processors;
[0016] The memory is used to store one or more programs;
[0017] When the one or more programs are executed by the one or more processors, the one or more processors implement the wire vector generation method as described in the first aspect.
[0018] In a fourth aspect, embodiments of this application provide a storage medium for storing computer-executable instructions, which, when executed by a computer processor, are used to perform the wire vector generation method as described in the first aspect.
[0019] This application embodiment determines the node connection relationship corresponding to multiple wire nodes based on the location information of multiple wire nodes, generates an undirected graph based on the node connection relationship, and determines the weight corresponding to each node connection relationship based on the location and height information of each wire node to obtain a first undirected weighted graph. The first undirected weighted graph is then subjected to wire fitting vectorization processing to obtain wire vector information. This method can generate wire vectors without relying on high-precision and high-completeness wire point cloud data, effectively improving the wire fitting accuracy and the quality of wire vector generation. Attached Figure Description
[0020] Figure 1 This is a flowchart of a wire vector generation method provided in an embodiment of this application;
[0021] Figure 2 This is a flowchart of another wire vector generation method provided in the embodiments of this application;
[0022] Figure 3 This is a schematic diagram of the distribution of wire nodes provided in an embodiment of this application;
[0023] Figure 4This is a schematic diagram illustrating the determination of a wire node and adjacent nodes according to an embodiment of this application;
[0024] Figure 5 This is a schematic diagram illustrating a segmented combination provided in an embodiment of this application;
[0025] Figure 6 This is a schematic diagram of the first type of connection grouping provided in the embodiments of this application;
[0026] Figure 7 This is a schematic diagram of the second type of connection grouping provided in the embodiments of this application;
[0027] Figure 8 This is a schematic diagram of an undirected graph provided in an embodiment of this application;
[0028] Figure 9 This is a schematic diagram of a second undirected weighted graph provided in an embodiment of this application;
[0029] Figure 10 This is a schematic diagram of wire vector information provided in an embodiment of this application;
[0030] Figure 11 This is a schematic diagram of the structure of a wire vector generation device provided in an embodiment of this application;
[0031] Figure 12 This is a schematic diagram of the structure of a wire vector generation device provided in an embodiment of this application. Detailed Implementation
[0032] To make the objectives, technical solutions, and advantages of this application clearer, specific embodiments of this application will be described in further detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely for explaining this application and not for limiting it. It should also be noted that, for ease of description, only the parts relevant to this application are shown in the drawings, not all of them. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe operations (or steps) as sequential processes, many of these operations can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but additional steps not included in the drawings may also be present. The above processes can correspond to methods, functions, procedures, subroutines, subroutines, etc.
[0033] Traditional methods for generating wire vectors require the acquisition of accurate and complete wire point cloud data of the target area. However, when the accuracy or completeness of the wire point cloud data is insufficient, it is impossible to accurately segment the wire point cloud, resulting in low wire fitting accuracy and poor wire vector generation quality. Therefore, this application provides a wire vector generation method to solve the technical problems of low wire fitting accuracy and poor wire vector generation quality in existing methods. The wire vector generation method provided in this application can be applied to the generation of wire vectors in a target area. It aims to obtain the position and height information of multiple wire nodes in the target area, generate an undirected weighted graph recording the node connection relationships and weights corresponding to multiple wire nodes based on the position and height information, and then perform wire fitting and vectorization processing based on the undirected weighted graph to obtain wire vector information, effectively improving the wire fitting accuracy and wire vector generation quality.
[0034] Figure 1 A flowchart of a wire vector generation method provided in an embodiment of this application is given. The wire vector generation method provided in this application can be executed by a wire vector generation device, which can be implemented by hardware and / or software and integrated into a wire vector generation equipment.
[0035] The following description uses a wire vector generation device to perform a wire vector generation method as an example. (Reference) Figure 1 The method for generating wire vectors includes:
[0036] S101: Obtain the location and height information of multiple wire nodes.
[0037] The wire nodes provided in this solution can be understood as intermediate nodes or endpoints used to connect wires. Wire nodes can be utility poles, power towers, etc. Both ends of the wire can be connected to utility poles or power towers at the same time, or one end can be connected to a utility pole and the other end to a power tower.
[0038] For example, when it is necessary to generate wire vector information for a target area, the position and height information of each wire node corresponding to the target area are obtained. In one embodiment, the position and height information of the wire nodes provided by this solution can be determined based on the acquired 3D point cloud data, or based on the position and height information input by the user.
[0039] In one embodiment, image information (original image data) of the target area can be collected by a drone. Point cloud data corresponding to the target area can be generated based on the image information. The wire point cloud corresponding to each wire node can be extracted from the point cloud data using a set classification algorithm. Based on the wire point cloud, the position and height information of each wire node can be determined. Optionally, the image information can be radar image information obtained by radar mapping of the target area by a drone, or two-dimensional image information obtained by taking pictures of the target area by a drone (three-dimensional point cloud data is built from multiple two-dimensional images).
[0040] In one embodiment, the user can input the corresponding location and height information based on the location and height of each wire node in the target area. Alternatively, the user can add, adjust, or delete wire nodes and their corresponding location and height information based on the wire nodes determined by the 3D point cloud.
[0041] S102: Determine the node connection relationship corresponding to multiple wire nodes based on location information, and generate an undirected graph based on the node connection relationship.
[0042] For example, the node connection relationships between each wire node are determined based on the location information of each wire node. For instance, the adjacent wire nodes of each wire node are determined based on their location information, and a node connection relationship is established between each wire node and its adjacent wire nodes. The adjacent wire nodes can be one or more wire nodes within a set distance threshold (e.g., 85m).
[0043] Furthermore, based on the aforementioned determined node connection relationships, an undirected graph is generated, using the wire node corresponding to each connection relationship as a vertex and the lines connecting the wire nodes as edges. It should be noted that a wire node may be connected to multiple wire segments; correspondingly, a single wire node in the undirected graph may have multiple adjacent wire nodes, resulting in multiple connection relationships. Multiple consecutive adjacent wire nodes are sequentially connected to form a continuous wire, and each wire node sequentially establishes a connection relationship with its adjacent wire nodes, forming a continuous connection relationship. The lines corresponding to multiple continuous connection relationships form continuous edges. Additionally, there may be cases where two wire nodes that are geographically close but not actually connected by wires are connected. This can lead to closed loops in the undirected graph. Therefore, connection relationships that do not meet the connection conditions can be deleted to ensure the quality of the wire fitting.
[0044] S103: Based on location and height information, determine the weight corresponding to the connection relationship of each node in the undirected graph, and generate the first undirected weighted graph based on the node connection relationship and weight.
[0045] For example, for each node connection in an undirected graph, the weight corresponding to the node connection is calculated based on the position and height information of each wire node in the connection. Further, a first undirected weighted graph is generated based on each node connection and its corresponding weight in the undirected graph.
[0046] It should be explained that the closer the direction of the wire node is to its adjacent wire node, the smaller the height difference between the wire nodes in the node connection relationship, and / or the smaller the distance between the wire nodes in the node connection relationship, the higher the probability that there is a wire connecting the two wire nodes in practice, and the greater the weight corresponding to the node connection relationship.
[0047] S104: Perform wire fitting and vectorization processing on the first undirected weighted graph to obtain wire vector information.
[0048] After obtaining the first undirected weighted graph, wire fitting and vectorization processing can be performed on the first undirected weighted graph to obtain wire vector information. For example, wire fitting and vectorization processing is performed based on the node connection relationships in the first undirected weighted graph to obtain wire vector information.
[0049] For example, taking the wire nodes corresponding to the connection relationships of each node in the first undirected weighted graph as vertices, wires are fitted between two wire nodes, and the wires are vectorized to obtain the wire vectors corresponding to the two wire nodes. Based on the wire vectors corresponding to the connection relationships of all nodes in the first undirected weighted graph, the wire vector information corresponding to the target region is generated.
[0050] In one possible embodiment, the wire vector generation method provided by this solution may further include, before performing wire fitting vectorization processing on the first undirected weighted graph, determining whether the first undirected weighted graph has a connection loop.
[0051] Based on this, when determining that the first undirected weighted graph has a closed loop, the wire vector generation method provided in this solution, when performing wire fitting and vectorization processing on the first undirected weighted graph to obtain wire vector information, includes:
[0052] S1041: Based on the weights, perform connection loop elimination processing on the first undirected weighted graph to obtain the second undirected weighted graph.
[0053] S1042: Perform wire fitting and vectorization processing on the second undirected weighted graph to obtain wire vector information.
[0054] After obtaining the first undirected weighted graph, it can be checked whether there are multiple closed-loop connections in the graph. If no closed-loop connections exist, the first undirected weighted graph can be directly vectorized by wire fitting to obtain wire vector information, without needing to perform connection loop elimination processing. If closed-loop connections exist, the node connection loops in the first undirected weighted graph can be eliminated first before generating wire vector information, ensuring the quality of wire fitting.
[0055] For example, when a connection loop is detected in the first undirected weighted graph, the connection loop can be eliminated by applying the weights corresponding to the connection relationships of each node in the connection loop, resulting in a second undirected weighted graph. In this second undirected weighted graph, all routes starting from any node are open loops, and no routes forming closed loops exist.
[0056] Furthermore, wire fitting and vectorization are performed based on the node connection relationships in the second undirected weighted graph to obtain wire vector information. For example, using the wire nodes corresponding to each node connection relationship in the second undirected weighted graph as vertices, wires are fitted between two wire nodes, and the wires are vectorized to obtain the wire vectors corresponding to the two wire nodes. Based on the wire vectors corresponding to all node connection relationships in the second undirected weighted graph, the wire vector information corresponding to the target region is generated.
[0057] The above describes a method that determines the node connections of multiple wire nodes based on their location information, generates an undirected graph based on these connections, and determines the weights of each node connection based on its location and height information, resulting in a first undirected weighted graph. This first undirected weighted graph is then vectorized using wire fitting to obtain wire vector information. This method does not require high-precision and high-completeness wire point cloud data to generate wire vectors, effectively improving wire fitting accuracy and generation quality. Specifically, during the wire fitting and vectorization process after obtaining the first undirected weighted graph, closed connections in the graph are eliminated based on the weights to obtain a second undirected weighted graph. This second graph is then vectorized using wire fitting to obtain wire vector information, reducing the presence of closed loops in the generated wire vector information and improving its generation quality.
[0058] Based on the above embodiments, Figure 2 A flowchart of another wire vector generation method provided in an embodiment of this application is given, which is a concretization of the above-described wire vector generation method. (Reference) Figure 2 The method for generating wire vectors includes:
[0059] S201: Obtain the location and height information of multiple wire nodes.
[0060] S202: Determine the adjacent nodes corresponding to each wire node based on the location information, and form a segment combination corresponding to each wire node based on the adjacent nodes.
[0061] For example, based on the location information of each wire node, search for adjacent wire nodes corresponding to each wire node or adjacent wire nodes within a set number according to a set distance threshold (e.g., 85m), and use the searched adjacent wire nodes as the adjacent nodes of that wire node.
[0062] Furthermore, based on the adjacent nodes corresponding to each wire node, a segment combination is established for each wire node. Each segment combination records the corresponding wire node and its adjacent nodes. Within a segment combination, each wire node forms a pairwise connection with each of its adjacent nodes.
[0063] S203: Based on the connection direction of each wire node and its adjacent nodes within each segment combination, multiple wire nodes are grouped to obtain multiple connection groups.
[0064] For example, based on the segmented combinations corresponding to each wire node determined above, the connection direction between the wire node and each adjacent node in each segmented combination is determined (i.e., the direction pointing from the wire node as the origin to the corresponding adjacent node).
[0065] Furthermore, within each segment combination, based on the direction of the wire indicated by the connection direction corresponding to each adjacent node, it is determined whether to add the wire node and its corresponding adjacent node to a connection group. For example, if the wire directions indicated by the connection directions of two adjacent nodes are consistent (generally, the wire directions are consistent when the two connection directions are opposite or the included angle is close to 180°), then the wire node and these two adjacent nodes are added to a connection group. It is understandable that for a connection group containing three or more wire nodes, if the line segments formed by connecting all the wire nodes in the connection group have high smoothness, then it can be assumed that there is actually a wire between these wire nodes, and thus these wire nodes can be added to a connection group.
[0066] In one possible embodiment, step S203, which involves grouping multiple wire nodes based on the connection directions of each segment combination's wire nodes and their adjacent nodes to obtain multiple connection groups, may include:
[0067] S2031: Determine the connection direction between the wire nodes and each adjacent node within each segment combination.
[0068] S2032: Determine the directional angles between each pair of connection directions within each segment combination, and classify the wire nodes and adjacent nodes corresponding to the connection directions within the set directional angle range into the same connection group.
[0069] For example, for each segment combination, the connection direction between the wire node and each adjacent node is calculated based on the position information of the wire nodes within the segment combination and each adjacent node. It can be understood that the number of determined connection directions in a segment combination is consistent with the number of adjacent nodes it contains.
[0070] Furthermore, the directional angles between any two connection directions within each segment combination are determined, and it is checked whether these directional angles fall within a set range. If the directional angles are within the set range, the wire nodes corresponding to these two connection directions, as well as their adjacent nodes, are grouped into the same connection group. For example, if the set directional angle range is 180°±a°, where a can be 0 to 10, such as setting a to 5, then the set directional angle range is 180°±5°. In this case, the wire nodes corresponding to connection directions with directional angles within 180°±5°, as well as their adjacent nodes, are grouped into the same connection group.
[0071] Optionally, one or more consecutive segment combinations can be grouped into a connection group, and the directional angle between adjacent segment combinations within a connection group is within a set angle range. Based on this, a connection group can record one or more segment combinations, and the directional angle between the connection directions corresponding to adjacent segment combinations within the connection group is within a set angle range. The smoothness of the line segments formed by sequentially connecting all wire nodes within the connection group is within a set smoothness threshold. In this case, sequentially connecting the wire nodes (wire nodes and their corresponding adjacent nodes) within the same connection group yields multiple continuous lines with turning angles within a set angle range (e.g., 180° - a set angle range), indicating that there are actually wires between these wire nodes.
[0072] This scheme accurately determines the direction of a wire node and its adjacent nodes by using the directional angle between the connection directions of the wire nodes and their respective adjacent nodes within a segmented combination. Wire nodes with the same direction and their adjacent nodes are added to the same connection group, thereby accurately identifying multiple wire nodes with the same direction and improving the accuracy of wire fitting.
[0073] In one possible embodiment, the wire vector generation method provided by this solution, when grouping multiple wire nodes based on the connection directions corresponding to the wire nodes and adjacent nodes in each segment combination to obtain multiple connection groups, further includes: in the case of wire nodes that have not been added to the connection group, forming a connection group with the wire nodes that have not been added to the connection group and the set adjacent nodes.
[0074] For example, after dividing the wire nodes into connection groups according to the directional angles corresponding to the connection directions of each pair, it is checked whether there are any wire nodes that have not been added to the connection group. If there are any wire nodes that have not been added to the connection group, then the wire nodes that have not been added to the connection group are combined with the set adjacent nodes to form a connection group.
[0075] Optionally, the designated adjacent nodes can be either the closest adjacent node to a wire node not included in a connection group, or a predetermined number of adjacent nodes. That is, a wire node not included in a connection group can form a connection group with its closest adjacent node, or it can form multiple connection groups with each of its predetermined number of closest adjacent nodes. This scheme, by forming connection groups between wire nodes not included in connection groups and their adjacent nodes, ensures that each wire node has a corresponding node connection relationship, which helps improve the accuracy of wire vector generation.
[0076] S204: Determine the node connection relationship corresponding to each wire node based on the connection group, and generate an undirected graph based on the node connection relationship.
[0077] For example, based on the wire nodes recorded in each connection group, the node connection relationship corresponding to each wire node (wire node and adjacent node) in each connection group is determined, and an undirected graph is generated based on the node connection relationship corresponding to each wire node.
[0078] S205: Based on location and height information, determine the weight corresponding to the connection relationship of each node in the undirected graph, and generate the first undirected weighted graph based on the node connection relationship and weight.
[0079] For example, after determining the undirected graph of the target region, the weights corresponding to the connection relationships of each node in the undirected graph are determined based on the position and height information of each wire node. In one possible embodiment, the weights corresponding to the node connection relationships can be determined based on the angle, height difference, and distance between the corresponding wire nodes of each connection relationship. Based on this, the wire vector generation method provided in this solution, when determining the weights corresponding to the connection relationships of each node in the undirected graph based on position and height information, includes:
[0080] S2051: Based on location and height information, calculate the angle, height difference, and distance information corresponding to the connection relationship of each node in the undirected graph.
[0081] S2052: Perform a weighted summation operation based on the angle information, height difference information, and distance information corresponding to the connection relationship of each node to obtain the weight value corresponding to the connection relationship of each node.
[0082] For example, for each node connection in an undirected graph, the angle information, height difference information, and distance information corresponding to the node connection are calculated based on the position and height information of the wire nodes corresponding to the node connection.
[0083] The angle information of the node connection relationship can be determined based on the angle between the connection direction corresponding to the position information of the two wire nodes in the node connection relationship and a set reference direction. Optionally, the set reference direction can be a pre-defined direction or the direction corresponding to the first determined node connection relationship. The height difference information of the node connection relationship can be determined based on the height difference corresponding to the height information of the two wire nodes in the node connection relationship. The distance information of the node connection relationship can be determined based on the distance corresponding to the position information of the two wire nodes in the node connection relationship.
[0084] Furthermore, for each node connection, based on the set weight coefficients, the angle information, height difference information, and distance information are weighted and summed to obtain the weight corresponding to each node connection (i.e., the weighted summation result).
[0085] In one embodiment, the weighting coefficients include angle weighting coefficients, height difference weighting coefficients, and distance weighting coefficients corresponding to angle information, height difference information, and distance information. For example, the weights corresponding to node connection relationships are calculated based on the following formula: W = α * angle information + β * height difference information + γ * distance information. Wherein, α is a set angle weighting coefficient, β is a set height difference weighting coefficient, and γ is a set distance weighting coefficient. Optionally, α + β + γ = 1.
[0086] Understandably, given the same height difference and distance, the smaller the angle reflected by the angle information (the more consistent the direction of the wire nodes in the connection group), the higher the weight of the node connection relationship; given the same angle and distance, the smaller the height difference (the closer the types of wire nodes), the higher the weight of the node connection relationship; and given the same angle and height difference, the smaller the distance (the smaller the distance between wire nodes), the higher the weight of the node connection relationship. This scheme determines the weight of each node connection relationship by calculating the weighted sum of angle information, height difference information, and distance information, thereby improving the accuracy of determining whether there are wires between wire nodes and effectively improving the accuracy of wire vector generation.
[0087] In one embodiment, the weight coefficients corresponding to angle information, height difference information, and distance information decrease sequentially. The weight coefficients corresponding to different information are set according to the actual distribution pattern of wire nodes. The weight coefficients corresponding to information that has a greater correlation with the judgment result of whether there is a wire between wire nodes are increased, thereby improving the accuracy of wire vector generation.
[0088] After determining the weights corresponding to the connections between each node in the undirected graph, a first undirected weighted graph is generated based on these weights. At this point, the first undirected weighted graph records the node connections from the undirected graph, along with the weights corresponding to each connection.
[0089] S206: Based on the weights, perform connection loop elimination processing on the first undirected weighted graph to obtain the second undirected weighted graph, and perform wire fitting vectorization processing on the second undirected weighted graph to obtain wire vector information.
[0090] For example, after obtaining a first undirected weighted graph, the first undirected weighted graph is subjected to connection loop elimination processing based on the weights corresponding to the connection relationships of each node in the first undirected weighted graph to obtain a second undirected weighted graph. In a possible embodiment, the wire vector generation method provided by this solution, when performing connection loop elimination processing on the first undirected weighted graph based on weights to obtain the second undirected weighted graph, includes:
[0091] S2061: Perform loop closure detection on the first undirected weighted graph to determine the closed-loop connection relationship in the first undirected weighted graph. The closed-loop connection relationship includes the connection relationship of multiple nodes connected end to end in sequence.
[0092] S2062: Delete the node connection with the smallest weight from the closed-loop connection relationship to obtain the second undirected weighted graph.
[0093] For example, a closed-loop detection is performed on the connection lines formed by the connection relationships of each node in the first undirected weighted graph to determine whether a closed-loop connection relationship exists in the first undirected weighted graph. The closed-loop connection relationship includes multiple node connections that are sequentially connected end-to-end. Connecting the corresponding wire nodes according to these node connections will form a closed loop route.
[0094] Furthermore, when a closed-loop connection is detected in the first undirected weighted graph, the weights corresponding to the connections between nodes in the closed-loop connection are determined, and the node connection with the smallest weight is deleted, thus transforming the closed-loop connection into an open-loop connection. After deleting the node connection with the smallest weight from all closed-loop connections, a second undirected weighted graph is obtained. It can be understood that the information recorded in the second undirected weighted graph at this point is based on the first undirected weighted graph, with the node connection with the smallest weight in the closed-loop connection removed. In one embodiment, when no closed-loop connection is detected in the first undirected weighted graph, the first undirected weighted graph can be directly used as the second undirected weighted graph.
[0095] This solution effectively improves the generation quality and efficiency of wire vectorization by deleting the node connection with the smallest weight in the closed-loop connection relationship and deleting the node connection relationship with the lowest probability of containing wires.
[0096] In one possible embodiment, when performing wire fitting vectorization processing on the second undirected weighted graph to obtain wire vector information, this scheme includes:
[0097] S2063: Perform wire fitting processing based on the second undirected weighted graph to obtain a wire fitting graph;
[0098] S2064: Perform wire vectorization processing on the wire fitting map to obtain wire vector information.
[0099] For example, based on the connection relationships of each node in the second undirected weighted graph, wire fitting is performed on the two adjacent wire nodes corresponding to each connection relationship to obtain the fitted wires corresponding to each connection relationship. Based on the fitted wires corresponding to each connection relationship, the wire fitting map corresponding to the target region can be obtained. The wire fitting map records the fitted wires corresponding to each connection relationship in the second undirected weighted graph. At this time, the fitted wires in the wire fitting map only record their corresponding positions and heights.
[0100] Furthermore, the fitted wires in the wire fitting graph are vectorized to obtain wire vector information. At this point, the wire vector information records not only the fitted line points in the wire fitting graph, but also the direction information (vector information) corresponding to each fitted wire.
[0101] Optionally, when performing wire vectorization processing on the fitted wire in the wire fitting diagram, the node connection direction of the wire node corresponding to the fitted wire can be determined (i.e., connecting from one wire node to another), wherein the reference node connection direction can be determined based on the node connection direction of the first determined wire node.
[0102] This scheme obtains a wire fitting map by performing wire fitting processing on the second undirected weighted graph, resulting in a wire fitting map that more closely approximates the wire distribution in the target area. The wire fitting map is then vectorized to obtain wire vector information that reflects the distribution and direction of wires in the target area. This method does not require high-precision and complete wire point cloud data, thus improving the efficiency of wire vector generation while ensuring the quality of wire vector generation.
[0103] In one possible embodiment, after generating the wire fitting map and / or generating wire vector information, in response to the user's editing operation on the wire fitting map and / or the generated wire vector information, the fitted wires in the wire fitting map and / or the fitted wires and the node connection directions corresponding to the fitted wires in the wire vector information can be updated, so that the generated wire fitting map and / or generated wire vector information improves the generation quality based on the shape, position, height or connection direction of the wires in the target area.
[0104] In one possible embodiment, the wire vector generation method provided by this solution, when performing wire fitting processing based on a second undirected weighted graph to obtain a wire fitting graph, includes: determining a reference node corresponding to each node connection relationship in the second undirected weighted graph; performing wire fitting processing on each node connection relationship according to a set wire fitting method, based on the wire node corresponding to the node connection relationship and the reference node, to obtain a fitted wire corresponding to each node connection relationship in the second undirected weighted graph; and generating a wire fitting graph based on the fitted wire.
[0105] For example, for the node connection relationships between any two wire nodes in the second undirected weighted graph, a reference node corresponding to the node connection relationship is determined. Optionally, the reference node can be a point between the lines connecting the two wire nodes corresponding to the node connection relationship, such as using the midpoint between the two wire nodes as the reference node for the node connection relationship.
[0106] Furthermore, for each node connection in the second undirected weighted graph, based on the position information of the wire nodes corresponding to the node connection and the position information of the reference node (the midpoint between the position information of the two wire nodes), wire fitting is performed according to a set wire fitting method to obtain the fitted wires corresponding to the node connection. After obtaining the fitted wires corresponding to each node connection in the second undirected weighted graph, a wire fitting graph can be generated based on these fitted wires.
[0107] Optionally, the wire fitting method provided in this solution can be a parabolic fitting method, that is, performing parabolic fitting based on the position information of the wire nodes corresponding to the node connection relationship and the position information of the reference node, and the fitted parabola is the fitted wire corresponding to the node connection relationship. In other possible embodiments, the wire fitting method can also be a Bézier curve fitting method, that is, performing Bézier curve fitting based on the position information of the wire nodes corresponding to the node connection relationship and the position information of the reference node to obtain the fitted wire.
[0108] This solution uses a defined wire fitting method to perform wire fitting processing based on the wire nodes corresponding to the node connection relationship and the reference node, generating a wire fitting map. The fitted wires in the wire fitting map are smoother and closer to the real wires. High-quality wire fitting maps can be generated without high-precision and complete wire point cloud data, thus improving the efficiency of wire vector generation while ensuring the quality of wire vector generation.
[0109] Figure 3 This is a schematic diagram of the distribution of wire nodes provided in an embodiment of this application. Figure 4 This is a schematic diagram illustrating the determination of a wire node and adjacent nodes according to an embodiment of this application. Figure 3 As shown, assuming the location and height information of five wire nodes A1-A5 in the target area are obtained, the adjacent nodes corresponding to each wire node are determined based on the location information of the five wire nodes and the set distance threshold. Figure 4 The diagram illustrates the node ranges D3 and D5 corresponding to the adjacent nodes of wire node A3 and A5. Node range D3 includes the adjacent nodes A2, A4, and A5 of wire node A3 (i.e., the distances of wire nodes A2, A4, and A5 to wire node A3 are all within a set distance threshold), and node range D5 includes the adjacent nodes A3 and A6 of wire node A5 (i.e., the distances of wire nodes A3 and A6 to wire node A5 are all within a set distance threshold).
[0110] Figure 5 This is a schematic diagram of a segmented combination provided in an embodiment of this application, such as... Figure 5 As shown, after determining the adjacent nodes corresponding to each wire node, multiple segment combinations are obtained by grouping each wire node based on the adjacent nodes. Figure 5 The diagram illustrates the segment combinations E1-2, E1-4, E2-3, E4-3, E3-5, and E5-6 corresponding to wire nodes A1 and A2, A1 and A4, A2 and 3, A3 and A4, A3 and A5, and A5 and A6.
[0111] Figure 6This is a schematic diagram of the first type of connection grouping provided in the embodiments of this application, such as... Figure 6 As shown, after determining the segment combination corresponding to each wire node, multiple wire nodes are grouped according to the connection direction between the wire node in each segment combination and each adjacent node to obtain multiple connection groups. Figure 6 The diagram illustrates one of the connection groups S1. Assume that the connection directions of the wire nodes in segment combinations E4-3, E3-5, and E5-6 with their respective adjacent nodes are within a set angle range. In this case, connection group S1 includes wire nodes A4, A3, A5, and A6 corresponding to segment combinations E4-3, E3-5, and E5-6.
[0112] Figure 7 This is a schematic diagram of the second type of connection grouping provided in the embodiments of this application, such as... Figure 7 As shown, based on Figure 6 After grouping multiple wire nodes to obtain multiple connection groups, there are wire nodes A1 and A2 that have not been added to the connection groups. Then, wire nodes A1 and A2 are respectively connected to their corresponding adjacent nodes to form connection groups S2, S3 and S4. Connection group S2 includes wire nodes A1 and A4, connection group S3 includes wire nodes A1 and A2, and connection group S4 includes wire nodes A2 and A3.
[0113] Figure 8 This is a schematic diagram of an undirected graph provided in an embodiment of this application, such as... Figure 8 As shown, after grouping each wire node to obtain multiple connection groups, the node connection relationship corresponding to each wire node is determined based on the determined connection group. Based on the wire node corresponding to each node connection relationship as the vertex and the line connecting the wire nodes as the edge, an undirected graph is generated. Figure 8 The graph contains the following node connection relationships: L1-2, L1-4, L2-3, L3-4, L3-5, and L5-6, corresponding to wire nodes A1 and A2, A1 and A4, A2 and A3, A3 and A4, A3 and A5, and A5 and A6. It is evident that the multiple node connection relationships L1-2-3-4 corresponding to wire node A1-4 form a closed loop connection. Furthermore, based on the position and height information of each wire node, the weight corresponding to each node connection relationship in the undirected graph is determined, and a first undirected weighted graph is generated based on the node connection relationships and weights.
[0114] Figure 9 This is a schematic diagram of a second undirected weighted graph provided in an embodiment of this application, such as... Figure 9 As shown, a loop closure test is performed on the first undirected weighted graph to determine the node connection relationship L1-2-3-4 in the first undirected weighted graph. Assuming that the weight of the node connection relationship L1-4 in the node connection relationship L1-2-3-4 is the smallest, the node connection relationship L1-4 is deleted to obtain the second undirected weighted graph.
[0115] Figure 10 This is a schematic diagram of wire vector information provided in an embodiment of this application, such as... Figure 10 As shown, based on the connection relationships of each node in the second undirected weighted graph and the midpoints corresponding to those connections, wire fitting (parabolic fitting) is performed to obtain fitted wires connecting the nodes (e.g., fitted wire k4-3 obtained by fitting nodes A3 and A4 in the graph), resulting in a wire fitting graph. This wire fitting graph is then vectorized to obtain the wires as shown in the figure. Figure 10 The cable vector information is shown.
[0116] The above describes a method that determines the node connections of multiple wire nodes based on their location information, generates an undirected graph based on these connections, and determines the weights of each node connection based on its location and height information, resulting in a first undirected weighted graph. This first undirected weighted graph is then vectorized using wire fitting to obtain wire vector information. This method does not require high-precision and high-completeness wire point cloud data to generate wire vectors, effectively improving wire fitting accuracy and generation quality. Specifically, during the wire fitting and vectorization process after obtaining the first undirected weighted graph, closed connections in the graph are eliminated based on the weights to obtain a second undirected weighted graph. This second graph is then vectorized using wire fitting to obtain wire vector information, reducing the presence of closed loops in the generated wire vector information and improving its generation quality. Meanwhile, each wire node is segmented and combined with its adjacent nodes, and then connected groups are formed according to the connection directions of the wire nodes and their adjacent nodes within each segmented group. The node connection relationships of each wire node are then determined based on the connection groups, and an undirected graph is generated based on the node connection relationships. This method can accurately determine the node connection relationships of possible wire connections in the target area without the need for high-precision and complete wire point cloud data, thus improving the efficiency of wire vector generation while ensuring the quality of wire vector generation.
[0117] Figure 11 A schematic diagram of a wire vector generation device provided in an embodiment of this application is given. (Reference) Figure 11 The wire vector generation device includes a node acquisition module 31, a node analysis module 32, a weight determination module 33, and a vector generation module 34.
[0118] The system includes a node acquisition module 31, which acquires the location and height information of multiple wire nodes; a node analysis module 32, which determines the node connection relationships corresponding to multiple wire nodes based on the location information and generates an undirected graph based on the node connection relationships; a weight determination module 33, which determines the weight corresponding to each node connection relationship in the undirected graph based on the location and height information and generates a first undirected weighted graph based on the node connection relationships and weights; and a vector generation module 34, which performs wire fitting vectorization processing on the first undirected weighted graph to obtain wire vector information.
[0119] The above describes a method that determines the node connection relationships of multiple wire nodes based on their location information, generates an undirected graph based on these relationships, and determines the weights corresponding to the node connection relationships based on the location and height information of each wire node, thus obtaining a first undirected weighted graph. This method then performs wire fitting and vectorization processing on the first undirected weighted graph to obtain wire vector information. This method can generate wire vectors without relying on high-precision and high-completeness wire point cloud data, effectively improving the accuracy of wire fitting and the quality of wire vector generation.
[0120] Based on the above embodiments, the node analysis module 32 is used for:
[0121] Based on location information, the adjacent nodes corresponding to each wire node are determined, and the segment combination corresponding to each wire node is formed based on the adjacent nodes.
[0122] Based on the connection direction of each wire node and its adjacent nodes within each segment combination, multiple wire nodes are grouped to obtain multiple connection groups.
[0123] The connection relationships between each wire node are determined based on the connection grouping, and an undirected graph is generated based on the connection relationships.
[0124] Based on the above embodiments, when the node analysis module 32 groups multiple wire nodes according to the connection direction corresponding to each wire node and each adjacent node in each segment combination to obtain multiple connection groups, it includes:
[0125] Determine the connection direction between the wire nodes and each adjacent node within each segment combination;
[0126] Determine the directional angles between each pair of connection directions within each segment combination, and classify the wire nodes and adjacent nodes corresponding to each pair of connection directions whose directional angles are within the set directional angle range into the same connection group.
[0127] Based on the above embodiments, when the node analysis module 32 groups multiple wire nodes based on the connection directions corresponding to the wire nodes and their adjacent nodes within each segment combination to obtain multiple connection groups, it further includes:
[0128] If there are wire nodes that are not included in the connection group, the wire nodes that are not included in the connection group will be combined with the designated adjacent nodes to form a connection group.
[0129] Based on the above embodiments, when determining the weights corresponding to the connection relationships of each node in an undirected graph based on location information and height information, the weight determination module 33 includes:
[0130] Based on location and height information, calculate the angle, height difference, and distance information corresponding to the connection relationship of each node in the undirected graph;
[0131] The weights of each node connection are obtained by performing a weighted summation operation based on the angle, height difference, and distance information corresponding to the connection relationship of each node.
[0132] Based on the above embodiments, the wire vector generation device further includes a closed-loop detection module, which is used to determine whether there is a connection closed loop in the first undirected weighted graph before the vector generation module 34 performs wire fitting vectorization processing on the first undirected weighted graph.
[0133] The vector generation module 34 is used to perform connection loop elimination processing on the first undirected weighted graph based on the weights when it is determined that there is a connection loop in the first undirected weighted graph, so as to obtain a second undirected weighted graph; and to perform wire fitting vectorization processing on the second undirected weighted graph to obtain wire vector information.
[0134] Based on the above embodiments, when the vector generation module 34 performs connection loop elimination processing on the first undirected weighted graph based on weights to obtain the second undirected weighted graph, it includes:
[0135] Perform loop closure detection on the first undirected weighted graph to determine the closed-loop connection relationship in the first undirected weighted graph. The closed-loop connection relationship includes the connection relationship of multiple nodes connected end to end in sequence.
[0136] Remove the node connection with the smallest weight from the closed-loop connection relationship to obtain the second undirected weighted graph.
[0137] Based on the above embodiments, when the vector generation module 34 performs wire fitting vectorization processing on the second undirected weighted graph to obtain wire vector information, it includes:
[0138] The wire fitting process is performed based on the second undirected weighted graph to obtain the wire fitting graph.
[0139] The fitted wire diagram is vectorized to obtain the wire vector information.
[0140] Based on the above embodiments, when the vector generation module 34 performs wire fitting processing based on the second undirected weighted graph to obtain a wire fitting graph, it includes:
[0141] Determine the reference node corresponding to the connection relationship of each node in the second undirected weighted graph;
[0142] According to the set wire fitting method, for each node connection relationship, wire fitting is performed based on the wire nodes corresponding to the node connection relationship and the reference node to obtain the fitted wires corresponding to each node connection relationship of the second undirected weighted graph.
[0143] Generate a wire fitting map based on the fitted wire.
[0144] It is worth noting that in the embodiments of the above-mentioned wire vector generation device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the protection scope of the embodiments of the present invention.
[0145] This application also provides a wire vector generation device, which can integrate the wire vector generation apparatus provided in this application. Figure 12 This is a schematic diagram of the structure of a wire vector generation device provided in an embodiment of this application. (Reference) Figure 12 The wire vector generation device includes: an input device 43, an output device 44, a memory 42, and one or more processors 41; the memory 42 is used to store one or more programs; when one or more programs are executed by one or more processors 41, the one or more processors 41 implement the wire vector generation method provided in the above embodiments. The input device 43, output device 44, memory 42, and processors 41 can be connected via a bus or other means. Figure 12 Taking the example of a connection between China and Israel via a bus.
[0146] The memory 42, as a computing device-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the wire vector generation method provided in any embodiment of this application (e.g., the node acquisition module 31, node analysis module 32, weight determination module 33, and vector generation module 34 in the wire vector generation device). The memory 42 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function; the data storage area may store data created based on the use of the device, etc. Furthermore, the memory 42 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 42 may further include memory remotely located relative to the processor 41, and these remote memories can be connected to the device via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0147] Input device 43 can be used to receive input digital or character information, and to generate key signal inputs related to user settings and function control of the device. Output device 44 may include display devices such as a display screen.
[0148] The processor 41 executes various functional applications and data processing of the device by running software programs, instructions and modules stored in the memory 42, thereby realizing the above-mentioned wire vector generation method.
[0149] The wire vector generation apparatus, device, and computer provided above can be used to execute the wire vector generation method provided in any of the above embodiments, and have corresponding functions and beneficial effects.
[0150] This application embodiment also provides a storage medium for storing computer-executable instructions. When executed by a computer processor, the computer-executable instructions are used to execute the wire vector generation method provided in the above embodiment. The wire vector generation method includes: acquiring position information and height information of multiple wire nodes; determining node connection relationships corresponding to the multiple wire nodes based on the position information, and generating an undirected graph based on the node connection relationships; determining the weight corresponding to each node connection relationship in the undirected graph based on the position information and the height information, and generating a first undirected weighted graph based on the node connection relationships and the weights; and performing wire fitting vectorization processing on the first undirected weighted graph to obtain wire vector information.
[0151] Storage medium – any type of memory device or storage device. The term “storage medium” is intended to include: mounting media, such as CD-ROMs, floppy disks, or magnetic tape devices; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (e.g., hard disks or optical storage); registers or other similar types of memory elements, etc. Storage media may also include other types of memory or combinations thereof. Furthermore, storage media may reside in a first computer system in which a program is executed, or may reside in a different second computer system connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term “storage medium” can include two or more storage media that may reside in different locations (e.g., in different computer systems connected via a network). Storage media may store program instructions (e.g., specifically implemented as a computer program) executable by one or more processors.
[0152] Of course, the computer-executable instructions provided in the embodiments of this application are not limited to the wire vector generation method provided above, but can also execute related operations in the wire vector generation method provided in any embodiment of this application.
[0153] The wire vector generation apparatus, device, and storage medium provided in the above embodiments can execute the wire vector generation method provided in any embodiment of this application. For technical details not described in detail in the above embodiments, please refer to the wire vector generation method provided in any embodiment of this application.
[0154] The above description is merely a preferred embodiment and the technical principles employed in this application. This application is not limited to the specific embodiments provided herein, and various obvious changes, readjustments, and substitutions that can be made by those skilled in the art will not depart from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of this application, the scope of which is determined by the scope of the claims.
Claims
1. A method of generating a wire vector, characterized by, The method comprises: obtaining position information and height information of a plurality of wire nodes; determining node connection relationships corresponding to the plurality of wire nodes based on the position information, and generating an undirected graph based on the node connection relationships, wherein vertices in the undirected graph are wire nodes corresponding to the node connection relationships, and edges are connections between wire nodes; based on the position information and the height information, calculating angle information, height difference information and distance information corresponding to each node connection relationship in the undirected graph; performing weighted summation operation on the angle information, the height difference information and the distance information corresponding to each node connection relationship to obtain a weight value corresponding to each node connection relationship, and generating a first undirected weighted graph based on the node connection relationships and the weight values; performing wire fitting vectorization processing on the first undirected weighted graph to obtain wire vector information.
2. The electric wire vector generation method according to claim 1, characterized by, The method comprises: determining adjacent nodes corresponding to each wire node based on the position information, and forming a segmented combination corresponding to each wire node based on the adjacent nodes; grouping the plurality of wire nodes based on connection directions corresponding to the wire nodes and the adjacent nodes in each segmented combination to obtain a plurality of connection groups; determining node connection relationships corresponding to each wire node based on the connection groups, and generating an undirected graph based on the node connection relationships.
3. The electric wire vector generation method according to claim 2, characterized by, The method comprises: determining connection directions corresponding to the wire nodes and the adjacent nodes in each segmented combination; determining direction angles corresponding to two-by-two connection directions in each segmented combination, and dividing wire nodes and adjacent nodes corresponding to connection directions within a set angle range into the same connection group.
4. The electric wire vector generation method according to claim 2, characterized by, The method further comprises: in the case where there is a wire node that has not joined a connection group, forming a connection group with a set adjacent node.
5. The electric wire vector generation method according to claim 1, characterized by, Before performing wire fitting vectorization processing on the first undirected weighted graph, the method further comprises: determining whether the first undirected weighted graph has a connection closed loop; when the first undirected weighted graph has a connection closed loop, the method of performing wire fitting vectorization processing on the first undirected weighted graph to obtain wire vector information comprises: performing connection closed loop elimination processing on the first undirected weighted graph based on the weight values to obtain a second undirected weighted graph; performing wire fitting vectorization processing on the second undirected weighted graph to obtain wire vector information.
6. The electric wire vector generation method according to claim 5, characterized by, The method comprises: The first undirected weighted graph is subjected to closed loop detection to determine a closed loop connection relationship in the first undirected weighted graph, and the closed loop connection relationship includes a plurality of node connection relationships connected in sequence. The node connection relationship with the smallest weight value is deleted from the closed loop connection relationship to obtain a second undirected weighted graph.
7. The electric wire vector generation method according to claim 6, characterized by, The second undirected weighted graph is subjected to wire fitting vectorization processing to obtain wire vector information, including: The second undirected weighted graph is subjected to wire fitting processing to obtain a wire fitting graph. The wire fitting graph is subjected to wire vectorization processing to obtain wire vector information.
8. The electric wire vector generation method according to claim 7, characterized by, The second undirected weighted graph is subjected to wire fitting processing to obtain a wire fitting graph, including: A reference node corresponding to each node connection relationship of the second undirected weighted graph is determined. According to a set wire fitting mode, for each node connection relationship, the reference node and the wire node corresponding to the node connection relationship are subjected to wire fitting processing to obtain a fitting wire corresponding to each node connection relationship of the second undirected weighted graph. The fitting wire is used to generate a wire fitting graph.
9. A wire vector generation apparatus characterized by comprising: The method includes a node acquisition module, a node analysis module, a weight value determination module, and a vector generation module, wherein: The node acquisition module is configured to acquire position information and height information of a plurality of wire nodes. The node analysis module is configured to determine node connection relationships corresponding to the plurality of wire nodes based on the position information, and generate an undirected graph based on the node connection relationships, wherein vertices in the undirected graph are wire nodes corresponding to the node connection relationships, and edges are connections between wire nodes. The weight value determination module is configured to calculate angle information, height difference information, and distance information corresponding to each node connection relationship in the undirected graph based on the position information and the height information, perform weighted summation operation based on the angle information, the height difference information, and the distance information corresponding to each node connection relationship to obtain a weight value corresponding to each node connection relationship, and generate a first undirected weighted graph based on the node connection relationships and the weight values. The vector generation module is configured to perform wire fitting vectorization processing on the first undirected weighted graph to obtain wire vector information.
10. A wire vector generation apparatus characterized by comprising: The method includes: a memory and one or more processors; The memory is configured to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the wire vector generation method according to any one of claims 1-8.
11. A storage medium storing computer-executable instructions, wherein: The computer executable instructions, when executed by a computer processor, are used to perform the wire vector generation method according to any one of claims 1-8.
Citation Information
Patent Citations
A method and apparatus for vectorizing power line
CN109272560A
A method and a device for drawing a path diagram of an electric power equipment
CN109460911A
airborne LiDAR point cloud power line vectorization modeling method and a storage medium
CN109767489A