Distribution network power line point cloud extraction method and system based on improved K-neighborhood algorithm
1. A distribution network power line point cloud extraction method based on an improved K-neighborhood algorithm is characterized by comprising the following steps:
s1, acquiring point cloud data of a target power line, and selecting a point at a recognizable part of the target power line as a starting point, wherein the target power line is a low distribution network line or a low voltage transmission line with the height lower than a preset threshold value;
s2, performing K neighborhood search from the starting point to different directions, judging whether the points in the neighborhood meet preset conditions, and storing the points meeting the preset conditions into corresponding power line point sets;
and S3, repeating the step S2 until the point meeting the preset condition cannot be found in the neighborhood range, completing the power line point cloud extraction and outputting a power line point set.
2. The distribution network power line point cloud extraction method based on the improved K-neighborhood algorithm of claim 1, wherein in step S2, K neighborhood search is performed in different directions starting from a starting point, and whether a point in a neighborhood meets a preset condition is determined, specifically comprising the following steps:
s201, setting the point set of the target power line as L, the excluded point set as M, and calculating the starting point P0Adding a point set L;
s202, based on the starting point P0K neighborhood search is carried out to search any point P in the distance point set L in the neighborhoodLNearest point Pi,PiNot belonging to point set L and point set M, recording point number i, calculating PiAnd PLDistance d ofmin,dminThe expression of (a) is as follows:
wherein dx is xi-xL,dy=yi-yL,dz=zi-zL;
S203 based on dminJudgment point PiWhether a preset condition is satisfied.
3. The distribution network power line point cloud extraction method based on the improved K-neighborhood algorithm of claim 2, wherein the preset conditions comprise a first preset condition, and the first preset condition is that: judgment of dminWhether the distance is smaller than a preset threshold K, wherein the preset threshold K is the maximum distance between adjacent points in the point cloud, and if d is smaller than the preset threshold KminLess than K, then PiAdd corresponding power line point set, otherwise PiAdd point set M.
4. The distribution network power line point cloud extraction method based on the improved K-neighborhood algorithm of claim 3, wherein the preset conditions further comprise a second preset condition, and the second preset condition is that: judging whether dz is smaller than a preset threshold value dz _ max, setting the value of dz _ max as the maximum height difference of adjacent points of the single power line, and if dz is smaller than dz _ max, setting PiAdd corresponding power line point set, otherwise PiAdd point set M.
5. The distribution network power line point cloud extraction method based on the improved K-neighborhood algorithm of claim 4, wherein the judgment condition further comprises a third preset condition, and the third preset condition is that: judging whether the number of points in the point set L is more than 2, if so, judging PiTemporarily adding a point set L, calculating a minimum circumscribed rectangle projected in the horizontal direction of the point set L, recording the minimum circumscribed rectangle as Rec, solving the short side length of Rec as S, judging whether S is less than S _ max, and if so, adding P to the point set LiAdd corresponding power line point set, otherwise PiAdd point set M.
6. The distribution network power line point cloud extraction method based on the improved K-neighborhood algorithm of claim 5, wherein the judgment condition further comprises a fourth preset condition, and the fourth preset condition is that: find all and PiCounting the number of points belonging to the point set L as a and the number of points not belonging to the point set L as b when the point distance is less than K, and if the value of b-a is less than n _ max, then P is countediAdding phaseSet of power line points, otherwise PiAdd point set M.
7. A distribution network power line point cloud extraction system based on an improved K-neighborhood algorithm is characterized by comprising:
the starting point selection module is used for acquiring point cloud data of a target power line, selecting a point at a recognizable position of the target power line as a starting point, wherein the target power line is a low distribution network line or a low-voltage power transmission line with the height lower than a preset threshold value;
the searching module is used for searching K neighborhoods from the starting point to different directions, judging whether the points in the neighborhoods meet preset conditions or not, and storing the points meeting the preset conditions into corresponding power line point sets;
and the output module is used for repeatedly calling the search module until the point meeting the preset condition cannot be found in the neighborhood range, finishing the power line point cloud extraction and outputting the power line point set.
Background
In recent years, with the development of an airborne laser radar technology and the reduction of cost, the application of the laser radar in the aspect of power line patrol is more and more extensive, the risks such as tree obstacles, crossing and the like can be accurately and quickly measured and analyzed, and the efficiency of the power line patrol is greatly improved. However, data processing personnel in the industry face the problems that the amount of laser point cloud data is larger and larger, and the workload of data classification is heavier and heavier, in order to improve the situation, domestic researches on automatic extraction of power line point cloud data are more, but the automatic extraction method mainly focuses on the situations that the characteristics of wires such as power transmission lines are obvious and the interference of surrounding objects is small, namely, the existing automatic extraction method of the point cloud data is mainly suitable for high-voltage-level power transmission lines with obvious characteristics and small interference, and has poor classification effect on shorter and complex distribution network lines or certain low-voltage power transmission lines, so that the power lines with low height and large interference of the surrounding objects are generally classified in a pure manual mode, and the mode has lower efficiency and needs to invest labor cost.
Disclosure of Invention
In view of the above, the present invention provides a distribution network power line point cloud extraction method based on an improved K-neighborhood algorithm, so as to overcome or at least partially solve the above problems in the prior art.
The invention provides a distribution network power line point cloud extraction method based on an improved K-neighborhood algorithm, which comprises the following steps:
s1, acquiring point cloud data of a target power line, and selecting a point at a recognizable part of the target power line as a starting point, wherein the target power line is a low distribution network line or a low voltage transmission line with the height lower than a preset threshold value;
s2, performing K neighborhood search from the starting point to different directions, judging whether the points in the neighborhood meet preset conditions, and storing the points meeting the preset conditions into corresponding power line point sets;
and S3, repeating the step S2 until the point meeting the preset condition cannot be found in the neighborhood range, completing the power line point cloud extraction and outputting a power line point set.
Further, in step S2, performing K neighborhood search in different directions from the starting point, and determining whether a point in a neighborhood satisfies a preset condition, specifically including the following steps:
s201, setting the point set of the target power line as L, the excluded point set as M, and calculating the starting point P0Adding a point set L;
s202, based on the starting point P0K neighborhood search is carried out to search any point P in the distance point set L in the neighborhoodLNearest point Pi,PiNot belonging to point set L and point set M, recording point number i, calculating PiAnd PLDistance d ofmin,dminThe expression of (a) is as follows:
wherein dx is xi-xL,dy=yi-yL,dz=zi-zL;
S203 based on dminJudgment point PiWhether a preset condition is satisfied.
Further, the preset conditions include a first preset condition, where the first preset condition is: judgment of dminWhether the distance is smaller than a preset threshold K, wherein the preset threshold K is the maximum distance between adjacent points in the point cloud, and if d is smaller than the preset threshold KminLess than K, then PiAdd corresponding power line point set, otherwise PiAdd point set M.
Further, the preset conditions further include a second preset condition, where the second preset condition is: judging whether dz is smaller than a preset threshold value dz _ max, setting the value of dz _ max as the maximum height difference of adjacent points of the single power line, and if dz is smaller than dz _ max, setting PiAdd corresponding power line point set, otherwise PiAdd point set M.
Further, the determination condition further includes a third preset condition, where the third preset condition is: judging whether the number of points in the point set L is more than 2, if so, judging PiTemporarily adding a point set L, calculating a minimum circumscribed rectangle projected in the horizontal direction of the point set L, recording the minimum circumscribed rectangle as Rec, solving the short side length of Rec as S, judging whether S is less than S _ max, and if so, adding P to the point set LiAdd corresponding power line point set, otherwise PiAdd point set M.
Further, the judgment condition further includes a fourth preset condition, where the fourth preset condition is: find all and PiCounting the number of points belonging to the point set L as a and the number of points not belonging to the point set L as b when the point distance is less than K, and if the value of b-a is less than n _ max, then P is countediAdd corresponding power line point set, otherwise PiAdd point set M.
The invention provides a distribution network power line point cloud extraction system based on an improved K-neighborhood algorithm.
Compared with the prior art, the invention has the beneficial effects that:
according to the distribution network power line point cloud extraction method and system based on the improved K-neighborhood algorithm, a point is selected as a starting point at the recognizable position of a target power line, the starting point triggers searching for points meeting preset conditions from different directions based on the improved K-neighborhood algorithm, the points are added into a power line point set, the power line of a short distribution network line is extracted in a semi-automatic mode, the problem that the short distribution network line cannot be extracted automatically is solved, the extraction efficiency is greatly improved compared with the mode of manually extracting the power line of the short distribution network line, and the classification efficiency of the distribution network line is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only preferred embodiments of the present invention, and it is obvious for a person skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic overall flow chart of a distribution network power line point cloud extraction method based on an improved K-neighborhood algorithm according to an embodiment of the present invention.
Fig. 2 is a schematic diagram of the overall structure of a distribution network power line point cloud extraction system based on an improved K-neighborhood algorithm according to another embodiment of the present invention.
In the figure, 1 a starting point selection module, 2 a search module and 3 an output module.
Detailed Description
The principles and features of this invention are described below in conjunction with the following drawings, the illustrated embodiments are provided to illustrate the invention and not to limit the scope of the invention.
Referring to fig. 1, an embodiment of the present invention provides a distribution network power line point cloud extraction method based on an improved K-neighborhood algorithm, where the method includes the following steps:
s1, obtaining point cloud data of the target power line, and selecting a point in the recognizable position of the target power line as a starting point based on the point cloud data of the target power line, wherein the target power line is a low distribution network line or a low voltage power transmission line with the height lower than a preset threshold value.
The target power line is mainly a low distribution network line or a low-voltage power transmission line which cannot extract point clouds in a conventional automatic extraction mode. The acquisition of target power line point cloud data can be that the unmanned aerial vehicle equipment who carries out the lidar flies according to predetermineeing the route and gathers the point cloud data of joining in marriage the net twine way along the way through dispatching, also can be the current power line point cloud data of direct use. The criterion that the target power line part is recognizable by naked eyes is a part recognizable by data processing personnel, and the data processing personnel can select one point from the part recognizable by the naked eyes of the target power line as a starting point.
And S2, performing K neighborhood search from the starting point to different directions, judging whether the points in the neighborhood meet the preset condition, and storing the points meeting the preset condition into the corresponding power line point set.
And S3, repeating the step S2 until the point meeting the preset condition cannot be found in the neighborhood range, completing the power line point cloud extraction and outputting a power line point set.
According to the distribution network power line point cloud extraction method based on the improved K-neighborhood algorithm, when low distribution network lines and low-voltage power transmission lines which cannot be processed by a conventional power line point cloud extraction method are processed, automatic extraction of power line point clouds can be achieved only by data processing personnel needing to appoint a point from recognizable positions of a target power line, labor is greatly saved and efficiency is improved compared with a manual extraction mode, and the problem that point cloud data cannot be automatically extracted due to the fact that the low distribution network lines are complex in environment and serious in interference is solved.
Specifically, in step S2, performing K neighborhood search in different directions from the starting point, and determining whether a point in a neighborhood satisfies a preset condition, specifically including the following steps:
s201, setting the point set of the target power line as L and the excluded point set as M, and setting the point set of the target power line as L and the excluded point set as MStarting point P0Adding a set of points L, based on the starting point P0And performing K neighborhood search.
S202, searching any point P in a distance point set L in the neighborhoodL(xL,yL,zL) Nearest point Pi(xi,yi,zi),PiNot belonging to point set L and point set M, recording point number i, calculating PiAnd PLDistance d ofmin,dminThe expression of (a) is as follows:
wherein dx is xi-xL,dy=yi-yL,dz=zi-zL。
S203 based on dminJudgment point PiWhether a preset condition is satisfied.
As an optional implementation manner of this embodiment, the preset condition includes a first preset condition, where the first preset condition specifically is: judgment of dminWhether the distance is smaller than a preset threshold K, wherein the preset threshold K is the maximum distance between adjacent points in the point cloud, and if d is smaller than the preset threshold KminLess than K indicates PiAnd PLIs less than the maximum distance between adjacent points in the point cloud, P is determinediAdding corresponding power line point set L, otherwise, adding PiAdd point set M.
As an optional implementation manner of this embodiment, the preset condition further includes a second preset condition, where the second preset condition specifically is: judging whether dz is smaller than a preset threshold value dz _ max or not, setting the value of dz _ max as the maximum height difference of adjacent points of the single power line, and if dz is smaller than dz _ max, indicating PiAnd PLThe height difference of the power line is not more than the preset maximum height difference of adjacent points of a single power line, then P is calculatediAdding corresponding power line point set L, otherwise, adding PiAdding point set M, i.e. when PiWhen the first preset condition and the second preset condition are met, P is addediAdd the target set of power line points L.
As an alternative to the present embodimentIn an embodiment, the preset conditions further include a third preset condition, where the third preset condition is specifically: judging whether the number of points in the point set L is more than 2, if so, judging PiTemporarily adding a point set L, calculating a minimum circumscribed rectangle projected in the horizontal direction of the point set L, recording the minimum circumscribed rectangle as Rec, solving the short side length of Rec as S, judging whether S is less than S _ max, and if so, adding P to the point set LiAdding corresponding power line point set L, otherwise, adding PiAdding point set M, i.e. when PiWhen the first preset condition, the second preset condition and the third preset condition are met, the P is addediAdd the target set of power line points L.
As an optional implementation manner of this embodiment, the preset conditions further include a fourth preset condition, where the fourth preset condition specifically is: find all and PiCounting the number of points belonging to the point set L as a and the number of points not belonging to the point set L as b when the point distance is less than K, and if the value of b-a is less than n _ max, then P is countediAdding corresponding power line point set L, otherwise, adding PiAdding point set M, n _ max is a threshold value preset by a data processing person, namely when PiWhen the first preset condition, the second preset condition, the third preset condition and the fourth preset condition are met, the P is addediAdd the target set of power line points L.
Based on the same inventive concept as the foregoing embodiment, another embodiment of the present invention provides a distribution network power line point cloud extraction system based on an improved K-neighborhood algorithm, and with reference to fig. 2, the system specifically includes:
the starting point selection module 1 is used for acquiring point cloud data of a target power line, selecting a point at a recognizable position of the target power line as a starting point, wherein the target power line is a low distribution network line or a low-voltage power transmission line with the height lower than a preset threshold value;
the searching module 2 is used for searching K neighborhoods from the starting point to different directions, judging whether the points in the neighborhoods meet preset conditions or not, and storing the points meeting the preset conditions into corresponding power line point sets;
and the output module 3 is used for repeatedly calling the search module until the point meeting the preset condition cannot be found in the neighborhood range, finishing the power line point cloud extraction and outputting the power line point set.
Optionally, the search module specifically includes:
a point set submodule for creating a point set L of the target power line, an excluded point set M, and a starting point P0Adding a point set L;
neighborhood search submodule for basing on starting point P0K neighborhood search is carried out to search any point P in the distance point set L in the neighborhoodLNearest point Pi,PiNot belonging to point set L and point set M, recording point number i, calculating PiAnd PLDistance d ofmin,dminThe expression of (a) is as follows:
wherein dx is xi-xL,dy=yi-yL,dz=zi-zL;
A judgment submodule for judging according to dminJudgment point PiWhether a preset condition is satisfied.
Optionally, the judgment submodule is specifically configured to judge the point PiWhether a first preset condition is satisfied, the judgment point PiWhether the first preset condition is met is specifically as follows: judgment of dminWhether the distance is smaller than a preset threshold K, wherein the preset threshold K is the maximum distance between adjacent points in the point cloud, and if d is smaller than the preset threshold KminLess than K, then PiAdd corresponding power line point set, otherwise PiAdd point set M.
Optionally, the determining submodule is further configured to determine the point PiWhether a second preset condition is satisfied, the judgment point PiWhether the second preset condition is met is specifically as follows: judging whether dz is smaller than a preset threshold value dz _ max, setting the value of dz _ max as the maximum height difference of adjacent points of the single power line, and if dz is smaller than dz _ max, setting PiAdd corresponding power line point set, otherwise PiAdd point set M. When point PiWhen the first preset condition and the second preset condition are simultaneously met, P is addediAdd corresponding power line point set, otherwise PiAdd point set M.
Optionally, the determining submodule is further configured to determine the point PiWhether a third preset condition is satisfied, the judgment point PiWhether the third preset condition is met is specifically as follows: judging whether the number of points in the point set L is more than 2, if so, judging PiTemporarily adding a point set L, calculating a minimum circumscribed rectangle projected in the horizontal direction of the point set L, recording the minimum circumscribed rectangle as Rec, solving the short side length of Rec as S, judging whether S is less than S _ max, and if so, adding P to the point set LiAdd corresponding power line point set, otherwise PiAdd point set M. When point PiWhen the first preset condition, the second preset condition and the third preset condition are simultaneously met, the P is addediAdd corresponding power line point set, otherwise PiAdd point set M.
Optionally, the determining submodule is further configured to determine the point PiWhether a fourth preset condition is satisfied, the judgment point PiWhether the fourth preset condition is met is specifically as follows: the judgment condition further comprises a fourth preset condition, and the fourth preset condition is as follows: find all and PiCounting the number of points belonging to the point set L as a and the number of points not belonging to the point set L as b when the point distance is less than K, and if the value of b-a is less than n _ max, then P is countediAdd corresponding power line point set, otherwise PiAdd point set M. When point PiWhen the first preset condition, the second preset condition, the third preset condition and the fourth preset condition are simultaneously met, the P is addediAdd corresponding power line point set, otherwise PiAdd point set M.
The above system embodiment is used to execute the method described in the foregoing method embodiment, and the technical principle and technical effect of the system embodiment can refer to the foregoing method embodiment, which is not described herein again.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.