Multi-sensor intelligent device
By utilizing the geometric characteristics and matching algorithms of point cloud data, accurate external parameter calibration of Lidar and depth cameras under different fields of view and point cloud densities is achieved, which solves the problem of difficult calibration in the existing technology and improves the accuracy of data matching. accuracy and efficiency, providing a reliable foundation for fields such as autonomous driving.
Patent Information
- Application Number
- CN202410590827.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-13
- Publication Date
- 2024-08-23
AI Technical Summary
In the calibration of Lidar and depth cameras using existing technology, it is difficult to achieve accurate external parameter registration under different fields of view and point cloud densities, resulting in poor data matching.
By utilizing the geometric features and matching algorithms of point cloud data, a multi-sensor smart device is designed, including a first sensor, a second sensor and moving parts. The controller drives the sensors to rotate synchronously, extracts planar features, and calculates the rotation vector R and the translation vector. t, perform nonlinear iterative optimization to obtain the final external parameters.
It achieves accurate external parameter calibration under different fields of view and point cloud densities, reduces the complexity of the calibration process, improves the accuracy and efficiency of data matching, and is suitable for fields such as autonomous driving and robot navigation.
Smart Images

Figure CN118537413A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of laser radar and depth camera joint calibration, and in particular to a multi-sensor intelligent device. Background Art
[0002] The joint calibration of the first sensor and the second sensor is a key step to ensure that the two sensors can work together accurately to provide precise 3D spatial information. Through joint calibration, the first sensor and the second sensor can work together to provide more accurate and richer 3D spatial information, supporting applications in areas such as autonomous driving and robot navigation.
[0003] The purpose of joint calibration of the first sensor and the second sensor is to find the spatial transformation relationship between the two so as to transform the data from one coordinate system to another. This process usually involves the following steps:
[0004] Camera extrinsic calibration: The purpose of extrinsic calibration is to determine the rotation matrix R and translation matrix T between the first sensor and the camera, so that the coordinates of the object points detected by the first sensor can be converted to the camera coordinate system, or vice versa.
[0005] Feature extraction and matching: In non-deep learning methods, it is necessary to extract corresponding features (such as semantic information, edges, etc.) from the first sensor and the camera respectively, and then project the features of the first sensor to the image plane through the initial external parameters, and design an objective function to evaluate the degree of match between the projected features and the actual image features.
[0006] Use professional software or tools: Some software or tools are specifically used for the joint calibration of the first sensor and the camera, such as Autoware, which provides a set of processes to help users complete the calibration work.
[0007] Online joint calibration: The deep learning-based method can realize the online joint calibration of the first sensor and the camera. This method usually uses a neural network to learn the mapping relationship between the two, thereby performing data fusion in real time.
[0008] As can be seen above, in the calibration of Lidar and depth cameras, point cloud data is usually used for data registration to obtain the external parameters between the two. Therefore, the registration method is the key to obtaining accurate and stable errors. Due to the difference in the field of view and point cloud density of the point cloud observed by the lidar and the depth camera with a limited field of view, it is challenging to accurately register the point clouds of the two.
[0009] Calibration in the prior art often requires the use of specific objects such as calibration plates, and the known information of the calibration object (such as size, relative position relationship, center point position, etc.) can be used for calibration at the factory. However, during the use process, the relative position of two different cameras may change, which often leads to poor matching of data obtained by different depth sensors after a period of use.
[0010] The disclosure of the above background technology content is only used to assist in understanding the inventive concept and technical solution of the present invention. It does not necessarily belong to the prior art of this patent application. In the absence of clear evidence that the above content has been disclosed on the filing date of this patent application, the above background technology should not be used to evaluate the novelty and creativity of the present application. Summary of the invention
[0011] To this end, the present invention can effectively solve the alignment problem between the first sensor and the second sensor by making full use of the geometric features and matching algorithms of the point cloud data, realize accurate external parameter calibration under different fields of view and point cloud densities, and provide accurate external parameter results.
[0012] The present invention provides a multi-sensor intelligent device, characterized in that it comprises:
[0013] A first sensor, used to obtain first point cloud data;
[0014] A second sensor, used to obtain second point cloud data; wherein the first sensor and the second sensor have a common viewing angle;
[0015] A moving component, connected to the first sensor and the second sensor, and capable of driving the first sensor and the second sensor to rotate synchronously;
[0016] The controller is used to control the moving part to rotate one circle, and control the first sensor and the second sensor to synchronously collect data; identify the number of collected planes, and calculate the rotation vector R and the translation vector t according to the number of planes, perform nonlinear iterative optimization on the matching relationship of all point clouds, and obtain the final external parameter
[0017] Optionally, the multi-sensor intelligent device is characterized in that the controller includes:
[0018] Step S1: Rotate the first sensor and the second sensor for one circle, and during the rotation process, allow the first sensor and the second sensor to continuously take photos synchronously;
[0019] Step S2: extracting planes from the photo to obtain candidate photos with the most planes; if there is only one plane in the candidate photos, selecting the candidate photos with the largest plane area and marking them as the first image and the second image respectively, and executing step S3; if there are two planes in the candidate photos, selecting the candidate photos facing the first sensor and the second sensor, marking them as the first image and the second image respectively, and executing step S4; if there are three planes in the candidate photos, marking them as the first image and the second image respectively, and calculating the rotation vector R and the translation vector t according to the three planes, and executing step S5;
[0020] Step S3: calculating a constrained rotation vector R and a translation vector t according to the plane, and matching the point cloud outside the plane to obtain a matching result;
[0021] Step S4: calculating a constrained rotation vector R and a translation vector t according to the two planes, and matching the point clouds outside the two planes to obtain a matching result;
[0022] Step S5: Perform nonlinear iterative optimization on the matching relationship of all point clouds to obtain the final external parameters
[0023] Optionally, the multi-sensor intelligent device is characterized in that, in step S2, when calculating the rotation vector R and the translation vector t according to the plane, the facing wall and the other wall, it includes:
[0024] Step S21: extracting a first plane, a second plane and a third plane in a first coordinate system generated by the first point cloud data, and extracting a fourth plane, a fifth plane and a sixth plane in a second coordinate system generated by the second point cloud data; wherein the first plane, the second plane and the third plane intersect, and the fourth plane, the fifth plane and the sixth plane intersect;
[0025] Step S22: Calculate the rotation vector R and the translation vector t between the first coordinate system and the second coordinate system based on the rotation vectors of at least four planes among the first plane, the second plane, the third plane, the fourth plane, the fifth plane and the sixth plane.
[0026] Optionally, the multi-sensor intelligent device is characterized in that step S3 comprises:
[0027] Step S31: Calculate the rotation axis n=n 1 ×n 2 , we get the rotation angle θ = arccos(n l n 2 ), the rotation matrix R1 of the plane; where n1 is the normal vector of the plane in the first image, n 2 is the normal vector of the plane in the second image;
[0028] Step S32: Obtain n 2 Two orthogonal vectors, n 2 The two orthogonal vectors are denoted as μ1, μ2, and μ3 respectively, and the translation vector t is denoted as: t=k1μ1+k2μ2+k3μ3, wherein k1=d2-d1, d1 is the plane parameter of the plane in the first image, and d2 is the plane parameter of the plane in the second image.
[0029] Optionally, the multi-sensor intelligent device is characterized in that step S4 comprises:
[0030] Step S41: respectively calculating the first rotation angle θ1, the first rotation matrix R1, the second rotation angle θ2 and the second rotation matrix R2 of the two planes to obtain the rotation matrix R of the first coordinate system and the second coordinate system;
[0031] Step S42: using the intersection information of the two planes to obtain two constrained translation vectors t.
[0032] Optionally, the multi-sensor intelligent device is characterized in that, when calculating the matching result, it includes:
[0033] Step S33: comparing the point clouds of the first image and the second image, comparing the point cloud densities, marking the point cloud with lower density as the first feature point, and marking the point cloud with higher density as the target point;
[0034] Step S34: screening the target points according to the first feature points and the height threshold to obtain matching points;
[0035] Step S35: constructing a first feature histogram for the first feature point and constructing a second feature histogram for the matchable point; the feature histogram includes height and direction parameters with adjacent points;
[0036] Step S36: performing matching according to the first feature histogram and the second feature histogram to obtain a pairing point set of the first feature point and the matchable point.
[0037] Optionally, the multi-sensor intelligent device is characterized in that, when calculating the matching result, it also includes:
[0038] Step S37: removing false matches from the matching point pairs using a random sample consensus algorithm.
[0039] Optionally, the multi-sensor intelligent device is characterized in that when there is only one plane in the candidate photo, step S5 is based on the formula Perform nonlinear optimization to obtain the final external parameters Where π represents the set of plane points in the second image, π' represents the set of plane points in the first image, pi and pi' represent the points on the plane in the second image and the first image, respectively; I represents the point cloud set in the second image excluding the plane; I' represents the point cloud set in the first image excluding the plane. n(Rp+t)+d is the distance formula from point to plane. 1 d 1 is the parameter of the plane in the second image, n 2 d 2 are the parameters of the plane in the first image.
[0040] Optionally, the multi-sensor intelligent device is characterized in that when there are two planes in the candidate photo, step S5 is based on the formula Perform nonlinear optimization to obtain the final external parameters Wherein, πi represents the set of points of the two planes in the second image, πi' represents the set of points of the two planes in the first image, pj represents the points of the two planes in the second image, pj' represents the points of the two planes in the first image; I represents the set of point clouds in the second image except the points of the two planes; I' represents the set of point clouds in the first image except the points of the two planes. li and d1i are the plane parameters of the two planes in the second image, n 2i and d2i are the plane parameters of the two planes in the first image.
[0041] Optionally, the multi-sensor intelligent device is characterized in that when there are three planes in the candidate photo, in step S5, according to the formula Perform nonlinear optimization to obtain the final external parameters Wherein, πi represents the set of points of the three planes in the second image, πi' represents the set of points of the three planes in the first image, pj represents the points of the three planes in the second image, pj' represents the points of the three planes in the first image; I represents the set of point clouds in the second image except the points of the three planes; I' represents the set of point clouds in the first image except the points of the three planes. li and d1i are the plane parameters of the three planes in the second image, n 2i and d2i are the plane parameters of the three planes in the first image.
[0042] Compared with the prior art, the present invention has the following beneficial effects:
[0043] By making full use of the geometric features and matching algorithms of point cloud data, the present invention can effectively solve the registration problem between the first sensor and the second sensor under different viewing angles, provide accurate external parameter results, and realize precise external parameter calibration under different fields of view and point cloud densities.
[0044] The present invention provides an effective solution for the joint calibration between the first sensor and the second sensor. It does not rely on items such as calibration plates, making the calibration process more efficient and easy to implement. It reduces the complexity of the calibration process while ensuring accuracy. It can be applied to many fields, such as autonomous driving, robot navigation, and three-dimensional reconstruction, and can achieve accurate sensor data fusion and scene reconstruction, providing a more reliable foundation for related applications.
[0045] The present invention simultaneously detects information of the wall and the ground for matching, and uses the largest number of identified numbers for calculation, which can determine the degrees of freedom in the rotation direction and the degrees of freedom in the translation to the greatest extent, greatly improve the accuracy of the initial parameters during optimization, greatly reduce the number of parameters that need to be matched, and can achieve fast and accurate external parameter calibration. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings in the following descriptions are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without creative work. By reading the detailed description of the non-limiting embodiments with reference to the following drawings, other features, purposes and advantages of the present invention will become more obvious:
[0047] Figure 1 This is a schematic diagram of the structure of a multi-sensor intelligent device in an embodiment of the present invention;
[0048] Figure 2 A flowchart of the steps of a controller during processing in an embodiment of the present invention;
[0049] Figure 3 Schematic diagram of the viewing angles of the first sensor and the second sensor in an embodiment of the present invention;
[0050] Figure 4 is a schematic diagram of a first coordinate system and a second coordinate system in an embodiment of the present invention;
[0051] Figure 5 This is a flow chart of steps for calculating a rotation vector R and a translation vector t in an embodiment of the present invention;
[0052] Figure 6This is another flowchart of steps for calculating the rotation vector R and the translation vector t in an embodiment of the present invention;
[0053] Figure 7 This is another flowchart of steps for calculating the rotation vector R and the translation vector t in an embodiment of the present invention;
[0054] Figure 8 A flowchart of the steps for calculating a matching result in an embodiment of the present invention;
[0055] Fig. 9 The following is another flowchart of steps for calculating matching results in an embodiment of the present invention. DETAILED DESCRIPTION
[0056] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several variations and improvements may be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.
[0057] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein, for example, can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0058] The method for calibrating a depth module using a first sensor and a second sensor provided in an embodiment of the present invention is intended to solve the problems existing in the prior art.
[0059] The present invention aims at the first sensor and the second sensor of the smart device, and can obtain accurate calibration results by rotating them close to the ground or around the wall. First, the geometric plane features between the 3D point clouds observed by the two are matched to establish initial constraints, and the initial constraints are used to estimate the external parameters of the remaining point clouds. Finally, the estimated external parameters with all degrees of freedom are used as relatively accurate initial values, and a least squares problem that takes into account both the plane features of the point cloud and the features of the remaining point cloud is established to solve the final calibration result.
[0060] The following specific embodiments are used to describe in detail the technical solutions of the present invention and how the technical solutions of the present application solve the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.
[0061] The present invention can effectively solve the registration problem between the first sensor and the second sensor by making full use of the geometric features and matching algorithms of the point cloud data, realize accurate external parameter calibration under different fields of view and point cloud densities, and provide accurate external parameter results.
[0062] Figure 1 FIG. 1 is a schematic diagram of the structure of a multi-sensor intelligent device in an embodiment of the present invention. Figure 1 As shown, a multi-sensor intelligent device in an embodiment of the present invention includes:
[0063] The first sensor is used to obtain first point cloud data.
[0064] Specifically, point cloud data is a collection of points in three-dimensional space, usually used to represent the external shape of an object or environment. Depth cameras and LiDAR are often used to generate point cloud data to help devices understand the three-dimensional world around them. The first sensor can be any device that can generate point cloud data.
[0065] The second sensor is used to obtain second point cloud data.
[0066] Specifically, the first sensor and the second sensor have a common viewing angle. Similar to the first sensor, the second sensor is used to obtain second point cloud data. The two sensors have a common viewing angle, which means that they can cover the same area or scene, thereby providing more complete and accurate environmental information. This design can improve the redundancy and robustness of the data, and have different detection accuracies for different directions. The point cloud density of the first point cloud data is different from the point cloud density of the second point cloud data. The common viewing angle is the viewing angle detected jointly by the first sensor and the second sensor, which can be the same as the viewing angle of one of the sensors, or it can be smaller than the viewing angle of both sensors. The first sensor and the second sensor can be sensors of different types, or they can be sensors of the same type.
[0067] The moving component is connected to the first sensor and the second sensor, and can drive the first sensor and the second sensor to rotate synchronously.
[0068] Specifically, the moving part is the power device of the smart device, which can drive the activities of the smart device. The moving part is connected to the first sensor and the second sensor, and can drive them to rotate synchronously. The function of this part is to ensure that the two sensors rotate one circle and can collect data synchronously, which is crucial for subsequent data fusion and analysis. Synchronous rotation means that the relative position of the two sensors is fixed and the shared viewing angle is also fixed. The moving part has high precision and high reliability, which can ensure the synchronization and stability of the two sensors during the rotation process. In addition, the moving part also needs to have sufficient strength and durability to cope with various complex environmental conditions.
[0069] The controller is used to control the moving part to rotate one circle, and control the first sensor and the second sensor to synchronously collect data; identify the number of collected planes, and calculate the rotation vector R and the translation vector t according to the number of planes, perform nonlinear iterative optimization on the matching relationship of all point clouds, and obtain the final external parameter
[0070] Specifically, the controller is the brain of the entire device, which is responsible for controlling the moving parts to rotate one circle and ensuring that the first sensor and the second sensor collect data synchronously. In addition, the controller is also responsible for identifying the number of planes collected and calculating the rotation vector R and the translation vector t based on these planes. These vectors are key parameters for point cloud registration and are used to align all point clouds to the same coordinate system. The controller also performs nonlinear iterative optimization on the matching relationship of all point clouds to obtain the final external parameters, that is, external parameters, which describe how to transform point clouds in different coordinate systems to the same coordinate system.
[0071] Figure 2 FIG. 1 is a flowchart of the steps of a controller in processing according to an embodiment of the present invention. Figure 2 As shown, in an embodiment of the present invention, a controller includes the following steps during processing:
[0072] Step S1: Rotate the first sensor and the second sensor for one circle, and during the rotation process, allow the first sensor and the second sensor to continuously take photos synchronously.
[0073] In this step, first ensure that the relative position between the first sensor and the second sensor is fixed and that they are able to take pictures synchronously. This usually involves calibrating the timestamps of the two devices to ensure that they capture images at the same time. The first sensor and the second sensor are rotated around a central axis and continue to take pictures during the rotation. This process is usually achieved by a mechanical device or a robotic arm. In the pictures captured during the rotation, image processing and plane extraction algorithms are used to identify the wall. This can be achieved by detecting straight lines, corners or other features in the pictures. During the rotation, when the device is facing the wall, the pictures obtained will contain clear wall features.
[0074] like Figure 3 As shown, the viewing angles of the first sensor and the second sensor are usually different. The viewing angle of the first sensor can be larger or smaller than that of the second sensor. The density of the point cloud generated by the first sensor is also different from the density of the point cloud generated by the second sensor. The point cloud generated by the first sensor and the point cloud generated by the second sensor cannot be one-to-one corresponding.
[0075] Step S2: extract planes from the photo to obtain the candidate photo with the most planes; if there is only one plane in the candidate photo, select the candidate photo with the largest plane area and mark them as the first image and the second image respectively, and execute step S3; if there are two planes in the candidate photo, select the candidate photo facing the first sensor and the second sensor, mark them as the first image and the second image respectively, and execute step S4; if there are three planes in the candidate photo, mark them as the first image and the second image respectively, and after calculating the rotation vector R and the translation vector t according to the three planes, execute step S5.
[0076] In this step, the candidate photos are a collection of all photos with the most planes. When all photos have only one plane, all photos are candidate photos; when some photos have one plane and some photos have two planes, the photos with two planes are candidate photos. If multiple candidate photos have different angles with the coordinate system, select the candidate photo with the most planes perpendicular to the coordinate system and mark them as the first image and the second image. If there are multiple perpendicular planes, select the photo with the largest plane area and mark them as the first image and the second image. Mark the photo taken by the first sensor as the first image, and mark the photo taken by the second sensor as the second image.
[0077] The first sensor and the second sensor in this step may be in testing or after a period of actual operation, that is, this embodiment can be used for the joint calibration of the first sensor and the second sensor before leaving the factory, and can also be used for re-calibration during the operation of the smart device.
[0078] In this step, planes are first extracted from all the photos taken when the first sensor and the second sensor rotate one circle, and the number of planes is identified. Corresponding processing is performed according to the number of planes. A plane may be determined as a valid plane only if its area reaches at least the first threshold. The plane in this embodiment refers to various large-area flat surfaces such as the ground and the wall.
[0079] In the point cloud data of the first sensor, use RANSAC (Random Sample Consensus) or other plane fitting algorithms to extract the plane representing the ground or wall from the point cloud. This plane will be defined in the first coordinate system (the coordinate system of the first sensor). Similarly, in the point cloud generated by the second sensor (converted from the depth map), the corresponding algorithm is also used to extract the corresponding plane. This plane will be defined in the second coordinate system (the coordinate system of the second sensor). Figure 4 In the figure, a is the first coordinate system. In the first coordinate system, the positive direction of the x-axis is forward, the positive direction of the z-axis is upward, and the positive direction of the y-axis is leftward. b is the second coordinate system. In the second coordinate system, the positive direction of the z-axis is forward, the positive direction of the y-axis is downward, and the positive direction of the x-axis is rightward. When extracting the wall, the plane with the smallest angle between the normal vector n and the z-axis and the closest distance to the center of the second sensor is selected as the matching plane in the second coordinate system, and the plane with the smallest angle between the normal vector n and the x-axis and the closest distance to the center of the first sensor is selected as the matching plane in the first coordinate system, that is, the corresponding frame of the facing wall and the plane to be matched are found respectively.
[0080] Step S3: Calculate the constrained rotation vector R and translation vector t according to the plane, and match the point cloud outside the plane to obtain a matching result.
[0081] In this step, by comparing the plane parameters (such as normal vector and intercept) in the two coordinate systems, the rotation from the ground from the first coordinate system to the second coordinate system can be calculated. This rotation can be represented by a rotation vector R1. Since the ground is on the same physical plane, the transformation relationship (rotation and translation) between them should be consistent. Therefore, this constraint can be used to solve the complete transformation relationship between the two coordinate systems, that is, the rotation vector R and the translation vector t. According to the R, t obtained in the previous step as the initial value, the point cloud outside the ground is further matched. After the plane is extracted and the preliminary transformation relationship is calculated, it is necessary to match the other point clouds in the two coordinate systems. This step is achieved by comparing the similarity or distance between the point clouds. The result of the matching will be a set of point pairs that correspond to the same physical point in the two coordinate systems. The traditional ICP (Iterative Closest Point) matching error is large, and NICP can be used for matching calculation. NICP considers the curvature and normal vector in the error judgment and error term on the basis of ICP, fully considers the geometric characteristics of the point cloud outside the plane, and makes the registration result more accurate. In this step, in addition to using the NICP method for matching, other methods can also be used for matching.
[0082] Step S4: Calculate the constrained rotation vector R and translation vector t according to the two planes, and match the point clouds outside the two planes to obtain a matching result.
[0083] In this step, the plane obtained includes not only the ground but also the wall. Compared with the solution using the ground in step S3, this step can also use the wall to solve. The solution steps are the same as the ground, but due to the added constraints, the constrained rotation vector R and translation vector t calculated are more accurate, and the accurate structure can be obtained more quickly in the final matching. The matching method in this step can be the same as that in step S3, or it can be different.
[0084] Step S5: Perform nonlinear iterative optimization on the matching relationship of all point clouds to obtain the final external parameters
[0085] In this step, global optimization is performed. After nonlinear iterative optimization, more accurate rotation vector R and translation vector t will be obtained, which will be used as the final external parameters to align the data in the two coordinate systems.
[0086] When there is only one plane in the candidate photo, in step S5, according to the formula Perform nonlinear optimization to obtain the final external parameters Where π represents the set of plane points in the second image, π' represents the set of plane points in the first image, pi and pi' represent the points on the plane in the second image and the first image, respectively; I represents the point cloud set in the second image excluding the plane; I' represents the point cloud set in the first image excluding the plane. n(Rp+t)+d is the distance formula from point to plane. 1 d 1 is the parameter of the plane in the second image, n 2 d 2 are the parameters of the plane in the first image.
[0087] When there are two planes in the candidate photo, in step S5, according to the formula Perform nonlinear optimization to obtain the final external parameters Wherein, πi represents the set of points of the two planes in the second image, πi' represents the set of points of the two planes in the first image, pj represents the points of the two planes in the second image, pj' represents the points of the two planes in the first image; I represents the set of point clouds in the second image except the points of the two planes; I' represents the set of point clouds in the first image except the points of the two planes. li and d1i are the plane parameters of the two planes in the second image, n 2i and d2i are the plane parameters of the two planes in the first image.
[0088] When there are three planes in the candidate photo, in step S5, according to the formula Perform nonlinear optimization to obtain the final external parameters Wherein, πi represents the set of points of the three planes in the second image, πi' represents the set of points of the three planes in the first image, pj represents the points of the three planes in the second image, pj' represents the points of the three planes in the first image; I represents the set of point clouds in the second image except the points of the three planes; I' represents the set of point clouds in the first image except the points of the three planes. li and d1i are the plane parameters of the three planes in the second image, n 2i and d2i are the plane parameters of the three planes in the first image.
[0089] Figure 5 1 is a flowchart of a step of calculating a rotation vector R and a translation vector t in an embodiment of the present invention. When the first image and the second image contain the ground, the facing wall and other walls, such as Figure 5 As shown, in an embodiment of the present invention, a step of calculating a rotation vector R and a translation vector t includes:
[0090] Step S21: extract the first plane, the second plane and the third plane in the first coordinate system generated by the first point cloud data, and extract the fourth plane, the fifth plane and the sixth plane in the second coordinate system generated by the second point cloud data; wherein the first plane, the second plane and the third plane intersect, and the fourth plane, the fifth plane and the sixth plane intersect.
[0091] Step S22: Calculate the rotation vector R and the translation vector t between the first coordinate system and the second coordinate system based on the rotation vectors of at least four planes among the first plane, the second plane, the third plane, the fourth plane, the fifth plane and the sixth plane.
[0092] In this step, the translation t is obtained by subtracting the coordinates of the intersection points of the three intersecting planes: that is, t=O-O', where O is the intersection point of the three planes in the second coordinate system, and O' is the intersection point coordinates of the three planes in the first coordinate system.
[0093] This embodiment uses three planes to determine the unique parameters of the rotation matrix and the translation vector, and can directly obtain the initial values of the refinement stage of the final optimization, which can greatly speed up the optimization process and improve efficiency and accuracy.
[0094] Figure 6 FIG. 1 is another flow chart of steps for calculating the rotation vector R and the translation vector t in an embodiment of the present invention. When only the ground exists in the first image and the second image, as Figure 6 As shown, another step of calculating the rotation vector R and the translation vector t in the embodiment of the present invention includes:
[0095] Step S31: Calculate the rotation axis n=n 1 ×n 2 , we get the rotation angle θ = arccos(n l n 2 ), the rotation matrix R1 of the plane.
[0096] In this step, n 1 is the normal vector of the plane in the first image, n 2 is the normal vector of the plane in the second image. Since we know the correspondence between a pair of planes, we can find the rotation between the two planes and use the rotation vector to represent the rotation, where the rotation axis n = n 1 ×n 2 Rotation angle θ = arccos(n l n 2 ). Obviously, since the above is the R between two planes, the rotation along this plane cannot be determined, that is to say, to obtain the R between the two modules It is also required that after the above plane rotation R1, the rotation angle θ2 (with the normal vector n of the first plane) 2 is the rotation axis), that is, a plane matching relationship provides an R1 and a fixed rotation axis R2 for the rotation between the two modules, where R=R2R1.
[0097] Step S32: Obtain n 2 Two orthogonal vectors, n 2 The two orthogonal vectors are denoted as μ1, μ2, and μ3 respectively, and the translation vector t is denoted as: t=k1μ1+k2μ2+k3μ3, wherein k1=d2-d1, d1 is the plane parameter of the plane in the first image, and d2 is the plane parameter of the plane in the second image.
[0098] In this step, the variables to be constrained of the translation vector t are k2 and k3.
[0099] This embodiment uses the constraint relationship between the first plane and the second plane to calculate R and t with constraints between the first coordinate system and the second coordinate system, thereby providing an accurate basis for subsequent calculations.
[0100] Figure 7 Flow chart of another step of calculating the rotation vector R and the translation vector t in an embodiment of the present invention. When only the ground and the wall facing each other exist in the first image and the second image, another step of calculating the rotation vector R and the translation vector t in an embodiment of the present invention includes:
[0101] Step S41: Calculate the first rotation angle θ1, the first rotation matrix R1, the second rotation angle θ2 and the second rotation matrix R2 of the two planes respectively to obtain the rotation matrix R of the first coordinate system and the second coordinate system.
[0102] In this step, n 1 is the normal vector of the ground in the first coordinate system, n 2 is the normal vector facing the wall in the first coordinate system, n 3 is the normal vector of the ground in the second coordinate system, n 4 is the normal vector facing the wall in the second coordinate system. Since we know the correspondence between a pair of planes, we can find the rotation between the two planes and use the rotation vector to represent the rotation, where the rotation axis n1 = n 1 ×n 3 , n2=n 2 ×n 4 Rotation angle θ1 = arccos(n l n 3 ),θ2=arccos(n 2 n 4 ). Rotation matrix R=R2R1.
[0103] Step S42: using the intersection information of the two planes to obtain two constrained translation vectors t.
[0104] In this step, the intersection information between the two intersecting planes is used to obtain t with two constraints. The point-wise form represents two straight lines:
[0105]
[0106]
[0107] get:
[0108] t=(x1-x2+tm,y1-y2+tn,z1-z2+tp)
[0109] Where (m, n, p) is the direction of the intersection line (because the intersection line obtained after rotation of the two planes in the second coordinate system is the same as that in the first coordinate system, the direction can be the direction of the intersection line in the first coordinate system or the second coordinate system), p1 (x1, y1, z1) is an arbitrary point on the intersection line in the second coordinate system, and p2 (x2, y2, z2) is an arbitrary point on the intersection line in the first coordinate system, that is, the variable to be constrained in translation is t.
[0110] This embodiment uses the constraint relationship between the ground and the opposite wall to calculate R and t with constraints between the first coordinate system and the second coordinate system, providing an accurate basis for subsequent calculations.
[0111] Figure 8 FIG. 1 is a flowchart of a step of calculating a matching result in an embodiment of the present invention. Figure 8 As shown, a step of calculating a matching result in an embodiment of the present invention includes:
[0112] Step S33: comparing the point clouds of the first image and the second image, comparing the point cloud densities, marking the point clouds with lower density as first feature points, and marking the point clouds with higher density as target points.
[0113] In this step, first, the common viewing angle area in the first image and the second image captured by the first sensor and the second sensor is determined. In this area, the density of the two point clouds is compared. Point cloud density refers to the number of points per unit area or volume, reflecting the degree of detail on the surface of the object. The point cloud area with lower density is marked as the first feature point. The point cloud area with higher density is marked as the target point. The target point refers to all point clouds with higher density, so it can exceed the common viewing angle area. The first feature point will be used as the reference for subsequent matching.
[0114] Step S34: Filter the target points according to the first feature points and the height threshold to obtain matching points.
[0115] In this step, the target points are screened using the first feature point and a preset height threshold. The height threshold can be set according to the actual application scenario. For example, if the point cloud on the ground or wall is of interest, the threshold can be set according to the height range of these surfaces. Of course, a fixed value can also be set as the height threshold according to the characteristics of the first sensor or the second sensor. After screening, target points corresponding to the first feature point and meeting the height threshold condition are obtained, and these points are marked as matching points.
[0116] Step S35: constructing a first feature histogram for the first feature points, and constructing a second feature histogram for the matchable points; the feature histogram includes height and direction parameters with adjacent points.
[0117] In this step, the feature histogram is a data structure used to describe the features of the point cloud. It can express the spatial distribution and local characteristics of the point cloud in the form of a histogram. In the feature histogram, height information and direction parameters are included. The height information directly reflects the spatial position of the point, while the direction parameter describes the relative direction relationship between each point and its adjacent points, such as the normal direction of the point cloud surface or the local gradient direction of the point. The direction parameter can also be the cosine value of the angle between the first feature point and the line connecting the adjacent points and the ground normal vector. For example, when each feature has 5 bins, each point has a 5*5=25-dimensional feature vector. For the first feature point and the matching point, their heights and direction parameters with adjacent points are calculated respectively, and these parameters are counted in the feature histogram.
[0118] Step S36: performing matching according to the first feature histogram and the second feature histogram to obtain a pairing point set of the first feature point and the matchable point.
[0119] In this step, the first feature points and the matching points are matched using the feature histogram constructed in step S35. By comparing the similarity of the feature histograms and determining the distance value, the matching point that best matches each first feature point can be found. The successfully matched first feature points and matching points are combined into matching point pairs. These matching point pairs will be used in subsequent tasks such as point cloud registration, coordinate conversion or 3D reconstruction.
[0120] This embodiment performs fast matching based on the characteristics of the point cloud, and is suitable for matching the remaining point cloud after removing the plane, and has the advantages of being simple, efficient, robust, and adaptable to current features. This embodiment is applicable to both step S3 and step S4, and can greatly improve the matching effect.
[0121] Fig. 9 FIG. 1 is another flow chart of steps for calculating matching results in an embodiment of the present invention. Fig. 9 As shown, compared with the above-mentioned embodiment, another step of calculating the matching result in the embodiment of the present invention further includes:
[0122] Step S37: removing false matches from the matching point pairs using a random sample consensus algorithm.
[0123] In this step, after completing the construction of matching point pairs, in order to further improve the accuracy and robustness of matching, it is necessary to remove those mismatched point pairs caused by noise, occlusion or other reasons. There are many ways to remove mismatches. Here, we can use the random sample consensus algorithm (RANSAC) as an example to illustrate.
[0124] Detailed steps to use the RANSAC algorithm to remove mismatched points:
[0125] Selecting a model and setting a threshold: First, you need to determine a mathematical model to describe the relationship between the correct matching point pairs. In the case of point cloud matching, this model may be a rigid body transformation (including rotation and translation) that describes the coordinate transformation from one point cloud to another. Then, set a threshold to determine whether a matching point pair satisfies this model.
[0126] Random sampling and model fitting: Randomly select a portion of the matching point pairs from all the matching point pairs and use them to fit the model selected above. This usually involves solving an optimization problem to minimize the error between all matching point pairs and the fitted model.
[0127] Calculate inliers and outliers: After fitting the model, calculate the error between all matching point pairs and the model. If the error of a point pair is less than the set threshold, it is considered an inlier (i.e., a correct matching point pair); otherwise, it is considered an outlier (i.e., a mismatched point pair).
[0128] Iteration and optimization: Repeat the above process of random sampling, model fitting, and calculation of internal and external points until a certain stopping condition is met (such as reaching the maximum number of iterations or finding enough internal points). In each iteration, the model can be refitted based on the found internal points, and new internal and external points can be calculated. This process is an iterative optimization process that aims to find the model that best describes all correctly matched point pairs.
[0129] Output results: After the iteration is completed, the model with the most inliers is selected as the final result, and the inliers corresponding to the model are output as the final matching point pairs. These matching point pairs have removed most of the mismatches, so they can be used for subsequent 3D reconstruction, scene understanding and other tasks.
[0130] By using the RANSAC algorithm to remove mismatched point pairs, the accuracy and robustness of point cloud matching can be significantly improved, providing a more reliable data foundation for subsequent applications.
[0131] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the embodiments can be referred to each other. The above description of the disclosed embodiments enables professionals and technicians in this field to implement or use the present invention. Various modifications to these embodiments will be obvious to professionals and technicians in this field, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to these embodiments shown in this article, but will comply with the widest range consistent with the principles and novel features disclosed herein.
[0132] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art may make various modifications or variations within the scope of the claims, which do not affect the essence of the present invention.
Claims
1. A multi-sensor intelligent device, characterized in that: include: A first sensor, used to obtain first point cloud data; A second sensor, used to obtain second point cloud data; wherein the first sensor and the second sensor have a common viewing angle; A moving component, connected to the first sensor and the second sensor, and capable of driving the first sensor and the second sensor to rotate synchronously; The controller is used to control the moving part to rotate one circle, and control the first sensor and the second sensor to synchronously collect data; identify the number of collected planes, and calculate the rotation vector R and the translation vector t according to the number of planes, and perform nonlinear iterative optimization on the matching relationship of all point clouds to obtain the final external parameter 2. A multi-sensor intelligent device according to claim 1, characterized in that: The controller includes: Step S1: Rotate the first sensor and the second sensor for one circle, and during the rotation process, allow the first sensor and the second sensor to continuously take photos synchronously; Step S2: extracting planes from the photo to obtain candidate photos with the most planes; if there is only one plane in the candidate photos, selecting the candidate photos with the largest plane area and marking them as the first image and the second image respectively, and executing step S3; if there are two planes in the candidate photos, selecting the candidate photos facing the first sensor and the second sensor, marking them as the first image and the second image respectively, and executing step S4; if there are three planes in the candidate photos, marking them as the first image and the second image respectively, and calculating the rotation vector R and the translation vector t according to the three planes, and executing step S5; Step S3: calculating a constrained rotation vector R and a translation vector t according to the plane, and matching the point cloud outside the plane to obtain a matching result; Step S4: calculating a constrained rotation vector R and a translation vector t according to the two planes, and matching the point clouds outside the two planes to obtain a matching result; Step S5: Perform nonlinear iterative optimization on the matching relationship of all point clouds to obtain the final external parameters 3. A multi-sensor intelligent device according to claim 2, characterized in that: In step S2, when calculating the rotation vector R and the translation vector t according to the plane, the facing wall and the other wall, it includes: Step S21: extracting a first plane, a second plane and a third plane in a first coordinate system generated by the first point cloud data, and extracting a fourth plane, a fifth plane and a sixth plane in a second coordinate system generated by the second point cloud data; wherein the first plane, the second plane and the third plane intersect, and the fourth plane, the fifth plane and the sixth plane intersect; Step S22: Calculate the rotation vector R and the translation vector t between the first coordinate system and the second coordinate system based on the rotation vectors of at least four planes among the first plane, the second plane, the third plane, the fourth plane, the fifth plane and the sixth plane.
4. A multi-sensor intelligent device according to claim 2, characterized in that: Step S3 includes: Step S31: Calculate the rotation axis n = n1 × n2, and obtain the rotation angle θ = arccos(n l n2), a rotation matrix R1 of the plane; wherein n1 is the normal vector of the plane in the first image, and n2 is the normal vector of the plane in the second image; Step S32: Obtain two orthogonal vectors of n2, record n2 and the two orthogonal vectors as μ1, μ2, μ3 respectively, and record the translation vector t as: t=k1μ1+k2μ2+k3μ3, where k1=d2-d1, d1 is the plane parameter of the plane in the first image, and d2 is the plane parameter of the plane in the second image.
5. A multi-sensor intelligent device according to claim 2, characterized in that: Step S4 includes: Step S41: respectively calculating the first rotation angle θ1, the first rotation matrix R1, the second rotation angle θ2 and the second rotation matrix R2 of the two planes to obtain the rotation matrix R of the first coordinate system and the second coordinate system; Step S42: using the intersection information of the two planes to obtain two constrained translation vectors t.
6. A multi-sensor intelligent device according to claim 2, characterized in that: When calculating the matching results, include: Step S33: comparing the point clouds of the first image and the second image, comparing the point cloud densities, marking the point cloud with lower density as the first feature point, and marking the point cloud with higher density as the target point; Step S34: screening the target points according to the first feature points and the height threshold to obtain matching points; Step S35: constructing a first feature histogram for the first feature point and constructing a second feature histogram for the matchable point; the feature histogram includes height and direction parameters with adjacent points; Step S36: performing matching according to the first feature histogram and the second feature histogram to obtain a pairing point set of the first feature point and the matchable point.
7. A multi-sensor intelligent device according to claim 6, characterized in that: When calculating the matching results, it also includes: Step S37: removing false matches from the matching point pairs using a random sample consensus algorithm.
8. The multi-sensor intelligent device according to claim 2, characterized in that: When there is only one plane in the candidate photo, in step S5, according to the formula Perform nonlinear optimization to obtain the final external parameters Where π represents the set of plane points in the second image, π' represents the set of plane points in the first image, pi and pi' represent the points on the plane in the second image and the points on the plane in the first image respectively; I represents the set of point clouds in the second image excluding the plane; I' represents the set of point clouds in the first image excluding the plane. n(Rp+t)+d is the formula for the distance from point to plane. n1 and d1 are the parameters of the plane in the second image, and n2 and d2 are the parameters of the plane in the first image.
9. The multi-sensor intelligent device according to claim 2, characterized in that: When there are two planes in the candidate photo, in step S5, according to the formula Perform nonlinear optimization to obtain the final external parameters Wherein, πi represents the set of points of the two planes in the second image, πi' represents the set of points of the two planes in the first image, pj represents the points of the two planes in the second image, pj' represents the points of the two planes in the first image; I represents the set of point clouds in the second image except the points of the two planes; I' represents the set of point clouds in the first image except the points of the two planes. li and d1i are the plane parameters of the two planes in the second image, n 2i and d2i are the plane parameters of the two planes in the first image.
10. The multi-sensor intelligent device according to claim 2, characterized in that: When there are three planes in the candidate photo, in step S5, according to the formula Perform nonlinear optimization to obtain the final external parameters Wherein, πi represents the set of points of the three planes in the second image, πi' represents the set of points of the three planes in the first image, pj represents the points of the three planes in the second image, pj' represents the points of the three planes in the first image; I represents the set of point clouds in the second image except the points of the three planes; I' represents the set of point clouds in the first image except the points of the three planes. li and d1i are the plane parameters of the three planes in the second image, n 2i and d2i are the plane parameters of the three planes in the first image.
Citation Information
Patent Citations
SFM reconstruction method and device based on laser radar, and computer equipment
CN112184768A
Depth camera external parameter calibration method, device, equipment and storage medium
CN116934864A
External parameter calibration method and system for camera and laser radar sensor equipment
CN117422771A
