Carriage point cloud posture automatic correction method and device
By acquiring point cloud data of the carriage, using the random sampling consensus algorithm to determine the side of the carriage and calculate the extrinsic parameter matrix, automatic attitude correction is achieved, which solves the problem of insufficient accuracy in measuring the carriage loading rate in the existing technology and improves the accuracy and versatility of the measurement.
Patent Information
- Application Number
- CN202111456052.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-30
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2041-11-30
AI Technical Summary
Existing technologies cannot perform on-site parameter adjustments or complex operations when installing lidar equipment on a large scale, resulting in insufficient accuracy in measuring the loading rate of carriages. In particular, in many scenarios, it is impossible to measure the loading rate of carriages without human intervention and without specific markers.
By acquiring point cloud data of the carriage, the side of the carriage is determined using the random sampling consensus algorithm, and the extrinsic parameter matrix of the point cloud data relative to the standard attitude is calculated to achieve automatic attitude correction and improve the accuracy of point cloud data correction.
It can accurately correct point cloud data without manual input or parameter adjustment, improve the accuracy of cargo loading rate calculation, and is applicable to empty carriages and loading and unloading situations. It has strong versatility, good anti-interference ability, and expands the application scope.
Smart Images

Figure CN114200415B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of three-dimensional measurement technology, and in particular to a method and device for automatic correction of the attitude of a carriage point cloud. Background Technology
[0002] With the diversification of consumption and the development of efficient distribution, people have increasingly higher demands for logistics services. Among these, the loading rate of vans, as the most important transportation tool in logistics services, is crucial. In order to flexibly deploy vans and achieve information management, more and more vans are equipped with sensors such as LiDAR. LiDAR has the advantages of accurate ranging, high precision, and intuitive measurement information. It can directly obtain the three-dimensional contour information of the van body, thereby enabling rapid modeling, intuitively reflecting the shape characteristics of the van body, and calculating the current loading rate of the van body.
[0003] Existing methods primarily rely on manual intervention or special markers to calculate the attitude change from the equipment coordinate system to the standard attitude coordinate system. Then, the point cloud data of the carriage collected by the LiDAR is corrected to the standard attitude coordinate system based on this attitude change. However, during large-scale equipment installations, the inability of installers to adjust parameters on-site or perform complex operations such as placing special markers, or even the inverted / upright or left / right installation of the equipment, leads to errors in the obtained data, affecting the accuracy of load rate measurement. Therefore, finding a method that can adapt to multiple scenarios, without human intervention or specific markers, to measure the load rate of the carriage is a pressing issue that needs to be addressed. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a method and apparatus for automatic correction of carriage point cloud attitude, so as to alleviate the above problems, improve the accuracy of point cloud data correction, and thus improve the accuracy of cargo loading rate calculation.
[0005] In a first aspect, embodiments of the present invention provide an automatic attitude correction method for a carriage point cloud. The method includes: acquiring point cloud data of the carriage; wherein the point cloud data includes multiple point data; determining the side of the carriage based on the point cloud data; wherein the side includes an upper side, a lower side, a left side, and a right side; calculating the extrinsic parameter matrix of the point cloud data relative to a standard attitude based on the normal vectors of any two mutually perpendicular sides; and automatically correcting the attitude of the point cloud data based on the extrinsic parameter matrix.
[0006] Preferably, the step of determining the side of the carriage based on point cloud data includes: determining a set of planes corresponding to the point cloud data based on a random sample consensus algorithm; wherein the set of planes includes multiple planes; determining a set of parallel plane pairs based on the normal vector of each plane; wherein the set of parallel plane pairs includes multiple parallel plane pairs, and each parallel plane pair includes two mutually parallel planes; determining a target orthogonal parallel plane pair based on the normal vector of each parallel plane pair; wherein the target orthogonal parallel plane pair includes two mutually perpendicular parallel plane pairs; and determining the side of the carriage based on the target orthogonal parallel plane pairs.
[0007] Preferably, the step of determining the plane set corresponding to the point cloud data based on the random sample consensus algorithm includes: fitting the point cloud data based on the random sample consensus algorithm to obtain multiple initial planes; wherein each initial plane includes multiple point cloud data; determining whether the number of point data in each initial plane is greater than a preset threshold; if so, determining the initial plane as a plane in the plane set.
[0008] Preferably, the step of determining the set of parallel plane pairs based on the normal vector of each plane includes: calculating the angle between the normal vectors of any two planes; determining whether the angle is less than a preset angle threshold; and if so, determining that the two planes are a pair of parallel planes.
[0009] Preferably, the step of determining the target orthogonal parallel plane pair based on the normal vector of each parallel plane pair includes: determining whether the normal vectors of any two parallel plane pairs are perpendicular to each other; if so, determining the two parallel plane pairs as orthogonal parallel plane pairs and obtaining a set of orthogonal parallel plane pairs containing multiple orthogonal parallel plane pairs; traversing the set of orthogonal parallel plane pairs and determining the orthogonal parallel plane pair containing the most point data as the target orthogonal parallel plane pair.
[0010] Preferably, the aforementioned target orthogonal parallel plane pair includes a first parallel plane pair and a second parallel plane pair that are perpendicular to each other; the step of determining the side of the carriage based on the target orthogonal parallel plane pair includes: calculating a first distance between the two planes in the first parallel plane pair and a second distance between the two planes in the second parallel plane pair; determining whether the first distance is greater than the second distance; if so, the first parallel plane pair is a parallel plane pair in the height direction of the carriage, and the second parallel plane pair is a parallel plane pair in the width direction of the carriage; determining the upper and lower sides of the carriage based on the distances from the two planes in the first parallel plane pair to the origin; and determining the left and right sides of the carriage based on the normal vectors of the two planes in the second parallel plane pair.
[0011] Preferably, the step of calculating the extrinsic parameter matrix of point cloud data relative to the standard pose based on the normal vectors of any two mutually perpendicular sides in the side includes: obtaining the first unit normal vector and the second unit normal vector corresponding to any two mutually perpendicular sides in the side; performing a cross product calculation on the first unit normal vector and the second unit normal vector to obtain the third normal vector; and obtaining the extrinsic parameter matrix based on the first unit normal vector, the second unit normal vector, and the third normal vector.
[0012] Secondly, embodiments of the present invention also provide an automatic attitude correction device for a carriage point cloud. The device includes: an acquisition module for acquiring point cloud data of the carriage, wherein the point cloud data includes multiple point data; a determination module for determining the side of the carriage based on the point cloud data, wherein the side includes an upper side, a lower side, a left side, and a right side; a calculation module for calculating the extrinsic parameter matrix of the point cloud data relative to a standard attitude based on the normal vectors of any two mutually perpendicular side surfaces; and a correction module for automatically correcting the attitude of the point cloud data based on the extrinsic parameter matrix.
[0013] Preferably, the aforementioned determining module is specifically used for: determining a set of planes corresponding to the point cloud data based on a random sample consensus algorithm; wherein the set of planes includes multiple planes; determining a set of parallel plane pairs based on the normal vector of each plane; wherein the set of parallel plane pairs includes multiple parallel plane pairs, and each parallel plane pair includes two mutually parallel planes; determining a target orthogonal parallel plane pair based on the normal vector of each parallel plane pair; wherein the target orthogonal parallel plane pair includes two mutually perpendicular parallel plane pairs; and determining the side of the carriage based on the target orthogonal parallel plane pair.
[0014] Preferably, the above calculation module is specifically used to: obtain the first unit normal vector and the second unit normal vector corresponding to any two mutually perpendicular sides in the side; perform a cross product calculation on the first unit normal vector and the second unit normal vector to obtain the third normal vector; and obtain the extrinsic parameter matrix based on the first unit normal vector, the second unit normal vector and the third normal vector.
[0015] The embodiments of the present invention bring the following beneficial effects:
[0016] This invention provides a method and apparatus for automatic attitude correction of a train carriage point cloud. The method involves acquiring point cloud data of the carriage, where the point cloud data includes multiple point data points; determining the sides of the carriage based on the point cloud data, where the sides include an upper side, a lower side, a left side, and a right side; calculating the extrinsic parameter matrix of the point cloud data relative to a standard attitude based on the normal vectors of any two mutually perpendicular sides; and automatically correcting the attitude of the point cloud data based on the extrinsic parameter matrix. This method eliminates the need for manual input or parameter tuning, allowing for automatic attitude correction of the point cloud data. Compared to existing methods that rely on manually calculated transformation matrices, this improves the accuracy of point cloud data correction, thereby enhancing the accuracy of cargo loading rate calculation. Furthermore, it can be used for both empty carriages and cargo loading / unloading, without requiring emptying the carriage or placing markers, making it highly versatile and easy to implement in practical applications.
[0017] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained through the structures particularly pointed out in the description and the drawings.
[0018] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0019] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0020] Figure 1 A flowchart illustrating an automatic carriage point cloud attitude correction method provided in an embodiment of the present invention;
[0021] Figure 2 An unfolded view of a carriage provided in an embodiment of the present invention;
[0022] Figure 3 A flowchart for determining a pair of target orthogonal parallel planes is provided as an embodiment of the present invention;
[0023] Figure 4 A schematic diagram of a lidar coordinate system and a carriage coordinate system provided for an embodiment of the present invention;
[0024] Figure 5 This is a schematic diagram of an automatic carriage point cloud attitude correction device provided in an embodiment of the present invention. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0026] To facilitate understanding of this embodiment, a detailed description of the automatic carriage point cloud attitude correction method provided by this invention is provided below. A lidar is installed in the carriage, and its attitude is adjusted so that its field of view simultaneously covers the upper, lower, left, and right sides of the carriage. In practical applications, the lidar is used to collect point cloud data of the carriage. This point cloud data is a dataset of points in the device coordinate system, where each point typically includes three-dimensional coordinates X, Y, and Z. The collected point cloud data is sent to an electronic device connected to the lidar, so that the electronic device can execute the steps of the automatic carriage point cloud attitude correction method provided by this invention based on the point cloud data. The electronic device includes, but is not limited to, smartphones, PDAs, and tablets, and can be specifically configured according to actual needs.
[0027] Based on the aforementioned electronic equipment, embodiments of the present invention provide an automatic correction method for the attitude of a carriage point cloud, such as... Figure 1 As shown, the method includes the following steps:
[0028] Step S102: Obtain point cloud data of the carriage;
[0029] The aforementioned point cloud data includes multiple point data points. Here, the point cloud data refers to the data in the device coordinate system. When the carriage is empty, the point cloud data includes multiple point data points corresponding to the carriage body. When the carriage is loaded with goods, the point cloud data includes multiple point data points corresponding to the carriage body and point cloud data points corresponding to the goods in the carriage. The specific settings can be configured according to the actual situation.
[0030] Step S104: Determine the side of the carriage based on the point cloud data;
[0031] Specifically, such as Figure 2 The diagram shown shows the unfolded carriage, which mainly consists of six sides: top, bottom, left, right, front, and rear. The rear side is where the door is located. Therefore, for the actual carriage, the sides mainly include the top side, bottom side, left side, and right side.
[0032] In one possible embodiment, the process of determining the side of the carriage based on point cloud data includes the following steps:
[0033] (1) Based on the Random Sample Consensus (RANSAC) algorithm, determine the plane set corresponding to the point cloud data; wherein, the plane set includes multiple planes;
[0034] Specifically, point cloud data is fitted using a random sampling consensus algorithm to obtain multiple initial planes. Each initial plane includes multiple point cloud data points. The number of point data points within each initial plane is determined to be greater than a preset threshold. If so, the initial plane is determined to be a plane in the plane set. For example, when fitting point cloud data, since the point cloud data may contain data corresponding to goods inside the carriage, multiple planes can be fitted. To improve the efficiency of determining the carriage side, for each obtained initial plane, it is further determined whether the number of point data points within that initial plane is greater than a preset threshold, such as 1 / 30 of the total number of point data points. If so, the point data points within that initial plane are removed from the point cloud data, and the initial plane is added to the plane set. Otherwise, the point data points within the initial plane are considered noise point data and are removed until the number of remaining point data points in the point cloud data is less than a preset value, such as 1 / 10 of the total number of point data points. It should be noted that in a spatial coordinate system, since a plane can be represented by the equation Ax + By + Cz + D = 0, where (A, B, C, D) are plane parameters, and A, B, C, and D are known constants, and A, B, and C are not all 0 at the same time, each plane also has a corresponding plane equation. In the plane set, the plane equation of each plane is added to the plane equation list.
[0035] (2) Determine the set of parallel plane pairs based on the normal vector of each plane; wherein the set of parallel plane pairs includes multiple parallel plane pairs, and each parallel plane pair includes two planes that are parallel to each other;
[0036] Specifically, for each plane in the plane set, the vector represented by the line perpendicular to that plane is the normal vector of that plane. For example, if the plane equation is (A, B, C, D), then its normal vector is (A, B, C). Furthermore, each plane has two unit normal vectors with opposite directions. Therefore, the angle between the normal vectors of any two planes is calculated; and it is determined whether the angle is less than a preset angle threshold. If so, the two planes are determined to be a parallel plane pair, such as... Figure 3 As shown, for multiple planes in the plane set (here, 8 planes), multiple parallel plane pairs can be obtained, such as 4, and added to the parallel plane pair list.
[0037] (3) Determine the target orthogonal parallel plane pair based on the normal vector of each parallel plane pair; wherein, the target orthogonal parallel plane pair includes two parallel plane pairs that are perpendicular to each other;
[0038] Specifically, for multiple parallel plane pairs in the set of parallel plane pairs, first, randomly select two parallel plane pairs for pairing, that is, determine whether the normal vectors of any two parallel plane pairs are perpendicular to each other; if so, then determine that the two parallel plane pairs are orthogonal parallel plane pairs, and obtain a set of orthogonal parallel plane pairs containing multiple orthogonal parallel plane pairs; such as Figure 3 As shown, based on the four pairs of parallel planes, two pairs of orthogonal parallel planes can be obtained. Finally, the set of orthogonal parallel plane pairs is traversed, and the orthogonal parallel plane pair containing the most point data is determined as the target orthogonal parallel plane pair.
[0039] For a set of orthogonal parallel plane pairs, the normal vector of the plane within each orthogonal parallel plane pair is determined, and the normal vector is made to point towards the inside of the carriage. For example, an orthogonal parallel plane pair includes two perpendicular parallel plane pairs, where one parallel plane pair includes two mutually parallel planes: a first plane and a second plane. Assume the vector formed by feature point PointA of the first plane and feature point PointB of the second plane is... If the normal vector of the first plane is If the angle between the two planes is greater than 90 degrees, then the direction of the normal vector of the first plane is reversed; otherwise, the direction of the normal vector of the first plane remains unchanged. Similarly, suppose the vector formed by the feature point PointB of the second plane and the feature point PointA of the first plane is... If the normal vector of the second plane is If the angle between the two planes is greater than 90 degrees, then the direction of the normal vector of the second plane is reversed; otherwise, the direction of the normal vector of the second plane remains unchanged.
[0040] Therefore, based on the above method for adjusting the normal vector direction, the normal vectors of the planes in each orthogonal parallel plane pair in the set of orthogonal parallel plane pairs are adjusted until a set of orthogonal parallel plane pairs in which the normal vector of each plane points to the inside of the carriage is obtained; then, a traversal operation is performed to calculate the number of point data within the three-dimensional space (such as the bounding box) formed by the two parallel plane pairs in each orthogonal parallel plane pair, and the orthogonal parallel plane pair containing the most point data is determined as the target orthogonal parallel plane pair, that is, the largest orthogonal parallel plane pair is determined as the target orthogonal parallel plane pair, such as... Figure 3 As shown, the number of point data contained in each of the two orthogonal parallel plane pairs is calculated, and the orthogonal parallel plane pair with the largest number is taken as the final target orthogonal parallel plane pair.
[0041] (4) Determine the side of the carriage based on the target orthogonal parallel plane pair.
[0042] For the aforementioned target orthogonal parallel plane pair, including a first parallel plane pair and a second parallel plane pair that are perpendicular to each other; specifically, calculate the first distance between the two planes in the first parallel plane pair and the second distance between the two planes in the second parallel plane pair; determine whether the first distance is greater than the second distance; if so, the first parallel plane pair is a parallel plane pair in the height direction of the carriage, and the second parallel plane pair is a parallel plane pair in the width direction of the carriage; determine the upper and lower sides of the carriage based on the distances from the two planes in the first parallel plane pair to the origin; and determine the left and right sides of the carriage based on the normal vectors of the two planes in the second parallel plane pair.
[0043] To facilitate understanding, an example is provided below. The first parallel plane pair mentioned above includes the first plane and the second plane, and the second parallel plane pair includes the third plane and the fourth plane. The distance dis1 between the first plane and the second plane, i.e., the first distance, and the distance dis2 between the third plane and the fourth plane, i.e., the second distance, are calculated respectively. If dis1 > dis2, then the first parallel plane pair is a parallel plane pair in the height direction of the carriage (i.e., Height Parallel Plane Pairs), and the second parallel plane pair is a parallel plane pair in the width direction of the carriage (i.e., Width Parallel Plane Pairs); if dis1 < dis2, then the first parallel plane pair is a parallel plane pair in the width direction of the carriage, and the second parallel plane pair is a parallel plane pair in the height direction of the carriage.
[0044] For a pair of parallel planes along the height of the carriage, such as the first pair of parallel planes, calculate the distances dis3 and dis4 from the first and second planes to the origin of the equipment coordinate system. If dis3 < dis4, then the first plane is the upper side of the carriage, and the second plane is the lower side of the carriage; if dis3 > dis4, then the first plane is the lower side of the carriage, and the second plane is the upper side of the carriage. After determining the upper side of the carriage, for a pair of parallel planes along the width of the carriage, such as the second pair of parallel planes, the process of determining the left and right sides of the carriage based on the normal vectors of the two planes in the second pair of parallel planes is as follows: Calculate the cross product of the normal vectors of the third and fourth planes with the normal vector of the upper side, such as the vector calculated by the cross product of the normal vector of the third plane and the normal vector of the upper side. The vector is obtained by calculating the cross product of the normal vector of the fourth plane and the normal vector of the upper surface. In addition, the coordinates of the center point Point_p of the point cloud data are obtained, and the vector from the origin to the center point Point_p is calculated. Finally, calculate the vector. respectively with vector sum vector The angle between vectors, such as the angle between vectors. with vector The first included angle between them, vector with vector The second included angle between the two included angles is determined, and the relationship between the two included angles and the specified angle 90° is determined. For example, if the first included angle is less than 90°, the corresponding third plane is the left side, and if the second included angle is greater than 90°, the corresponding fourth plane is the right side.
[0045] In addition, for the left and right sides of the carriage, calculate the distances dis5 and dis6 from the left and right sides to the origin of the equipment coordinate system, respectively. If dis5 < dis6, then... Figure 4 As shown, the device, i.e., the LiDAR, is installed on the left side of the carriage; otherwise, it is installed on the right side. Therefore, after determining the side of the carriage, the installation position of the LiDAR can also be determined, such as whether it is on the left or right side. Furthermore, since there is less point cloud data on the side closer to the LiDAR, in practical applications, point cloud data from the opposite side can be selected. For example, if the LiDAR is installed on the left side, point cloud data from the right side can be selected, thereby improving the robustness of the correction and thus improving the accuracy of cargo loading rate calculation.
[0046] In summary, the above-mentioned random sampling consensus algorithm first determines multiple corresponding planes based on point cloud data, and then determines the sides of the carriage based on these multiple planes. This method of determining the carriage sides is unaffected by the cargo loading in the carriage. For example, even when the carriage is partially loaded, it can accurately determine the sides of the carriage based on the collected point cloud data, improving the accuracy of side determination. Furthermore, this method of determining the carriage sides can avoid the influence of ground-mounted conveyor belts on the loading rate in later applications, thereby improving the accuracy of cargo loading rate calculation and facilitating its widespread implementation in practical applications.
[0047] Step S106: Calculate the extrinsic parameter matrix of the point cloud data relative to the standard pose based on the normal vectors of any two mutually perpendicular sides.
[0048] Specifically, firstly, obtain the first unit normal vector and the second unit normal vector corresponding to any two mutually perpendicular sides in the side profile; then, perform a cross product of the first and second unit normal vectors to obtain the third normal vector; finally, based on the first, second, and third unit normal vectors, obtain the extrinsic parameter matrix. For example, for any two mutually perpendicular sides in the side profile, the left side and the top side, where the unit normal vector of the left side is N1 and the unit normal vector of the top side is N2, perform a cross product of N1 and N2 to obtain N3, and thus construct the extrinsic parameter matrix based on N1, N2, and N3.
[0049] Step S108: Perform automatic attitude correction on the point cloud data based on the extrinsic parameter matrix.
[0050] The aforementioned extrinsic parameter matrix can also be called the transformation matrix from the equipment coordinate system to the standard attitude coordinate system. Here, the standard attitude coordinate system can be the carriage coordinate system, such as... Figure 4 As shown, H represents the height of the carriage, W represents the width of the carriage, the equipment coordinate system (i.e., the lidar coordinate system) is O-XYZ, and the carriage coordinate system is O. c -X c Y c Z c For point cloud data acquired by lidar, automatic attitude correction is performed according to the following formula:
[0051]
[0052] in, This represents the point cloud data in the corrected standard attitude coordinate system, where R represents the extrinsic parameter matrix. This represents the point cloud data collected by the lidar.
[0053] In summary, the automatic carriage point cloud attitude correction method provided in this invention firstly does not limit the type of equipment or data. As long as the three-dimensional point cloud data of the carriage can be obtained, and the point cloud data includes the four sides of the carriage (top, bottom, left, and right), the sides of the carriage can be determined based on the point cloud data, and then the extrinsic parameter matrix can be calculated. Secondly, this method has strong applicability, and can be used in both empty and loaded / unloaded carriages without the need to empty the carriage or place special markers. Thirdly, this method does not require manual input or parameter adjustment to obtain the extrinsic parameter matrix, making it convenient to use. Finally, it also has rotation invariance, meaning that the point cloud data can be rotated arbitrarily without affecting the accuracy of the correction. The correct extrinsic parameter matrix can be obtained, leading to point cloud data in the corrected standard attitude coordinate system, thus expanding the application scope. Finally, this method has good anti-interference capability. When there are errors in the collected point cloud data, automatic attitude correction can be performed on the point cloud data by using the extrinsic parameter matrix determined from the point cloud data. This avoids the errors caused by the existing fixed transformation matrix correction of point cloud data, thereby improving the accuracy of point cloud data correction. Furthermore, it can automatically identify the installation position of the equipment, thus providing standard attitude data for the measurement of cargo loading rate, thereby improving the accuracy of cargo loading rate calculation and facilitating its promotion and implementation in practical applications.
[0054] Corresponding to the above method embodiments, this invention also provides a carriage point cloud attitude automatic correction device, such as... Figure 5 As shown, the device includes: an acquisition module 51, a determination module 52, a calculation module 53, and a correction module 54; wherein the functions of each module are as follows:
[0055] The acquisition module 51 is used to acquire point cloud data of the carriage; wherein, the point cloud data includes multiple point data;
[0056] The determination module 52 is used to determine the sides of the carriage based on point cloud data; wherein, the sides include the upper side, lower side, left side and right side;
[0057] Calculation module 53 is used to calculate the extrinsic parameter matrix of point cloud data relative to the standard pose based on the normal vectors of any two mutually perpendicular sides in the side.
[0058] The correction module 54 is used to perform automatic attitude correction on point cloud data based on the extrinsic parameter matrix.
[0059] The automatic attitude correction device for carriage point cloud provided in this invention can obtain the extrinsic parameter matrix without manual input or parameter adjustment, thereby automatically correcting the attitude of point cloud data, improving the accuracy of point cloud data correction, and thus improving the accuracy of cargo loading rate calculation. In addition, it can be used for empty carriages and when loading and unloading cargo, without the need to empty the carriage or place markers, making it highly versatile and easy to promote and implement in practical applications.
[0060] In one possible embodiment, the determining module 52 is further configured to: determine a set of planes corresponding to the point cloud data based on a random sampling consensus algorithm; wherein the set of planes includes multiple planes; determine a set of parallel plane pairs based on the normal vector of each plane; wherein the set of parallel plane pairs includes multiple parallel plane pairs, and each parallel plane pair includes two mutually parallel planes; determine a target orthogonal parallel plane pair based on the normal vector of each parallel plane pair; wherein the target orthogonal parallel plane pair includes two mutually perpendicular parallel plane pairs; and determine the side of the carriage based on the target orthogonal parallel plane pair.
[0061] In another possible embodiment, the above-mentioned determination of the plane set corresponding to the point cloud data based on the random sample consensus algorithm includes: fitting the point cloud data based on the random sample consensus algorithm to obtain multiple initial planes; wherein each initial plane includes multiple point cloud data; determining whether the number of point data in each initial plane is greater than a preset threshold; if so, determining the initial plane as a plane in the plane set.
[0062] In another possible embodiment, determining the set of parallel plane pairs based on the normal vector of each plane includes: calculating the angle between the normal vectors of any two planes; determining whether the angle is less than a preset angle threshold; and if so, determining that the two planes are a pair of parallel planes.
[0063] In another possible embodiment, determining the target orthogonal parallel plane pair based on the normal vector of each parallel plane pair includes: determining whether the normal vectors of any two parallel plane pairs are perpendicular to each other; if so, determining the two parallel plane pairs as orthogonal parallel plane pairs and obtaining a set of orthogonal parallel plane pairs containing multiple orthogonal parallel plane pairs; traversing the set of orthogonal parallel plane pairs and determining the orthogonal parallel plane pair containing the most point data as the target orthogonal parallel plane pair.
[0064] In another possible embodiment, the aforementioned target orthogonal parallel plane pair includes a first parallel plane pair and a second parallel plane pair that are mutually perpendicular; the determination of the side of the carriage based on the target orthogonal parallel plane pair includes: calculating a first distance between two planes in the first parallel plane pair and a second distance between two planes in the second parallel plane pair; determining whether the first distance is greater than the second distance; if so, the first parallel plane pair is a parallel plane pair in the height direction of the carriage, and the second parallel plane pair is a parallel plane pair in the width direction of the carriage; determining the upper and lower side of the carriage based on the distances from the two planes in the first parallel plane pair to the origin; and determining the left and right side of the carriage based on the normal vectors of the two planes in the second parallel plane pair. In another possible embodiment, the aforementioned calculation module 53 is further configured to: obtain the first unit normal vector and the second unit normal vector corresponding to any two mutually perpendicular side surfaces; perform a cross product calculation on the first unit normal vector and the second unit normal vector to obtain a third normal vector; and obtain an external parameter matrix based on the first unit normal vector, the second unit normal vector, and the third normal vector.
[0065] The automatic carriage point cloud attitude correction device provided in this embodiment of the invention has the same technical features as the automatic carriage point cloud attitude correction method provided in the above embodiment, so it can also solve the same technical problems and achieve the same technical effects.
[0066] This embodiment also provides a machine-readable storage medium storing machine-executable instructions. When the machine-executable instructions are called and executed by the processor, the machine-executable instructions cause the processor to implement the above-described automatic carriage point cloud attitude correction method.
[0067] The computer program product of the automatic carriage point cloud attitude correction method and device provided in the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.
[0068] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system and apparatus described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0069] Furthermore, in the description of the embodiments of the present invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention based on the specific circumstances.
[0070] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0071] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0072] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for automatic correction of carriage point cloud attitude, characterized in that, The method includes: Acquire point cloud data of the carriage; wherein, the point cloud data includes multiple point data; The sides of the carriage are determined based on the point cloud data; wherein, the sides include the upper side, the lower side, the left side, and the right side. Based on the normal vectors of any two mutually perpendicular sides of the side, the extrinsic parameter matrix of the point cloud data relative to the standard pose is calculated; wherein, the first unit normal vector and the second unit normal vector corresponding to any two mutually perpendicular sides of the side are obtained respectively; the first unit normal vector and the second unit normal vector are cross-multiplied to obtain the third normal vector; based on the first unit normal vector, the second unit normal vector and the third normal vector, the extrinsic parameter matrix is obtained; the extrinsic parameter matrix is used to characterize the transformation matrix from the equipment coordinate system to the carriage coordinate system; Automatic attitude correction is performed on the point cloud data based on the extrinsic parameter matrix.
2. The method according to claim 1, characterized in that, The step of determining the side of the carriage based on the point cloud data includes: Based on the random sampling consensus algorithm, the plane set corresponding to the point cloud data is determined; wherein, the plane set includes multiple planes; Based on the normal vector of each plane, a set of parallel plane pairs is determined; wherein, the set of parallel plane pairs includes multiple parallel plane pairs, and each parallel plane pair includes two mutually parallel planes; Based on the normal vector of each of the parallel plane pairs, a target orthogonal parallel plane pair is determined; wherein, the target orthogonal parallel plane pair includes two parallel plane pairs that are perpendicular to each other; The side of the carriage is determined based on the target orthogonal parallel plane pair.
3. The method according to claim 2, characterized in that, The step of determining the plane set corresponding to the point cloud data based on the random sample consensus algorithm includes: The point cloud data is fitted based on the random sampling consensus algorithm to obtain multiple initial planes; wherein each initial plane includes multiple point cloud data. Determine whether the number of point data in each initial plane is greater than a preset threshold; If so, then the initial plane is determined to be a plane in the plane set.
4. The method according to claim 2, characterized in that, The step of determining the set of parallel plane pairs based on the normal vector of each of the planes includes: Calculate the angle between the normal vectors of any two planes; Determine whether the included angle is less than a preset angle threshold; If so, then the two planes are determined to be a parallel plane pair.
5. The method according to claim 2, characterized in that, The step of determining the target orthogonal parallel plane pair based on the normal vector of each of the parallel plane pairs includes: Determine whether the normal vectors of any two pairs of parallel planes are perpendicular to each other; If so, then the two parallel plane pairs are determined to be orthogonal parallel plane pairs, and a set of orthogonal parallel plane pairs containing multiple orthogonal parallel plane pairs is obtained; Traverse the set of orthogonal parallel plane pairs and determine the orthogonal parallel plane pair containing the most point data as the target orthogonal parallel plane pair.
6. The method according to claim 2, characterized in that, The target orthogonal parallel plane pair includes a first parallel plane pair and a second parallel plane pair that are perpendicular to each other; the step of determining the side of the carriage based on the target orthogonal parallel plane pair includes: Calculate the first distance between the two planes in the first parallel plane pair and the second distance between the two planes in the second parallel plane pair. Determine whether the first distance is greater than the second distance; If so, the first pair of parallel planes is a pair of parallel planes in the height direction of the carriage, and the second pair of parallel planes is a pair of parallel planes in the width direction of the carriage. The upper and lower sides of the carriage are determined based on the distances from the origin of the two planes in the first parallel plane pair; and the left and right sides of the carriage are determined based on the normal vectors of the two planes in the second parallel plane pair.
7. An automatic carriage point cloud attitude correction device, characterized in that, The device includes: An acquisition module is used to acquire point cloud data of the carriage; wherein, the point cloud data includes multiple point data; A determining module is used to determine the side of the carriage based on the point cloud data; wherein the side includes an upper side, a lower side, a left side, and a right side; The calculation module is used to calculate the extrinsic parameter matrix of the point cloud data relative to the standard pose based on the normal vectors of any two mutually perpendicular sides of the side; wherein, the first unit normal vector and the second unit normal vector corresponding to any two mutually perpendicular sides of the side are obtained respectively; the first unit normal vector and the second unit normal vector are cross-multiplied to obtain a third normal vector; the extrinsic parameter matrix is obtained based on the first unit normal vector, the second unit normal vector and the third normal vector; the extrinsic parameter matrix is used to characterize the transformation matrix from the equipment coordinate system to the carriage coordinate system; The correction module is used to automatically correct the attitude of the point cloud data based on the extrinsic parameter matrix.
8. The apparatus according to claim 7, characterized in that, The determining module is specifically used for: Based on the random sampling consensus algorithm, the plane set corresponding to the point cloud data is determined; wherein, the plane set includes multiple planes; Based on the normal vector of each plane, a set of parallel plane pairs is determined; wherein, the set of parallel plane pairs includes multiple parallel plane pairs, and each parallel plane pair includes two mutually parallel planes; Based on the normal vector of each of the parallel plane pairs, a target orthogonal parallel plane pair is determined; wherein, the target orthogonal parallel plane pair includes two parallel plane pairs that are perpendicular to each other; The side of the carriage is determined based on the target orthogonal parallel plane pair.
Citation Information
Patent Citations
Method for quickly calibrating external parameters of multi-line laser radar based on orthogonal normal vector
CN109375195A
Carriage internal attitude detection method
CN112278891A