Calibration method, device and storage medium for vehicle-mounted camera
By setting up a first calibration object and a second calibration object on the vehicle to construct a calibration scene, and utilizing the known relationship between the first calibration object and the vehicle coordinate system, the calibration process of the vehicle-mounted camera is simplified, solving the problems of complex and inefficient calibration in the prior art, and realizing efficient vehicle-mounted camera calibration.
Patent Information
- Application Number
- CN202311479143.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-07
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2043-11-07
AI Technical Summary
In the existing technology, the after-sales calibration process of vehicle-mounted cameras is complex and inefficient, requiring professional personnel to perform it in a high-precision calibration environment, making it difficult to efficiently and accurately calibrate vehicle-mounted cameras.
A calibration scene is constructed by setting up a first calibration object and a second calibration object on the vehicle. Image information is obtained through target detection. The calibration parameters of the vehicle camera are determined by using the known relationship between the first calibration object and the vehicle coordinate system, combined with the pose parameters of the second calibration object, thus simplifying the camera calibration process.
The vehicle-mounted camera can be accurately calibrated without the need for precise placement of a second calibration object, which improves calibration efficiency, simplifies the calibration process, and reduces reliance on professional personnel.
Smart Images

Figure CN117541659B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of camera calibration technology, and in particular to a calibration method, apparatus and storage medium for a vehicle-mounted camera. Background Technology
[0002] Camera calibration is an important branch of computer vision. It is currently being used in autonomous driving and 3D...
[0003] It is widely used in fields such as vision.
[0004] After a vehicle is sold, accidents or prolonged driving can cause damage to the vehicle's onboard camera.
[0005] The external parameters have changed, so the camera needs to be recalibrated. However, currently, camera calibration during the after-sales process requires professional personnel to perform calibration in a high-precision calibration environment. The calibration process is complex.
[0006] The calibration process is complex and inefficient. Therefore, how can we improve the efficiency of camera calibration while ensuring accuracy?
[0007] The efficiency of camera calibration has become an urgent problem to be solved. Summary of the Invention
[0008] The main technical problem addressed in this application is to provide a calibration method and device for vehicle-mounted cameras.
[0009] And storage media, which can improve the calibration efficiency of vehicle-mounted cameras.
[0010] To solve the above-mentioned technical problems, one technical solution adopted in this application is: to provide a vehicle
[0011] A calibration method for a vehicle-mounted camera, the method comprising: acquiring images captured by the vehicle-mounted camera in the target calibration scene.
[0012] The target image; the target calibration scene consists of a first calibration object, a second calibration object, and a vehicle.
[0013] The calibration scene is constructed, and the first calibration object is set on the vehicle; the target image includes the first calibration object.
[0014] The first sub-image corresponding to a calibration object, and the second sub-image corresponding to a second calibration object; for the...
[0015] The target image is subjected to target detection to obtain the target detection result of the target image; the target...
[0016] The target detection result includes the first pose parameter between the first sub-image and the second sub-image.
[0017] Number; based on the first pose parameters, and the pre-acquired first calibration object and the vehicle
[0018] The second pose parameter between the vehicle coordinate system and the vehicle coordinate system is used to determine the third pose parameter between the second calibration object and the vehicle coordinate system; the vehicle-mounted camera is calibrated based at least on the third pose parameter to obtain the target calibration parameter of the vehicle-mounted camera.
[0019] The target detection result further includes the first position of each feature point on the second calibrated object in the second sub-image; the step of calibrating the vehicle camera at least based on the third pose parameter to obtain the target calibration parameters of the vehicle camera includes: calibrating the vehicle camera based on the first position of each feature point and the third pose parameter to obtain the target calibration parameters.
[0020] Wherein, the vehicle-mounted camera is a surround-view camera, and the target calibration parameters include a first target calibration parameter of the vehicle-mounted camera relative to the vehicle coordinate system; the calibration of the vehicle-mounted camera based on the first position and the third pose parameter of each feature point to obtain the target calibration parameters includes: performing a first coordinate transformation on each feature point based on the third pose parameter to obtain a second position of each feature point in the vehicle coordinate system; and optimizing the calibration parameters of the vehicle-mounted camera to be optimized based on the first position, the second position, and the preset calibration intrinsic parameters of the vehicle-mounted camera to obtain the first target calibration parameters.
[0021] The step of optimizing the calibration parameters of the surround-view camera based on the first position of each feature point, the second position of each feature point, and the preset calibration intrinsic parameters of the surround-view camera to obtain the first target calibration parameters includes: performing a second coordinate transformation on each feature point based on the second position of each feature point and the calibration parameters to be optimized to obtain a third position of each feature point in camera coordinates; projecting each feature point based on the third position of each feature point and the preset calibration intrinsic parameters to obtain a fourth position of each feature point projected onto the target image; and optimizing the calibration parameters to be optimized based on the difference between the first position and the corresponding fourth position of each feature point to obtain the first target calibration parameters.
[0022] Wherein, the vehicle-mounted camera is a driving camera, and the target calibration parameters include the second target calibration parameters of the vehicle-mounted camera; the calibration of the vehicle-mounted camera based on the first position and the third pose parameters of each feature point to obtain the target calibration parameters includes: performing linear fitting using the first position of each feature point to obtain a plurality of first straight lines; determining at least one pair of target parallel lines from the second calibration object based on the plurality of first straight lines and the third pose parameters between the second calibration object and the vehicle coordinate system; two second straight lines in each pair of target parallel lines are parallel to each other; determining at least one pair of target straight lines projected onto the target image by the at least one pair of target parallel lines; two third straight lines in each pair of target straight lines are the straight lines projected onto the target image by the two second straight lines in the corresponding pair of target parallel lines; calibrating the vehicle-mounted camera based on the intersection of the two third straight lines in the at least one pair of target straight lines to obtain the second target calibration parameters of the vehicle-mounted camera.
[0023] The target parallel line pair includes at least one of a first parallel line pair and a second parallel line pair; wherein each second straight line in the first parallel line pair is parallel to the target axis of the vehicle coordinate system, and each second straight line in the second parallel line pair is not parallel to the target axis.
[0024] The target line pair includes at least one of the following: a first target line pair projected onto the target image by the first parallel line pair, and a second target line pair projected onto the target image by the second parallel line pair; the second target calibration parameters include at least one of the heading angle, pitch angle, and roll angle of the vehicle-mounted camera; calibrating the vehicle-mounted camera based on the intersection point of two third lines in the at least one set of target line pairs to obtain the second target calibration parameters of the vehicle-mounted camera includes at least one of the following steps: performing a first preset calculation based on the coordinates of the first intersection point of two third lines in the first target line pair and the coordinates of the center point of the target image to determine the heading angle and / or the pitch angle of the vehicle-mounted camera; performing a second preset calculation based on the coordinates of the first intersection point, the coordinates of the second intersection point of two third lines in the second target line pair, and the coordinates of the center point of the target image to determine the roll angle of the vehicle-mounted camera.
[0025] The first calibration object is a QR code calibration board, and the second calibration object is a calibration cloth including several chessboard patterns, wherein the feature points are the corner points of the chessboard patterns.
[0026] To solve the above-mentioned technical problems, another technical solution adopted in this application is: to provide an electronic device, including a memory and a processor coupled to each other, wherein the memory stores program instructions; and the processor is used to execute the program instructions stored in the memory to implement the above-mentioned method.
[0027] To solve the above-mentioned technical problems, another technical solution adopted in this application is to provide a computer-readable storage medium for storing program instructions that can be executed to implement the above-mentioned method.
[0028] The above scheme simultaneously uses a first calibration object and a second calibration object to calibrate the vehicle-mounted camera. Since the first calibration object is located on the vehicle, the second pose parameter between the first calibration object and the vehicle coordinate system can be accurately determined in advance based on the placement position of the first calibration object on the vehicle and the vehicle parameters. Then, combining the second pose parameter with the first pose parameter obtained from the detection of the target image (first sub-image and second sub-image), the third pose parameter between the second calibration object and the vehicle coordinate system is determined. Because this application uses a first calibration object on the vehicle with a known positional relationship to the vehicle coordinate system, the third pose parameter between the second calibration object and the vehicle coordinate system can be accurately determined based on the first and second pose parameters, regardless of whether the second calibration object is precisely placed. Compared to calibrating the camera by precisely placing the second calibration object, this camera calibration method does not require precise placement of the second calibration object, thus saving time and improving the efficiency of camera calibration. Attached Figure Description
[0029] Figure 1 This is a schematic flowchart of an embodiment of the calibration method for vehicle-mounted cameras provided in this application;
[0030] Figure 2 This is a schematic diagram of an embodiment of the target calibration scenario constructed in this application;
[0031] Figure 3 yes Figure 1 The flowchart of an embodiment of step S14 is shown below;
[0032] Figure 4 yes Figure 3 The flowchart of step S32 shown is a schematic diagram of one embodiment;
[0033] Figure 5 yes Figure 1 A flowchart illustrating another embodiment of step S14 is shown.
[0034] Figure 6 This is a flowchart illustrating another embodiment of the target calibration scenario provided in this application;
[0035] Figure 7This is a schematic diagram of the framework of an embodiment of the electronic device provided in this application;
[0036] Figure 8 This is a schematic diagram of the framework of the computer-readable storage medium provided in this application. Detailed Implementation
[0037] To make the purpose, technical solution and effects of this application clearer and more explicit, the following describes this application in further detail with reference to the accompanying drawings and embodiments.
[0038] Furthermore, if the embodiments of this application involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined with "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the technical solutions of various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed in this application.
[0039] In summary, the vehicle-mounted camera calibration method provided in this application can calibrate cameras for different purposes installed on vehicles. For example, the method in this embodiment can calibrate not only surround-view cameras but also driving cameras. The calibration method of this application involves calibrating an on-vehicle camera within a calibration scene constructed from a first calibration object, a second calibration object, and a vehicle. The first calibration object is located on the vehicle. Since the first calibration object is located on the vehicle, the second pose parameter between the first calibration object and the vehicle's coordinate system can be obtained in advance based on the placement position of the first calibration object on the vehicle and the vehicle's parameters (such as the position and size information of various vehicle components). Furthermore, after the camera acquires the target image of the calibration scene, target detection can be performed on the target image to determine the first pose parameter (relative positional relationship) between the first sub-image corresponding to the first calibration object and the second sub-image corresponding to the second calibration object in the target image. Further, based on the first pose parameter between the images corresponding to the two calibration objects and the pre-determined second pose parameter between the first calibration object and the vehicle's coordinate system, the third pose parameter between the second calibration object and the vehicle coordinate system can be determined. Thus, the on-vehicle camera is calibrated based at least on the third pose parameter to obtain the calibration parameters of the on-vehicle camera.
[0040] It should be noted that the existing calibration method only uses the second calibration object to calibrate the camera. Since camera calibration requires accurately determining the positional relationship between the second calibration object and the vehicle coordinate system, the second calibration object needs to be placed precisely in order to accurately calibrate the camera parameters.
[0041] Unlike other applications, this application's camera calibration method uses both a first calibration object and a second calibration object to calibrate the camera. The first calibration object is placed on the vehicle, so the positional relationship between the first calibration object and the vehicle coordinate system can be obtained in advance based on the placement position of the first calibration object on the vehicle and the vehicle's parameters. Then, the third pose parameter (relative positional relationship) between the second calibration object and the vehicle coordinate system is determined in the above manner. In other words, when the first calibration object is placed on the vehicle, the accuracy of the relative positional relationship between the second calibration object and the vehicle's coordinate system is not affected regardless of whether the second calibration object is precisely placed. Therefore, the calibration method of this application can accurately calibrate the camera without precisely placing the second calibration object.
[0042] Please see Figure 1 , Figure 1 This is a schematic flowchart of an embodiment of the vehicle-mounted camera calibration method provided in this application. It should be noted that if substantially the same result is obtained, this embodiment is not necessarily identical. Figure 1 The illustrated process sequence is limited. For example... Figure 1 As shown, this embodiment includes:
[0043] S11: Acquire the target image captured by the vehicle-mounted camera in the target calibration scene; the target calibration scene is a calibration scene constructed by the first calibration object, the second calibration object and the vehicle, the first calibration object is set on the vehicle, and the target image includes the first sub-image corresponding to the first calibration object and the second sub-image corresponding to the second calibration object.
[0044] This embodiment is used to calibrate a vehicle-mounted camera in a calibration scenario constructed by a first calibration object, a second calibration object, and a vehicle, and obtain the calibration parameters of the vehicle-mounted camera.
[0045] In this embodiment, the target image captured by the vehicle-mounted camera includes a first sub-image corresponding to a first calibration object and a second sub-image corresponding to a second calibration object.
[0046] In some embodiments, the first calibration object is a calibration plate disposed on the vehicle; wherein, the calibration plate may be a QR code calibration plate including a QR code pattern, or other calibration plates including, for example, a checkerboard pattern or a solid circle array pattern; furthermore, the first calibration object can be disposed on the vehicle at any position that facilitates the pre-determining of the second pose parameters between the first calibration object and the vehicle's vehicle coordinate system, and that allows its image to be captured by the vehicle-mounted camera. It should be noted that the vehicle-mounted camera may be multiple cameras, and in order to enable each camera to capture the image of the first calibration object, multiple first calibration objects may be disposed at different positions on the vehicle.
[0047] In one embodiment, to make the front and rear wheels of the vehicle parallel, a profile can be provided on the outer edge of the tire, and then the first calibration object is placed close to the profile on the front and rear wheels of the vehicle; of course, in another embodiment, in order to facilitate the cameras located at the front and rear of the vehicle to capture images of the first calibration object, a profile of suitable size can also be placed on the vehicle body at the front or rear of the vehicle, and then the first calibration object is placed close to the profile on the vehicle body.
[0048] In some embodiments, the second calibration material is a calibration cloth that includes a plurality of calibration patterns; for example, a calibration cloth that includes a plurality of checkerboard patterns, each checkerboard pattern including black and white squares.
[0049] For example, please refer to Figure 2 , Figure 2 This is a schematic diagram of an embodiment of the target calibration scenario constructed in this application. Figure 2 As shown, the target calibration scenario 20 includes a QR code calibration board 21, a calibration cloth 22, a vehicle 23, and a profile 24. Figure 2 In the middle, the calibration cloth 22 has a hollowed-out section. The size of the hollowed-out section can be set according to the approximate size (length and width) of the vehicle so that it can be fitted into the vehicle 23. The profile 24 is set on the outer edge of the tire of the vehicle 23, and the QR code calibration plate 21 is placed on the wheel in close contact with the profile.
[0050] It should be noted that in practical applications, the number of first calibration objects and their placement on the vehicle can be set according to the actual situation. The number of second calibration objects can also be set according to the actual situation. The goal is to enable the camera to be calibrated to acquire the first sub-image corresponding to the first calibration object and the second sub-image corresponding to the second calibration object, and to construct the target calibration scene based on the condition that the positional relationship between the first calibration object and the vehicle can be determined in advance.
[0051] S12: Perform target detection on the target image to obtain the target detection result of the target image; the target detection result includes the first pose parameter between the first sub-image and the second sub-image.
[0052] In this embodiment, a relevant detection model or algorithm can be used to perform target detection on the target image to obtain the target detection result. For example, the perspective three-point algorithm (PnP algorithm), Harris detection algorithm, FAST detection algorithm, or SIFT detection algorithm can be used for target detection.
[0053] In this embodiment, the target detection result includes the first pose parameter between the first sub-image and the second sub-image. In other embodiments, target detection can also be performed as needed to obtain the corresponding target detection result; for example, target detection can also be performed on the target image to obtain the first position of each feature point on the second calibration object in the second sub-image.
[0054] The feature points on the second calibration object are the points that clearly serve as markers in the calibration pattern of the second calibration object. In one embodiment, the calibration pattern of the second calibration object is a black and white checkerboard, and the feature points can be the corner points between the black and white squares in the checkerboard.
[0055] The first pose parameter between the first sub-image and the second sub-image is a parameter used to describe the positional relationship between the first sub-image and the second sub-image. For example, the first pose parameter between the two sub-images can be determined based on the position of the first sub-image in the target image and the position of the second sub-image in the target image. The first pose parameter includes at least one of a rotation parameter and a translation parameter.
[0056] S13: Based on the first pose parameter and the second pose parameter between the first calibration object and the vehicle coordinate system obtained in advance, determine the third pose parameter between the second calibration object and the vehicle coordinate system.
[0057] In one implementation scenario, a first calibration object coordinate system and a vehicle coordinate system corresponding to the first calibration object can be pre-constructed. For the first calibration object, the displacement and rotation parameters between the two can be obtained based on the pre-constructed first calibration object coordinate system and vehicle coordinate system, serving as the second pose parameters between the first calibration object and the vehicle coordinate system. Since the first calibration object is set on the vehicle, the second pose parameters between the first calibration object and the vehicle coordinate system can be accurately determined based on the position of the first calibration object on the vehicle and the vehicle's parameters.
[0058] Furthermore, after determining the first pose parameter between the two sub-images, the third pose parameter between the second calibration object and the vehicle coordinate system can be determined using the first pose parameter and the second pose parameter between the first calibration object and the vehicle coordinate system obtained in advance.
[0059] For example, please refer to the following formula, which can be used to calculate the third pose parameter between the second calibration object and the vehicle coordinate system:
[0060] T b2_v =T b1-b2 *T 1_v
[0061] In the formula, T b2_v T represents the third pose parameter between the second calibration object and the vehicle coordinate system. b1-b2 T represents the first pose parameter between the first sub-image and the second sub-image. 1_v The second pose parameter represents the relationship between the first calibration object and the vehicle's vehicle coordinate system.
[0062] S14: Calibrate the vehicle-mounted camera based on at least the third pose parameter to obtain the target calibration parameters of the vehicle-mounted camera.
[0063] The vehicle-mounted camera in this embodiment can be, but is not limited to, a surround-view camera, or a driving camera or other cameras for different purposes. In one embodiment, the target detection result of the target image obtained in step S12 also includes the first position of each feature point on the second calibration object in the second sub-image. The first position is the coordinate position of the feature point on the second calibration object in the image.
[0064] In this embodiment, step S14 calibrates the vehicle-mounted camera based at least on the third pose parameter to obtain the target calibration parameters of the vehicle-mounted camera, including: calibrating the vehicle-mounted camera based on the first position and the third pose parameter of each feature point to obtain the target calibration parameters. The target calibration parameters of the vehicle-mounted camera can be the first target calibration parameters of the vehicle-mounted camera relative to the vehicle coordinate system (including at least one of rotation parameters and displacement parameters), or the second target calibration parameters of the vehicle-mounted camera relative to the image center point.
[0065] In one embodiment, a first coordinate transformation is first performed on the first position of each feature point based on the third pose parameter to obtain the second position of each feature point in the vehicle coordinate system. Then, based on the first position of each feature point, the second position of each feature point, and the preset calibration intrinsic parameters of the vehicle camera, the calibration parameters to be optimized of the vehicle camera are optimized to obtain the first target calibration parameters of the vehicle camera. Specific calibration methods are described below. Figure 3 The relevant description of the corresponding embodiments.
[0066] In another embodiment, several first straight lines can be obtained by fitting the first positions of each feature point. Then, based on the first straight lines and the third pose parameters between the second calibration object and the vehicle coordinate system, at least one pair of target parallel lines is determined from the second calibration object. In each pair of target parallel lines, two second straight lines are parallel to each other, and the second straight lines are straight lines in physical space (in the vehicle coordinate system or the coordinate system of the second calibration object corresponding to the second calibration object). Then, the target straight line pairs projected onto the target image by the parallel line pairs are determined, and the vehicle camera is calibrated based on the intersection of the target straight line pairs to obtain the second target calibration parameters of the vehicle camera relative to the center point of the target image. Specific calibration methods are described below. Figure 5 The relevant description of the corresponding embodiments.
[0067] The above scheme simultaneously uses a first calibration object and a second calibration object to calibrate the vehicle-mounted camera. Since the first calibration object is located on the vehicle, the second pose parameter between the first calibration object and the vehicle coordinate system can be accurately determined in advance based on the placement position of the first calibration object on the vehicle and the vehicle parameters. Then, combining the second pose parameter with the first pose parameter obtained from the detection of the target image (first sub-image and second sub-image), the third pose parameter between the second calibration object and the vehicle coordinate system is determined. Because this application uses a first calibration object on the vehicle with a known positional relationship to the vehicle coordinate system, the third pose parameter between the second calibration object and the vehicle coordinate system can be accurately determined based on the first and second pose parameters, regardless of whether the second calibration object is precisely placed. Compared to calibrating the camera by precisely placing the second calibration object, this camera calibration method does not require precise placement of the second calibration object, thus saving time and improving the efficiency of camera calibration.
[0068] Please see Figure 3 , Figure 3 yes Figure 1 The diagram shows a flowchart of one embodiment of step S14. It should be noted that if substantially the same result is achieved, this embodiment does not necessarily follow the same pattern. Figure 3 The illustrated process sequence is limited. In this embodiment, the vehicle-mounted camera is calibrated based on the first position and third pose parameters of each feature point to obtain target calibration parameters, including:
[0069] S31: Perform a first coordinate transformation on each feature point based on the third pose parameter to obtain the second position of each feature point in the vehicle coordinate system.
[0070] This embodiment determines the second position of each feature point on the second calibration object in the vehicle coordinate system after determining the third pose parameters between the second calibration object and the vehicle's vehicle coordinate system. Then, by combining the first position of each feature point in the image, the second position in the vehicle coordinate system, and the preset calibration intrinsic parameters of the vehicle camera, the vehicle camera is calibrated to obtain the first target calibration parameters of the vehicle camera relative to the vehicle coordinate system. The calibration method of this embodiment can be used to calibrate surround-view cameras.
[0071] S32: Based on the first position of each feature point, the second position of each feature point, and the preset calibration intrinsic parameters of the vehicle camera, optimize the calibration parameters to be optimized of the vehicle camera to obtain the first target calibration parameters.
[0072] In this embodiment, the calibration parameters to be optimized are the rotation parameters between the vehicle-mounted camera and the vehicle coordinate system, wherein the calibration parameters to be optimized include the rotation parameters and displacement parameters to be optimized.
[0073] In one implementation scenario, calibration parameters to be optimized can be preset. Then, based on the second position of each feature point and the calibration parameters to be optimized, each feature point is converted into a third position in the camera coordinate system. Then, combining the third position of each feature point and the preset calibration intrinsic parameters, the fourth position of each feature point projected onto the target image is determined. Here, the fourth position of each feature point projected onto the target image represents the position of the second calibration object feature point in the target image. The first position of each feature point mentioned earlier is the position of each feature point in the target image determined by target detection. It can be understood that if the preset calibration parameters to be optimized are accurate rotation parameters, the closeness between the fourth position of each feature point and the corresponding first position of each feature point should meet the preset requirements. Therefore, in this implementation scenario, the fourth position of each feature point projected onto the target image can be determined first. Then, based on the difference between the fourth position of each feature point and the corresponding first position of each feature point, the calibration parameters to be optimized are optimized to obtain the target calibration parameters (including rotation parameters and displacement parameters).
[0074] Specifically, please refer to Figure 4 , Figure 4 yes Figure 3 The flowchart of one embodiment of step S32 is shown. In this embodiment, step S32 further includes:
[0075] S41: Based on the second position of each feature point and the calibration parameters to be optimized, perform a second coordinate transformation on each feature point to obtain the third position of each feature point in the camera coordinate system.
[0076] In this embodiment, the calibration parameters to be optimized include rotation parameter R and displacement parameter t. This embodiment is used to optimize rotation parameter R and displacement parameter t based on the difference between the fourth position of each feature point and the first position of the corresponding feature point to obtain the first target calibration parameters.
[0077] For each feature point i, the second position of feature point i in the vehicle coordinate system can be denoted as P. i =[X i ,Y i Z i Then, based on the second position P of feature point i, i =[X i ,Y i Z i Given the calibration parameters R and t to be optimized, perform a second coordinate transformation on each feature point i to obtain the third position of each feature point in the camera coordinate system, which can be denoted as P'. i =[X' i ,Y' i ,Z' i Specifically, please refer to the following formula:
[0078] [X'i ,Y' i ,Z' i ]=R*[X i ,Y i Z i ]+t
[0079] In the formula, [X' i ,Y' i ,Z' i ] represents the third position of feature point i in camera coordinates, [X i ,Y i Z i ] represents the second position of feature point i in the vehicle coordinate system, R is the rotation parameter to be optimized, t is the displacement parameter to be optimized, and both R and t represent the calibration parameters of the vehicle camera.
[0080] S42: Based on the third position of each feature point and the preset calibration parameters, project each feature point to obtain the fourth position of each feature point projected onto the target image.
[0081] In this embodiment, the preset calibration parameters of the vehicle-mounted camera include parameters such as the focal length and optical center of the vehicle-mounted camera. These preset calibration parameters are the parameters that have been calibrated at the time the camera leaves the factory.
[0082] In this embodiment, the third position of each feature point in the camera coordinate system and the preset calibration intrinsic parameters of the vehicle camera can be used to perform preset calculations to obtain the fourth position of each feature point projected onto the target image. For example, please refer to the following formula:
[0083] [u' i ,v' i ]=K*[X' i ,Y' i ]
[0084] In the formula, [u' i ,v' i [X'] represents the fourth position of feature point i projected onto the target image. i ,Y' i [] represents the third position of feature point i in the camera coordinate system, and K is the preset calibration intrinsic parameter of the vehicle camera.
[0085] S43: Based on the difference between the first position and the corresponding fourth position of each feature point, optimize the calibration parameters to be optimized to obtain the target calibration parameters.
[0086] It should be noted that if the pre-set calibration parameters to be optimized are accurate rotation parameters, the fourth position of each feature point should be infinitely close to the first position of the corresponding feature point. Therefore, in this implementation scenario, the fourth position of each feature point projected onto the target image can be determined first. Then, the calibration parameters to be optimized are optimized based on the difference between the fourth position of each feature point and the first position of the corresponding feature point to obtain the first target calibration parameters. Among them, the optimized first target calibration parameters (R and t) are the rotation parameters corresponding to the minimum difference between the fourth position of each feature point and the first position of the corresponding feature point.
[0087] Please see Figure 5 , Figure 5 yes Figure 1 The flowchart of another embodiment of step S14 is shown. It should be noted that if substantially the same result is achieved, this embodiment does not necessarily follow the same pattern. Figure 5 The illustrated process sequence is limited. In this embodiment, the vehicle-mounted camera is calibrated based on the first position and third pose parameters of each feature point to obtain target calibration parameters, including:
[0088] S51: Perform linear fitting using the first position of each feature point to obtain several first straight lines.
[0089] The calibration method in this embodiment can be used to calibrate a vehicle camera.
[0090] In summary, this embodiment mainly utilizes the first position of each feature point to obtain several first straight lines in the target image. Then, based on the several first straight lines in the target image and the third pose parameters between the second calibration object and the vehicle coordinate system, at least one pair of target parallel lines is determined from the second calibration object. Then, at least one pair of target parallel lines is projected onto at least one pair of target straight lines in the target image. The vehicle camera is calibrated based on the intersection of two straight lines in at least one pair of target straight lines to obtain the second target calibration parameters of the vehicle camera.
[0091] It should be noted that the calibration principle of the calibration method in this embodiment is as follows: two parallel lines in physical space have an intersection point in the image. The intersection point of the two parallel lines in physical space is a position that is far away from the camera in physical space. Under normal circumstances, the position of the intersection point should coincide with the position of the image center point. If the position of the camera changes, the position of the intersection point will change. Therefore, the camera can be calibrated according to the positional relationship between the intersection point and the image center point, and the second target calibration parameters of the camera relative to the image center point can be determined.
[0092] As can be seen from the above, the first position of each feature point in the second calibration object in the target image has been determined by target detection. In this embodiment, the first position of each feature point can be used to perform linear fitting to obtain several first straight lines.
[0093] S52: Based on several first straight lines and the third pose parameters between the second calibration object and the vehicle coordinate system, determine at least one pair of target parallel lines from the second calibration object; the two second straight lines in each pair of target parallel lines are parallel to each other.
[0094] The main objective of this embodiment is to determine at least one pair of target parallel lines in the vehicle coordinate system (physical space), wherein the two second straight lines in each pair of target parallel lines are parallel to each other. Based on the at least one pair of target parallel lines in the physical space, at least one pair of target straight lines projected onto the target image is determined. Then, camera calibration is performed based on the intersection of each pair of target straight lines.
[0095] In this embodiment, based on several first straight lines and the third pose parameters between the second calibration object and the vehicle coordinate system, the second straight line corresponding to each first straight line in the vehicle coordinate system can be determined. Then, from several corresponding second straight lines, mutually parallel second straight lines are selected to form each set of target parallel line pairs.
[0096] It should be noted that since the first position of each feature point is known, the equation expression corresponding to each first straight line can be determined through linear fitting. Then, based on the equation expression corresponding to each first straight line and the third pose parameter, the equation expression of the second straight line corresponding to each first straight line in the vehicle coordinate system can be determined. Based on the slope in the equation expression of each second straight line, parallel second straight lines can be found from several corresponding second straight lines to form each set of target parallel line pairs.
[0097] S53: Determine at least one set of target parallel line pairs projected onto at least one set of target line pairs in the target image; the two third lines in each set of target line pairs are the lines in the target image projected onto the two second lines in the corresponding set of target parallel line pairs.
[0098] In one embodiment, using the preset camera intrinsic parameters described above, at least one set of target parallel line pairs projected onto at least one set of target straight line pairs in the target image are determined. Specifically, the two third straight lines in each set of target straight line pairs are the straight lines in the target image projected onto the two second straight lines in the corresponding set of target parallel line pairs.
[0099] In this embodiment, the target parallel line pair includes at least one of a first parallel line pair and a second parallel line pair; wherein, each second straight line in the first parallel line pair is parallel to the target axis of the vehicle coordinate system, and each second straight line in the second parallel line pair is not parallel to the target axis. The target axis of the vehicle coordinate system can be the orientation of the entire vehicle body.
[0100] Correspondingly, the target line pair includes at least one of the first target line pair projected onto the target image by the first parallel line pair and the second target line pair projected onto the target image by the second parallel line pair.
[0101] S54: Based on the intersection of at least one set of target lines and two third lines, calibrate the vehicle-mounted camera to obtain the second target calibration parameters of the vehicle-mounted camera.
[0102] In this embodiment, the second target calibration parameters of the vehicle-mounted camera include at least one of the vehicle-mounted camera's heading angle, pitch angle, and roll angle.
[0103] In this embodiment, step S44 calibrates the vehicle-mounted camera based on the intersection of at least one set of target straight lines and two third straight lines to obtain the second target calibration parameters of the vehicle-mounted camera, including at least one of the following steps:
[0104] First, based on the coordinates of the first intersection point of the two third lines aligned with the first target line and the coordinates of the center point of the target image, a first preset calculation is performed to determine the heading angle and / or pitch angle of the vehicle-mounted camera.
[0105] For example, the tilt angle of the vehicle-mounted camera can be determined by using the coordinates of the first intersection point of the two third lines aligned with the first target line and the coordinates of the center point of the target image, as follows:
[0106] p = tan -1 (V0-VP y ) / fy
[0107] In the formula, p represents the pitch angle of the vehicle-mounted camera, V0 represents the ordinate of the center point of the target image (the ordinate of the optical center), and VP... y y represents the ordinate of the first intersection point VP (also known as the vanishing point VP), and fy represents the longitudinal focal length of the vehicle-mounted camera.
[0108] Optionally, the heading angle of the vehicle-mounted camera can be determined by using the coordinates of the first intersection point of the two third lines aligned with the first target line and the coordinates of the center point of the target image as a first preset calculation:
[0109] y = tan -1 (VP x -U0) / fx
[0110] In the formula, y represents the heading angle of the vehicle-mounted camera, U0 represents the x-coordinate of the center point of the target image (x-coordinate of the optical center), and VP... x fx represents the x-coordinate of the first intersection point VP (also known as the vanishing point VP), and fx represents the lateral focal length of the vehicle-mounted camera.
[0111] It should be noted that, in order to accurately determine the pitch angle and / or yaw angle of the vehicle-mounted camera, the coordinates of the corresponding first intersection points of the two third lines aligned with the first target line can be used to perform the first preset calculation and the second preset calculation with the coordinates of the center point of the target image, respectively, to obtain multiple pitch angles and / or yaw angles. Then, the average value of the multiple pitch angles is used as the final calibrated pitch angle, and the average value of the multiple yaw angles is used as the final calibrated yaw angle.
[0112] Second, based on the coordinates of the first intersection point, the coordinates of the second intersection point of the two third lines aligned with the second target line, and the coordinates of the center point of the target image, a second preset calculation is performed to determine the roll angle of the vehicle-mounted camera.
[0113] For example, the roll angle of the vehicle-mounted camera can be determined by using the coordinates of the first intersection point of the first target line aligned with the two third lines, the coordinates of the second intersection point of the second target line aligned with the two third lines, and the coordinates of the center point of the target image, as follows:
[0114] r = tan -1 (VP y -VP′ y ) / (VP x -VP′ x )
[0115] Where r represents the roll angle of the vehicle-mounted camera, VP y and VP x Let VP' represent the ordinate and abscissa of the first intersection point. y and VP′ x Represent the ordinate and abscissa of the second intersection point VP′ (vanishing point VP′).
[0116] It should be noted that, as Figure 5 As shown, the first intersection point VP is the intersection point of the first parallel line pair projected onto the target image and corresponding to the first target line pair. Specifically, the intersection point VP can be determined according to the equation expression of the two third lines of the first target line pair. In addition, the second intersection point VP′ is the intersection point of the second parallel line pair projected onto the target image and corresponding to the second target line pair. Specifically, the intersection point VP′ can be determined according to the equation expression of the two third lines of the second target line pair. Then, the first intersection point, the second intersection point, and the center point of the target image are used to perform the above calculations to obtain the second target calibration parameters of the vehicle camera.
[0117] Additionally, it should be noted that driving cameras generally consist of several cameras: front-view, rear-view, left-front, right-front, left-rear, and right-rear; surround-view cameras generally consist of several cameras: front surround-view, left surround-view, right surround-view, and rear surround-view. In order to calibrate both driving cameras and surround-view cameras simultaneously in one calibration, a target calibration scene can be constructed based on the conditions that "the camera to be calibrated acquires the first sub-image corresponding to the first calibration object and the second sub-image corresponding to the second calibration object, and the positional relationship between the first calibration object and the vehicle can be determined in advance."
[0118] The following section uses a surround-view camera as an example to briefly introduce the calibration of a surround-view camera. Please continue reading... Figure 2 ,like Figure 2 As shown, after determining the third pose parameters between the calibration cloth 22 and the vehicle coordinate system of the vehicle 23 according to the QR code calibration plate 21, for the front surround view camera, the three checkerboard grids in the calibration cloth 22 located in front of the front of the vehicle 23 can be used to calibrate the front surround view camera, and the rotation parameter R and displacement parameter t between the front surround view camera and the vehicle coordinate system can be obtained, which can also be called rotation matrix R and translation matrix t; for the left surround view camera, the five checkerboard grids in the calibration cloth 22 located on the left side of the vehicle 23 can be used to calibrate the left surround view camera, and the rotation parameter R and displacement parameter t between the left surround view camera and the vehicle coordinate system can be obtained. Other surround view cameras are similar and will not be introduced one by one.
[0119] Furthermore, taking a dashcam as an example, we will briefly introduce the calibration of dashcams. Please refer to [link / reference]. Figure 6 , Figure 6 This is a flowchart illustrating another embodiment of the target calibration scenario provided in this application. For example... Figure 6 As shown, the target calibration scenario 60 includes a QR code calibration board 61, a vehicle 62, a profile 63, and a calibration cloth 64 (including three integrated calibration cloths: #1, #2, and #3). Figure 5 The #1 calibration cloth shown is Figure 2 (See calibration cloth 22). After determining the third pose parameters between the vehicle coordinate system of calibration cloth 64 and vehicle 62 according to the QR code calibration plate 61, the four checkerboard grids at the four corners of calibration cloth 1, as well as calibration cloths 2 and 3, can be used to calibrate each driving camera. For the rear-view camera, calibration cloth 3 can be used to determine the first and second intersection points, and then the pitch angle, yaw angle, and roll angle of the camera can be determined using the coordinates of the first and second intersection points. In addition, the four side-view driving cameras can be calibrated using the four checkerboard grids at the four corners of calibration cloth 1, and the front-view camera can be calibrated using calibration cloth 2.
[0120] It should be noted that, Figure 6 The #1 calibration cloth shown is Figure 2 The calibration cloth 22 shown is therefore set as follows: Figure 6In the target calibration scenario shown, the calibration method provided in this application can be used to calibrate both the driving camera and the surround-view camera simultaneously.
[0121] Please see Figure 7 , Figure 7 This is a schematic diagram of a framework of an embodiment of the electronic device provided in this application. In this embodiment, the electronic device 70 includes a memory 71 and a processor 72 coupled to each other.
[0122] The memory 71 stores program instructions, and the processor 72 executes the program instructions stored in the memory 71 to implement the steps of any of the above-described method embodiments. In a specific implementation scenario, the electronic device 70 may include, but is not limited to, a microcomputer or a server. In addition, the electronic device 70 may also include mobile devices such as laptops and tablets, which are not limited here.
[0123] Specifically, processor 72 controls itself and memory 71 to implement the steps of any of the above embodiments. Processor 72 may also be referred to as a CPU (Central Processing Unit). Processor 72 may be an integrated circuit chip with signal processing capabilities. Processor 72 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor may be a microprocessor or any conventional processor. Furthermore, processor 72 may be implemented using integrated circuit chips.
[0124] Please see Figure 8 , Figure 8This is a schematic diagram of the framework of the computer-readable storage medium provided in this application. The computer-readable storage medium 80 of this application embodiment stores program instructions 81, which, when executed, implement the methods provided in any embodiment or any non-conflicting combination of the above-described methods. The program instructions 81 can form a program file and be stored in the computer-readable storage medium 80 in the form of a software product, so that a computer device (which may be a personal computer, server, or network device, etc.) can execute all or part of the steps of the methods of various embodiments of this application. The aforementioned computer-readable storage medium 80 includes various media capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, or terminal devices such as computers, servers, mobile phones, and tablets.
[0125] The above scheme simultaneously uses a first calibration object and a second calibration object to calibrate the vehicle-mounted camera. Since the first calibration object is located on the vehicle, the second pose parameter between the first calibration object and the vehicle coordinate system can be accurately determined in advance based on the placement position of the first calibration object on the vehicle and the vehicle parameters. Then, combining the second pose parameter with the first pose parameter obtained from the detection of the target image (first sub-image and second sub-image), the third pose parameter between the second calibration object and the vehicle coordinate system is determined. Because this application uses a first calibration object on the vehicle with a known positional relationship to the vehicle coordinate system, the third pose parameter between the second calibration object and the vehicle coordinate system can be accurately determined based on the first and second pose parameters, regardless of whether the second calibration object is precisely placed. Compared to calibrating the camera by precisely placing the second calibration object, this camera calibration method does not require precise placement of the second calibration object, thus saving time and improving the efficiency of camera calibration.
[0126] The description of the various embodiments above tends to emphasize the differences between the various embodiments. The similarities or similarities between them can be referred to, and for the sake of brevity, they will not be repeated here.
[0127] In the embodiments provided in this application, it should be understood that the disclosed methods can be implemented in other ways. For example, the embodiments described above are merely illustrative.
[0128] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A calibration method for a vehicle-mounted camera, characterized in that, The method includes: Acquire target images captured by vehicle-mounted cameras in a target calibration scene; the target calibration scene is a calibration scene constructed by a first calibration object, a second calibration object, and a vehicle, wherein the first calibration object is set on the vehicle; the target image includes a first sub-image corresponding to the first calibration object and a second sub-image corresponding to the second calibration object; Target detection is performed on the target image to obtain the target detection result of the target image; the target detection result includes the first pose parameter between the first sub-image and the second sub-image. Based on the first pose parameters and the second pose parameters between the first calibration object and the vehicle coordinate system of the vehicle obtained in advance, the third pose parameters between the second calibration object and the vehicle coordinate system are determined. The vehicle-mounted camera is calibrated based at least on the third pose parameter to obtain the target calibration parameters of the vehicle-mounted camera.
2. The method according to claim 1, characterized in that, The target detection result also includes the first position of each feature point on the second calibration object in the second sub-image; The step of calibrating the vehicle-mounted camera based at least on the third pose parameter to obtain the target calibration parameters of the vehicle-mounted camera includes: The vehicle-mounted camera is calibrated based on the first position and the third pose parameters of each feature point to obtain the target calibration parameters.
3. The method according to claim 2, characterized in that, The vehicle-mounted camera is a surround-view camera, and the target calibration parameters include the first target calibration parameters of the vehicle-mounted camera relative to the vehicle coordinate system; The calibration of the vehicle-mounted camera based on the first position and the third pose parameters of each feature point to obtain the target calibration parameters includes: Based on the third pose parameter, a first coordinate transformation is performed on each of the feature points to obtain the second position of each of the feature points in the vehicle coordinate system; Based on the first position of each feature point, the second position of each feature point, and the preset calibration intrinsic parameters of the vehicle camera, the calibration parameters to be optimized of the vehicle camera are optimized to obtain the first target calibration parameters.
4. The method according to claim 3, characterized in that, The first target calibration parameters are obtained by optimizing the calibration parameters of the surround-view camera based on the first position of each feature point, the second position of each feature point, and the preset calibration intrinsic parameters of the surround-view camera, including: Based on the second position of each feature point and the calibration parameters to be optimized, a second coordinate transformation is performed on each feature point to obtain the third position of each feature point in camera coordinates; Based on the third position of each feature point and the preset calibration parameters, each feature point is projected to obtain the fourth position of each feature point projected onto the target image; The calibration parameters to be optimized are optimized based on the difference between the first position and the corresponding fourth position of each feature point to obtain the first target calibration parameters.
5. The method according to claim 2, characterized in that, The vehicle-mounted camera is a driving camera, and the target calibration parameters include the second target calibration parameters of the vehicle-mounted camera; The calibration of the vehicle-mounted camera based on the first position and the third pose parameters of each feature point to obtain the target calibration parameters includes: By performing linear fitting using the first positions of each of the aforementioned feature points, several first straight lines are obtained; Based on several first straight lines and the third pose parameters between the second calibration object and the vehicle coordinate system, at least one pair of target parallel lines is determined from the second calibration object; the two second straight lines in each pair of target parallel lines are parallel to each other. Determine at least one set of target parallel line pairs projected onto at least one set of target line pairs in the target image; the two third lines in each set of target line pairs are the lines projected onto the target image by the two second lines in the corresponding set of target parallel line pairs; The vehicle-mounted camera is calibrated based on the intersection of the two third lines in the at least one set of target lines, and the second target calibration parameters of the vehicle-mounted camera are obtained.
6. The method according to claim 5, characterized in that, The target parallel line pair includes at least one of a first parallel line pair and a second parallel line pair; wherein each second straight line in the first parallel line pair is parallel to the target axis of the vehicle coordinate system, and each second straight line in the second parallel line pair is not parallel to the target axis.
7. The method according to claim 6, characterized in that, The target line pair includes at least one of the following: a first target line pair in which the first parallel line pair is projected into the target image, and a second target line pair in which the second parallel line pair is projected into the target image; The second target calibration parameters include at least one of the heading angle, pitch angle, and roll angle of the vehicle-mounted camera; The step of calibrating the vehicle-mounted camera based on the intersection of two of the third lines in the at least one set of target lines to obtain the second target calibration parameters of the vehicle-mounted camera includes at least one of the following steps: Based on the coordinates of the first intersection point of the two third lines aligned with the first target line and the coordinates of the center point of the target image, a first preset calculation is performed to determine the heading angle and / or the pitch angle of the vehicle-mounted camera. Based on the coordinates of the first intersection point, the coordinates of the second intersection point of the two third lines aligned with the second target line, and the coordinates of the center point of the target image, a second preset calculation is performed to determine the roll angle of the vehicle-mounted camera.
8. The method according to claim 2, characterized in that, The first calibration object is a QR code calibration board, and the second calibration object is a calibration cloth including several checkerboard patterns, wherein the feature points are the corner points of the checkerboard patterns.
9. An electronic device, characterized in that, Including interconnected memory and processor, The memory stores program instructions; The processor is used to execute program instructions stored in the memory to implement the method according to any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program instructions that can be executed by a processor to implement the method of any one of claims 1-8.
Citation Information
Patent Citations
Calibration method, surround view image generation method, device, equipment and storage medium
CN115601449A
Vehicle-mounted surround view equipment calibration method and device, storage medium and electronic equipment
CN116630441A
