Distance line calibration method and device of electronic rearview mirror, equipment, storage medium
By acquiring calibration images and coordinate data, the spatial position matrix of the electronic rearview mirror module is calculated, solving the problem of cumbersome and inaccurate distance line calibration of electronic rearview mirrors in the existing technology, and realizing convenient and accurate automated calibration.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING JINGWEI HIRAIN TECH CO INC
- Filing Date
- 2026-03-18
- Publication Date
- 2026-06-19
AI Technical Summary
Existing methods for calibrating distance lines on electronic rearview mirrors are cumbersome, cannot guarantee accuracy, have poor adaptability, and cannot provide timely and adaptive calibration for various situations.
By acquiring calibration images and coordinate data, the spatial position matrix of the electronic rearview mirror module is calculated. A six-axis robotic arm is used to simulate the vehicle's posture. Combined with total station measurements and lens distortion correction, the distance of the distance line in the electronic rearview mirror module's coordinate system is automatically calculated.
It achieves convenient and accurate distance line calibration, can automatically adapt to various situations, improves calibration adaptability and accuracy, and reduces the need for calibration on actual vehicles.
Smart Images

Figure CN122244175A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of optical devices, and in particular to a method, apparatus, device, and storage medium for calibrating the distance line of an electronic rearview mirror. Background Technology
[0002] Electronic rearview mirrors (Camera Monitor System, CMS) collect images of the area behind the vehicle using external cameras and integrate intelligent connectivity and other related functions into the cameras. This allows the collected images to be displayed in real time on the in-vehicle display, thus replacing traditional external rearview mirrors. This can effectively reduce air resistance, minimize blind spots, and improve the vehicle's visibility in adverse environments.
[0003] Furthermore, the distance lines on the electronic rearview mirror are a crucial component of Advanced Driving Assistance Systems (ADAS). Specifically, the distance lines on the electronic rearview mirror detect lane lines, obstacles, and pedestrians, and then use the detection results to enable various autonomous driving and driver assistance functions, such as Automatic Emergency Braking (AEB), Lane Departure Warning (LDW), and Lane Keeping Assist (LKA). Therefore, the accurate calibration of the distance lines on the electronic rearview mirror is of paramount importance. Currently, however, the distance lines on the electronic rearview mirror installed on the vehicle are primarily calibrated manually by the user.
[0004] However, the existing method cannot effectively guarantee accuracy, and because it requires manual calibration and adjustment on the actual vehicle, it is very inconvenient and cannot be calibrated in a timely manner for various situations. Therefore, the adaptability of the distance line of the electronic rearview mirror is relatively poor. Summary of the Invention
[0005] In view of the shortcomings of the prior art, this application provides a distance line calibration method, device, equipment, and storage medium for electronic rearview mirrors to solve the problems that the prior art is cumbersome and cannot guarantee accuracy.
[0006] To achieve the above objectives, this application provides the following technical solution:
[0007] The first aspect of this application provides a method for calibrating the distance line of an electronic rearview mirror, including:
[0008] Acquire a calibration image; wherein the calibration image is an image of a scene with multiple reflective sheets placed, acquired by simulating the pose of the electronic rearview mirror of a vehicle through an electronic rearview mirror module.
[0009] Obtain first coordinate data; wherein, the first coordinate data includes the three-dimensional position coordinates of the corner point corresponding to each of the reflective sheets; the corner point corresponding to the reflective sheet is a point selected on the reflective sheet;
[0010] Obtain second coordinate data; wherein, the second coordinate data includes the two-dimensional pixel coordinates of the corner points corresponding to each of the reflective sheets on the calibration image;
[0011] Using the first coordinate data and the second coordinate data, the spatial position matrix of the electronic rearview mirror module is calculated; wherein, the spatial position matrix includes a rotation matrix and a translation vector;
[0012] The distances of each calibration distance in the coordinate system of the electronic rearview mirror module are calculated using the spatial position matrix of the electronic rearview mirror module and then calibrated.
[0013] Optionally, in the above-described method for calibrating the distance line of an electronic rearview mirror, acquiring the calibration image includes:
[0014] The three-dimensional coordinates, roll angle, pitch angle, and yaw angle of the electronic rearview mirror on the vehicle are acquired and transmitted to the six-axis robotic arm, so that the six-axis robotic arm can adjust its posture according to the three-dimensional coordinates, roll angle, pitch angle, and yaw angle of the electronic rearview mirror on the vehicle; wherein, the end of the six-axis robotic arm is equipped with an electronic rearview mirror module.
[0015] Acquire the calibration image captured by the electronic rearview mirror module.
[0016] Optionally, in the above-described method for calibrating the distance line of an electronic rearview mirror, acquiring the calibration image collected by the electronic rearview mirror module further includes:
[0017] The calibration image is obtained by acquiring an image of the imaging range area collected by the electronic rearview mirror module; wherein, a preset number of reflective sheets are placed on the ground or on the surface of an object with a height lower than a preset height in the imaging range area of the electronic rearview mirror module according to asymmetric and nonlinear rules; wherein, the preset number is not less than 8.
[0018] Optionally, in the above-described method for calibrating the distance line of an electronic rearview mirror, obtaining the first coordinate data includes:
[0019] The three-dimensional position coordinates of the corner points corresponding to each of the reflective sheets are obtained by measuring with a total station to form the first coordinate data; wherein, after the total station is placed and leveled, and oriented by a known point, the prism measurement mode is used to sequentially aim at the center of each reflective sheet to measure and obtain the three-dimensional position coordinates of the corner points corresponding to each reflective sheet.
[0020] Optionally, in the above-described method for calibrating the distance line of the electronic rearview mirror, calculating the spatial position matrix of the electronic rearview mirror module using the first coordinate data and the second coordinate data includes:
[0021] The distortion coefficient of the electronic rearview mirror module is used to perform distortion correction on the second coordinate data.
[0022] Based on the first coordinate data, the second coordinate data after distortion correction, the distortion coefficients and intrinsic parameters of the electronic rearview mirror module, the rotation matrix and translation vector of the electronic rearview mirror module are solved using the solvePnP function.
[0023] Optionally, in the above-described method for calibrating the distance lines of an electronic rearview mirror, after calculating and calibrating the distances of each calibration distance in the coordinate system of the electronic rearview mirror module using the spatial position matrix of the electronic rearview mirror module, the method further includes:
[0024] Acquire a verification image; wherein the verification image is an image of a test object placed at any of the calibration distances, acquired by the electronic rearview mirror module;
[0025] The actual two-dimensional pixel coordinates of the corner point corresponding to the reflective sheet on the test object in the verification image are detected;
[0026] Obtain the three-dimensional position coordinates of the reflective sheet on the test object;
[0027] Based on the spatial position matrix of the electronic rearview mirror module, the position error is calculated using the actual two-dimensional pixel coordinates and three-dimensional position coordinates of the corner points corresponding to the reflective sheet on the test object.
[0028] Optionally, in the above-described distance line calibration method for electronic rearview mirrors, the step of calculating the position error based on the spatial position matrix of the electronic rearview mirror module, using the actual two-dimensional pixel coordinates and three-dimensional position coordinates of the corner points corresponding to the reflective sheet on the test object, includes:
[0029] Based on the spatial position matrix of the electronic rearview mirror module, the three-dimensional position coordinates of the corner points corresponding to the reflective sheet on the test object are transformed into the coordinate system of the electronic rearview mirror module.
[0030] Using the distortion coefficient and intrinsic parameters of the electronic rearview mirror module, the three-dimensional coordinates of the corner point corresponding to the reflector on the test object are transformed from the coordinate system of the electronic rearview mirror module to the pixel coordinate system to obtain the theoretical two-dimensional pixel coordinates of the corner point corresponding to the reflector on the test object.
[0031] The Euclidean distance is calculated using the actual two-dimensional pixel coordinates and the theoretical two-dimensional pixel coordinates to obtain the position error.
[0032] A second aspect of this application provides a distance line calibration device for an electronic rearview mirror, comprising:
[0033] A calibration image acquisition unit is used to acquire a calibration image; wherein the calibration image is an image of a scene with multiple reflective sheets placed, which is acquired by simulating the pose of the electronic rearview mirror of a vehicle through an electronic rearview mirror module.
[0034] A position acquisition unit is used to acquire first coordinate data; wherein, the first coordinate data includes the three-dimensional position coordinates of the corner point corresponding to each of the reflective sheets; the corner point corresponding to the reflective sheet is a point selected on the reflective sheet;
[0035] A position detection unit is used to acquire second coordinate data; wherein, the second coordinate data includes the two-dimensional pixel coordinates of the corner points corresponding to each of the reflective sheets on the calibration image;
[0036] The relationship calculation unit is used to calculate the spatial position matrix of the electronic rearview mirror module using the first coordinate data and the second coordinate data; wherein, the spatial position matrix includes a rotation matrix and a translation vector;
[0037] The calibration unit is used to calculate and calibrate the distances of each calibration distance in the coordinate system of the electronic rearview mirror module using the spatial position matrix of the electronic rearview mirror module.
[0038] Optionally, in the above-mentioned distance line calibration device for electronic rearview mirrors, the calibration image acquisition unit includes:
[0039] The pose information acquisition unit is used to acquire the three-dimensional coordinates, roll angle, pitch angle and yaw angle of the electronic rearview mirror on the vehicle and transmit them to the six-axis robotic arm so that the six-axis robotic arm can adjust its pose according to the three-dimensional coordinates, roll angle, pitch angle and yaw angle of the electronic rearview mirror on the vehicle; wherein, the end of the six-axis robotic arm is provided with an electronic rearview mirror module.
[0040] The calibration image acquisition unit is used to acquire the calibration image acquired by the electronic rearview mirror module.
[0041] Optionally, in the above-mentioned distance line calibration device for electronic rearview mirrors, the calibration image acquisition unit includes:
[0042] The calibration image acquisition subunit acquires images of the imaging range area acquired by the electronic rearview mirror module to obtain the calibration image; wherein, a preset number of reflective sheets are placed on the ground or on the surface of an object with a height lower than a preset height in the imaging range area of the electronic rearview mirror module according to asymmetric and nonlinear rules; wherein, the preset number is not less than 8.
[0043] Optionally, in the above-mentioned distance line calibration device for electronic rearview mirrors, the position acquisition unit includes:
[0044] The location acquisition subunit is used to acquire the three-dimensional position coordinates of the corner points corresponding to each of the reflective sheets measured by the total station, forming the first coordinate data; wherein, after the total station is placed and leveled, and oriented by known points, it adopts prism measurement mode to sequentially aim at the center of each reflective sheet to measure and obtain the three-dimensional position coordinates of the corner points corresponding to each reflective sheet.
[0045] Optionally, in the above-mentioned distance line calibration device for electronic rearview mirrors, the relationship calculation unit includes:
[0046] The processing unit is used to perform distortion correction processing on the second coordinate data using the distortion coefficient of the electronic rearview mirror module;
[0047] The calculation unit is used to solve the rotation matrix and translation vector of the electronic rearview mirror module based on the first coordinate data, the second coordinate data after distortion correction, the distortion coefficients and intrinsic parameters of the electronic rearview mirror module, using the solvePnP function.
[0048] Optionally, the distance line calibration device for the aforementioned electronic rearview mirror further includes:
[0049] A verification image acquisition unit is used to acquire a verification image; wherein, the verification image is an image of a test object placed at any of the calibration distances acquired by the electronic rearview mirror module;
[0050] A coordinate detection unit is used to detect the actual two-dimensional pixel coordinates of the corner point corresponding to the reflective sheet on the test object in the verification image;
[0051] The coordinate acquisition unit is used to acquire the three-dimensional position coordinates of the reflector on the test object using the total station;
[0052] The error calculation unit is used to calculate the position error based on the spatial position matrix of the electronic rearview mirror module, using the actual two-dimensional pixel coordinates and three-dimensional position coordinates of the corner points corresponding to the reflective sheet on the test object.
[0053] Optionally, in the above-mentioned distance line calibration device for electronic rearview mirrors, the error calculation unit includes:
[0054] The first conversion unit is used to convert the three-dimensional position coordinates of the corner point corresponding to the reflector on the test object to the coordinate system of the electronic rearview mirror module based on the spatial position matrix of the electronic rearview mirror module.
[0055] The second conversion unit is used to use the distortion coefficient and intrinsic parameters of the electronic rearview mirror module to convert the three-dimensional coordinates of the corner point corresponding to the reflector on the test object in the coordinate system of the electronic rearview mirror module to the pixel coordinate system, so as to obtain the theoretical two-dimensional pixel coordinates of the corner point corresponding to the reflector on the test object.
[0056] The distance calculation unit is used to calculate the Euclidean distance using the actual two-dimensional pixel coordinates and the theoretical two-dimensional pixel coordinates to obtain the position error.
[0057] A third aspect of this application provides an electronic device, comprising:
[0058] Memory and processor;
[0059] The memory is used to store programs;
[0060] The processor is used to execute the program, which, when executed, is specifically used to implement the distance line calibration method for the electronic rearview mirror as described in any of the above.
[0061] The fourth aspect of this application provides a computer storage medium for storing a computer program, which, when executed by a processor, is used to implement the distance line calibration method for an electronic rearview mirror as described in any of the preceding claims.
[0062] This application provides a distance line calibration method for an electronic rearview mirror. First, a calibration image is acquired. This calibration image is an image of a scene with multiple reflective elements placed, captured by an electronic rearview mirror module simulating the pose of the vehicle's electronic rearview mirror. This allows for the simulation of various situations, resulting in a highly adaptable calibration image. By arranging the reflective elements, position data can be accurately measured, and this position data can then be used to obtain distance line calibration results suitable for various situations. Next, first coordinate data is acquired. This first coordinate data includes the three-dimensional position coordinates of the corner points corresponding to each reflective element. The corner point is a selected point on the reflective element, thus obtaining position data from multiple real-world environments. Simultaneously, second coordinate data, including the two-dimensional pixel coordinates of the corner points corresponding to each reflective element in the calibration image, is acquired. Then, using the first and second coordinate data, the spatial position matrix of the electronic rearview mirror module is calculated. The spatial position matrix includes a rotation matrix and a translation vector, which gives the relationship between the three-dimensional coordinate system and the coordinate system of the electronic rearview mirror module. Therefore, the spatial position matrix of the electronic rearview mirror module can be used to calculate and calibrate the distances of each calibration distance in the coordinate system of the electronic rearview mirror module. This achieves a way to automatically calibrate distance lines for various situations without needing to calibrate on the actual vehicle, making distance line calibration more convenient and accurate. Attached Figure Description
[0063] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0064] Figure 1 A flowchart illustrating a distance line calibration method for an electronic rearview mirror provided in this application embodiment;
[0065] Figure 2 A flowchart illustrating a method for calculating a spatial position matrix provided in an embodiment of this application;
[0066] Figure 3 A flowchart illustrating a method for verifying the spatial position matrix of an electronic rearview mirror module provided in an embodiment of this application;
[0067] Figure 4 A flowchart illustrating a method for calculating position error provided in an embodiment of this application;
[0068] Figure 5 A schematic diagram of the architecture of a distance line calibration device for an electronic rearview mirror provided in an embodiment of this application;
[0069] Figure 6 This is a schematic diagram of the architecture of an electronic device provided in an embodiment of this application. Detailed Implementation
[0070] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0071] In this application, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.
[0072] This application provides a method for calibrating the distance line of an electronic rearview mirror, such as... Figure 1 As shown, it includes:
[0073] S101. Obtain the calibration image.
[0074] The calibration image is an image of a scene with multiple reflective sheets placed on it, which is acquired by simulating the pose of the electronic rearview mirror of a vehicle through the electronic rearview mirror module.
[0075] It should be noted that, in order to avoid being limited to calibrating markings on actual vehicles and to perform calibration automatically, in this embodiment of the application, an electronic rearview mirror module is set on a corresponding device, and the device is used to simulate the position and posture of the electronic rearview mirror in any situation on the vehicle. This allows for the automatic simulation of various situations and calibration of distance lines in the laboratory stage, making it more convenient and adaptable.
[0076] Specifically, the electronic rearview mirror module can be a camera placed at the rearview mirror, so that the image it captures is consistent with the image captured by the vehicle's electronic rearview mirror.
[0077] In order to obtain the coordinates of multiple positions in the calibration image acquired by the electronic rearview mirror module and the coordinates of the actual positions within the corresponding imaging area, distance lines can be calibrated using the position coordinates in the calibration image and the coordinates of the actual positions. Therefore, in this embodiment, multiple reflective sheets are placed within the imaging range of the electronic rearview mirror module, i.e., within the area captured by the electronic rearview mirror module, and then an image is acquired by the electronic rearview mirror module. This image will include the arranged reflective sheets, which can then be used for subsequent distance line calibration.
[0078] Optionally, in another embodiment of this application, one specific implementation of step S101 includes:
[0079] The system acquires the three-dimensional coordinates, roll angle, pitch angle, and yaw angle of the electronic rearview mirror on the vehicle and transmits them to the six-axis robotic arm. This allows the six-axis robotic arm to adjust its posture according to the three-dimensional coordinates, roll angle, pitch angle, and yaw angle of the electronic rearview mirror on the vehicle, and to acquire the calibration image collected by the electronic rearview mirror module on the six-axis robotic arm.
[0080] The electronic rearview mirror module is located at the end of the six-axis robotic arm.
[0081] It should be noted that, in order to simulate various poses of the electronic rearview mirror, in this embodiment of the application, a six-axis robotic arm is used to simulate the pose of the electronic rearview mirror according to the acquired pose parameters, and an electronic rearview mirror module is installed at the end of the six-axis robotic arm, so as to simulate the pose of the electronic rearview mirror and acquire calibration images.
[0082] To accurately reflect the pose of the electronic rearview mirror, this embodiment describes its pose using six degrees of freedom, specifically: three-dimensional coordinates X, Y, and Z reflecting position, and roll, pitch, and yaw angles reflecting rotation. Therefore, the user can input these six parameters for the pose of a single rearview mirror in various vehicle conditions, and then control the pose of the six-axis robotic arm according to the input pose information.
[0083] Optionally, in another embodiment of this application, a method for acquiring calibration images collected by an electronic rearview mirror module is provided, comprising:
[0084] The image of the imaging range area captured by the electronic rearview mirror module is obtained to obtain the calibration image.
[0085] In this system, a preset number of reflective sheets are placed on the ground or on the surface of an object at a height lower than a preset height within the imaging range of the electronic rearview mirror module, following asymmetrical and nonlinear rules.
[0086] Optionally, the preset number should be no less than 8. This is because each reflector corresponds to a corner point, yielding one data point. Since the parameters to be calibrated subsequently include 9 unknowns, which decrease to 8 after normalization, 8 data points are needed for the solution. Therefore, at least 8 reflectors are required. Of course, to improve calibration accuracy, more reflectors can be used, for example, 16 reflectors. 16 reflectors provide more data, and redundant data effectively improves the robustness of the results. However, this requires a larger area and more setup time.
[0087] It should be noted that placing symmetrical reflectors or reflectors on the same straight line will result in identical data, reducing the amount of data and introducing fewer positional parameters, thus worsening the calibration effect. Therefore, it is necessary to place them according to asymmetrical and non-linear rules; that is, the reflectors should avoid symmetrical or linear arrangements.
[0088] To allow for some variation along the Z-axis, some reflective elements can be placed on the surface of low-profile objects. These low-profile objects can specifically be objects with a height lower than a preset height.
[0089] S102, Obtain the first coordinate data.
[0090] The first coordinate data includes the three-dimensional position coordinates of the corner points corresponding to each reflector, where each corner point is a selected point on the reflector. In other words, the first coordinate data includes the position coordinates of points on each reflector in the actual scene.
[0091] Since the actual distance needs to be calibrated within the image of the electronic rearview mirror, it is necessary to obtain the position information of the reflector in the actual scene. Therefore, in this embodiment, the three-dimensional position coordinates of a corner point on each reflector are obtained, which are usually the three-dimensional position coordinates of the center point on the reflector.
[0092] Optionally, in another embodiment of this application, one specific implementation of step S102 includes:
[0093] Obtain the three-dimensional position coordinates of the corner points corresponding to each reflector measured by a total station, and form the first coordinate data.
[0094] In this process, after the total station is placed and leveled, and oriented using known points, it uses prism measurement mode to measure the center of each reflector in turn, thereby obtaining the three-dimensional position coordinates of the corner points corresponding to each reflector.
[0095] It should be noted that, in this embodiment of the application, the three-dimensional position coordinates of the corner points corresponding to each reflector are measured by a total station and uploaded to the system for calibration.
[0096] Therefore, specifically, set the total station on a stable surface, level the base, and then activate the electronic bubble leveling function for precise leveling. Then input the coordinates of the total station, specifically (0, 0, 0), and aim at the backsight control point. Orient the instrument using known points to complete the orientation, thus determining the origin of the total station's coordinate system and establishing its coordinate system.
[0097] To achieve accurate measurements, in this embodiment, the total station is controlled to sequentially aim at the center of each reflector using prism measurement mode. The center of each reflector is used as its corresponding corner point, thus obtaining the three-dimensional position coordinates of the corner points of each reflector, forming the first coordinate data. Optionally, the acquired first coordinate data can be saved in a specified format, such as CSV, for later use.
[0098] S103. Obtain the second coordinate data.
[0099] The second coordinate data includes the two-dimensional pixel coordinates of the corner points corresponding to each reflector on the calibration image, so the second coordinate data is measured from the calibration image.
[0100] Specifically, the coordinates of the corner points corresponding to each reflector on the calibration image are detected, i.e., their coordinates in the pixel coordinate system, and uploaded to the system for distance line calibration. Since the image is two-dimensional, what is obtained is the two-dimensional pixel coordinates of the corner points corresponding to each reflector.
[0101] Alternatively, the two-dimensional pixel coordinates of the corner points can be detected using corner detection algorithms in OpenCV. Alternatively, the corner points can be manually clicked to obtain their two-dimensional pixel coordinates.
[0102] S104. Using the first coordinate data and the second coordinate data, calculate the spatial position matrix of the electronic rearview mirror module.
[0103] The spatial position matrix includes a rotation matrix and a translation vector.
[0104] It should be noted that since the calibration image is acquired by the rearview mirror module, the relationship between the pixel coordinate system and the rearview mirror module's coordinate system can be directly obtained. Specifically, this relationship can be derived from the parameters of the rearview mirror module. Therefore, obtaining the two-dimensional pixel coordinates of each corner point represents the coordinates of each corner point in the electronic rearview mirror module's coordinate system. The three-dimensional position coordinates of each corner point represent its coordinates in the actual scene's coordinate system. Therefore, using the three-dimensional position coordinates and the two-dimensional pixel coordinates of each corner point, the transformation relationship information between the electronic rearview mirror module's coordinate system and the actual scene's coordinate system can be obtained, namely, the rotation matrix and translation vector. Specifically, if the three-dimensional position coordinates of each corner point are measured using a total station, the transformation relationship information obtained is specifically the transformation relationship information between the electronic rearview mirror module's coordinate system and the total station's coordinate system.
[0105] Optionally, in another embodiment of this application, one specific implementation of step S104 is as follows: Figure 2 As shown, it includes:
[0106] S201. The distortion coefficient of the electronic rearview mirror module is used to perform distortion correction on the second coordinate data.
[0107] It should be noted that due to optical defects in the lens, the images captured by the electronic rearview mirror module may be distorted, resulting in errors in the second coordinate data. Therefore, the distortion coefficient of the electronic rearview mirror module is used to perform distortion correction processing on the second coordinate data to eliminate the influence of image distortion, ensure the accuracy of the second coordinate data, and thus improve the accuracy of the calibration distance line.
[0108] S202. Based on the first coordinate data, the second coordinate data after distortion correction, the distortion coefficients and intrinsic parameters of the electronic rearview mirror module, the rotation matrix and translation vector of the electronic rearview mirror module are solved using the solvePnP function.
[0109] It should be noted that, in order to directly obtain the rotation matrix and translation vector of the electronic rearview mirror module from the three-dimensional position coordinates and two-dimensional pixel coordinates without prior conversion, the solvePnP function is directly used to solve for the rotation matrix and translation vector of the electronic rearview mirror module in this embodiment.
[0110] S105. Calculate and calibrate the distances of each calibration distance in the coordinate system of the electronic rearview mirror module using the spatial position matrix of the electronic rearview mirror module.
[0111] Since the spatial position matrix of the electronic rearview mirror module represents the relationship between the coordinate system of the actual scene and the coordinate system of the rearview mirror module, for various calibration distances that need to be calibrated in the actual scene, such as 30m, 50m, and 100m, the distance mapped to the electronic rearview mirror module's coordinate system can be calculated using the spatial position matrix of the electronic rearview mirror module. This allows for the marking of line segments at each distance within the image of the electronic rearview mirror module. Optionally, different colors can be used for marking different distances.
[0112] Optionally, to ensure the accuracy of the obtained spatial position matrix, and thus the accuracy of the distance line calibration, another embodiment of this application further includes verifying the accuracy of the calculated spatial position matrix of the electronic rearview mirror module. For example... Figure 3 As shown in the embodiment of this application, a method for verifying the spatial position matrix of an electronic rearview mirror module includes:
[0113] S301. Obtain the verification image.
[0114] The verification image is an image of a test object placed at any calibrated distance, captured by the electronic rearview mirror module.
[0115] Optionally, a test object can be placed at a calibrated distance, and a reflective sheet can be attached to the test object. For example, two cardboard boxes can be placed at a distance of 30m, and a reflective sheet can be attached to each box. Then, the electronic rearview mirror module can be controlled to acquire an image containing the test object, which will be used as a verification image.
[0116] S302. Detect the actual two-dimensional pixel coordinates of the corner points corresponding to the reflective sheet on the test object in the verification image.
[0117] Similarly, corner detection algorithms in OpenCV can be used for detection, or the pixel coordinates of the corners can be obtained by manually clicking on them. Since these coordinates are obtained directly through acquisition and measurement, they are the actual coordinates obtained. Therefore, the two-dimensional pixel coordinates of the corner obtained at this time are used as the actual two-dimensional pixel coordinates.
[0118] S303. Obtain the three-dimensional position coordinates of the reflector on the test object using a total station.
[0119] To determine whether the actual corner coordinates are accurately converted according to the spatial position matrix of the electronic rearview mirror module, and to verify the accuracy of the spatial position matrix of the electronic rearview mirror module, it is necessary to obtain the three-dimensional position coordinates of the reflector on the test object using a total station.
[0120] S304. Based on the spatial position matrix of the electronic rearview mirror module, the position error is calculated using the actual two-dimensional pixel coordinates and three-dimensional position coordinates of the corner points corresponding to the reflective sheet on the test object.
[0121] Specifically, based on the spatial position matrix of the electronic rearview mirror module, the three-dimensional position coordinates of the reflector on the test object are transformed. Then, the position error is obtained by calculating the deviation between the three-dimensional position coordinates of the reflector and the actual two-dimensional pixel coordinates of the corner points. Therefore, the position error reflects the accuracy of the spatial position matrix of the electronic rearview mirror module.
[0122] Optionally, it can be determined whether the position error is less than a set error threshold. If the position error is less than the set error threshold, it can be determined that the spatial position matrix of the calibrated electronic rearview mirror module meets the accuracy requirements, thereby using it for distance line calibration and improving the accuracy of the calibrated distance line.
[0123] Optionally, in another embodiment of this application, one specific implementation of step S304 is as follows: Figure 4 As shown, it includes:
[0124] S401. Based on the spatial position matrix of the electronic rearview mirror module, the three-dimensional position coordinates of the corner points corresponding to the reflective sheet on the test object are transformed into the coordinate system of the electronic rearview mirror module.
[0125] Specifically, the three-dimensional position coordinates of the corner point corresponding to the reflector on the test object can be denoted as P. W = (X W Y W Z W Then, using the rotation matrix R and translation vector t of the electronic rearview mirror module, its coordinates in the coordinate system of the electronic rearview mirror module are:
[0126]
[0127] Therefore, the three-dimensional position coordinates of the corner points corresponding to the reflective sheet on the test object can be transformed into the coordinate system of the electronic rearview mirror module through the above relationship.
[0128] S402. Using the distortion coefficient and intrinsic parameters of the electronic rearview mirror module, the three-dimensional coordinates of the corner point corresponding to the reflector on the test object are transformed from the coordinate system of the electronic rearview mirror module to the pixel coordinate system to obtain the theoretical two-dimensional pixel coordinates of the corner point corresponding to the reflector on the test object.
[0129] Specifically, the relationship between the two-dimensional pixel coordinate system P and the coordinate system of the electronic rearview mirror module, with respect to the distortion coefficients and intrinsic parameter K of the electronic rearview mirror module, is as follows:
[0130]
[0131] Therefore, the three-dimensional coordinates of the electronic rearview mirror module in the coordinate system can be transformed to the pixel coordinate system through the above relationship.
[0132] S403. Calculate the Euclidean distance using the actual two-dimensional pixel coordinates and the theoretical two-dimensional pixel coordinates to obtain the position error.
[0133] Specifically, the two-dimensional pixel coordinates of the image are P = (u, v). Therefore, the distance calculated using Euclidean distance is used as the error, so the positional error is:
[0134]
[0135] Among them, (u proj v proj ) represents the theoretical two-dimensional pixel coordinates, while (u) det v det () represents the actual two-dimensional pixel coordinates.
[0136] This application provides a distance line calibration method for an electronic rearview mirror. First, a calibration image is acquired. This calibration image is an image of a scene with multiple reflective elements placed, captured by simulating the pose of the electronic rearview mirror in a vehicle using an electronic rearview mirror module. This allows for the simulation of various situations, resulting in a highly adaptable calibration image. By arranging the reflective elements, position data can be accurately measured, and this position data can then be used to obtain distance line calibration results suitable for various situations. Next, first coordinate data is acquired. This first coordinate data includes the three-dimensional position coordinates of the corner points corresponding to each reflective element. The corner point is a selected point on the reflective element, thus obtaining position data from multiple real-world environments. Simultaneously, second coordinate data, including the two-dimensional pixel coordinates of the corner points corresponding to each reflective element in the calibration image, is acquired. Then, using the first and second coordinate data, the spatial position matrix of the electronic rearview mirror module is calculated. The spatial position matrix includes a rotation matrix and a translation vector, which gives the relationship between the three-dimensional coordinate system and the coordinate system of the electronic rearview mirror module. Therefore, the spatial position matrix of the electronic rearview mirror module can be used to calculate and calibrate the distances of each calibration distance in the coordinate system of the electronic rearview mirror module. This achieves a way to automatically calibrate distance lines for various situations without needing to calibrate on the actual vehicle, making distance line calibration more convenient and accurate.
[0137] Another embodiment of this application provides a distance line calibration device for an electronic rearview mirror, such as... Figure 5 As shown, it includes:
[0138] The calibration image acquisition unit 501 is used to acquire calibration images. The calibration images are images of a scene with multiple reflective sheets placed, acquired by simulating the pose of the electronic rearview mirrors of a vehicle using the electronic rearview mirror module.
[0139] The position acquisition unit 502 is used to acquire first coordinate data. The first coordinate data includes the three-dimensional position coordinates of the corner points corresponding to each reflector. The corner point corresponding to a reflector is a point selected on the reflector.
[0140] The position detection unit 503 is used to acquire second coordinate data. The second coordinate data includes the two-dimensional pixel coordinates of the corner points corresponding to each reflective sheet on the calibration image.
[0141] The relation calculation unit 504 is used to calculate the spatial position matrix of the electronic rearview mirror module using the first coordinate data and the second coordinate data. The spatial position matrix includes a rotation matrix and a translation vector.
[0142] The calibration unit 505 is used to calculate and calibrate the distances of each calibration distance in the coordinate system of the electronic rearview mirror module using the spatial position matrix of the electronic rearview mirror module.
[0143] Optionally, in another embodiment of the electronic rearview mirror distance line calibration device provided in this application, the calibration image acquisition unit includes:
[0144] The pose information acquisition unit is used to acquire the three-dimensional coordinates, roll angle, pitch angle, and yaw angle of the electronic rearview mirror on the vehicle and transmit them to the six-axis robotic arm, so that the six-axis robotic arm can adjust its pose according to the three-dimensional coordinates, roll angle, pitch angle, and yaw angle of the electronic rearview mirror on the vehicle. The end effector of the six-axis robotic arm is equipped with an electronic rearview mirror module.
[0145] The calibration image acquisition unit is used to acquire calibration images collected by the electronic rearview mirror module.
[0146] Optionally, in another embodiment of the distance line calibration device for an electronic rearview mirror provided in this application, the calibration image acquisition unit includes:
[0147] The calibration image acquisition subunit acquires images of the imaging range area captured by the electronic rearview mirror module, resulting in a calibration image. Specifically, a preset number of reflective sheets are placed on the ground or on the surface of an object at a height lower than a preset height within the imaging range area of the electronic rearview mirror module, following asymmetric and non-linear rules. The preset number is no less than 8.
[0148] Optionally, in another embodiment of the electronic rearview mirror distance line calibration device provided in this application, the position acquisition unit includes:
[0149] The location acquisition subunit is used to acquire the three-dimensional position coordinates of the corner points corresponding to each reflector measured by the total station, forming the first coordinate data. Specifically, after the total station is placed and leveled, and oriented using known points, it employs prism measurement mode to sequentially aim at the center of each reflector and measure, obtaining the three-dimensional position coordinates of the corner points corresponding to each reflector.
[0150] Optionally, in another embodiment of the distance line calibration device for an electronic rearview mirror provided in this application, the relationship calculation unit includes:
[0151] The processing unit is used to perform distortion correction on the second coordinate data using the distortion coefficients of the electronic rearview mirror module.
[0152] The calculation unit is used to solve for the rotation matrix and translation vector of the electronic rearview mirror module based on the first coordinate data, the distortion-reduced second coordinate data, the distortion coefficients and intrinsic parameters of the electronic rearview mirror module, using the solvePnP function.
[0153] Optionally, in another embodiment of the electronic rearview mirror distance line calibration device provided in this application, the device further includes:
[0154] The verification image acquisition unit is used to acquire verification images. These verification images are images of the test object placed at any calibrated distance, acquired by the electronic rearview mirror module.
[0155] The coordinate detection unit is used to detect the actual two-dimensional pixel coordinates of the corner points corresponding to the reflective sheet on the test object in the verification image.
[0156] The coordinate acquisition unit is used to acquire the three-dimensional position coordinates of the reflector on the test object using a total station.
[0157] The error calculation unit is used to calculate the position error based on the spatial position matrix of the electronic rearview mirror module, using the actual two-dimensional pixel coordinates and three-dimensional position coordinates of the corner points corresponding to the reflective sheet on the test object.
[0158] Optionally, in another embodiment of the electronic rearview mirror distance line calibration device provided in this application, the error calculation unit includes:
[0159] The first conversion unit is used to convert the three-dimensional position coordinates of the corner points corresponding to the reflective sheet on the test object to the coordinate system of the electronic rearview mirror module based on the spatial position matrix of the electronic rearview mirror module.
[0160] The second conversion unit is used to convert the three-dimensional coordinates of the corner point corresponding to the reflector on the test object in the coordinate system of the electronic rearview mirror module to the pixel coordinate system using the distortion coefficient and intrinsic parameters of the electronic rearview mirror module, so as to obtain the theoretical two-dimensional pixel coordinates of the corner point corresponding to the reflector on the test object.
[0161] The distance calculation unit is used to calculate the Euclidean distance using the actual two-dimensional pixel coordinates and the theoretical two-dimensional pixel coordinates, and obtain the position error.
[0162] It should be noted that the specific working process of each unit provided in the above embodiments of this application can be referred to the implementation process of the corresponding steps in the above method embodiments, and will not be repeated here.
[0163] Another embodiment of this application provides an electronic device, such as... Figure 6 As shown, it includes:
[0164] Memory 601 and processor 602.
[0165] The memory 601 is used to store the program.
[0166] The processor 602 is used to execute the program stored in the memory 601. When the program is executed, it is specifically used to implement the distance line calibration method of the electronic rearview mirror as provided in any of the above embodiments.
[0167] Another embodiment of this application provides a computer storage medium for storing a computer program, which, when executed by a processor, is used to implement the distance line calibration method for an electronic rearview mirror as provided in any of the above embodiments.
[0168] Computer storage media, including both permanent and non-permanent, removable and non-removable media, can store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0169] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0170] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for calibrating the distance line of an electronic rearview mirror, characterized in that, include: Acquire a calibration image; wherein the calibration image is an image of a scene with multiple reflective sheets placed, acquired by simulating the pose of the electronic rearview mirror of a vehicle through an electronic rearview mirror module. Obtain first coordinate data; wherein, the first coordinate data includes the three-dimensional position coordinates of the corner point corresponding to each of the reflective sheets; the corner point corresponding to the reflective sheet is a point selected on the reflective sheet; Obtain second coordinate data; wherein, the second coordinate data includes the two-dimensional pixel coordinates of the corner points corresponding to each of the reflective sheets on the calibration image; Using the first coordinate data and the second coordinate data, the spatial position matrix of the electronic rearview mirror module is calculated; wherein, the spatial position matrix includes a rotation matrix and a translation vector; The distances of each calibration distance in the coordinate system of the electronic rearview mirror module are calculated using the spatial position matrix of the electronic rearview mirror module and then calibrated.
2. The method according to claim 1, characterized in that, The acquisition of the calibration image includes: The three-dimensional coordinates, roll angle, pitch angle, and yaw angle of the electronic rearview mirror on the vehicle are acquired and transmitted to the six-axis robotic arm, so that the six-axis robotic arm can adjust its posture according to the three-dimensional coordinates, roll angle, pitch angle, and yaw angle of the electronic rearview mirror on the vehicle; wherein, the end of the six-axis robotic arm is equipped with an electronic rearview mirror module. Acquire the calibration image captured by the electronic rearview mirror module.
3. The method according to claim 2, characterized in that, The process of acquiring the calibration image collected by the electronic rearview mirror module includes: The calibration image is obtained by acquiring an image of the imaging range area collected by the electronic rearview mirror module; wherein, a preset number of reflective sheets are placed on the ground or on the surface of an object with a height lower than a preset height in the imaging range area of the electronic rearview mirror module according to asymmetric and nonlinear rules; wherein, the preset number is not less than 8.
4. The method according to claim 1, characterized in that, The acquisition of the first coordinate data includes: The three-dimensional position coordinates of the corner points corresponding to each of the reflective sheets are obtained by measuring with a total station to form the first coordinate data; wherein, after the total station is placed and leveled, and oriented by a known point, the prism measurement mode is used to sequentially aim at the center of each reflective sheet to measure and obtain the three-dimensional position coordinates of the corner points corresponding to each reflective sheet.
5. The method according to claim 1, characterized in that, The step of calculating the spatial position matrix of the electronic rearview mirror module using the first coordinate data and the second coordinate data includes: The distortion coefficient of the electronic rearview mirror module is used to perform distortion correction on the second coordinate data. Based on the first coordinate data, the second coordinate data after distortion correction, the distortion coefficients and intrinsic parameters of the electronic rearview mirror module, the rotation matrix and translation vector of the electronic rearview mirror module are solved using the solvePnP function.
6. The method according to claim 1, characterized in that, After calculating and calibrating the distances of each calibration distance in the coordinate system of the electronic rearview mirror module using the spatial position matrix of the electronic rearview mirror module, the process further includes: Acquire a verification image; wherein the verification image is an image acquired by the electronic rearview mirror module of a test object placed at any of the calibration distances; The actual two-dimensional pixel coordinates of the corner point corresponding to the reflective sheet on the test object in the verification image are detected; Obtain the three-dimensional position coordinates of the reflective sheet on the test object; Based on the spatial position matrix of the electronic rearview mirror module, the position error is calculated using the actual two-dimensional pixel coordinates and three-dimensional position coordinates of the corner points corresponding to the reflective sheet on the test object.
7. The method according to claim 6, characterized in that, The position error is calculated based on the spatial position matrix of the electronic rearview mirror module, using the actual two-dimensional pixel coordinates and three-dimensional position coordinates of the corner points corresponding to the reflective sheet on the test object, including: Based on the spatial position matrix of the electronic rearview mirror module, the three-dimensional position coordinates of the corner points corresponding to the reflective sheet on the test object are transformed into the coordinate system of the electronic rearview mirror module. Using the distortion coefficient and intrinsic parameters of the electronic rearview mirror module, the three-dimensional coordinates of the corner point corresponding to the reflector on the test object are transformed from the coordinate system of the electronic rearview mirror module to the pixel coordinate system to obtain the theoretical two-dimensional pixel coordinates of the corner point corresponding to the reflector on the test object. The Euclidean distance is calculated using the actual two-dimensional pixel coordinates and the theoretical two-dimensional pixel coordinates to obtain the position error.
8. A distance line calibration device for an electronic rearview mirror, characterized in that, include: A calibration image acquisition unit is used to acquire a calibration image; wherein the calibration image is an image of a scene with multiple reflective sheets placed, which is acquired by simulating the pose of the electronic rearview mirror of a vehicle through an electronic rearview mirror module. A position acquisition unit is used to acquire first coordinate data; wherein, the first coordinate data includes the three-dimensional position coordinates of the corner point corresponding to each of the reflective sheets; the corner point corresponding to the reflective sheet is a point selected on the reflective sheet; A position detection unit is used to acquire second coordinate data; wherein, the second coordinate data includes the two-dimensional pixel coordinates of the corner points corresponding to each of the reflective sheets on the calibration image; The relationship calculation unit is used to calculate the spatial position matrix of the electronic rearview mirror module using the first coordinate data and the second coordinate data; wherein, the spatial position matrix includes a rotation matrix and a translation vector; The calibration unit is used to calculate and calibrate the distances of each calibration distance in the coordinate system of the electronic rearview mirror module using the spatial position matrix of the electronic rearview mirror module.
9. An electronic device, characterized in that, include: Memory and processor; The memory is used to store programs; The processor is used to execute the program, which, when executed, is specifically used to implement the distance line calibration method for the electronic rearview mirror as described in any one of claims 1 to 7.
10. A computer storage medium, characterized in that, Used to store a computer program, which, when executed by a processor, is used to implement the distance line calibration method for an electronic rearview mirror as described in any one of claims 1 to 7.