Point cloud stitching method, device, equipment and storage medium

By using the encoder and liftable bracket to determine the masking area and initial transformation matrix on the three-dimensional laser scanner, the problem of low point cloud splicing accuracy in the distribution room area is solved, and higher accuracy and stability are achieved.

CN112967189BActive Publication Date: 2024-11-22GUANGZHOU POWER SUPPLY BUREAU GUANGDONG POWER GRID CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110279708.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-16
Publication Date
2024-11-22
Estimated Expiration
2041-03-16

AI Technical Summary

Technical Problem

The prior art has a high cost of point cloud scanning equipment and is difficult to obtain accurate and stable point cloud data in the distribution room area, resulting in low point cloud splicing accuracy.

Method used

By installing the encoder track assembly and liftable bracket on the three-dimensional laser scanner, initial point cloud data is collected, the masking area is determined and moved to the area, and the encoder pulse number is read to determine the stop position and the initial transformation matrix, and optimized Transform matrix to achieve coordinate conversion of point cloud data.

Benefits of technology

It reduces the cost of point cloud scanning, improves the accuracy and stability of point cloud data acquisition, and improves the accuracy of point cloud splicing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112967189B_ABST
    Figure CN112967189B_ABST
Patent Text Reader

Abstract

The present invention discloses a point cloud splicing method, device, equipment and storage medium, which are applied to a three-dimensional laser scanner. The three-dimensional laser scanner includes a crawler assembly provided with a first encoder, a liftable bracket provided with a second encoder and a point cloud scanning assembly. The method includes: responding to a scanning instruction, collecting first point cloud data at a preset initial position and determining a masking area, and in the process of moving to the masking area, regularly reading the first pulse number of the first encoder and the second pulse number of the second encoder; determining a stop position and an initial transformation matrix according to the first point cloud data, the first pulse number and the second pulse number; optimizing the initial transformation matrix to a target transformation matrix according to the first point cloud data and the second point cloud data collected at the stop position; using the target transformation matrix to convert the second point cloud data to the three-dimensional coordinate system where the first point cloud data is located, and obtaining the target point cloud coordinates. The point cloud scanning cost is reduced and the accuracy of point cloud data splicing is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of point cloud data splicing, and in particular to a point cloud splicing method, device, equipment and storage medium. Background Art

[0002] With the widespread use of 3D sensors in the industry, more and more applications are being developed around 3D point clouds. When using a 3D laser scanner to obtain the point cloud of a distribution room, due to the limitations of line of sight, multiple stations are usually required to obtain a complete point cloud of the distribution room. Point cloud stitching is to obtain the relative movement and rotation between point cloud data from different sites. The point cloud data obtained from independent coordinate systems at different positions and postures are transformed into a unified coordinate system to achieve point cloud data stitching from different sites, and finally obtain complete and unified 3D point cloud data of the distribution room.

[0003] Point cloud data stitching technology can be mainly divided into stitching based on measuring equipment, stitching based on auxiliary identification, and automatic stitching based on public point cloud. Point cloud stitching based on measuring equipment is to equip the scanning device with a precision mobile device with 6 degrees of freedom to record the relative movement or rotation between point cloud data of different sites; while the stitching method based on auxiliary identification is currently mainly to deploy artificial control targets such as plane targets, spherical targets, etc., or to select the same-name features between point clouds of different sites through manual interaction, perform target recognition or feature extraction in the office, and finally obtain the relative movement or rotation between point cloud data of different sites; automatic stitching based on public point cloud is mainly to use algorithms to search for the common feature point cloud used for stitching in the multi-site cloud, so as to calculate the translation and rotation parameters between the two coordinate systems, so that stitching can be completed without additional assistance.

[0004] However, due to the high cost of the equipment used in the above point cloud data stitching method, it is difficult to reasonably arrange targets in the distribution room area, and the public feature point cloud contains less geometric information and has poor stability, which makes matching errors prone to occur during the stitching process. Summary of the invention

[0005] The present invention provides a point cloud stitching method, device, equipment and storage medium, which solves the technical problems in the prior art of low point cloud stitching accuracy due to the high cost of point cloud scanning equipment and the difficulty in obtaining accurate and stable point cloud data in the distribution room area.

[0006] A first aspect of the present invention provides a point cloud stitching method, which is applied to a three-dimensional laser scanner, wherein the three-dimensional laser scanner comprises a crawler assembly provided with a first encoder, a liftable bracket provided with a second encoder, and a point cloud scanning assembly, wherein the method comprises:

[0007] When receiving a scanning instruction, collecting first point cloud data at a preset initial position by the point cloud scanning component;

[0008] Determine a masked area according to the first point cloud data and move to the masked area;

[0009] When the three-dimensional laser scanner moves, reading the first pulse number of the first encoder and the second pulse number of the second encoder at predetermined time intervals;

[0010] Determine a stop position and an initial transformation matrix within the masking area according to the first point cloud data, the first pulse number, and the second pulse number;

[0011] According to the first point cloud data and the second point cloud data collected at the stop position by the point cloud scanning component, the initial transformation matrix is ​​optimized to obtain a target transformation matrix;

[0012] The target transformation matrix is ​​used to transform the initial point cloud coordinates corresponding to the second point cloud data into the three-dimensional coordinate system where the first point cloud data is located, so as to obtain the target point cloud coordinates.

[0013] Optionally, the step of determining a masked area according to the first point cloud data and moving to the masked area includes:

[0014] Dividing the first point cloud data into a plurality of grids;

[0015] Respectively detecting the point cloud density of each of the grids;

[0016] If the point cloud density is less than a preset density threshold, determining that the area corresponding to the grid is a masked area;

[0017] The three-dimensional laser scanner is moved to the masked area.

[0018] Optionally, the step of determining the stop position and the initial transformation matrix in the masking area according to the first point cloud data, the first pulse number and the second pulse number comprises:

[0019] Determine the track movement amount in each of the predetermined time intervals according to a first difference of the first pulse number in the predetermined time interval and in combination with the track wheel diameter of the track assembly;

[0020] Determine the amount of movement of the support within each of the predetermined time intervals according to a second difference of the second pulse number within the predetermined time interval and in combination with the diameter of the lifting drive wheel of the liftable support;

[0021] Determine the amount of change of the azimuth angle within each of the predetermined time intervals according to the amount of movement of the crawler track;

[0022] Accumulating all the azimuth changes to determine the azimuth of the point cloud scanning component;

[0023] Determine a stop position within the masking area according to the point cloud coordinates of the first point cloud data, the track movement amount, the bracket movement amount and the azimuth angle;

[0024] An initial transformation matrix is ​​constructed using the azimuth angle.

[0025] Optionally, the track assembly includes a left track and a right track; the step of determining the amount of change of the azimuth angle within each predetermined time interval according to the amount of movement of the track includes:

[0026] calculating a third difference between the track movement amount of the left track and the track movement amount of the right track;

[0027] Obtaining a track spacing between the left track and the right track;

[0028] The azimuth angle change amount within each of the predetermined time intervals is determined according to the third difference and the track spacing.

[0029] Optionally, the step of optimizing the initial transformation matrix to obtain a target transformation matrix according to the first point cloud data and collecting second point cloud data at the stop position by the point cloud scanning component comprises:

[0030] Collecting second point cloud data at the stop position by the point cloud scanning component;

[0031] Using the initial transformation matrix, the initial point cloud coordinates corresponding to the second point cloud data are converted into the three-dimensional coordinate system where the first point cloud data is located, to obtain intermediate point cloud coordinates;

[0032] The initial transformation matrix is ​​optimized according to the point cloud coordinates of the first point cloud data and the intermediate point cloud coordinates to obtain a target transformation matrix.

[0033] Optionally, the step of optimizing the initial transformation matrix according to the point cloud coordinates of the first point cloud data and the intermediate point cloud coordinates to obtain a target transformation matrix comprises:

[0034] Using a preset RANSAC algorithm to extract initial planes from the point cloud coordinates of the first point cloud data and the intermediate point cloud coordinates respectively;

[0035] Acquire the point cloud data in the initial plane as a point set plane;

[0036] Performing principal component analysis on the point set plane to obtain a circumscribed rectangle projected by the point set plane;

[0037] Calculate the geometric center and unit normal vector of the circumscribed rectangle;

[0038] Determine a circumscribed rectangle where the geometric center meets a first preset density threshold and the unit normal vector meets a second preset density threshold as a plane with the same name;

[0039] Calculating the distances between a plurality of non-parallel planes of the same name;

[0040] Taking the minimum sum of squared distances as the criterion, the target transformation matrix is ​​iteratively solved as an unknown number to obtain the target change matrix.

[0041] Optionally, the method further comprises:

[0042] When there are overlapping target point cloud coordinates, the overlapping target point cloud coordinates are deleted.

[0043] The second aspect of the present invention further provides a point cloud stitching device, which is applied to a three-dimensional laser scanner, wherein the three-dimensional laser scanner comprises a crawler assembly provided with a first encoder, a liftable bracket provided with a second encoder, and a point cloud scanning assembly, wherein the device comprises:

[0044] A collection module, configured to collect first point cloud data at a preset initial position through the point cloud scanning component when a scanning instruction is received;

[0045] A moving module, used for determining a masked area according to the first point cloud data and moving to the masked area;

[0046] A pulse number reading module, used for reading a first pulse number of the first encoder and a second pulse number of the second encoder at a predetermined time interval when the three-dimensional laser scanner moves;

[0047] a stop position determination module, configured to determine a stop position and an initial transformation matrix within the masking area according to the first point cloud data, the first pulse number, and the second pulse number;

[0048] a transformation matrix optimization module, configured to optimize the initial transformation matrix according to the first point cloud data and the second point cloud data collected at the stop position by the point cloud scanning component, so as to obtain a target transformation matrix;

[0049] A coordinate conversion module is used to convert the initial point cloud coordinates corresponding to the second point cloud data into the three-dimensional coordinate system where the first point cloud data is located by using the target transformation matrix to obtain the target point cloud coordinates.

[0050] The third aspect of the present invention also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the point cloud stitching method as described in any one of the first aspect of the present invention.

[0051] The fourth aspect of the present invention further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by the processor, the point cloud stitching method as described in any one of the first aspects of the present invention is implemented.

[0052] It can be seen from the above technical solutions that the present invention has the following advantages:

[0053] When the 3D laser scanner receives a scanning instruction, the point cloud scanning component collects the first point cloud data at a preset initial position; according to the first point cloud data, the masking area is determined and the 3D laser scanner is moved to the masking area; when the 3D laser scanner is moved, the first pulse number of the first encoder and the second pulse number of the second encoder are read at a predetermined time interval; according to the first point cloud data, the first pulse number and the second pulse number, the stop position and the initial transformation matrix of the 3D laser scanner in the masking area are determined; according to the first point cloud data and the second point cloud data collected at the stop position by the point cloud scanning component, the initial transformation matrix is ​​optimized to obtain the target transformation matrix; the target transformation matrix is ​​used to convert the initial point cloud coordinates corresponding to the second point cloud data to the three-dimensional coordinate system where the first point cloud data is located, and the target point cloud coordinates are obtained. Thus, the technical problem of low point cloud splicing accuracy caused by the high cost of point cloud scanning equipment and the difficulty in obtaining accurate and stable point cloud data in the power distribution room area in the prior art is solved, the point cloud scanning cost is reduced, the accuracy and stability of point cloud data acquisition are improved, and the accuracy of point cloud splicing is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0055] Figure 1 A flowchart of a point cloud stitching method provided in Embodiment 1 of the present invention;

[0056] Figure 2 A flowchart of a point cloud stitching method provided in Embodiment 2 of the present invention;

[0057] Figure 3 A schematic diagram of coordinate transformation provided in the second embodiment of the present invention;

[0058] Figure 4 This is a structural block diagram of a point cloud stitching device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION

[0059] The embodiments of the present invention provide a point cloud stitching method, device, equipment and storage medium, which are used to solve the technical problems in the prior art that the point cloud stitching accuracy is low due to the high cost of point cloud scanning equipment and the difficulty in obtaining accurate and stable point cloud data in the distribution room area.

[0060] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described below are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0061] See also Figure 1 , Figure 1 A flowchart of the steps of a point cloud stitching method provided in Embodiment 1 of the present invention.

[0062] A point cloud stitching method provided by the present invention is applied to a three-dimensional laser scanner, wherein the three-dimensional laser scanner comprises a crawler assembly provided with a first encoder, a liftable bracket provided with a second encoder, and a point cloud scanning assembly, and the method comprises:

[0063] Step 101, when a scanning instruction is received, first point cloud data is collected at a preset initial position by the point cloud scanning component;

[0064] Point cloud scanning components refer to measuring instruments that use a laser beam to illuminate the surface of an object, obtain information such as direction and distance from the reflected laser, and obtain point cloud data on the surface of the object. The principle is to scan the laser beam along a certain trajectory, and record the reflected laser point information while scanning. Since the scanning is extremely fine, a large number of laser points can be obtained, thus forming a laser point cloud.

[0065] In an embodiment of the present invention, when the user needs to scan the distribution room, a scanning command can be sent to the three-dimensional laser scanner. When the three-dimensional laser scanner receives the scanning command, it starts to collect point cloud data at the current preset initial position of the instrument through its own point cloud scanning component to obtain the first point cloud data corresponding to the preset initial position.

[0066] It is worth mentioning that the first encoder and the second encoder can be incremental encoders, which can convert the displacement into a periodic electrical signal, and then convert the electrical signal into counting pulses, using the number of pulses to represent the size of the displacement.

[0067] Step 102, determining a masked area according to the first point cloud data and moving to the masked area;

[0068] After obtaining the first point cloud data, since the first point cloud data is only scanned by the point cloud scanning component at the preset initial position, in the actual environment, due to the location of the equipment in the power distribution room, there may be some areas that cannot be scanned at the preset initial position. At this time, the masked area can be determined based on the object content displayed in the first point cloud data, and the 3D laser scanner can be moved to the masked area to obtain more detailed point cloud data.

[0069] Step 103, when the three-dimensional laser scanner moves, reading the first pulse number of the first encoder and the second pulse number of the second encoder at a predetermined time interval;

[0070] When the 3D laser scanner moves to the masking area, the scanning angle and the scanning height may change, and the crawler assembly is provided with a first encoder, and the liftable bracket is provided with a second encoder. The first pulse number of the first encoder and the second pulse number of the second encoder can be read at a predetermined time interval to further determine the angle change and position change of the 3D laser scanner during the movement, as well as the position in the masking area.

[0071] Step 104, determining a stop position and an initial transformation matrix in the masking area according to the first point cloud data, the first pulse number and the second pulse number;

[0072] In a specific implementation, the coordinates of the stop position of the three-dimensional laser scanner in the masked area can be determined according to the first pulse number and the second pulse number, and the coordinates of the stop position can be transformed into the same coordinate system in combination with the first point cloud data to obtain an initial change matrix.

[0073] Step 105, optimizing the initial transformation matrix according to the first point cloud data and the second point cloud data collected at the stop position by the point cloud scanning component to obtain a target transformation matrix;

[0074] After the 3D laser scanner reaches the stop position, the point cloud scanning component is used to collect the second point cloud data at the stop position. After obtaining the second point cloud data, since the coordinate system of the second point cloud data is different from the coordinate system of the first point cloud data, the initial transformation matrix can be used to coarsely splice them to obtain coarsely spliced ​​point cloud data in the same coordinate system; and the initial transformation matrix is ​​further optimized according to the coarsely spliced ​​point cloud data to obtain the target transformation matrix.

[0075] Step 106 , using the target transformation matrix to transform the initial point cloud coordinates corresponding to the second point cloud data into the three-dimensional coordinate system where the first point cloud data is located, to obtain target point cloud coordinates.

[0076] After obtaining the target transformation matrix, the initial point cloud coordinates corresponding to the second point cloud data may be transformed again to obtain the target point cloud coordinates in the same coordinate system as the first point cloud data.

[0077] It is worth mentioning that the masking area may include multiple stop positions, and the second point cloud data can be collected at each stop position.

[0078] In an embodiment of the present invention, when the three-dimensional laser scanner receives a scanning instruction, the point cloud scanning component collects first point cloud data at a preset initial position; according to the first point cloud data, the masking area is determined and the three-dimensional laser scanner is moved to the masking area; when the three-dimensional laser scanner is moved, the first pulse number of the first encoder and the second pulse number of the second encoder are read at a predetermined time interval; according to the first point cloud data, the first pulse number and the second pulse number, the stop position and the initial transformation matrix of the three-dimensional laser scanner in the masking area are determined; according to the first point cloud data and the second point cloud data collected by the point cloud scanning component at the stop position, the initial transformation matrix is ​​optimized to obtain the target transformation matrix; the target transformation matrix is ​​used to convert the initial point cloud coordinates corresponding to the second point cloud data to the three-dimensional coordinate system where the first point cloud data is located, and the target point cloud coordinates are obtained. Thus, the technical problem of low point cloud splicing accuracy caused by the high cost of point cloud scanning equipment and the difficulty in obtaining accurate and stable point cloud data in the power distribution room area in the prior art is solved, the point cloud scanning cost is reduced, the accuracy and stability of point cloud data acquisition are improved, and the accuracy of point cloud splicing is improved.

[0079] See also Figure 2 , Figure 2 A flowchart of the steps of a point cloud stitching method provided in Embodiment 2 of the present invention.

[0080] In order to improve the flexibility of the use of the three-dimensional laser scanner, a track assembly provided with a first encoder and a liftable bracket provided with a second encoder can be installed on the basis of the point cloud scanning assembly to provide the movable function and liftable function of the three-dimensional laser scanner. Among them, the track assembly can include left and right tracks, each track is provided with a first encoder, and the liftable bracket is provided with a second encoder, and the first encoder and the second encoder can continuously output pulses. The cumulative number of pulses of the first encoder is obtained in continuous equal time intervals, so as to calculate the moving distance of each track in the time interval; at the same time, the cumulative number of pulses of the second encoder is obtained in continuous equal time intervals, and the lifting distance is calculated. According to the moving distance and the lifting distance, the position and angular change value of the three-dimensional laser scanner after the movement can be calculated.

[0081] A point cloud stitching method provided by the present invention is applied to a three-dimensional laser scanner, wherein the three-dimensional laser scanner comprises a crawler assembly provided with a first encoder, a liftable bracket provided with a second encoder, and a point cloud scanning assembly, and the method comprises:

[0082] Step 201, when a scanning instruction is received, first point cloud data is collected at a preset initial position by the point cloud scanning component;

[0083] In an embodiment of the present invention, when the three-dimensional laser scanner receives a scanning instruction, it indicates that the user needs to scan the point cloud data of the room where the three-dimensional laser scanner is currently located. At this time, the point cloud data can be scanned by the point cloud scanning component on the three-dimensional laser scanner at the preset initial position where the three-dimensional laser scanner is located to collect the first point cloud data.

[0084] It is worth mentioning that when the first point cloud data is collected, the initial position can also be preset as the origin, with the zero direction of the point cloud scanner as the X-axis direction and the direction angle as zero, to establish a three-dimensional coordinate system, so as to facilitate the subsequent conversion of the point cloud coordinates of each stop position in the masked area into the three-dimensional coordinate system to achieve point cloud data stitching at different positions.

[0085] Step 202, determining a masked area according to the first point cloud data and moving to the masked area;

[0086] Optionally, step 202 may include the following sub-steps S11-S14:

[0087] S11, dividing the first point cloud data into a plurality of grids;

[0088] S12, detecting the point cloud density of each grid respectively;

[0089] S13, if the point cloud density is less than a preset density threshold, determining that the area corresponding to the grid is a masked area;

[0090] S14, moving the three-dimensional laser scanner to the masking area.

[0091] In an embodiment of the present invention, since the point cloud density of different objects at different distances is different, in order to determine the masked area, the first point cloud data can be divided into multiple grids. By detecting the point cloud density in each grid respectively, if the point cloud density is less than a preset density threshold, the area corresponding to the grid can be determined as the masked area.

[0092] In a specific implementation, the first point cloud data may be divided into a plurality of regions according to point cloud density, and a region with a smaller point cloud density among regions where the point cloud difference exceeds a preset density threshold may be determined as a masked region.

[0093] Among them, the preset density threshold can be set by technical personnel.

[0094] Step 203, when the three-dimensional laser scanner moves, reading the first pulse number of the first encoder and the second pulse number of the second encoder at a predetermined time interval;

[0095] In actual operation, when the mobile 3D laser scanner is moved from a preset initial position to the masked area, since the 3D laser scanner may not travel in a straight line during the movement but may need to turn, this will cause the azimuth angle of the point cloud scanning component to change. The first pulse number of the first encoder can be read at a predetermined time interval to determine the azimuth angle change of the point cloud scanning component; and the point cloud scanning component may need to rise and fall to obtain point cloud data at different heights. At this time, the second pulse number of the second encoder can be read at a predetermined time interval.

[0096] The predetermined time interval may be 20-100 ms, or may be set by a technician, and the embodiment of the present invention does not limit this.

[0097] Step 204, determining a stop position and an initial transformation matrix in the masking area according to the first point cloud data, the first pulse number and the second pulse number;

[0098] In an example of the present invention, step 204 may include the following sub-steps S21-S26:

[0099] S21, determining the track movement amount in each of the predetermined time intervals according to the first difference of the first pulse number in the predetermined time interval and in combination with the track wheel diameter of the track assembly;

[0100] In a specific implementation, the track assembly includes a left track and a right track. The first pulse numbers of the left and right tracks before and after a predetermined time interval can be obtained respectively, and the first difference of the first pulse number in the predetermined time interval can be calculated, and then combined with the track wheel diameter to determine the track movement amount in each of the predetermined time intervals.

[0101] Specifically, the track movement of each track can be calculated by the following formula:

[0102] ΔL i =(LM i -LM i-1 ) / Count*π*d LR

[0103] ΔR i =(RM i -RM i-1 ) / Count*π*d LR

[0104] Among them, LM i is the first pulse number of the left track at the current moment, RM i is the first pulse number of the right track at the current moment; LM i-1 is the first pulse number of the left track at the previous moment of the predetermined time interval, RM i is the first pulse number of the right track at the previous moment of the predetermined time interval; ΔL i is the track movement of the left track, ΔR i is the movement of the right track, Count is the total number of pulses per revolution of the encoder, d LR is the track wheel diameter of the left and right tracks, i is a positive integer, 1≤i≤n, n is a positive integer, n≥1.

[0105] S22, determining the amount of movement of the support within each of the predetermined time intervals according to a second difference of the second pulse number within the predetermined time interval and in combination with the diameter of the lifting drive wheel of the liftable support;

[0106] In an embodiment of the present invention, the second pulse number obtained by reading before and after the predetermined time interval can be used to calculate the second difference of the second pulse number within the predetermined time interval, combined with the diameter of the lifting drive wheel of the liftable bracket to determine the amount of bracket movement of the three-dimensional laser scanner within each of the predetermined time intervals.

[0107] In the specific implementation, it can also be achieved by the following formula:

[0108] ΔH i =(HM i -HM i-1 ) / Count*π*d H

[0109] Where ΔH i is the amount of bracket movement, HM i is the second pulse number at the current moment, HM i-1 is the number of second pulses at the previous moment of the predetermined time interval, d H is the diameter of the lifting drive wheel, i is a positive integer, 1≤i≤n, n is a positive integer, n≥1.

[0110] S23, determining the amount of change of the azimuth angle within each of the predetermined time intervals according to the amount of movement of the crawler track;

[0111] Further, the track assembly includes a left track and a right track; step S23 may include the following sub-steps S231-S233:

[0112] S231, calculating a third difference between the track movement amount of the left track and the track movement amount of the right track;

[0113] S232, obtaining a track spacing between the left track and the right track;

[0114] S233. Determine the azimuth angle change in each of the predetermined time intervals according to the third difference and the track spacing.

[0115] In an embodiment of the present invention, the difference between the track movement of the left track and the track movement of the right track can be calculated as a third difference, and the track spacing between the left and right tracks can be obtained at the same time. The azimuth angle change of the three-dimensional laser scanner within each predetermined time interval can be determined based on the third difference and the track spacing.

[0116] In the specific implementation, after obtaining the track movement amount ΔL of the left track i The track movement of the right track ΔR i After that, the azimuth angle change ΔA of the 3D laser scanner within a predetermined time interval can be determined by combining the track spacing b with the following formula: i :

[0117]

[0118] S24, accumulating all the azimuth changes to determine the azimuth of the point cloud scanning component;

[0119] In a specific implementation, after knowing each azimuth change, the azimuth change in each predetermined time interval can be accumulated to obtain the azimuth of the three-dimensional laser scanner at the stop position, which can be specifically implemented by any of the following formulas:

[0120]

[0121] Among them, A0=0, Ai T k-1 Station moves to T k The azimuth of the i-th movement during the station process.

[0122] S25, determining a stop position within the masking area according to the point cloud coordinates of the first point cloud data, the movement amount of the crawler track, the movement amount of the bracket, and the azimuth angle;

[0123] See also Figure 3 , Figure 3 A schematic diagram of coordinate transformation in the second embodiment of the present invention is shown.

[0124] In the embodiment of the present invention, the point cloud coordinates, track movement, bracket movement and azimuth obtained above can be used to perform further coordinate calculation to determine the coordinates T of the stop position of the three-dimensional laser scanner in the masking area. k (X k , Y k , Z k ).

[0125] Specifically, it can be achieved through the following formula:

[0126]

[0127] Among them, X k Indicates the X-axis coordinate of the stop position, Y k Indicates the Y-axis coordinate of the stop position, Z k Indicates the Z-axis coordinate of the stop position; X k-1 is the X-axis coordinate of the 3D laser scanner at a predetermined time interval before reaching the stop position, and Y k-1 is the Y-axis coordinate of the 3D laser scanner at a predetermined time interval before reaching the stop position, Z k-1 is the Z-axis coordinate of the 3D laser scanner at a predetermined time interval before reaching the stop position; k is a positive integer, and the value of k is the same as the value of i; the coordinate of the preset initial position is T 1 (X 1 , Y 1 , Z 1 )=(0,0,0).

[0128] S26. Construct an initial transformation matrix using the azimuth angle.

[0129] In the embodiment of the present invention, after the azimuth angle of the three-dimensional laser scanner at the stop position is obtained, the azimuth angle can be used to construct an initial transformation matrix R, which is expressed as follows:

[0130]

[0131] Step 205, collecting second point cloud data at the stop position by the point cloud scanning component;

[0132] In the embodiment of the present invention, the second point cloud data collected by the point cloud scanning component at the stop position can be expressed in the form of Q(x k ,y k ,z k ).

[0133] Step 206, using the initial transformation matrix to transform the initial point cloud coordinates corresponding to the second point cloud data into the three-dimensional coordinate system where the first point cloud data is located, to obtain intermediate point cloud coordinates;

[0134] In a specific implementation, the initial transformation matrix R constructed above can be used to transform the second point cloud data Q(x k ,y k ,z k ) is converted to the three-dimensional coordinate system of the first point cloud data to obtain the intermediate point cloud coordinates The specific conversion process is as follows:

[0135]

[0136] Step 207: Optimize the initial transformation matrix according to the point cloud coordinates of the first point cloud data and the intermediate point cloud coordinates to obtain a target transformation matrix.

[0137] In an optional embodiment of the present invention, step 207 may include the following sub-steps S31-S37:

[0138] S31, using a preset RANSAC algorithm to extract initial planes from the point cloud coordinates of the first point cloud data and the intermediate point cloud coordinates respectively;

[0139] S32, acquiring the point cloud data in the initial plane as a point set plane;

[0140] S33, performing principal component analysis on the point set plane to obtain a circumscribed rectangle projected by the point set plane;

[0141] S34, calculating the geometric center and unit normal vector of the circumscribed rectangle;

[0142] S35, determining a circumscribed rectangle whose geometric center meets a first preset density threshold and whose unit normal vector meets a second preset density threshold as a plane with the same name;

[0143] S36, calculating the distances between a plurality of non-parallel planes of the same name;

[0144] S37, taking the minimum sum of squared distances as the criterion, the target transformation matrix is ​​iteratively solved as an unknown number to obtain a target change matrix.

[0145] In an embodiment of the present invention, a RANSAC algorithm can be used to extract an initial plane from the point cloud coordinates of the first point cloud data and the intermediate point cloud coordinates, perform principal component analysis on the point set plane belonging to the same initial plane, use the first and second principal component directions as the length and width directions, construct a bounding rectangle obtained by projecting the point set plane, and calculate the geometric center and unit normal vector of the bounding rectangle. Based on the comparison of the geometric center and unit normal vector of the bounding rectangle with the first preset density threshold and the second preset density threshold, the corresponding planes with the same name in the point cloud coordinates of the first point cloud data and the intermediate point cloud coordinates are determined and retained, and the plane primitives that cannot correspond are deleted.

[0146] In the specific implementation, more than one pair of non-parallel planes with the same name can be found, and the distances between the primitives of the planes with the same name can be calculated. The minimum sum of squared distances is used as the criterion, and the coordinate transformation parameters are used as unknowns. The optimal transformation parameters are solved iteratively to converge, thereby achieving accurate stitching of the clouds of two adjacent sites.

[0147] RANSAC algorithm, RANSAC is the abbreviation of Random Sample Consensus, is an algorithm that calculates the mathematical model parameters of data based on a set of sample data containing abnormal data to obtain valid sample data. ① Consider a model with a minimum sampling set power of n (n is the minimum number of samples required to initialize the model parameters) and a sample set P, the number of samples in the set P #(P)>n, randomly extract a subset S of P containing n samples from P to initialize the model M; ② The sample set in the remainder set SC=P\S whose error with the model M is less than a certain set threshold t and S constitute S*. S* is considered to be an inlier set, and they constitute the consensus set (Consensus Set) of S; ③ If #(S*)≥N, it is considered that the correct model parameters are obtained, and the set S* (inliers) is used to recalculate the new model M* using the least squares method; re-randomly extract a new S and repeat the above process. ④ After a certain number of sampling times, if the consensus set is not found, the algorithm fails, otherwise the maximum consensus set obtained after sampling is selected to determine the inliers and inliers, and the algorithm ends.

[0148] Step 208 : Using the target transformation matrix, the initial point cloud coordinates corresponding to the second point cloud data are transformed into the three-dimensional coordinate system where the first point cloud data is located, so as to obtain the target point cloud coordinates.

[0149] After obtaining the target transformation matrix, the initial point cloud coordinates corresponding to the second point cloud data may be transformed again to obtain the target point cloud coordinates in the same coordinate system as the first point cloud data.

[0150] Step 209: when there are overlapping target point cloud coordinates, delete the overlapping target point cloud coordinates.

[0151] In an embodiment of the present invention, after all target point cloud coordinates are obtained, in the process of point cloud data conversion in multiple coordinate systems, some target point cloud coordinates may be scanned repeatedly, resulting in overlapping target point cloud coordinates. At this time, the overlapping target point cloud coordinates can be deleted to ensure the uniqueness of the target point cloud coordinates.

[0152] In an embodiment of the present invention, when the three-dimensional laser scanner receives a scanning instruction, the point cloud scanning component collects first point cloud data at a preset initial position; according to the first point cloud data, the masking area is determined and the three-dimensional laser scanner is moved to the masking area; when the three-dimensional laser scanner is moved, the first pulse number of the first encoder and the second pulse number of the second encoder are read at a predetermined time interval; according to the first point cloud data, the first pulse number and the second pulse number, the stop position and the initial transformation matrix of the three-dimensional laser scanner in the masking area are determined; according to the first point cloud data and the second point cloud data collected by the point cloud scanning component at the stop position, the initial transformation matrix is ​​optimized to obtain the target transformation matrix; the target transformation matrix is ​​used to convert the initial point cloud coordinates corresponding to the second point cloud data to the three-dimensional coordinate system where the first point cloud data is located, and the target point cloud coordinates are obtained. Thus, the technical problem of low point cloud splicing accuracy caused by the high cost of point cloud scanning equipment and the difficulty in obtaining accurate and stable point cloud data in the power distribution room area in the prior art is solved, the point cloud scanning cost is reduced, the accuracy and stability of point cloud data acquisition are improved, and the accuracy of point cloud splicing is improved.

[0153] See also Figure 4 , Figure 4 This is a structural block diagram of a point cloud stitching device provided in Embodiment 3 of the present invention.

[0154] A point cloud stitching device provided by the present invention is applied to a three-dimensional laser scanner, wherein the three-dimensional laser scanner comprises a crawler assembly provided with a first encoder, a liftable bracket provided with a second encoder, and a point cloud scanning assembly, wherein the device comprises:

[0155] The acquisition module 401 is used to acquire first point cloud data at a preset initial position through the point cloud scanning component when receiving a scanning instruction;

[0156] A moving module 402, configured to determine a masked area according to the first point cloud data and move to the masked area;

[0157] A pulse number reading module 403, used for reading the first pulse number of the first encoder and the second pulse number of the second encoder at a predetermined time interval when the three-dimensional laser scanner moves;

[0158] A stop position determination module 404, configured to determine a stop position and an initial transformation matrix within the masking area according to the first point cloud data, the first pulse number, and the second pulse number;

[0159] A transformation matrix optimization module 405 is used to optimize the initial transformation matrix according to the first point cloud data and the second point cloud data collected at the stop position by the point cloud scanning component to obtain a target transformation matrix;

[0160] The coordinate conversion module 406 is used to convert the initial point cloud coordinates corresponding to the second point cloud data into the three-dimensional coordinate system where the first point cloud data is located by using the target transformation matrix to obtain the target point cloud coordinates.

[0161] Optionally, the moving module 402 includes:

[0162] A grid division submodule, used for dividing the first point cloud data into a plurality of grids;

[0163] A point cloud density detection submodule, used to detect the point cloud density of each grid respectively;

[0164] A masked area determination submodule, configured to determine that the area corresponding to the grid is a masked area if the point cloud density is less than a preset density threshold;

[0165] The moving submodule is used to move the three-dimensional laser scanner to the masking area.

[0166] Optionally, the stop position determination module 404 includes:

[0167] A crawler track movement amount determination submodule, used to determine the crawler track movement amount within each of the predetermined time intervals according to a first difference of the first pulse number within the predetermined time interval and in combination with a crawler wheel diameter of the crawler track assembly;

[0168] a support movement amount determination submodule, configured to determine the support movement amount within each of the predetermined time intervals according to a second difference of the second pulse number within the predetermined time interval and in combination with a lifting drive wheel diameter of the liftable support;

[0169] An azimuth angle variation determination submodule, configured to determine an azimuth angle variation within each of the predetermined time intervals according to the track movement amount;

[0170] A variation accumulation submodule, used for accumulating all the azimuth variations to determine the azimuth of the point cloud scanning component;

[0171] a stop position determination submodule, configured to determine a stop position within the masking area according to the point cloud coordinates of the first point cloud data, the track movement amount, the bracket movement amount and the azimuth angle;

[0172] The initial transformation matrix construction submodule is used to construct an initial transformation matrix using the azimuth angle.

[0173] Optionally, the track assembly includes a left track and a right track; the azimuth angle variation determination submodule includes:

[0174] a track movement difference calculation unit, used for calculating a third difference between the track movement of the left track and the track movement of the right track;

[0175] A track spacing unit, used for obtaining the track spacing between the left track and the right track;

[0176] The azimuth angle change amount determining unit is used to determine the azimuth angle change amount within each of the predetermined time intervals according to the third difference and the track spacing.

[0177] Optionally, the transformation matrix optimization module 405 includes:

[0178] A second point cloud data acquisition submodule, used for collecting second point cloud data at the stop position through the point cloud scanning component;

[0179] An intermediate coordinate conversion submodule, used to convert the initial point cloud coordinates corresponding to the second point cloud data into the three-dimensional coordinate system where the first point cloud data is located by using the initial transformation matrix to obtain intermediate point cloud coordinates;

[0180] The matrix optimization submodule is used to optimize the initial transformation matrix according to the point cloud coordinates of the first point cloud data and the intermediate point cloud coordinates to obtain a target transformation matrix.

[0181] Optionally, the matrix optimization submodule includes:

[0182] An initial plane extraction unit, used to extract initial planes from the point cloud coordinates of the first point cloud data and the intermediate point cloud coordinates respectively by using a preset RANSAC algorithm;

[0183] A point set plane determination unit, used to obtain the point cloud data in the initial plane as the point set plane;

[0184] A principal component analysis unit, used for performing principal component analysis on the point set plane to obtain a circumscribed rectangle projected by the point set plane;

[0185] A circumscribed matrix parameter calculation unit, used to calculate the geometric center and unit normal vector of the circumscribed rectangle;

[0186] A plane-of-the-same-name determining unit, configured to determine a circumscribed rectangle whose geometric center satisfies a first preset density threshold and whose unit normal vector satisfies a second preset density threshold as a plane of the same name;

[0187] A plane distance calculation unit, used for calculating the distance between a plurality of non-parallel planes of the same name;

[0188] The iterative optimization unit is used to iteratively solve the target transformation matrix as an unknown number with the minimum sum of squared distances as a criterion to obtain the target change matrix.

[0189] Optionally, the device further comprises:

[0190] The overlapping point cloud deletion module is used to delete the overlapping target point cloud coordinates when there are overlapping target point cloud coordinates.

[0191] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of the point cloud stitching method as described in any embodiment of the present invention.

[0192] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by the processor, the point cloud stitching method as described in any embodiment of the present invention is implemented.

[0193] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0194] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0195] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0196] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0197] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0198] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A point cloud stitching method, characterized in that: Applied to a three-dimensional laser scanner, the three-dimensional laser scanner includes a crawler assembly provided with a first encoder, a liftable bracket provided with a second encoder, and a point cloud scanning assembly, the method includes: When receiving a scanning instruction, collecting first point cloud data at a preset initial position by the point cloud scanning component; Determine a masked area according to the first point cloud data and move to the masked area; When the three-dimensional laser scanner moves, reading the first pulse number of the first encoder and the second pulse number of the second encoder at predetermined time intervals; Determine a stop position and an initial transformation matrix within the masking area according to the first point cloud data, the first pulse number, and the second pulse number; According to the first point cloud data and the second point cloud data collected at the stop position by the point cloud scanning component, the initial transformation matrix is ​​optimized to obtain a target transformation matrix; The target transformation matrix is ​​used to transform the initial point cloud coordinates corresponding to the second point cloud data into the three-dimensional coordinate system of the first point cloud data to obtain the target point cloud coordinates; The step of optimizing the initial transformation matrix to obtain a target transformation matrix based on the first point cloud data and collecting the second point cloud data at the stop position by the point cloud scanning component comprises: Collecting second point cloud data at the stop position by the point cloud scanning component; Using the initial transformation matrix, the initial point cloud coordinates corresponding to the second point cloud data are converted into the three-dimensional coordinate system where the first point cloud data is located, to obtain intermediate point cloud coordinates; According to the point cloud coordinates of the first point cloud data and the intermediate point cloud coordinates, optimizing the initial transformation matrix to obtain a target transformation matrix; The step of optimizing the initial transformation matrix according to the point cloud coordinates of the first point cloud data and the intermediate point cloud coordinates to obtain a target transformation matrix comprises: Using a preset RANSAC algorithm to extract initial planes from the point cloud coordinates of the first point cloud data and the intermediate point cloud coordinates respectively; Acquire the point cloud data in the initial plane as a point set plane; Performing principal component analysis on the point set plane to obtain a circumscribed rectangle projected by the point set plane; Calculate the geometric center and unit normal vector of the circumscribed rectangle; Determine a circumscribed rectangle where the geometric center meets a first preset density threshold and the unit normal vector meets a second preset density threshold as a plane with the same name; Calculating the distances between a plurality of non-parallel planes of the same name; Taking the minimum sum of squared distances as the criterion, the target transformation matrix is ​​iteratively solved as an unknown number to obtain the target change matrix.

2. The point cloud stitching method according to claim 1, characterized in that: The step of determining a masked area according to the first point cloud data and moving to the masked area comprises: Dividing the first point cloud data into a plurality of grids; Respectively detecting the point cloud density of each of the grids; If the point cloud density is less than a preset density threshold, determining that the area corresponding to the grid is a masked area; The three-dimensional laser scanner is moved to the masked area.

3. The point cloud stitching method according to claim 1, characterized in that: The step of determining the stop position and the initial transformation matrix in the masking area according to the first point cloud data, the first pulse number and the second pulse number comprises: Determine the track movement amount in each of the predetermined time intervals according to a first difference of the first pulse number in the predetermined time interval and in combination with the track wheel diameter of the track assembly; Determine the amount of movement of the support within each of the predetermined time intervals according to a second difference of the second pulse number within the predetermined time interval and in combination with the diameter of the lifting drive wheel of the liftable support; Determine the amount of change of the azimuth angle within each of the predetermined time intervals according to the amount of movement of the crawler track; Accumulating all the azimuth changes to determine the azimuth of the point cloud scanning component; Determine a stop position within the masking area according to the point cloud coordinates of the first point cloud data, the track movement amount, the bracket movement amount and the azimuth angle; An initial transformation matrix is ​​constructed using the azimuth angle.

4. The point cloud stitching method according to claim 3, characterized in that: The crawler assembly includes a left crawler and a right crawler; the step of determining the amount of change of the azimuth angle within each predetermined time interval according to the amount of movement of the crawler includes: calculating a third difference between the track movement amount of the left track and the track movement amount of the right track; Obtaining a track spacing between the left track and the right track; The azimuth angle change amount within each of the predetermined time intervals is determined according to the third difference and the track spacing.

5. The point cloud stitching method according to claim 1, characterized in that: The method further comprises: When there are overlapping target point cloud coordinates, the overlapping target point cloud coordinates are deleted.

6. A point cloud stitching device, characterized in that: Applied to a three-dimensional laser scanner, the three-dimensional laser scanner comprises a crawler assembly provided with a first encoder, a liftable bracket provided with a second encoder and a point cloud scanning assembly, the device comprises: A collection module, configured to collect first point cloud data at a preset initial position through the point cloud scanning component when a scanning instruction is received; A moving module, used for determining a masked area according to the first point cloud data and moving to the masked area; A pulse number reading module, used for reading a first pulse number of the first encoder and a second pulse number of the second encoder at a predetermined time interval when the three-dimensional laser scanner moves; a stop position determination module, configured to determine a stop position and an initial transformation matrix within the masking area according to the first point cloud data, the first pulse number, and the second pulse number; a transformation matrix optimization module, configured to optimize the initial transformation matrix according to the first point cloud data and the second point cloud data collected at the stop position by the point cloud scanning component, so as to obtain a target transformation matrix; A coordinate conversion module, used to convert the initial point cloud coordinates corresponding to the second point cloud data into the three-dimensional coordinate system where the first point cloud data is located by using the target transformation matrix to obtain the target point cloud coordinates; The transformation matrix optimization module comprises: A second point cloud data acquisition submodule, used for collecting second point cloud data at the stop position through the point cloud scanning component; An intermediate coordinate conversion submodule, used to convert the initial point cloud coordinates corresponding to the second point cloud data into the three-dimensional coordinate system where the first point cloud data is located by using the initial transformation matrix to obtain intermediate point cloud coordinates; A matrix optimization submodule, configured to optimize the initial transformation matrix according to the point cloud coordinates of the first point cloud data and the intermediate point cloud coordinates to obtain a target transformation matrix; The matrix optimization submodule comprises: An initial plane extraction unit, used to extract initial planes from the point cloud coordinates of the first point cloud data and the intermediate point cloud coordinates respectively by using a preset RANSAC algorithm; A point set plane determination unit, used to obtain the point cloud data in the initial plane as the point set plane; A principal component analysis unit, used for performing principal component analysis on the point set plane to obtain a circumscribed rectangle projected by the point set plane; A circumscribed matrix parameter calculation unit, used to calculate the geometric center and unit normal vector of the circumscribed rectangle; A plane-of-the-same-name determining unit, configured to determine a circumscribed rectangle whose geometric center satisfies a first preset density threshold and whose unit normal vector satisfies a second preset density threshold as a plane of the same name; A plane distance calculation unit, used for calculating the distance between a plurality of non-parallel planes of the same name; The iterative optimization unit is used to iteratively solve the target transformation matrix as an unknown number with the minimum sum of squared distances as a criterion to obtain the target change matrix.

7. An electronic device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of the point cloud stitching method according to any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the point cloud stitching method according to any one of claims 1 to 5 is implemented.