Multi-camera online calibration method, device, electronic device and storage medium

Through the multi-camera online calibration method, using technologies such as panoramic segmentation and inverse perspective mapping, the camera extrinsic parameter pose is determined in real time, which solves the problems of high calibration cost and poor real-time performance in the existing technology, and realizes the calibration of camera extrinsic parameters in autonomous driving technology. Real-time calibration and efficient operation of surround vision algorithms.

CN118628586BActive Publication Date: 2024-10-11ECARX (HUBEI) TECHCO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411102578.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-13
Publication Date
2024-10-11
Estimated Expiration
2044-08-13

AI Technical Summary

Technical Problem

In existing autonomous driving technology, camera external parameter calibration is expensive and cannot be calibrated in real time, making it difficult to meet the real-time needs of surround vision algorithms.

Method used

Through the multi-camera online calibration method, panoramic segmentation, inverse perspective mapping, feature point extraction and three-dimensional point cloud fitting are used to determine the external parameter pose of the camera in real time and reduce calibration costs.

Benefits of technology

It achieves real-time calibration of camera external parameters, reduces calibration costs, and improves the accuracy and efficiency of the surround vision algorithm.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628586B_ABST
    Figure CN118628586B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a multi-camera online calibration method, device, electronic device and storage medium, the method comprising: performing panoramic segmentation on the current image frames taken by multiple cameras respectively to obtain image segmentation results; performing IPM processing on the image segmentation results to obtain an IPM matrix; determining the common view area in the IPM matrix corresponding to the two cameras; obtaining the first feature point and the second feature point in the common view area; respectively determining the positions of the first feature point and the second feature point in the common view area in three-dimensional space to obtain point cloud data; performing plane fitting on the point cloud data corresponding to the second feature point in the segmented area in the image segmentation result to obtain a fitting plane; determining the current relative external parameter pose of the two adjacent cameras based on the point cloud data of the corresponding first feature point in the two adjacent cameras and the fitting plane of the corresponding segmented area. The embodiment of the present application realizes the real-time calibration of camera external parameters and reduces the calibration cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of autonomous driving technology, and in particular to a multi-camera online calibration method, device, electronic device, and storage medium. Background Art

[0002] In the current field of autonomous driving, surround vision has become the standard for urban NOA (Navigate on Autopilot) and automatic parking. When implementing surround vision, the BEV (Bird's Eye View) algorithm is increasingly receiving attention from major manufacturers, and the prerequisite for the BEV algorithm to achieve good results is to have a good external parameter calibration result.

[0003] In the prior art, the calibration of camera extrinsic parameters is generally achieved through a calibration room, but the processing method of the calibration room is costly and the calibration cannot be completed anytime and anywhere. Summary of the invention

[0004] The embodiments of the present application provide a multi-camera online calibration method, device, electronic device and storage medium, which help to reduce calibration costs and achieve real-time calibration.

[0005] In order to solve the above problems, in a first aspect, an embodiment of the present application provides a multi-camera online calibration method, comprising:

[0006] Perform panoramic segmentation on the current image frames taken by multiple cameras respectively to obtain the image segmentation results corresponding to each camera;

[0007] Perform inverse perspective mapping IPM processing on the image segmentation results corresponding to each camera to obtain the IPM matrix corresponding to each camera;

[0008] Determine a common view area in the IPM matrix corresponding to each two adjacent cameras among the multiple cameras, where the two adjacent cameras refer to two cameras that are adjacently located on the vehicle;

[0009] For each camera, a first feature point and a second feature point in the common viewing area are obtained, wherein the first feature point is a feature point located within a preset range of a boundary feature, and the second feature point is a feature point located outside the preset range of the boundary feature;

[0010] Determine positions of a first feature point and a second feature point in the common viewing area in three-dimensional space respectively, and obtain point cloud data corresponding to the camera;

[0011] Performing plane fitting on the point cloud data corresponding to the second feature point in the segmented area in the image segmentation result to obtain a fitting plane corresponding to the segmented area;

[0012] The current relative external parameter pose of the two adjacent cameras is determined according to the point cloud data of the corresponding first feature points in the two adjacent cameras and the fitting plane of the corresponding segmented area.

[0013] In a second aspect, an embodiment of the present application provides a multi-camera online calibration device, comprising:

[0014] A panoramic segmentation module is used to perform panoramic segmentation on the current image frames taken by multiple cameras respectively to obtain the image segmentation results corresponding to each camera;

[0015] An IPM processing module is used to perform inverse perspective mapping IPM processing on the image segmentation results corresponding to each camera to obtain an IPM matrix corresponding to each camera;

[0016] A common viewing area determination module is used to determine a common viewing area in an IPM matrix corresponding to each two adjacent cameras among a plurality of cameras, where the two adjacent cameras refer to two cameras that are adjacent in position on the vehicle;

[0017] A feature point acquisition module, used for acquiring, for each camera, a first feature point and a second feature point in the common view area, wherein the first feature point is a feature point located within a preset range of a boundary feature, and the second feature point is a feature point located outside the preset range of the boundary feature;

[0018] A three-dimensional position determination module, used to respectively determine the positions of the first feature point and the second feature point in the common viewing area in the three-dimensional space, and obtain point cloud data corresponding to the camera;

[0019] A plane fitting module, used for performing plane fitting on the point cloud data corresponding to the second feature point in the segmented area in the image segmentation result to obtain a fitting plane corresponding to the segmented area;

[0020] The external parameter determination module is used to determine the current relative external parameter posture of the two adjacent cameras based on the point cloud data of the corresponding first feature points in the two adjacent cameras and the fitting plane of the corresponding segmented area.

[0021] In a third aspect, an embodiment of the present application further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the multi-camera online calibration method described in the embodiment of the present application is implemented.

[0022] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the program is executed by a processor, the steps of the multi-camera online calibration method disclosed in the embodiment of the present application are performed.

[0023] The multi-camera online calibration method, device, electronic device and storage medium provided in the embodiments of the present application perform panoramic segmentation on the current image frames taken by the multiple cameras respectively to obtain the image segmentation results corresponding to each camera, perform IPM processing on the image segmentation results corresponding to each camera respectively to obtain the IPM matrix corresponding to each camera, determine the common view area in the IPM matrix corresponding to each two adjacent cameras in the multiple cameras, obtain the first feature point and the second feature point in the common view area for each camera, the first feature point is a feature point located within a preset range of the boundary feature, and the second feature point is a feature point located outside the preset range of the boundary feature, and determine the common view area respectively. The positions of the first feature point and the second feature point in the three-dimensional space are obtained to obtain the point cloud data corresponding to the camera, and plane fitting is performed on the point cloud data corresponding to the second feature point in the segmented area in the image segmentation result to obtain the fitting plane corresponding to the segmented area. According to the point cloud data of the corresponding first feature points in the two adjacent cameras and the fitting plane relative to the segmented area, the current relative extrinsic parameter posture of the two adjacent cameras is determined. After panoramic segmentation of the current image frame, different areas in the common view area can be distinguished, and then point features and surface features can be constructed. Based on these features, the camera extrinsic parameters can be determined, thereby realizing real-time calibration of the camera extrinsic parameters and reducing the calibration cost. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0025] Figure 1 is a flow chart of a multi-camera online calibration method provided in an embodiment of the present application;

[0026] Figure 2 is a flow chart of another multi-camera online calibration method provided in an embodiment of the present application;

[0027] Figure 3 It is a structural schematic diagram of a multi-camera online calibration device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0029] Figure 1 1 is a flowchart of a multi-camera online calibration method provided in an embodiment of the present application. The method can be applied to scenarios where real-time calibration of multiple cameras is performed, such as online calibration of multiple cameras on a vehicle. Figure 1 As shown, the method includes: steps 110 to 170.

[0030] Step 110 , performing panoramic segmentation on the current image frames taken by multiple cameras respectively, and obtaining image segmentation results corresponding to each camera.

[0031] The multiple cameras are multiple cameras at different positions on the vehicle. The current image frame is the image frame currently being processed. The current image frame taken by each camera is generally an image from a bird's-eye view.

[0032] For the current image frame taken by each camera, the current image frame is input into the lightweight Mobile Segment Anything Model (MobileSAM), and the current image frame is panorama segmented by the MobileSAM model to obtain the image segmentation result corresponding to the camera. The image segmentation result is a classification labeling of each pixel in the current image frame. An object is divided into one or more segmented areas, and the classification labels of each pixel in each segmented area are the same.

[0033] Among them, MobileSAM is an image segmentation model optimized for mobile devices. The goal of this model is to reduce computational complexity and memory usage while maintaining high-quality segmentation results, so as to run efficiently on mobile devices with limited resources. The MobileSAM model can include a text encoder, an image encoder, a cross-modal attention module, and a decoder; the text encoder is used to convert the input text prompt into a vector representation for combination with image features; the image encoder can be implemented by a pre-trained convolutional neural network, which is used to extract image features in the current image frame and convert the image features into a vector representation; the cross-modal attention module combines text information and image information, and uses the attention mechanism to guide the segmentation process, which can help the model understand which areas in the current image frame the input text prompt is related to; the decoder can be implemented by a fully connected layer or a convolutional layer, which is used to map the output of the cross-modal attention module to the pixel level of image segmentation and generate the final segmentation mask.

[0034] Step 120 , performing inverse perspective mapping IPM processing on the image segmentation results corresponding to each camera respectively, to obtain an IPM matrix corresponding to each camera.

[0035] Among them, IPM (Inverse Perspective Mapping) is an image processing technology used to convert an image from a top-down or bird's-eye view into a direct view.

[0036] IPM processing is performed on the image segmentation results corresponding to each camera respectively. Based on the extrinsic parameter information of the currently processed camera (the extrinsic parameter information is the currently available extrinsic parameter information, which is determined based on the image frame before the current image frame) and the intrinsic parameter information, the image segmentation results from the bird's-eye view are converted into a direct view to obtain the IPM matrix corresponding to the camera.

[0037] Step 130 , determining a common viewing area in the IPM matrix corresponding to each two adjacent cameras among the plurality of cameras, wherein the two adjacent cameras refer to two cameras that are adjacently located on the vehicle.

[0038] The two adjacent cameras are located adjacently on the vehicle and at two different positions. Four cameras may be installed on the vehicle, and the common viewing area refers to the area of ​​the same scene that can be captured by the two cameras at different positions.

[0039] Based on the field of view overlap information of two adjacent cameras, the common viewing area in the IPM matrix corresponding to the two adjacent cameras can be determined. For a camera, the common viewing area between the camera and the adjacent camera is determined in the IPM matrix of the camera, that is, for the same scene, the IPM matrices of the two cameras both include the common viewing area of ​​the scene.

[0040] Step 140: For each camera, obtain a first feature point and a second feature point in the common view area, wherein the first feature point is a feature point located within a preset range of a boundary feature, and the second feature point is a feature point located outside the preset range of the boundary feature.

[0041] The boundary feature refers to the boundary information of each segmented area in the image segmentation result. The first feature point is a feature point located near the boundary feature, and the second feature point is a feature point far from the boundary feature and located inside the segmented area.

[0042] For each camera, feature extraction can be performed on the common viewing area corresponding to the camera to obtain feature points of the common viewing area, and each feature point in the common viewing area can be compared with the boundary features in the IPM matrix to distinguish the first feature point from the second feature point.

[0043] In one embodiment of the present application, for each camera, obtaining the first feature point and the second feature point in the common view area includes: for each camera, performing feature extraction on the common view area corresponding to the camera by using an ORB operator to obtain feature points in the common view area corresponding to the camera; performing expansion processing on the feature boundary in the common view area corresponding to the camera to obtain an expansion area corresponding to the feature boundary, wherein the feature boundary is the boundary of the segmentation area; determining the feature point located in the expansion area as the first feature point, and determining the feature point located outside the expansion area as the second feature point.

[0044] For each camera, the point features of the common view area corresponding to the camera are extracted by the ORB (Oriented FAST and Rotated BRIEF) operator according to the pixel difference, and the feature points in the common view area corresponding to the camera are obtained. Each feature point can be represented by the position and feature description of the feature point. The point features of the common view area are extracted by Oriented FAST, that is, Gaussian blur processing of different scales is performed on the common view area, and the common view area after Gaussian blur processing is downsampled to obtain a multi-layer pyramid image. The common view area and each layer of the pyramid image are subjected to FAST (Features from Accelereated Segments Test) feature point detection, and the feature points in the common view area and each layer of the pyramid image are determined as the feature points of the common view area; the neighborhood of the feature point is selected in the common view area, the grayscale average of each pixel in the neighborhood is calculated, and the pixel point with a grayscale value equal to the grayscale average is taken as the centroid of the neighborhood. The direction of the vector starting from the feature point and ending at the centroid is determined as the direction of the feature point. By determining the direction of the feature point, the feature point has rotation invariance. The feature points are described by binary strings through Rotated BRIEF, that is, a certain number of pixels are randomly selected in the neighborhood of the feature point, the grayscale values ​​of each pair of pixels are compared, and binary values ​​are assigned to the pair of pixels based on the comparison results. After each pair of pixels is assigned, the binary strings of all the pairs of pixels are used as the initial feature description of the feature point. The initial feature description is rotated based on the direction of the feature point to obtain the final feature description of the feature point.

[0045] For each camera, based on the image segmentation result, the feature boundary in the common view area corresponding to the camera is expanded, and the expansion range can be determined using an n×n matrix, that is, each pixel point in the feature boundary is expanded within the expansion range to obtain the expansion area corresponding to the feature boundary. The expansion range is determined based on the above-mentioned preset range.

[0046] After the feature boundary is expanded, it is determined whether each feature point extracted by the ORB operator is located in the expansion area, and the feature point located in the expansion area is determined as the first feature point, which is a feature point located near the feature boundary and is a very obvious feature point, and the feature point located outside the expansion area is determined as the second feature point, which is a feature point far from the feature boundary and is a non-obvious feature point. The purpose of distinguishing the first feature point from the second feature point is to determine whether it is a feature point between different objects (the first feature point) or a feature point of the internal texture of the object (the second feature point).

[0047] By extracting feature points based on the ORB operator and determining the first feature points and the second feature points through dilation processing, the first feature points of the feature boundary and the second feature points of the internal texture of the object can be accurately distinguished, which facilitates the subsequent construction of point feature constraints and surface feature constraints, thereby improving the accuracy of online calibration.

[0048] In another embodiment of the present application, for each camera, obtaining the first feature point and the second feature point in the common view area includes: for each camera, performing optical flow tracking on the first feature point of the camera in the previous image frame to obtain the first feature point in the common view area; performing optical flow tracking on the second feature point of the camera in the previous image frame to obtain the second feature point in the common view area.

[0049] For each camera, the optical flow tracking method is used to complete the feature point tracking between camera image frames, that is, the first feature point in the previous image frame can be optically tracked to obtain the first feature point in the common view area in the current image frame, and the second feature point in the previous image frame can be optically tracked to obtain the second feature point in the common view area in the current image frame.

[0050] Determining the first feature point and the second feature point in the common view area of ​​the current image frame by optical flow tracking can save computing power and avoid repeated selection of a large number of feature points.

[0051] It should be noted that if the number of feature points (including the first feature point and the second feature point) determined based on optical flow tracking is less than the preset feature point number threshold, and online calibration cannot be completed based on these feature points, the above-mentioned ORB operator and expansion processing method are used to determine the first feature point and the second feature point.

[0052] Step 150 , respectively determine the positions of the first feature point and the second feature point in the common viewing area in the three-dimensional space to obtain point cloud data corresponding to the camera.

[0053] Based on the corresponding first feature points of two adjacent cameras in the common viewing area, triangulation is used to restore the first depth information of the first feature point in the three-dimensional space, and the position of the first feature point corresponding to the camera in the three-dimensional space is obtained based on the first feature point and the first depth information in each camera; based on the corresponding second feature points of the two adjacent cameras in the common viewing area, triangulation is used to restore the second depth information of the second feature point in the three-dimensional space, and the position of the second feature point corresponding to the camera in the three-dimensional space is obtained based on the second feature point and the second depth information in each camera; the position of the first feature point corresponding to each camera in the three-dimensional space and the position of the second feature point in the three-dimensional space constitute the point cloud data corresponding to the camera.

[0054] Step 160 , performing plane fitting on the point cloud data corresponding to the second feature point in the segmented area in the image segmentation result, to obtain a fitting plane corresponding to the segmented area.

[0055] For each camera, a plane fitting algorithm is used to perform plane fitting on the point cloud data corresponding to the second feature point located in the same segmented area to obtain a fitting plane corresponding to each segmented area.

[0056] In one embodiment of the present application, the plane fitting of the point cloud data corresponding to the second feature point in the segmented area in the image segmentation result to obtain the fitting plane corresponding to the segmented area includes: using the RANSAC algorithm to perform plane fitting on the point cloud data corresponding to the second feature point in the segmented area in the image segmentation result to obtain an initial plane and outliers and inliers corresponding to the initial plane, wherein the outlier is a second feature point whose distance from the initial plane is outside a preset distance range, and the inlier is a second feature point whose distance from the initial plane is within the preset distance range; when the ratio of the number of outliers to the total number of second feature points in the segmented area is less than or equal to a number ratio threshold, using the principal component analysis method to perform plane fitting on the inliers to obtain the fitting plane corresponding to the segmented area.

[0057] Among them, RANSAC (Random Sample Consensus) is used to process the noise and outliers in the image.

[0058] When the RANSAC algorithm is used to fit the plane of the point cloud data corresponding to the second feature point in the segmented area, all the second feature points in the segmented area are randomly sampled, and the plane is fitted based on the point cloud data of the sampled second feature points to obtain a fitted plane. The point cloud data of the second feature points that are not sampled in the segmented area are used to test the fitted plane, and the number of inliers is determined. If the ratio of the number of inliers to the total number of all the second feature points in the segmented area is greater than or equal to the set threshold, the plane is used as the initial plane. If the ratio of the number of inliers to the total number of all the second feature points in the segmented area is less than the set threshold, the above-mentioned second feature point sampling, plane fitting and fitting operations are iteratively performed until the number of iterations reaches a preset number or the ratio of the number of inliers to the total number is greater than or equal to the set threshold. After iterative processing using the RANSAC algorithm, the optimal fitting plane is finally obtained, and the optimal fitting plane is used as the initial plane. The distance between the second feature point and the initial plane can be determined based on the point cloud data of each second feature point, and the second feature point whose distance is within the preset distance range is determined as an inlier, and the second feature point whose distance is outside the preset distance range is determined as an outlier. The preset distance range may be, for example, 0.05-0.2 m.

[0059] The RANSAC algorithm can remove outliers and gross errors in point cloud data and retain good quality point cloud data (inliers). The ratio of the number of outliers to the total number of second feature points in the segmented area is used to determine whether the initial plane obtained by fitting is a good plane. If the ratio is greater than the set number ratio threshold, it is considered that the fit is not good, that is, it is not a very good plane. If the ratio is less than or equal to the number ratio threshold, it is considered that the quality of the initial plane fitting is good. For example, the number ratio threshold can be 20%, 30%, 40%, etc. When the number ratio threshold is 20%, if the number of outliers accounts for more than 20% of the total, it is considered not to be a good plane.

[0060] When the initial plane is of good quality, the principal component analysis (PCA) method is used to fit the interior points to obtain a fitting plane corresponding to the segmented area, and the eigenvector with the smallest eigenvalue is selected as the normal vector of the fitting plane. The plane equation of the fitting plane can be expressed as π=[ n T ,d ] T ,in n is a normal vector, representing the normal line of the fitted plane, d Is a real number, representing the signed distance from the fitting plane to the origin. The distance can be calculated using the normal vector and a point on the fitting plane, using the distance formula from the origin to the fitting plane. d=-ax-by-cz , where (a,b,c) are the components of the normal vector, and (x,y,z) are the coordinates of the point on the fitted plane (such as the center of mass). In this way, the plane equation of the fitted plane corresponding to the current camera viewing angle is obtained.

[0061] By using the RANSAC algorithm to screen the internal points and remove the outliers, and then performing plane fitting based on the principal component analysis method, the accuracy of the fitting plane can be improved, thereby improving the accuracy of the online calibration.

[0062] Step 170: Determine the current relative extrinsic reference pose of the two adjacent cameras based on the point cloud data of the corresponding first feature points in the two adjacent cameras and the fitting plane of the corresponding segmented area.

[0063] According to the correspondence between the feature points in the common view area in the two cameras, the first residual information of the corresponding first feature point in the point cloud data of the two adjacent cameras is determined, and the second residual information of the fitting plane for the corresponding segmented area in the two adjacent cameras is determined. Based on the first residual information and the second residual information, the least squares constraint is constructed, and the relative extrinsic parameter pose of the two adjacent cameras is calculated using the least squares method.

[0064] It should be noted that if after the above processing, there is no point feature, that is, no first feature point, only surface feature (fitting plane), then it is necessary to measure whether there are normal vector constraint features in multiple directions, that is, to determine whether there are planes in different directions. If there are normal vector constraint features in multiple directions, it is determined that the surface features are sufficiently constrained, and the relative extrinsic parameter pose can be determined directly based on the surface features. If there are no normal vector constraint features in multiple directions, then the final relative extrinsic parameter pose result is under-constrained, and the result is not output.

[0065] The multi-camera online calibration method provided by the embodiment of the present application performs panoramic segmentation on the current image frames taken by multiple cameras respectively to obtain the image segmentation results corresponding to each camera, performs IPM processing on the image segmentation results corresponding to each camera respectively to obtain the IPM matrix corresponding to each camera, determines the common view area in the IPM matrix corresponding to each two adjacent cameras in the multiple cameras, obtains the first feature point and the second feature point in the common view area for each camera, the first feature point is a feature point located within a preset range of the boundary feature, and the second feature point is a feature point located outside the preset range of the boundary feature, determines the positions of the first feature point and the second feature point in the common view area in three-dimensional space respectively, obtains the point cloud data corresponding to the camera, performs plane fitting on the point cloud data corresponding to the second feature point in the segmented area in the image segmentation result, obtains the fitting plane corresponding to the segmented area, determines the current relative extrinsic parameter pose of the two adjacent cameras according to the point cloud data of the corresponding first feature points in the two adjacent cameras and the fitting plane relative to the segmented area, because after performing panoramic segmentation on the current image frame, different areas in the common view area can be distinguished, and then point features and surface features can be constructed, and the camera extrinsics can be determined based on these features, thereby realizing real-time calibration of the camera extrinsics and reducing the calibration cost.

[0066] On the basis of the above technical solution, after determining the current relative extrinsic parameter pose of the two adjacent cameras based on the point cloud data for the same first feature point in the two adjacent cameras and the fitting plane for the same segmented area, it also includes: comparing the current relative extrinsic parameter pose of the two adjacent cameras with the fluctuation value of the relative extrinsic parameter pose determined based on the previous image frame, when the fluctuation value is less than or equal to the fluctuation threshold, storing the current relative extrinsic parameter pose in a queue and updating a counter; when the count value of the counter reaches the target count value, updating the extrinsic parameter information of the camera in the vehicle according to the relative extrinsic parameter pose in the queue.

[0067] After determining the current relative extrinsic parameter pose of each two adjacent cameras, the extrinsic parameter information of the camera in the vehicle will not be directly updated. Instead, the difference between the current relative extrinsic parameter pose and the relative extrinsic parameter pose determined based on the previous image frame is determined to obtain a fluctuation value, which includes a position difference and an attitude difference. The fluctuation value is compared with a fluctuation threshold, which includes a position threshold and an attitude threshold. If the position difference is less than or equal to the position threshold and the attitude difference is less than or equal to the attitude threshold, the current relative extrinsic parameter pose is considered valid, the current relative extrinsic parameter pose is stored in a queue, and the counter is updated, that is, the counter is increased by 1 based on the original count value. If the position difference is greater than the position threshold or the attitude difference is greater than the attitude threshold, it is considered that the determined current relative extrinsic parameter pose fluctuates greatly, and the current relative extrinsic parameter pose is invalid.

[0068] When the count value of the counter reaches the target count value, the external parameter information of the camera in the vehicle is updated according to the relative external parameter pose in the queue. Exemplarily, for each camera, the relative external parameter pose of the camera and another camera in the queue is averaged, and the average value is used to update the external parameter information of the camera in the vehicle relative to another camera.

[0069] By updating the counter when the fluctuation value is less than or equal to the fluctuation threshold, the stability of the data in the calibration phase can be ensured. An external parameter result can be calculated every certain period of time (such as every second), and the external parameter result is stable during the entire counting process.

[0070] Figure 2 is a flow chart of another multi-camera online calibration method provided in an embodiment of the present application. Figure 2 As shown, the method includes: steps 210 to 280.

[0071] Step 210 , performing panoramic segmentation on the current image frames taken by multiple cameras respectively, and obtaining image segmentation results corresponding to each camera.

[0072] Step 220 , performing inverse perspective mapping IPM processing on the image segmentation results corresponding to each camera respectively, to obtain an IPM matrix corresponding to each camera.

[0073] Step 230 , determining a common viewing area in the IPM matrix corresponding to each two adjacent cameras among the plurality of cameras, wherein the two adjacent cameras refer to two cameras that are adjacently located on the vehicle.

[0074] Step 240: For each camera, obtain a first feature point and a second feature point in the common view area, wherein the first feature point is a feature point located within a preset range of a boundary feature, and the second feature point is a feature point located outside the preset range of the boundary feature.

[0075] Step 250 , respectively determine the positions of the first feature point and the second feature point in the common viewing area in the three-dimensional space to obtain point cloud data corresponding to the camera.

[0076] Step 260 , performing plane fitting on the point cloud data corresponding to the second feature point in the segmented area in the image segmentation result, to obtain a fitting plane corresponding to the segmented area.

[0077] Step 270, for each camera, determine the minimum bounding rectangle of each segmented area in the IPM matrix, and when the intersection-and-annex ratio of the segmented area to the minimum bounding rectangle is greater than the intersection-and-annex ratio threshold, perform straight line fitting on the pixel points in the segmented area to obtain a fitting line segment.

[0078] For a camera, after determining the common view area, for each segmented area in the common view area of ​​the IPM matrix, determine the minimum bounding rectangle, and calculate the intersection and union ratio of the segmented area and the minimum bounding rectangle. If the intersection and union ratio is less than or equal to the intersection and union ratio threshold, it is considered that the match fails and the feature is not used. If the intersection and union ratio is greater than the intersection and union ratio threshold, it is determined that there are line features (such as lane lines) in the segmented area. At this time, the segmented area can be skeletonized, the center line can be extracted, and the straight line fitting method of OpenCV can be used to fit the pixels within a certain range of the center line in the segmented area to obtain the fitted line segment.

[0079] Step 280 , determining the current relative extrinsic parameter pose of the two adjacent cameras according to the point cloud data of the corresponding first feature points in the two adjacent cameras, the fitting plane of the corresponding segmented area, and the fitting line segment of the corresponding segmented area.

[0080] The current relative external parameter pose of two adjacent cameras is determined by combining point features (first feature points), surface features (fitted planes) and line features (fitted line segments).

[0081] In one embodiment of the present application, the current relative external parameter pose of the two adjacent cameras is determined based on the point cloud data of the corresponding first feature points in the two adjacent cameras, the fitting planes of the corresponding segmented areas, and the fitting line segments of the corresponding segmented areas, including: determining first residual information of the corresponding first feature points in the point cloud data of the two adjacent cameras; determining second residual information of the fitting planes of the corresponding segmented areas in the two adjacent cameras; determining third residual information of the fitting line segments of the corresponding segmented areas in the two adjacent cameras; and determining the current relative external parameter pose of the two adjacent cameras based on the first residual information, the second residual information, and the third residual information.

[0082] For point features, according to the correspondence between the feature points in the common view area in the two cameras, the positions of the corresponding first feature points in the two cameras should be consistent, based on which the first residual information of the corresponding first feature points in two adjacent cameras can be determined.

[0083] For surface features, according to the correspondence between each segmented area in the common view area in the two cameras, the positions and directions of the fitting planes of the corresponding segmented areas in the two cameras should be consistent. Based on this, the second residual information between the fitting planes of the corresponding segmented areas in two adjacent cameras can be determined.

[0084] For line features, the endpoints method is used. When the above-mentioned intersection ratio conditions are met, at the same scale, the positions and lengths of the two fitted line segments (line features observed by two cameras respectively) are basically consistent. Based on this, the third residual information between the fitted line segments of the corresponding segmented areas in two adjacent cameras can be determined.

[0085] A least square constraint is constructed based on the first residual information, the second residual information and the third residual information, and the current relative extrinsic parameter pose of two adjacent cameras is calculated using the least square method.

[0086] The multi-camera online calibration method provided in the embodiment of the present application further introduces line features on the basis of point features and surface features. In this way, when point features, surface features and line features exist at the same time, online calibration is performed by combining point features, surface features and line features, which can further improve the accuracy of camera extrinsic calibration. In addition, online calibration can also be achieved when one or two of the point features, surface features and line features are missing.

[0087] On the basis of the above technical solution, before determining the current relative external parameter pose of the two adjacent cameras according to the point cloud data of the corresponding first feature points in the two adjacent cameras, the fitting plane of the corresponding segmented area, and the fitting line segment of the corresponding segmented area, it also includes: for the fitting line segments of the corresponding segmented areas in the two adjacent cameras, determining the number of different pixels of the two fitting line segments and the length ratio of the two fitting line segments; if the number of different pixels is greater than the number threshold and the length ratio is less than the length ratio threshold, discarding the fitting line segment.

[0088] When the above-mentioned intersection-over-combination ratio conditions are met, at the same scale, the positions and lengths of the two fitting line segments (line features observed by the two cameras respectively) are basically consistent. Based on this, the fitting line segments of the corresponding segmented areas in the two adjacent cameras are compared to determine the number of different pixels in the two fitting line segments and the length ratio of the two fitting line segments. If the number of different pixels is greater than the number threshold or the length ratio is less than the length ratio threshold, the fitting line segment is discarded, that is, the fitting line segment is not used as the calibrated line feature. Otherwise, the fitting line segment is retained and the retained fitting line segment is used as the calibrated line feature. Among them, the number of different pixels is n, and the length ratio threshold is 5 / n. For example, the line segments with positive and negative pixels (different pixels) exceeding 10 pixels and the line segments with a length ratio less than 0.5 are discarded.

[0089] By discarding line segments whose number of different pixels is greater than the number threshold or whose length ratio is less than the length ratio threshold, false detection can be prevented.

[0090] Figure 3is a schematic diagram of the structure of a multi-camera online calibration device provided in an embodiment of the present application, such as Figure 3 As shown, the device comprises:

[0091] A panoramic segmentation module 310 is used to perform panoramic segmentation on the current image frames taken by multiple cameras respectively to obtain image segmentation results corresponding to each camera;

[0092] An IPM processing module 320 is used to perform inverse perspective mapping IPM processing on the image segmentation results corresponding to each camera to obtain an IPM matrix corresponding to each camera;

[0093] A common view area determination module 330 is used to determine a common view area in an IPM matrix corresponding to each two adjacent cameras among the plurality of cameras, where the two adjacent cameras refer to two cameras that are adjacently located on the vehicle;

[0094] A feature point acquisition module 340 is used to acquire, for each camera, a first feature point and a second feature point in the common view area, wherein the first feature point is a feature point located within a preset range of a boundary feature, and the second feature point is a feature point located outside the preset range of the boundary feature;

[0095] A three-dimensional position determination module 350 is used to respectively determine the positions of the first feature point and the second feature point in the common viewing area in the three-dimensional space to obtain point cloud data corresponding to the camera;

[0096] A plane fitting module 360 ​​is used to perform plane fitting on the point cloud data corresponding to the second feature point in the segmented area in the image segmentation result to obtain a fitting plane corresponding to the segmented area;

[0097] The extrinsic parameter determination module 370 is used to determine the current relative extrinsic parameter pose of the two adjacent cameras according to the point cloud data of the corresponding first feature points in the two adjacent cameras and the fitting plane of the corresponding segmented area.

[0098] Optionally, the feature point acquisition module includes:

[0099] A feature extraction unit, configured to extract features of a common viewing area corresponding to each camera by using an ORB operator to obtain feature points in the common viewing area corresponding to the camera;

[0100] A dilation processing unit, configured to dilate a feature boundary in the common view area corresponding to the camera to obtain a dilated area corresponding to the feature boundary, wherein the feature boundary is a boundary of a segmented area;

[0101] The feature point distinguishing unit is used to determine the feature points located in the expansion area as first feature points, and determine the feature points located outside the expansion area as second feature points.

[0102] Optionally, the feature point acquisition module includes:

[0103] A first optical flow tracking unit is used to perform optical flow tracking on a first feature point of each camera in a previous image frame to obtain a first feature point in the common view area;

[0104] The second optical flow tracking unit is used to perform optical flow tracking on the second feature point of the camera in the previous image frame to obtain the second feature point in the common viewing area.

[0105] Optionally, the device further comprises:

[0106] A straight line fitting module, used for determining the minimum bounding rectangle of each segmented area in the IPM matrix for each camera, and performing straight line fitting on the pixel points in the segmented area when the intersection-and-union ratio between the segmented area and the minimum bounding rectangle is greater than an intersection-and-union ratio threshold to obtain a fitting line segment;

[0107] The external parameter determination module is specifically used for:

[0108] The current relative external parameter pose of the two adjacent cameras is determined according to the point cloud data of the corresponding first feature points in the two adjacent cameras, the fitting plane of the corresponding segmented area, and the fitting line segment of the corresponding segmented area.

[0109] Optionally, the device further comprises:

[0110] A fitting line segment comparison module, for determining, for the fitting line segments of the corresponding segmented areas in two adjacent cameras, the number of different pixels between the two fitting line segments and the length ratio of the two fitting line segments;

[0111] The fitting line segment discarding module is used to discard the fitting line segment if the number of different pixels is greater than a number threshold or the length ratio is less than a length ratio threshold.

[0112] Optionally, the external parameter determination module includes:

[0113] A first residual determination unit, used to determine first residual information of first feature points corresponding to point cloud data of two adjacent cameras;

[0114] A second residual determination unit, used to determine second residual information of a fitting plane of a corresponding segmented area in two adjacent cameras;

[0115] A third residual determination unit, used to determine third residual information of the fitting line segments of the corresponding segmented areas in two adjacent cameras;

[0116] An extrinsic parameter determination unit is used to determine the current relative extrinsic parameter posture of the two adjacent cameras according to the first residual information, the second residual information and the third residual information.

[0117] Optionally, the plane fitting module includes:

[0118] A first plane fitting unit is used to perform plane fitting on the point cloud data corresponding to the second feature point in the segmentation area in the image segmentation result by using a RANSAC algorithm to obtain an initial plane and outliers and inliers corresponding to the initial plane, wherein the outliers are second feature points whose distance from the initial plane is outside a preset distance range, and the inliers are second feature points whose distance from the initial plane is within the preset distance range;

[0119] The second plane fitting unit is used to use the principal component analysis method to perform plane fitting on the internal points when the ratio of the number of the outliers to the total number of the second feature points in the segmented area is less than or equal to the number ratio threshold, so as to obtain a fitting plane corresponding to the segmented area.

[0120] Optionally, the device further comprises:

[0121] An external parameter saving module, used for comparing the current relative external parameter pose of the two adjacent cameras with the fluctuation value of the relative external parameter pose determined based on the previous image frame, and when the fluctuation value is less than or equal to the fluctuation threshold, storing the current relative external parameter pose in a queue and updating a counter;

[0122] The external parameter updating module is used to update the external parameter information of the camera in the vehicle according to the relative external parameter posture in the queue when the count value of the counter reaches the target count value.

[0123] The multi-camera online calibration device provided in the embodiment of the present application is used to implement the various steps of the multi-camera online calibration method described in the embodiment of the present application. The specific implementation methods of each module of the device refer to the corresponding steps and will not be repeated here.

[0124] The multi-camera online calibration device provided by the embodiment of the present application performs panoramic segmentation on the current image frames taken by multiple cameras respectively to obtain the image segmentation results corresponding to each camera, performs IPM processing on the image segmentation results corresponding to each camera respectively to obtain the IPM matrix corresponding to each camera, determines the common view area in the IPM matrix corresponding to each two adjacent cameras in the multiple cameras, obtains the first feature point and the second feature point in the common view area for each camera, the first feature point is a feature point located within a preset range of the boundary feature, and the second feature point is a feature point located outside the preset range of the boundary feature, determines the positions of the first feature point and the second feature point in the common view area in three-dimensional space respectively, obtains the point cloud data corresponding to the camera, performs plane fitting on the point cloud data corresponding to the second feature point in the segmented area in the image segmentation result, obtains the fitting plane corresponding to the segmented area, determines the current relative extrinsic parameter pose of the two adjacent cameras according to the point cloud data of the corresponding first feature points in the two adjacent cameras and the fitting plane relative to the segmented area, because after performing panoramic segmentation on the current image frame, different areas in the common view area can be distinguished, and then point features and surface features can be constructed, and the camera extrinsics can be determined based on these features, thereby realizing real-time calibration of the camera extrinsics and reducing the calibration cost.

[0125] Accordingly, an embodiment of the present application further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the multi-camera online calibration method as described in the embodiment of the present application is implemented. The electronic device may be a vehicle-mounted terminal, etc.

[0126] The embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the multi-camera online calibration method described in the embodiment of the present application are implemented.

[0127] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0128] The above is a detailed introduction to a multi-camera online calibration method, device, electronic device and storage medium provided in an embodiment of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

[0129] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

Claims

1. A multi-camera online calibration method, characterized in that: include: Perform panoramic segmentation on the current image frames taken by multiple cameras respectively to obtain the image segmentation results corresponding to each camera; Perform inverse perspective mapping IPM processing on the image segmentation results corresponding to each camera to obtain the IPM matrix corresponding to each camera; Determine a common view area in the IPM matrix corresponding to each two adjacent cameras among the multiple cameras, where the two adjacent cameras refer to two cameras that are adjacently located on the vehicle; For each camera, a first feature point and a second feature point in the common viewing area are obtained, wherein the first feature point is a feature point located within a preset range of a boundary feature, and the second feature point is a feature point located outside the preset range of the boundary feature; Determine positions of a first feature point and a second feature point in the common viewing area in three-dimensional space respectively, and obtain point cloud data corresponding to the camera; Performing plane fitting on the point cloud data corresponding to the second feature point in the segmented area in the image segmentation result to obtain a fitting plane corresponding to the segmented area; The current relative external parameter pose of the two adjacent cameras is determined according to the point cloud data of the corresponding first feature points in the two adjacent cameras and the fitting plane of the corresponding segmented area.

2. The method according to claim 1, characterized in that The step of acquiring the first feature point and the second feature point in the common viewing area for each camera includes: For each camera, feature extraction is performed on the common viewing area corresponding to the camera using an ORB operator to obtain feature points in the common viewing area corresponding to the camera; Performing dilation processing on a feature boundary in the common viewing area corresponding to the camera to obtain a dilated area corresponding to the feature boundary, wherein the feature boundary is a boundary of a segmented area; The feature points located within the expansion area are determined as first feature points, and the feature points located outside the expansion area are determined as second feature points.

3. The method according to claim 1, characterized in that The step of acquiring the first feature point and the second feature point in the common viewing area for each camera includes: For each camera, performing optical flow tracking on a first feature point of the camera in a previous image frame to obtain a first feature point in the common view area; Optical flow tracking is performed on the second feature point of the camera in the previous image frame to obtain the second feature point in the common view area.

4. The method according to claim 1, characterized in that: Also includes: For each camera, determine the minimum bounding rectangle of each segmented area in the IPM matrix, and when the intersection-and-union ratio of the segmented area to the minimum bounding rectangle is greater than the intersection-and-union ratio threshold, perform straight line fitting on the pixel points in the segmented area to obtain a fitting line segment; The step of determining the current relative external reference pose of the two adjacent cameras according to the point cloud data of the corresponding first feature points in the two adjacent cameras and the fitting plane of the corresponding segmented area includes: The current relative external parameter pose of the two adjacent cameras is determined according to the point cloud data of the corresponding first feature points in the two adjacent cameras, the fitting plane of the corresponding segmented area, and the fitting line segment of the corresponding segmented area.

5. The method according to claim 4, characterized in that Before determining the current relative external parameter pose of the two adjacent cameras according to the point cloud data of the corresponding first feature points in the two adjacent cameras, the fitting plane of the corresponding segmented area, and the fitting line segment of the corresponding segmented area, the method further includes: For the fitting line segments of the corresponding segmented areas in two adjacent cameras, determine the number of different pixels of the two fitting line segments and the length ratio of the two fitting line segments; If the number of different pixels is greater than a number threshold or the length ratio is less than a length ratio threshold, the fitting line segment is discarded.

6. The method according to claim 4, characterized in that The method of determining the current relative external parameter pose of the two adjacent cameras according to the point cloud data of the corresponding first feature points in the two adjacent cameras, the fitting plane of the corresponding segmented area, and the fitting line segment of the corresponding segmented area includes: Determine first residual information of first feature points corresponding to point cloud data of two adjacent cameras; Determine second residual information of the fitting plane of the corresponding segmented areas in two adjacent cameras; Determine third residual information of the fitting line segments of the corresponding segmentation areas in two adjacent cameras; The current relative extrinsic parameter pose of the two adjacent cameras is determined according to the first residual information, the second residual information and the third residual information.

7. The method according to claim 1, characterized in that The performing plane fitting on the point cloud data corresponding to the second feature point in the segmented area in the image segmentation result to obtain a fitting plane corresponding to the segmented area includes: Using the RANSAC algorithm to perform plane fitting on the point cloud data corresponding to the second feature point in the segmented area in the image segmentation result, an initial plane and outliers and inliers corresponding to the initial plane are obtained, wherein the outliers are second feature points whose distance from the initial plane is outside a preset distance range, and the inliers are second feature points whose distance from the initial plane is within the preset distance range; When the ratio of the number of the outliers to the total number of the second feature points in the segmented area is less than or equal to a quantity ratio threshold, a principal component analysis method is used to perform plane fitting on the interior points to obtain a fitting plane corresponding to the segmented area.

8. The method according to any one of claims 1 to 7, characterized in that: After determining the current relative external parameter pose of the two adjacent cameras according to the point cloud data for the same first feature point in the two adjacent cameras and the fitting plane for the same segmented area, the method further includes: Compare the fluctuation value of the current relative extrinsic parameter pose of the two adjacent cameras with the relative extrinsic parameter pose determined based on the previous image frame, and when the fluctuation value is less than or equal to the fluctuation threshold, store the current relative extrinsic parameter pose in a queue and update the counter; When the count value of the counter reaches the target count value, the external parameter information of the camera in the vehicle is updated according to the relative external parameter position in the queue.

9. A multi-camera online calibration device, characterized in that: include: A panoramic segmentation module is used to perform panoramic segmentation on the current image frames taken by multiple cameras respectively to obtain the image segmentation results corresponding to each camera; An IPM processing module is used to perform inverse perspective mapping IPM processing on the image segmentation results corresponding to each camera to obtain an IPM matrix corresponding to each camera; A common viewing area determination module is used to determine a common viewing area in an IPM matrix corresponding to each two adjacent cameras among a plurality of cameras, where the two adjacent cameras refer to two cameras that are adjacent in position on the vehicle; A feature point acquisition module, used for acquiring, for each camera, a first feature point and a second feature point in the common view area, wherein the first feature point is a feature point located within a preset range of a boundary feature, and the second feature point is a feature point located outside the preset range of the boundary feature; A three-dimensional position determination module, used to respectively determine the positions of the first feature point and the second feature point in the common viewing area in the three-dimensional space, and obtain point cloud data corresponding to the camera; A plane fitting module, used for performing plane fitting on the point cloud data corresponding to the second feature point in the segmented area in the image segmentation result, to obtain a fitting plane corresponding to the segmented area; The external parameter determination module is used to determine the current relative external parameter posture of the two adjacent cameras based on the point cloud data of the corresponding first feature points in the two adjacent cameras and the fitting plane of the corresponding segmented area.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the multi-camera online calibration method according to any one of claims 1 to 8 is implemented.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the multi-camera online calibration method described in any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Vehicle-mounted camera self-calibration method and device, electronic equipment and storage medium

    CN115546313A

  • Camera IPM calibration method and system

    CN115719389A

  • Around view camera calibration method and device, electronic equipment and storage medium

    CN117315046A

  • Online vehicle camera calibration based on continuity of features

    WO2012143036A1

  • Calibration method and apparatus

    WO2024012405A1