External parameter calibration method, system, robot and storage medium
By obtaining the laser point cloud and image set, the external parameters of the lidar and the camera are calculated, which solves the problem of external parameter calibration between the lidar and the camera and improves the robot's perception performance.
Patent Information
- Application Number
- CN202110382201.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-09
- Publication Date
- 2024-09-13
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing technology makes it difficult to achieve external parameter calibration between lidar and cameras, which makes it difficult to accurately fuse sensory data in the same coordinate reference system and affects the robot's perception performance.
By obtaining the laser point cloud set and image set of the preset calibration plate in different postures, the mapping relationship between the pixel key points and the laser key points is calculated, and then the external parameters of the camera and lidar are determined.
Automatic external parameter calibration between lidar and camera is realized, which improves the accuracy and robustness of the calibration and ensures the accurate fusion of sensing data in the same coordinate system.
Smart Images

Figure CN113160328B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to an external parameter calibration method, system, robot and storage medium. Background Art
[0002] In actual use, robots usually need multi-sensor fusion for perception and positioning, target detection and obstacle avoidance, etc. Each type of sensor has its own advantages and disadvantages. LiDAR can provide accurate distance information and work well at night, but it cannot provide information about the color of obstacles. Cameras can perceive information such as the color and texture of obstacles and can be used for target classification, but their detection range is limited and they are sensitive to lighting conditions.
[0003] Therefore, by fusing LiDAR and cameras, we can achieve the complementary advantages of the sensors and improve perception performance. The data fusion of multiple sensors requires very precise external parameter calibration of the sensors to ensure that the sensor's perception data of the environment can be accurately fused in the same coordinate reference system. Therefore, external parameter calibration of LiDAR and camera is a very necessary step. Summary of the invention
[0004] The purpose of the present invention is to provide an extrinsic parameter calibration method, system, robot and storage medium to realize automatic calibration of extrinsic parameters between a camera and a laser radar, and effectively improve the accuracy and robustness of the extrinsic parameter calibration.
[0005] The technical solution provided by the present invention is as follows:
[0006] The present invention provides an external parameter calibration method, comprising the steps of:
[0007] Obtaining a laser point cloud set and an image set of a preset calibration plate in different postures; the white area of the preset calibration plate is a reflective material;
[0008] According to the laser point cloud set and the image set, respectively obtaining a laser point cloud front view and a target image of the preset calibration plate in the same posture;
[0009] According to the laser point cloud front view and the target image, a mapping relationship between a pixel key point and a matching laser key point is obtained;
[0010] The camera extrinsic parameters and the lidar extrinsic parameters are calculated according to the mapping relationship.
[0011] The present invention also provides an external parameter calibration system, comprising:
[0012] An acquisition module is used to acquire a laser point cloud set and an image set of a preset calibration plate in different postures; the white area of the preset calibration plate is a reflective material;
[0013] A processing module, used for respectively acquiring a laser point cloud front view and a target image of the preset calibration plate in the same posture according to the laser point cloud set and the image set;
[0014] A calculation module, used for obtaining a mapping relationship between a pixel key point and a matching laser key point according to the laser point cloud front view and the target image;
[0015] The calibration module is used to calculate the camera extrinsic parameters and the lidar extrinsic parameters according to the mapping relationship.
[0016] The present invention also provides a robot, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor is used to execute the computer program stored in the memory to implement the operations performed by the external parameter calibration method.
[0017] The present invention also provides a storage medium, in which at least one instruction is stored. The instruction is loaded and executed by a processor to implement the operation performed by the external parameter calibration method.
[0018] Through the extrinsic parameter calibration method, system, robot and storage medium provided by the present invention, automatic calibration of extrinsic parameters between a camera and a laser radar can be achieved, and the accuracy and robustness of the extrinsic parameter calibration can be effectively improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The following will explain the preferred implementation mode in a clear and understandable manner with reference to the accompanying drawings, and further explain the above-mentioned characteristics, technical features, advantages and implementation methods of an external parameter calibration method, system, robot and storage medium.
[0020] Figure 1 is a flow chart of an embodiment of an external parameter calibration method of the present invention;
[0021] Figure 2 It is a schematic diagram of the coordinate system relationship of an external parameter calibration method of the present invention;
[0022] Figure 3 It is a schematic diagram of a scene of laser point suspension in an external parameter calibration method of the present invention;
[0023] Figure 4 It is a flow chart of another embodiment of an external parameter calibration method of the present invention. DETAILED DESCRIPTION
[0024] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0025] It should be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections.
[0026] In order to simplify the drawings, only the parts related to the present invention are schematically shown in each figure, and they do not represent the actual structure of the product. In addition, in order to simplify the drawings and facilitate understanding, in some figures, only one of the parts with the same structure or function is schematically drawn or marked. In this article, "one" not only means "only one", but also means "more than one".
[0027] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0028] In addition, in the description of the present application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0029] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the specific implementation methods of the present invention will be described below with reference to the accompanying drawings. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings and other implementation methods can be obtained based on these drawings without creative work.
[0030] One embodiment of the present invention, as Figure 1 As shown, an external parameter calibration method includes:
[0031] S100 obtains the laser point cloud set and image set of the preset calibration plate in different postures; the white area of the preset calibration plate is a reflective material;
[0032] Specifically, first place a preset calibration plate (any rigid flat plate can be used, with a length and width greater than 1 meter) in front of the laser radar and camera, and in a place where both the laser radar and the camera can see it, and then collect it once at different distances and different orientations to cover as much space in front of the laser radar and the camera as possible. Ensure that there is overlap in the field of view of the camera and the laser radar so that the laser point cloud set and the image set can be collected synchronously. For example, install the camera and the laser radar on the robot and ensure that there is overlap in the field of view of the camera and the laser radar. The laser point cloud set is obtained by emitting laser from the laser radar to the preset calibration plate. When a beam of laser irradiates the surface of an object, the reflected laser will carry information such as orientation and distance. If the laser beam is scanned along a certain trajectory, the reflected laser point information will be recorded while scanning. Since the scanning is extremely fine, a large number of laser points can be obtained, and thus a laser point cloud can be formed based on a large number of laser points. After a period of accumulation, several laser point clouds can be obtained. In this way, the preset calibration plate with the same posture is collected for a period of time to obtain a laser point cloud set. Among them, the laser point cloud obtained according to the laser measurement principle includes three-dimensional coordinates (XYZ) and laser reflection intensity (Intensity). In addition, a plurality of images can be obtained by taking pictures of the preset calibration plate in the same posture with a camera, and an image set can be obtained by taking pictures of the preset calibration plate in the same posture for a period of time. The current laser point cloud set includes laser point cloud data obtained by scanning the preset calibration plate in the current posture with a laser radar, and the current image set includes images obtained by photographing the preset calibration plate in the current posture with a camera. By analogy, several laser point cloud sets and several image sets of the preset calibration plate in different postures can be obtained.
[0033] Among them, the calibration plate types include checkerboard calibration plate, dot calibration plate (including black background with white dots and white background with black dots), CharuCo calibration plate, etc. The preset calibration plate refers to the above-mentioned calibration plate with reflective material in the white area. It can be obtained by pasting reflective paper on the white area. Of course, the preset calibration plate can also be made by using reflective material in the white area during production.
[0034] Preferably, the preset calibration plate is placed in front of the camera and the laser radar, and the preset calibration plate is controlled to translate and rotate in the front, back, left and right directions to change the posture of the preset calibration plate. Exemplarily, the preset calibration plate is placed vertically in front of the camera and the laser radar (assuming that this is the current posture of the preset calibration plate), so that the camera can collect the image set of the preset calibration plate, and the laser beam of the laser radar can hit the preset calibration plate to collect the laser point cloud set. Once the laser point cloud set and image set in the current posture of the calibration plate are collected, the preset calibration plate can be gradually laid down or rotated to change to the next posture, and the laser point cloud set and image set in the next posture are collected.
[0035] S200 obtains a laser point cloud front view and a target image of a preset calibration plate in the same posture according to the laser point cloud set and the image set;
[0036] Specifically, a laser point cloud set has a laser point cloud front view and multiple target images. The processor is connected to the laser radar and the camera respectively, and can acquire and store the laser point cloud set collected by the laser radar and the image set collected by the camera. The processor selects a laser point cloud set arbitrarily, and the corresponding laser point cloud front view can be obtained by processing according to the selected laser point cloud set. In addition, the processor can obtain the target image matching the current posture from all image sets according to the current posture of the preset calibration plate of the selected laser point cloud set. Among them, the laser point cloud front view includes the coordinate values of the laser data points in the pre-established laser coordinate system (which is a three-dimensional coordinate system) and the laser reflection intensity (Intensity). The target image includes the coordinate values and depth values of the pixel key points in the pixel coordinate system (which is a two-dimensional coordinate system).
[0037] Preferably, since the laser radar has a timestamp when collecting and acquiring the laser point cloud, the camera also has a timestamp when capturing and acquiring the image, and the start and end time of the preset calibration plate in the same posture is known, when the processor stores the data, it stores all the laser point clouds and all the images acquired in different postures in the corresponding storage area respectively, and names them according to the posture of the preset calibration plate and / or the start and end time of the posture duration. In this way, it is convenient to search for the laser data set and image set in the same posture later.
[0038] Exemplarily, assume that in the first time period t1, the laser data set S1 and the image set P1 are acquired when the preset calibration plate is in the current posture, the laser data set S2 is acquired in the next posture, and in the second time period t2 (where t2>t1), the image set P2 is acquired when the preset calibration plate is in the next posture. Then, the laser data set S1 and the image set P1 corresponding to the current posture are stored in the storage area D1, and the storage area D1 is named according to the current posture of the preset calibration plate and its start and end time t1. Similarly, the laser data set S2 and the image set P2 corresponding to the current posture are stored in the storage area D2, and the storage area D2 is named according to the next posture of the preset calibration plate and its start and end time t2. By analogy, laser point cloud sets and image sets of different postures can be stored in groups.
[0039] After storing data in the above manner, call a laser point cloud set from any storage area, match the called laser point cloud set according to the name of the storage area where it is located, and you can get the posture information of the preset calibration plate corresponding to the called laser point cloud set, and perform point cloud processing on the called laser point cloud set to obtain the laser point cloud front view in the corresponding posture, and use the laser point cloud front view and target image obtained above as a point cloud image pair corresponding to the current posture information. It should be understood that the posture of the preset calibration plate corresponding to the laser point cloud front view and target image in each point cloud image pair is the same, that is, the laser point cloud front view and target image of the preset calibration plate in the same posture are obtained. In addition, select any image from the images stored in the storage area as the target image. By analogy, point cloud image pairs of preset calibration plates in different postures can be obtained.
[0040] S300 obtains the mapping relationship between the pixel key point and its matching laser key point based on the laser point cloud front view and the target image;
[0041] Specifically, it can be seen from the above that the postures of the preset calibration plate corresponding to the laser point cloud front view and the target image are the same. When the preset calibration plate is in the current posture, the laser point cloud front view is obtained according to the coordinate values of each laser point on the calibration plate in the laser point cloud in the laser coordinate system and the laser reflection intensity (Intensity), and the corresponding target image is obtained by capturing each laser point on the calibration plate through camera shooting. The laser key point matched by the pixel key point refers to the point observed by the camera and the laser radar for the preset calibration plate of the same posture.
[0042] like Figure 2 As shown in the figure, when the preset calibration plate is in a constant posture, since the pixel coordinate system and the laser coordinate system have a fixed mapping relationship, the processor can obtain the mapping relationship between the pixel key point and its matching laser key point according to the laser point cloud front view and the target image. Among them, the pixel key point and the laser key point are set according to the characteristics of the white area of the preset calibration plate.
[0043] For example, a pixel key point may be a pixel point on the target image where at least one corner point in any white reflective area on a preset calibration plate is imaged, and a laser key point may be a laser point corresponding to at least one corner point in any white reflective area on a preset calibration plate emitted by a laser radar.
[0044] For example, assuming that the preset calibration plate is a circular calibration plate with black background and white dots, the pixel key point is the pixel point where at least one center of a circle in any white reflective area on the preset calibration plate is imaged on the target image, and the laser key point is the laser point corresponding to the center of at least one circle in any white reflective area on the preset calibration plate emitted by the laser radar.
[0045] S400 calculates the camera extrinsic parameters and the lidar extrinsic parameters according to the mapping relationship.
[0046] Specifically, the processor can obtain the coordinate value of the pixel key point in the pixel coordinate system and the coordinate value of the laser key point in the laser coordinate system, and calculate the camera extrinsic parameters and the lidar extrinsic parameters by combining the mapping relationship between the pixel key point and its matching laser key point.
[0047] The present invention obtains point cloud image pairs in different postures, and then obtains the mapping relationship between pixel key points and their matching laser key points according to the point cloud image pairs to perform external parameter calibration of cameras and laser radars. The process is simple, easy to operate, and efficient. It has high external parameter calibration accuracy for laser radars and cameras, and the consistency of external parameter calibration results is good. It realizes automatic calibration of external parameters between cameras and laser radars, and effectively improves the accuracy and robustness of calibration. In addition, the white block of the preset calibration plate is made of reflective material, so that the laser radar can use the difference in reflective intensity of different materials and colors to perform color distinction similar to image space, and can accurately and efficiently extract key points in the point cloud space.
[0048] One embodiment of the present invention is an external parameter calibration method, comprising:
[0049] S100 obtains the laser point cloud set and image set of the preset calibration plate in different postures; the white area of the preset calibration plate is a reflective material;
[0050] It should be noted that the camera used in the present invention should include but not be limited to monocular cameras, and other available visual sensors such as surround view cameras, binocular cameras, TOF cameras, structured light cameras, etc. may also be used; the laser radar should include but not be limited to multi-line laser radar, and may also be Flash radar, MEMS radar, phased array radar, Livox laser radar, and any other sensor that can generate three-dimensional laser point cloud information.
[0051] S210 extracts the board surface laser point cloud from the laser point cloud set, and obtains the laser point cloud front view in the current posture according to the board surface laser point cloud;
[0052] Specifically, since the environment in which the preset calibration plate is located may have various interference objects, such as walls, doors, and even the ground, these interference objects will cause interfering laser points in the laser point cloud set obtained by feedback when the laser radar emits laser to the preset calibration plate. Therefore, it is necessary to delete the interfering laser points in the laser point cloud set and only leave the board surface laser point cloud corresponding to the preset calibration plate.
[0053] Preferably, the process of acquiring the laser point cloud of the board surface, that is, the process of extracting the calibration plate in the point cloud, includes: clustering all laser points in the laser point cloud set to obtain clustering results, displaying each clustering result through a display screen, and manually sliding and setting the 3D space coordinates to obtain [xmin, xmax, ymin, ymax, zmin, zmax] so that the preset calibration plate is completely included, and then performing plane extraction on the laser point cloud set obtained by manual selection, and retaining the obtained plane point cloud as the original point cloud of the preset calibration plate, that is, the board surface laser point cloud.
[0054] Preferably, clustering can be performed based on all laser points in the laser point cloud set to obtain a clustering result, and it is determined whether the laser reflection intensity (Intensity) corresponding to the current clustering result meets the set reflection intensity of the white reflective area, and it is determined whether the distance values from each laser point in the current clustering result to the origin of the laser coordinate system are equal (or the distance is within the preset error range) according to the Euclidean distance transformation formula. If the laser reflection intensity corresponding to the current clustering result not only meets the set reflection intensity, but also the distance values from each laser point in the current clustering result to the origin of the laser coordinate system are equal (or the distance is within the preset error range), it is determined that the laser point data corresponding to the current clustering result belongs to the preset calibration plate, and then the laser point data corresponding to the current clustering result is determined to obtain the board laser point cloud. If any one does not meet, it is determined that the laser point data corresponding to the current clustering result does not belong to the preset calibration plate, and the next clustering result is switched to continue the judgment until a clustering result that meets the above conditions is found.
[0055] S220 acquires a target image having the same posture as the preset calibration plate corresponding to the front view of the laser point cloud;
[0056] S230 obtains a front view of the laser point cloud and a target image of the preset calibration plate in the next posture, until all front views of the laser point cloud and target images in the same posture are obtained;
[0057] Specifically, according to the above embodiment, according to the target acquisition time range of the laser point cloud set of the preset calibration plate in the current posture, a matching image set with the same target acquisition time range is screened out from all image sets, and an image is randomly selected from the matching image set as the target image. With reference to the above embodiment, all laser point cloud front views and target images in the same posture are obtained, which will not be described one by one here.
[0058] S300 obtains the mapping relationship between the pixel key point and its matching laser key point based on the laser point cloud front view and the target image;
[0059] S400 calculates the camera extrinsic parameters and the lidar extrinsic parameters according to the mapping relationship.
[0060] The present invention extracts a plate surface laser point cloud from a laser point cloud set, and then obtains a corresponding laser point cloud front view based on the plate surface laser point cloud, thereby avoiding interference from laser data or noise data corresponding to interference objects, and further obtaining an accurate laser point cloud front view, thereby greatly improving the accuracy of external parameter calibration of the laser radar and camera.
[0061] An embodiment of the present invention is an external parameter calibration method, such as Figure 4 As shown, including:
[0062] S100 obtains the laser point cloud set and image set of the preset calibration plate in different postures; the white area of the preset calibration plate is a reflective material;
[0063] S211 performs dense processing on the laser point cloud of the plate surface to obtain a dense laser point cloud in the current posture;
[0064] Specifically, the interpolation method can be used to densify the laser point cloud of the plate surface, such as nearest neighbor interpolation, bilinear interpolation, etc., so as to upsample the laser point cloud and achieve the densification effect of the laser point cloud of the plate surface. Of course, the plate surface laser point cloud can also be preliminarily densified based on the edge interpolation method, and then the plate surface laser point cloud after the preliminary densification can be subjected to secondary densification based on the regional interpolation method (i.e., the original low-resolution plate surface laser point cloud is divided into different regions, and then the interpolation points are mapped to the original low-resolution laser point cloud). In this way, the overall plate surface laser point cloud can have a certain degree of encryption enhancement, thereby improving the densification effect of the plate surface laser point cloud.
[0065] S212 performs plane extraction on the dense laser point cloud to obtain a plate surface laser point cloud corresponding to a preset calibration plate in the current posture;
[0066] S213 performs plane fitting on the laser point cloud of the plate surface to obtain a fitting plane;
[0067] Specifically, after the processor obtains the dense laser point cloud in the above manner, it uses the PCL point cloud library or the random sampling consensus (RANSAC) algorithm to extract the plane of the dense laser point cloud, and then removes some noise laser points to obtain the plate surface laser point cloud corresponding to the preset calibration plate in the current posture. Then, the random sampling consensus (RANSAC) algorithm is used to fit the plane of the dense laser point cloud. The steps of the RANSAC algorithm are as follows: randomly select a sample point cloud set from the dense laser point cloud, the sample point cloud set includes three non-collinear point cloud data, use the minimum variance estimation to calculate the sample point cloud set to obtain a candidate plane, calculate the difference between all sample point clouds and the candidate plane, compare the difference with the preset threshold, when the difference is less than the threshold, the sample point cloud belongs to the plate laser point corresponding to the preset calibration plate, and count the number of plate laser points in the current sample point cloud set. Repeat the above process to randomly select a new candidate plane again, and use the candidate plane with the largest number of plate laser points as the final fitting plane. The RANSAC algorithm can eliminate the influence of interfering laser points caused by noise and other factors.
[0068] Then, the processor uses least squares optimization to obtain the plane equation of the fitting plane obtained by fitting the preset plate surface laser point cloud as shown in the following formula (1):
[0069] Ax p +By p +Cz p +D=0 (1)
[0070] Among them, (x p ,y p , z p ) represents the coordinate value of the point on the fitting plane in the laser coordinate system, A is the coefficient of the coordinate axis X, B is the coefficient of the coordinate axis Y, C is the coefficient of the coordinate axis Z, and D is the constant term coefficient; A, B, C and D are all constants.
[0071] S214 projects the laser point cloud of the board surface onto the fitting plane to obtain the target point cloud board surface;
[0072] Specifically, Figure 2 As shown, Ow-XwYwZw is the world coordinate system, O L -X L Y L Z Lis the laser coordinate system, the origin is the center of the laser radar, and the Z axis is the laser emission direction of the laser radar. Oc-XcYcZc is the camera coordinate system, the origin is the optical center of the camera, the x and y axes are parallel to the two sides of the image plane, and the z axis is the optical axis of the lens. o-xy is the image coordinate system, and the origin is the midpoint of the image. uv is the pixel coordinate system, the origin is point a in the upper left corner of the image, the u axis is parallel to the x axis to the right, and the v axis is parallel to the y axis downward. P is any point on the preset calibration plate where the laser emitted by the laser radar hits. p' is the imaging point of P in the image coordinate system, the coordinates of p' in the image coordinate system are (x, y), the coordinates of p' in the pixel coordinate system are (u, v), and f is the focal length of the camera. The relationship between the world coordinate system, the camera coordinate system, the image coordinate system, and the pixel coordinate system is as follows: Figure 2 As shown, the world coordinate system Ow-XwYwZw is transformed into the camera coordinate system Oc-XcYcZc and the laser coordinate system O L -X L Y L Z L The camera coordinate system Oc-XcYcZc is projected into the image coordinate system o-xy by perspective projection, and the image coordinate system o-xy is transformed into the pixel coordinate system uv by secondary transformation. The first conversion matrix between the pixel coordinate system and the world coordinate system can be obtained by calculation through the existing technology. Similarly, the second conversion matrix between the laser coordinate system and the world coordinate system can be obtained by calculation through the existing technology.
[0073] The laser point cloud of the plate surface is projected onto the fitting plane, and the laser points in the laser point cloud of the plate surface are projected in the XY axis plane direction respectively, so that the laser point cloud of the plate surface is projected onto the fitting plane. The origin of the laser coordinate system is taken as the projection center (x0, y0, z0), the fitting plane is taken as the projection plane, and the positive direction of the z-axis direction of the laser radar is taken as the projection direction. The laser scanning point cloud is projected, and the laser point cloud suspended outside the fitting plane is projected onto the fitting plane. A center point projection ray is formed by using any laser point on the fitting plane and the projection center (x0, y0, z0), and the spatial straight line equation of the projection ray in the laser coordinate system is calculated. Then, the intersection point (xj, yj, zj) of the projection ray passing through the point and the fitting plane is calculated according to the spatial straight line equation and the plane equation of the fitting plane. The intersection point is the projection point.
[0074] Because the point cloud data of the laser radar can be obtained as very dense point cloud data after a period of accumulation, it is possible to find the 3D points corresponding to the key points in the actual environment in such a dense point cloud more accurately. Then, the 3D-2D correspondence form can be used to find the points in the laser radar and the points in the image, and the external parameters of the laser radar and the camera can be optimized and solved. Since there are certain errors and fluctuations in the laser points, such as Figure 3As shown on the left, when the laser radar emits laser and hits the preset calibration plate, the collected laser point cloud set is the plate surface laser point cloud obtained by the above method, such as Figure 3 As shown on the right, there are laser points floating outside the fitting plane. If these laser points are removed, the subsequent key point selection will cause precision loss, so these laser points need to be projected correctly. The main process is to first fit the main plane of the board laser point cloud, and then project all points onto this fitting plane. Project any laser point of the board laser point cloud onto the fitting plane, and use the principle that the light starts from the optical center and then intersects with the fitting plane. According to the following formula (2), the projection point can be solved, and then the target point cloud board can be obtained based on all the projection points.
[0075]
[0076] Among them, (x p ,y p , z p ) represents the coordinate value of the point on the fitting plane in the laser coordinate system, A is the coefficient of the coordinate axis X, B is the coefficient of the coordinate axis Y, C is the coefficient of the coordinate axis Z, and D is the constant term coefficient; A, B, C and D are all constants.
[0077] S215 rotates and rasterizes the target point cloud surface based on the ground normal vector to obtain a laser point cloud front view including a plurality of laser point cloud grids; the laser point cloud grid corresponds to the laser reflection intensity of a laser point;
[0078] Specifically, after obtaining the target point cloud panel through the above method, PCA analysis is first performed to obtain the main direction, and then the transformation matrix is manually adjusted visually to transform it into the front view direction. The purpose of this step is to make the final 3D-2D correspondence more concise and direct. Then these plane point clouds are converted into 2D image form by rasterization. Among them, the physical space grid side length d during the conversion process can be used to control the image size resolution. At the same time, this is a downsampling coefficient, which can be adjusted according to the actual situation to ensure that the converted image is clear. Then, the mapping from point cloud to pixel is unique, but the mapping from pixel to point cloud may be multiple. For convenience, the point with the largest reflection intensity in each grid is selected to represent the actual physical space point corresponding to the pixel, or the points in the grid can be averaged. Then, the spatial point mapping relationship corresponding to each pixel can be saved. The point cloud image needs to be binarized. Due to the use of reflective materials, the white area can be well distinguished, and the reflection intensity of the entire image can be clustered into two categories, or a specific threshold can be directly set to distinguish the image. The final point cloud image is an image with pixel values of 255 or 0, where 255 represents the white area in the checkerboard and 0 represents the black area. Then, key point detection is performed on the laser point cloud front view and the target image obtained by the camera to obtain 3D-2D point pairs. After collecting several sets of data and performing pnp solution, the external parameters of the camera and lidar are finally obtained.
[0079] Exemplarily, the feature points of a checkerboard calibration plate are used as the points to be solved. Solving these points in the image is a common method, and the checkerboard detection method provided by existing tools can be used. The corresponding points in the point cloud are extracted from the calibration plate plane, then rotated to the direction of the front view, and then converted into a 2D image in the form of a grid, in which the reflection intensity is used as the pixel intensity. Then, for the converted 2D image, the corresponding key points are obtained by using checkerboard detection, and the key points in the image are matched, thus forming 3D-2D corresponding data, based on which the optimization solution is performed. Among them, in order to better extract key points in the point cloud space, the white blocks of the checkerboard calibration plate are covered with reflective materials, so that the difference in reflection intensity of different materials and colors can be used by lidar to perform color differentiation similar to that in the image space.
[0080] Exemplarily, the calibration plate changes different positions to collect n groups of data, each group of data contains the point cloud and image data of the laser radar. The laser radar point cloud in each group of data is accumulated to obtain the dense point cloud data of each group, and a picture is selected as the corresponding camera data. Since it is in a static state, the selected camera data can be used as long as it can detect the checkerboard. Manual 3D area selection is performed on each group of point cloud data, and then plane detection is performed to obtain a checkerboard point cloud. Plane fitting is performed on each group of checkerboard point clouds, and then point cloud projection is performed to obtain the final checkerboard point cloud plane. PCA analysis is performed on each group of checkerboard point cloud planes, and then rotated to obtain the front view, retaining the transformation matrix. Rasterize the front view of each group of point clouds, and then cluster and binarize to obtain the image and the mapping relationship between pixels and 3D points. Checkerboard detection is performed on each group of point cloud images and the images obtained by the camera to obtain the final 3D-2D point pairs. All point pairs are used as data sets, and pnp solutions are performed to obtain the external parameters of the camera and the laser radar.
[0081] S220 acquires a target image having the same posture as the preset calibration plate corresponding to the front view of the laser point cloud;
[0082] S230 obtains a front view of the laser point cloud and a target image of the preset calibration plate in the next posture, until all front views of the laser point cloud and target images in the same posture are obtained;
[0083] S300 obtains the mapping relationship between the pixel key point and its matching laser key point based on the laser point cloud front view and the target image;
[0084] S410 obtains the coordinate value of the pixel key point and the laser key point that matches it;
[0085] S420 calculates the machine external parameters and the laser radar external parameters according to the coordinate values and the mapping relationship.
[0086] Specifically, the parts of this embodiment that are the same as those in the above embodiment refer to the above embodiment and will not be described in detail here.
[0087] The present invention obtains a pair of point cloud images, selects preset pixel key points on the target image in the point cloud image pair, selects corresponding preset laser key points in the laser point cloud front view in the point cloud image pair, controls the preset calibration plate to translate and rotate in multiple directions to make the collected data more uniform, calculates the rotation matrix R and translation vector t between the laser radar and the camera, and performs extrinsic calibration of the laser radar and the camera according to the rotation matrix R and translation vector t to ensure that the extrinsic calibration result is accurate.
[0088] The present invention uses a checkerboard calibration plate with a white area made of reflective material, which can achieve rapid calibration when the calibration plate posture is changed, effectively reducing the complexity of the calibration process and calculation, and has the advantages of simple operation, fast calibration speed, strong practicality, etc. Changing the calibration plate posture for external parameter calibration effectively improves the calibration accuracy.
[0089] One embodiment of the present invention is an external parameter calibration system, comprising:
[0090] An acquisition module is used to acquire a laser point cloud set and an image set of a preset calibration plate in different postures; the white area of the preset calibration plate is a reflective material;
[0091] A processing module, used for respectively acquiring a laser point cloud front view and a target image of the preset calibration plate in the same posture according to the laser point cloud set and the image set;
[0092] A calculation module, used for obtaining a mapping relationship between a pixel key point and a matching laser key point according to the laser point cloud front view and the target image;
[0093] The calibration module is used to calculate the camera extrinsic parameters and the lidar extrinsic parameters according to the mapping relationship.
[0094] Specifically, this embodiment is a system embodiment corresponding to the above method embodiment. For specific effects, please refer to the above method embodiment, which will not be described one by one here.
[0095] Based on the above embodiment, the processing module includes:
[0096] An acquisition unit is used to extract a board laser point cloud from the laser point cloud set, and acquire a laser point cloud front view in a current posture according to the board laser point cloud; and acquire a target image having the same posture as a preset calibration plate corresponding to the laser point cloud front view;
[0097] The acquisition unit is further used to acquire the laser point cloud front view and target image of the preset calibration plate in the next posture until all the laser point cloud front views and target images in the same posture are acquired.
[0098] Specifically, this embodiment is a system embodiment corresponding to the above method embodiment. For specific effects, please refer to the above method embodiment, which will not be described one by one here.
[0099] Based on the foregoing embodiment, the acquisition unit includes:
[0100] A dense processing subunit, used for performing dense processing on the plate surface laser point cloud to obtain a dense laser point cloud in a current posture;
[0101] The extraction subunit is used to perform plane extraction on the dense laser point cloud to obtain the plate surface laser point cloud corresponding to the preset calibration plate in the current posture.
[0102] Specifically, this embodiment is a system embodiment corresponding to the above method embodiment. For specific effects, please refer to the above method embodiment, which will not be described one by one here.
[0103] Based on the foregoing embodiment, the acquisition unit further includes:
[0104] A fitting subunit performs plane fitting on the plate surface laser point cloud to obtain a fitting plane;
[0105] A projection subunit, used for projecting the board surface laser point cloud onto the fitting plane to obtain a target point cloud board surface;
[0106] The processing subunit is used to rotate and rasterize the target point cloud panel based on the ground normal vector to obtain a laser point cloud front view including a plurality of laser point cloud grids; the laser point cloud grid corresponds to the laser reflection intensity of a laser point.
[0107] Specifically, this embodiment is a system embodiment corresponding to the above method embodiment. For specific effects, please refer to the above method embodiment, which will not be described one by one here.
[0108] Based on the above embodiment, the calibration module includes:
[0109] Obtaining the coordinate value of the pixel key point and the laser key point that matches it;
[0110] The machine external parameters and the laser radar external parameters are calculated according to the coordinate values and the mapping relationship.
[0111] Specifically, this embodiment is a system embodiment corresponding to the above method embodiment. For specific effects, please refer to the above method embodiment, which will not be described one by one here.
[0112] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned program modules is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program units or modules to complete all or part of the functions described above. The program modules in the embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into a processing unit, and the above-mentioned integrated unit can be implemented in the form of hardware or in the form of software program units. In addition, the specific names of the program modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application.
[0113] One embodiment of the present invention is a robot, comprising a processor and a memory, wherein the memory is used to store a computer program; the processor is used to execute the computer program stored in the memory to implement the external parameter calibration method in the above-mentioned corresponding method embodiment.
[0114] The robot can be a desktop computer, a notebook, a PDA, a tablet computer, a mobile phone, a human-computer interaction screen and other devices. The robot may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that the above are only examples of robots and do not constitute a limitation on the robot. The robot may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the robot may also include an input / output interface, a display device, a network access device, a communication bus, a communication interface, and the like. The communication interface and the communication bus may also include an input / output interface, wherein the processor, the memory, the input / output interface and the communication interface communicate with each other through the communication bus. The memory stores a computer program, and the processor is used to execute the computer program stored in the memory to implement the external parameter calibration method in the above-mentioned corresponding method embodiment.
[0115] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0116] The memory may be an internal storage unit of the robot, such as a hard disk or memory of a terminal device. The memory may also be an external storage device of the terminal device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device. Furthermore, the memory may include both an internal storage unit and an external storage device of the robot. The memory is used to store the computer program and other programs and data required by the robot. The memory may also be used to temporarily store data that has been output or is to be output.
[0117] The communication bus is a circuit that connects the elements described and implements transmission between these elements. For example, the processor receives commands from other elements through the communication bus, decrypts the received commands, and performs calculations or data processing according to the decrypted commands. The memory may include program modules, such as a kernel, middleware, an application programming interface (API), and an application. The program module may be composed of software, firmware, or hardware, or at least two of them. The input / output interface forwards commands or data entered by the user through the input / output interface (such as a sensor, keyboard, touch screen). The communication interface connects the robot to other network devices, user devices, and networks. For example, the communication interface can be connected to the network via wired or wireless connection to connect to other external network devices or user devices. Wireless communication may include at least one of the following: wireless fidelity (WiFi), Bluetooth (BT), near field communication technology (NFC), global satellite positioning system (GPS), and cellular communication, etc. Wired communication may include at least one of the following: universal serial bus (USB), high-definition multimedia interface (HDMI), asynchronous transmission standard interface (RS-232), etc. The network may be a telecommunications network and a communication network. The communication network may be a computer network, the Internet, the Internet of Things, or a telephone network. The robot may be connected to the network via a communication interface, and the protocol used by the robot to communicate with other network devices may be supported by at least one of an application, an application programming interface (API), a middleware, a kernel, and a communication interface.
[0118] One embodiment of the present invention is a storage medium, in which at least one instruction is stored, and the instruction is loaded and executed by a processor to implement the operations performed by the corresponding embodiment of the above-mentioned external parameter calibration method. For example, the storage medium can be a read-only memory (ROM), a random access memory (RAM), a read-only compact disk (CD-ROM), a magnetic tape, a floppy disk, and an optical data storage device.
[0119] They can be implemented with program codes executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0120] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0121] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed with hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0122] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.
[0123] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0124] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0125] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by sending instructions to related hardware through a computer program. The computer program can be stored in a storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program can be in source code form, object code form, executable file or some intermediate form. The storage medium may include: any entity or device capable of carrying the computer program, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example: in some jurisdictions, according to legislation and patent practice, computer-readable storage media do not include electric carrier signals and telecommunication signals.
[0126] It should be noted that the above embodiments can be freely combined as needed. The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered as the protection scope of the present invention.
Claims
1. A method for extrinsic calibration, It is characterized in that Includes steps: Obtaining a laser point cloud set and an image set of a preset calibration plate in different postures; the white area of the preset calibration plate is a reflective material; According to the laser point cloud set and the image set, respectively obtain a laser point cloud front view and a target image of the preset calibration plate in the same posture, including: extracting a plate surface laser point cloud from the laser point cloud set, and obtaining a laser point cloud front view in the current posture according to the plate surface laser point cloud, including: performing plane fitting on the plate surface laser point cloud to obtain a fitting plane; projecting the plate surface laser point cloud onto the fitting plane to obtain a target point cloud plate surface; rotating and rasterizing the target point cloud plate surface based on a ground normal vector to obtain a laser point cloud front view including a plurality of laser point cloud grids; the laser point cloud grid corresponds to a laser reflection intensity of a laser point; obtaining a target image with the same posture as the preset calibration plate corresponding to the laser point cloud front view; obtaining a laser point cloud front view and a target image of the preset calibration plate in the next posture, until all laser point cloud front views and target images in the same posture are obtained; According to the laser point cloud front view and the target image, a mapping relationship between a pixel key point and a matching laser key point is obtained; The camera extrinsic parameters and the lidar extrinsic parameters are calculated according to the mapping relationship.
2. The external parameter calibration method according to claim 1, It is characterized in that The extracting of the panel laser point cloud from the laser point cloud set comprises the following steps: Densifying the laser point cloud of the plate surface to obtain a dense laser point cloud in a current posture; Perform plane extraction on the dense laser point cloud to obtain a plate surface laser point cloud corresponding to the preset calibration plate in the current posture.
3. The external parameter calibration method according to any one of claims 1 to 2, It is characterized in that The step of calculating the camera extrinsic parameters and the laser radar extrinsic parameters according to the mapping relationship comprises the following steps: Obtaining the coordinate value of the pixel key point and the laser key point that matches it; The machine external parameters and the laser radar external parameters are calculated according to the coordinate values and the mapping relationship.
4. An external parameter calibration system, It is characterized in that include: An acquisition module, used to acquire a laser point cloud set and an image set of a preset calibration plate in different postures; the white area of the preset calibration plate is a reflective material; A processing module, used for respectively acquiring a laser point cloud front view and a target image of the preset calibration plate in the same posture according to the laser point cloud set and the image set; The processing module comprises: An acquisition unit is used to extract a board laser point cloud from the laser point cloud set, and acquire a laser point cloud front view in a current posture according to the board laser point cloud; and acquire a target image having the same posture as a preset calibration plate corresponding to the laser point cloud front view; The acquisition unit is further used to acquire the laser point cloud front view and target image of the preset calibration plate in the next posture, until all the laser point cloud front views and target images in the same posture are acquired; The acquisition unit further includes: A fitting subunit performs plane fitting on the plate surface laser point cloud to obtain a fitting plane; A projection subunit, used for projecting the board surface laser point cloud onto the fitting plane to obtain a target point cloud board surface; A processing subunit is used to rotate and rasterize the target point cloud panel based on the ground normal vector to obtain a laser point cloud front view including a plurality of laser point cloud grids; the laser point cloud grid corresponds to the laser reflection intensity of a laser point; A calculation module, used for obtaining a mapping relationship between a pixel key point and a matching laser key point according to the laser point cloud front view and the target image; The calibration module is used to calculate the camera extrinsic parameters and the lidar extrinsic parameters according to the mapping relationship.
5. The external parameter calibration system according to claim 4, It is characterized in that The acquisition unit comprises: A dense processing subunit, used for performing dense processing on the plate surface laser point cloud to obtain a dense laser point cloud in a current posture; The extraction subunit is used to perform plane extraction on the dense laser point cloud to obtain the plate surface laser point cloud corresponding to the preset calibration plate in the current posture.
6. The external parameter calibration system according to claim 4 or 5, It is characterized in that The calibration module comprises: Obtaining the coordinate value of the pixel key point and the laser key point that matches it; The machine external parameters and the laser radar external parameters are calculated according to the coordinate values and the mapping relationship.
7. A robot, It is characterized in that It includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor is used to execute the computer program stored in the memory to implement the operations performed by the external parameter calibration method according to any one of claims 1 to 3.
8. A storage medium, It is characterized in that The storage medium stores at least one instruction, which is loaded and executed by the processor to implement the operation performed by the external parameter calibration method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Three-dimensional laser scanner and camera calibration method based on geometric constraint
CN109029284A
External parameter calibration system and method, terminal and readable storage medium
CN110189381A
Laser radar and camera calibration method, device and equipment and readable storage medium
CN111965624A
Laser radar and camera combined calibration method and device
CN112230204A
Method, apparatus and computer program for a vehicle
EP3438777A1
