Method and device for obtaining roll angle and correcting installation angle of vehicle-mounted camera
By identifying the horizontal straight lines on the car body, the camera roll corner, and uses the Karman filter in real -time correction angle to solve the problem of accuracy and speed of car camera correction in the existing technology, and achieve efficient and stable correction effects.
Patent Information
- Application Number
- CN202010834781.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-18
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2040-08-18
AI Technical Summary
The prior art is difficult to quickly and accurately correct the rolling angle and installation position of on-board cameras, especially in the absence of lane lines or due to driving factors.
By identifying the horizontal straight line on the vehicle body, the corner of the camera is calculated, and the installation angle of the Calman filter dynamically corrected the camera is used in real time, including the corner, aurax and pitch angle.
The fast and accurate camera corner corner and installation position correction is achieved, reducing the time -consuming and noise effect of detection, and improving the stability and accuracy of correction.
Smart Images

Figure CN112017249B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a vehicle-mounted camera, and in particular to real-time dynamic correction of the installation position of the vehicle-mounted camera. Background Art
[0002] In the ADAS system, visual ranging technology provides distance information of targets in road scenes. Camera calibration determines the correspondence between the image coordinate system, camera coordinate system and world coordinate system, and obtains the distance of the target by calculating the transformation projection matrix, camera internal parameters and using the principle of triangulation. After the focal length of the camera is fixed, the change of internal parameters can generally be ignored, so the accuracy and adaptability of the camera external parameter calibration have a greater impact on the ranging accuracy.
[0003] Referring to Chinese patent CN201680069618.0, the installation angle of the vehicle-mounted camera is an external parameter of the camera. It is calibrated with high precision using a precise checkerboard pattern drawn on a calibration plate or calibration cloth before leaving the factory or using the camera. However, vehicles often bump or shake under normal road conditions, and the camera installation angle will deviate from the initial state. At this time, if the previous calibration result is used for distance calculation, a large error will occur.
[0004] Visual ranging restricts the performance improvement of ADAS products to a certain extent, so it is very important to develop a visual ranging system that can dynamically correct the camera installation angle.
[0005] To this end, Chinese patent CN201910469033.3 discloses a method for calibrating camera extrinsic parameters at a high frequency during vehicle use. However, it mainly performs pitch angle and camera height correction, and has limited correction of other camera extrinsic parameters.
[0006] In Chinese patent CN201910510879.7, the lane lines in the road image are first extracted, and then the constraint equations of the pitch angle, yaw angle and roll angle are derived according to the preset correction formula. The pitch angle, yaw angle and roll angle are solved by the constraint equations. Although this method corrects the camera installation angle more comprehensively, the correction of the roll angle depends on the lane lines. On roads without lanes or due to driving factors and the accuracy of the lane lines, it often affects the accuracy of detection.
[0007] In Chinese patent CN201910362590.5, the continuously captured grayscale images are tracked and calibrated in the images taken by the camera to perform three-dimensional reconstruction and then fit the ground plane equation. Although it does not rely on any parallel lines and other signs on the road surface, it solves the problem of accurate detection, but the amount of calculation is large, the system required is relatively complex, and it takes a long time.
[0008] Therefore, there is an urgent need for a method for calibrating the roll angle and installation position of a vehicle-mounted camera with high accuracy and convenient and fast detection. Summary of the invention
[0009] The purpose of the present invention is to provide a method for obtaining the roll angle of a vehicle-mounted camera, a corresponding electronic device and a computer-readable storage medium, which can quickly and accurately correct the roll angle of the camera, and the calculation is simple and convenient.
[0010] Another object of the present invention is to provide a real-time dynamic correction method for the installation angle of a vehicle-mounted camera, as well as a corresponding electronic device and computer-readable storage medium, which can quickly and accurately obtain the roll angle of the camera, and correct the installation position of the camera through the roll angle, pitch angle and azimuth angle.
[0011] In order to achieve the above-mentioned object, the present invention discloses a method for obtaining the roll angle of a vehicle-mounted camera, comprising the following steps: (1) obtaining a captured image having a vehicle body area by using a vehicle-mounted camera; (2) extracting all horizontal straight lines in the vehicle body area in the captured image; (3) calculating the slopes of all horizontal straight lines, and taking the slope value in the middle of the slopes of the straight lines as the slope corresponding to the final horizontal angle; and (4) calculating the roll angle of the camera according to the horizontal angle.
[0012] Compared with the prior art, the present invention calculates the roll angle of the camera by identifying the horizontal straight line on the vehicle body. On the one hand, the detection result is accurate and time-consuming because the features on the vehicle body on which the camera is installed are used for identification. On the other hand, the roll angle is calculated by identifying the horizontal straight line and calculating the slope of the horizontal straight line, which is simple and convenient. On the other hand, the present invention takes the slope of the straight line in the middle of all the horizontal straight lines on the vehicle body identified as the final horizontal angle, and the calculation result is more accurate, which can quickly and effectively eliminate the interference caused by extreme situations and ensure the stability of the correction.
[0013] Preferably, between steps (2) and (3), the step (a) further includes: removing interfering straight lines from the straight lines in the horizontal direction, so as to further improve the accuracy of detection.
[0014] Specifically, the step (a) includes: deleting horizontal straight lines whose length is less than a preset value.
[0015] Preferably, in step (2), the LSD straight line detection method is used to extract all horizontal straight lines in the vehicle body area in the captured image. The LSD straight line detection method is used for straight line extraction, which is simple and accurate. Of course, other methods can also be used for straight line extraction, which is not limited to LSD straight line detection.
[0016] Specifically, the step (2) includes: (21) extracting the vehicle body area image in the captured image; (22) calculating the gradients of the vehicle body area image in the vertical and horizontal directions; (23) selecting pixel points whose gradient values satisfy the preset direction threshold range of the horizontal gradient and performing pseudo-sorting; (24) using the pseudo-sorting result as a seed point to perform four-neighborhood area growth, and calculating the circumscribed rectangle of each connected area to form a rectangular frame; (25) determining whether the density of the alignment points in each rectangular frame meets the preset threshold, and outputting the rectangular frame that meets the preset threshold as the screened straight line, wherein the alignment point is a pixel point whose gradient angle is consistent with the main axis angle of the rectangular frame within the tolerance range.
[0017] The present invention also discloses a method for real-time dynamic correction of the installation angle of a vehicle-mounted camera, which uses the vehicle-mounted camera to collect and shoot images to calculate the roll angle, azimuth angle, and pitch angle of the vehicle-mounted camera, and dynamically corrects the installation angle of the camera in real time based on the roll angle, azimuth angle, and pitch angle, wherein the roll angle is calculated using the vehicle-mounted camera roll angle acquisition method as described above.
[0018] Compared with the prior art, the present invention calculates the roll angle of the camera by identifying the horizontal straight line on the vehicle body. On the one hand, the detection result is accurate because the features on the vehicle body on which the camera is installed are used for identification. On the other hand, the roll angle is calculated by identifying the horizontal straight line and calculating the slope of the horizontal straight line, which is simple and convenient. On the other hand, the present invention takes the slope of the straight line in the middle of all the horizontal straight lines on the vehicle body as the final horizontal angle, which is not only convenient and fast to calculate, but also more accurate in calculation results, and can effectively eliminate interference caused by extreme situations to ensure the stability of correction. On the other hand, the present invention can simultaneously correct the three installation angles of the camera: roll angle, azimuth angle, and pitch angle.
[0019] Preferably, using a vehicle-mounted camera to collect captured images to calculate the azimuth and pitch angles of the vehicle-mounted camera includes the following steps: using the captured images to perform multi-lane line detection and filter out lane lines; using the lane lines to calculate the azimuth and pitch angles of the camera.
[0020] More preferably, the “performing multi-lane line detection and screening out lane lines” specifically screens out two parallel lane lines.
[0021] Specifically, "using lane lines to calculate the azimuth and pitch angle of the camera" specifically means: calculating the intersection of two parallel lane lines to obtain a vanishing point, and using the vanishing point to calculate the azimuth and pitch angle of the camera. The present invention obtains the azimuth and pitch angle by obtaining the vanishing point of the lane line.
[0022] Specifically, the specific steps of selecting two parallel lane lines include: selecting the two longest straight lane lines as the selected lane lines.
[0023] More specifically, the specific steps of screening out two parallel lane lines include: acquiring lane detection data based on the captured image and screening out lane line data, projecting the lane line data into a bird's-eye view, calculating the slopes of all lane lines in the bird's-eye view, calculating the average of the slopes of all lane lines, and deleting the lane lines whose difference between the slope and the average exceeds a preset threshold among all lane lines; sorting the remaining lane lines after deletion, and selecting the two longest straight lane lines as the screened out lane lines.
[0024] Preferably, the step (A4) specifically includes: constructing a Kalman filter by combining the roll angle, azimuth angle, pitch angle and the angular velocity of the current camera into state variables, and correcting the installation angle of the camera according to the filtering result. By establishing a Kalman filter for the three angles and angular velocity, noise is filtered out, and the change of the angle is corrected, so as to further improve the accuracy of dynamic correction.
[0025] Specifically, the angular velocity includes the angular velocity of the roll angle, the azimuth angle, and the pitch angle.
[0026] The present invention also discloses an electronic device, comprising: a camera; one or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, and the program includes instructions for executing the method for acquiring the roll angle of a vehicle-mounted camera as described above.
[0027] The present invention also discloses a computer-readable storage medium, including a computer program used in combination with a camera, and the computer program can be executed by a processor to implement the above-mentioned method for acquiring the roll angle of the vehicle-mounted camera.
[0028] The present invention also discloses an electronic device, comprising: a camera; one or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, and the program includes instructions for executing the real-time dynamic correction method for the installation angle of a vehicle-mounted camera as described above.
[0029] The present invention also discloses a computer-readable storage medium, including a computer program used in combination with a camera, and the computer program can be executed by a processor to implement the real-time dynamic correction method for the installation angle of the vehicle-mounted camera as described above. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 It is a flow chart of the method for real-time dynamic correction of the installation angle of the vehicle-mounted camera described in the present invention.
[0031] Figure 2It is a flow chart of the method for obtaining the azimuth angle and pitch angle of the vehicle-mounted camera described in the present invention.
[0032] Figure 3 It is a flow chart of the method for acquiring the roll angle of a vehicle-mounted camera described in the present invention.
[0033] Figure 4 It is a flow chart of extracting all horizontal straight lines of the vehicle body area image according to the present invention.
[0034] Figure 5 is to solve for the pitch angle of geometric figures.
[0035] Figure 6 is to solve for the azimuth of geometric figures.
[0036] Figure 7 Schematic diagram of the relationship between horizontal angle and roll angle. DETAILED DESCRIPTION
[0037] In order to explain the technical content, structural features, achieved objectives and effects of the present invention in detail, the following is a detailed description in conjunction with the implementation methods and the accompanying drawings.
[0038] refer to Figure 1 The present invention discloses a method 100 for real-time dynamic correction of the installation angle of a vehicle-mounted camera, comprising the following steps: (A1) using a vehicle-mounted camera to capture images, (A2) calculating the roll angle, azimuth angle, and pitch angle of the vehicle-mounted camera based on the captured images, and (A3) real-time dynamic correction of the installation angle of the camera based on the roll angle, azimuth angle, and pitch angle.
[0039] Preferably, before step (A2), the method further includes the step of obtaining the preset internal calibration parameters of the camera, the external calibration results, and the correction angle of the camera in the previous frame. In steps (A2) and (A3), the preset internal calibration parameters of the camera, the external calibration results, and the correction angle of the camera in the previous frame are used to perform specific numerical calculations, as described below.
[0040] Among them, the camera internal calibration parameters, static external calibration results, and the roll angle, azimuth angle, and pitch angle of the previous camera frame calibration are obtained by reading the configuration parameters. The internal calibration parameters and static external calibration results include the camera focal length, optical center position, distortion matrix, camera height, roll angle, azimuth angle, pitch angle of the camera installation, etc. The previous camera frame calibration angle is the roll angle, azimuth angle, and pitch angle of the previous camera frame calibration.
[0041] refer to Figure 2The method 200 for calculating the azimuth and elevation angle of the vehicle-mounted camera by collecting a captured image using a vehicle-mounted camera comprises the following steps: (B1) performing multi-lane line detection based on the captured image and selecting two parallel lane lines, (B2) calculating the intersection of the two parallel lane lines to obtain a vanishing point, and (B3) using the vanishing point to calculate the azimuth and elevation angle of the camera.
[0042] Preferably, in step (B1), selecting two parallel lane lines specifically includes: selecting the two longest straight lane lines as the selected lane lines.
[0043] Specifically, the specific steps of screening out two parallel lane lines include: (1) obtaining lane detection data and screening out lane line data. (2) projecting the lane line data into a top view. (3) calculating the slopes of all lane lines in the top view. (4) calculating the average of the slopes of all lane lines. (5) deleting lane lines whose difference between the slope and the average exceeds a preset threshold among all lane lines, that is, eliminating lane lines that deviate far from the average. (6) sorting the remaining lane lines after the deletion, and selecting the two longest straight lane lines as the screened lane lines.
[0044] Of course, different from the above embodiment, the azimuth and pitch angles can also be calculated in other ways, such as after screening out all lane lines, calculating the slope of the lane line, and using the slope of the lane line to calculate the azimuth and pitch angle. The slope of the lane line can be the average value of the slopes of all lane lines, or the middle value of the slope of the lane line can be taken as the final lane line. Before calculating the slope of the lane line, lane line screening is also performed to remove lane lines whose length is less than a preset value.
[0045] In step B1, multiple lane line detection is performed based on the detection data obtained by the ADAS front. In step B2, the intersection of two parallel lane lines is calculated on the original image by extending the intersection of the two lane lines to infinity. The original image is included in the detection data obtained by the ADAS front, and is the image captured by the front camera.
[0046] The specific steps of projecting the lane line data into the top view include:
[0047] (1) Project all lane lines onto the top view according to the perspective transformation matrix:
[0048]
[0049] Where u and v are image coordinates, Xw, Yw, and Zw are world coordinates, k is the scale factor, dx and dy are the pixel sizes in the x and y directions, f is the focal length of the camera, and u0 and v0 are the positions of the optical center.
[0050] The rotation matrix R is:
[0051]
[0052] θ is the roll angle of the previous frame dynamic correction, is the pitch angle corrected in the previous frame, Ψ is the azimuth angle corrected in the previous frame, that is, the angle between the camera optical center and the lane line direction.
[0053] Wherein, before step (1), the detection data is also subjected to Gaussian downsampling.
[0054] (2) World coordinates Map to the top view coordinates x,y according to the proportion k: .
[0055] Among them, in step B2, the vanishing point is obtained by screening based on the obtained multi-lane detection results and the camera calibration results of the previous frame. Of course, other methods can also be used to screen lane lines, such as selecting a straight line with a vertical gradient in the area outside the vehicle for lane line recognition, etc., which is not limited to this embodiment.
[0056] Among them, in step B3, the azimuth angle of the camera is calculated using the vanishing point P (xt, yt) and pitch angle :
[0057] Using the formula calculate . That is, calculate t vk , and then the pitch angle can be calculated by the inverse tangent function .
[0058] Specific visible Figure 5 , where 0z is the z-axis of the world coordinate system, 0y is the y-axis in the image coordinate system, f is the focal length of the camera, the image coordinates of the vanishing point P(xt, yt) (i.e., the intersection of the two lane lines in the image plane), and Pyt is the projection of the vanishing point P(xt, yt) on the y-axis of the camera coordinate system. Cyo' is the direction of the optical axis, and cy is the y-coordinate of the optical center of the camera. t vk is the difference between Pyt and cy. The pitch angle can be calculated by the inverse tangent function. .
[0059] in accordance with Figure 6 Solve the geometric figures in the calculation of azimuth , where xoy is the camera coordinate system, 0 is the optical center coordinate, 00' is the optical axis, and f is the focal length. yt0' is the road direction. The azimuth angle can be determined by geometric solution.
[0060] refer to Figure 3, the method 300 for calculating the roll angle of a vehicle-mounted camera based on a captured image comprises the following steps: (S1) using a vehicle-mounted camera to obtain a captured image having a vehicle body area. (S2) extracting all horizontal straight lines in the vehicle body area in the captured image. (S3) calculating the slopes of all horizontal straight lines, and taking the slope value in the middle of the straight line slope as the slope corresponding to the final horizontal angle. (S4) calculating the roll angle of the camera based on the horizontal angle. Among them, step (S1) can be implemented in step A1.
[0061] In step S1, the front camera at the front and rear of the vehicle is used to capture an image of the vehicle body area. In this embodiment, the front camera and the rear camera capture images of the front and rear areas of the vehicle for straight line detection. Of course, the front camera or the rear camera can also capture images of the front or rear area of the vehicle for straight line detection. The specific camera used is a camera for installation angle correction, and is not limited to the range of the front camera at the front and rear of the vehicle.
[0062] In the step S2, the LSD straight line detection method is used to extract all horizontal straight lines in the vehicle body area in the captured image.
[0063] refer to Figure 4 , the step S2 specifically includes: (S21) extracting the vehicle body area image in the captured image. (S22) calculating the vertical and horizontal gradients in the vehicle body area image. (S23) filtering out the horizontal gradient according to a preset direction threshold, and performing pseudo-sorting. (S24) using the result of the pseudo-sorting as a seed point to perform 4-neighborhood area growth, and calculating the circumscribed rectangle of each connected area to form a rectangular frame. (S25) judging whether the density of the alignment points in each rectangular frame meets the preset threshold. (S26) outputting the rectangular frame that meets the preset threshold as the filtered straight line. Among them, the alignment point is a pixel point whose gradient angle is consistent with the main axis angle of the rectangular frame within a tolerance range. The present invention extracts horizontal straight lines of the vehicle body part in the captured image through a simplified LSD straight line detection method.
[0064] Of course, other algorithms may also be used for line detection, such as Hough line detection, Freeman line detection algorithm, neural network feature extraction to obtain lines, and the like.
[0065] Step S22 specifically includes: (1) using the Sobel edge operator to calculate the image gradient. (2) convolving the vehicle body region image I with the Sobel vertical operator and horizontal operator to obtain the vertical and horizontal gradients.
[0066]
[0067]
[0068] The direction of the line is calculated using the following formula:
[0069]
[0070] Gradient Amplitude:
[0071] .
[0072] Of course, other methods may also be used to calculate image gradients, and are not limited to this embodiment.
[0073] Step S23 specifically includes: selecting pixel points whose gradient values are within a preset threshold value from the horizontal gradient (the horizontal gradient calculated in the above step S22), and performing pseudo sorting. Specifically, taking the straight line direction F as a reference, the gradient whose straight line direction is within a preset threshold range from the above straight line direction F is selected as the selected horizontal gradient, and pseudo sorting is performed on the pixel points whose gradient values are the selected horizontal gradient.
[0074] Step S24 specifically includes: taking the pixel points whose gradient values meet the preset threshold as seed points to perform 4-neighborhood region growth to form a rectangular frame.
[0075] Step S25 specifically includes: using the rectangle in the LSD algorithm to estimate the straight line (the segmented straight line can be represented by a circumscribed rectangle). The area is constructed into a rectangle, and the size of the rectangle is set to 10 pixels (of course, other values can also be used, which can be set by the technician as needed). The pixels whose gradient angles in the rectangular area are within the tolerance range of the main axis angle of the rectangle are screened out as alignment points. In this embodiment, the tolerance is set to 20° (of course, other values can be set as needed). The pixels that remain consistent within the range are called alignment points. When the density of the alignment points is greater than the threshold, a straight line is output.
[0076] Preferably, the step S2 and S3 further include (a): removing interfering straight lines in the horizontal straight lines to further improve the correction accuracy. Specifically, the horizontal straight lines whose length is less than a preset value are deleted, that is, the shorter straight lines are deleted. Of course, different from the above embodiment, all the horizontal straight lines are sorted, and the first N straight lines are selected, where N is set by the technician according to needs and is preferably greater than or equal to 3. Based on this embodiment, the horizontal straight lines whose length is greater than a preset value (body width) can also be deleted.
[0077] The step S3 comprises: (S3a) obtaining the slopes of all horizontal straight lines. (S3b) taking the slope value in the middle of the straight line slope as the slope corresponding to the final horizontal angle. All horizontal straight lines in step (S3a) are the straight lines selected in step (a).
[0078] Step (S3a) specifically includes:
[0079] (1) Calculate the center of the rectangle:
[0080]
[0081]
[0082] G(j) is the gradient value of pixel j, where j represents every pixel in the region.
[0083] (2) Obtain the angle of the rectangle (i.e., the horizontal straight line) through the angle of the characteristic vector: , the angle of the eigenvector refers to the angle of the eigenvector corresponding to the minimum eigenvalue when the M matrix is used to calculate the eigenvalue; where
[0084] ;
[0085] ;
[0086] .
[0087] The step (S3b) specifically includes: finding the slopes of all the horizontal straight lines in step (S3a), sorting the slopes, and selecting the slope at the middle value as the slope corresponding to the final horizontal angle. If the number of the horizontal straight lines is an even number, the slope value of the straight line with the slope value close to the average value of the slopes of all the horizontal straight lines in the middle is selected as the slope corresponding to the final horizontal angle.
[0088] In step S4, if the roll angle is Ɵ, the slope corresponding to the final horizontal angle is tanƟ.
[0089] refer to Figure 7 , xoy is the camera coordinate system, M1, M2, and M3 are three points in the straight line with the slope at the middle value, oc is the center of the rectangular frame, ox1 is the final horizontal direction, and oy1 is the vertical direction after roll angle correction.
[0090] The step A3 specifically includes: constructing a Kalman filter by combining the roll angle, azimuth angle, pitch angle and the angular velocity of the current camera into state variables, and correcting the installation angle of the camera according to the filtering result. Specifically, the angular velocity is the angular velocity of the roll angle, azimuth angle and pitch angle respectively.
[0091] The present invention also discloses an electronic device, comprising: a camera; one or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, and the program includes instructions for executing the method for acquiring the roll angle of a vehicle-mounted camera as described above.
[0092] The present invention also discloses a computer-readable storage medium, including a computer program used in combination with a camera, and the computer program can be executed by a processor to implement the above-mentioned method for acquiring the roll angle of the vehicle-mounted camera.
[0093] The present invention also discloses an electronic device, comprising: a camera; one or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, and the program includes instructions for executing the real-time dynamic correction method for the installation angle of a vehicle-mounted camera as described above.
[0094] The present invention also discloses a computer-readable storage medium, including a computer program used in combination with a camera, and the computer program can be executed by a processor to implement the real-time dynamic correction method for the installation angle of the vehicle-mounted camera as described above.
[0095] The above disclosure is only the preferred embodiment of the present invention, which certainly cannot be used to limit the scope of rights of the present invention. Therefore, equivalent changes made according to the scope of the patent application of the present invention are still within the scope covered by the present invention.
Claims
1. A method for obtaining a roll angle of a vehicle-mounted camera, characterized in that: The following steps are involved: (1) Using a vehicle-mounted camera to obtain a photographic image of a vehicle body region where the vehicle body is located; (2) extracting all horizontal straight lines in the vehicle body region of the vehicle body where the vehicle-mounted camera is located in the captured image, thereby identifying the horizontal straight lines based on the features of the vehicle body itself on which the vehicle-mounted camera is installed; (3) Calculate the slopes of all horizontal lines and take the slope value in the middle as the slope corresponding to the final horizontal angle; (4) The roll angle of the camera is calculated based on the horizontal angle. The slope corresponding to the final horizontal angle is tanθ, and the roll angle is θ.
2. The method for acquiring the roll angle of a vehicle-mounted camera according to claim 1, wherein: The step (a) is also included between steps (2) and (3): removing interfering straight lines from the straight lines in the horizontal direction.
3. The method for acquiring the roll angle of a vehicle-mounted camera according to claim 2, wherein: The step (a) specifically includes: deleting horizontal straight lines whose length is less than a preset value.
4. The method for acquiring the roll angle of a vehicle-mounted camera according to claim 1, wherein: In the step (2), the LSD straight line detection method is used to extract all horizontal straight lines in the vehicle body area in the captured image.
5. The method for acquiring the roll angle of a vehicle-mounted camera according to claim 4, characterized in that: The step (2) specifically includes: (21) extracting the vehicle body area image within the captured image; (22) Calculating the gradients of the vehicle body area image in the vertical and horizontal directions; (23) Select the pixel points whose gradient values meet the preset direction threshold range of the horizontal gradient and perform pseudo sorting; (24) Using the pseudo-sorting result as the seed point to grow the 4-neighborhood region, calculate the circumscribed rectangle of each connected region to form a rectangular frame; (25) Determine whether the density of the alignment points in each rectangular box meets the preset threshold, and output the rectangular boxes that meet the preset threshold as the screened straight lines. The alignment points are the pixel points whose gradient angles are consistent with the main axis angles of the rectangular boxes within the tolerance range.
6. A method for real-time dynamic correction of the installation angle of a vehicle-mounted camera, which uses the vehicle-mounted camera to collect and shoot images to calculate the roll angle, azimuth angle, and pitch angle of the vehicle-mounted camera, and dynamically corrects the installation angle of the camera in real time based on the roll angle, azimuth angle, and pitch angle, characterized in that: The roll angle is calculated using the roll angle acquisition method for a vehicle-mounted camera as described in any one of claims 1 to 5.
7. The method for real-time dynamic correction of the installation angle of a vehicle-mounted camera according to claim 6, characterized in that: Using a vehicle-mounted camera to collect and shoot images to calculate the azimuth angle and pitch angle of the vehicle-mounted camera includes the following steps: Using the captured image to perform multi-lane line detection and filter out lane lines; Calculate the camera's azimuth and pitch angles using the lane lines.
8. The method for real-time dynamic correction of the installation angle of a vehicle-mounted camera according to claim 7, characterized in that: The multiple lane line detection and lane line screening are specifically as follows: two parallel lane lines are screened out.
9. The method for real-time dynamic correction of the installation angle of a vehicle-mounted camera according to claim 8, characterized in that: The specific method of using lane lines to calculate the azimuth and pitch angle of the camera is as follows: the intersection of two parallel lane lines is calculated to obtain a vanishing point, and the vanishing point is used to calculate the azimuth and pitch angle of the camera.
10. The method for real-time dynamic correction of the installation angle of a vehicle-mounted camera according to claim 8, characterized in that: The specific steps of selecting two parallel lane lines include: selecting the two longest straight lane lines as the selected lane lines.
11. The method for real-time dynamic correction of the installation angle of a vehicle-mounted camera according to claim 10, characterized in that: The specific steps of screening out two parallel lane lines include: acquiring lane detection data based on the captured image and screening out lane line data, projecting the lane line data into a bird's-eye view, calculating the slopes of all lane lines in the bird's-eye view, calculating the average of the slopes of all lane lines, and deleting lane lines whose difference between the slope and the average exceeds a preset threshold among all lane lines; sorting the remaining lane lines after deletion, and selecting the two longest straight lane lines as the screened out lane lines.
12. The method for real-time dynamic correction of the installation angle of a vehicle-mounted camera according to claim 6, characterized in that: The specific steps of correcting the installation angle of the camera according to the roll angle, azimuth angle, and pitch angle include: constructing a Kalman filter by combining the roll angle, azimuth angle, pitch angle, and angular velocity of the current camera into state variables, and correcting the installation angle of the camera according to the filtering result, wherein the angular velocity includes the angular velocity of the roll angle, azimuth angle, and pitch angle.
13. An electronic device, characterized in that: include: Camera; one or more processors; Memory; as well as One or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, and the programs include instructions for executing the method for acquiring the roll angle of a vehicle-mounted camera as described in any one of claims 1-5.
14. A computer readable storage medium comprising a computer program for use in conjunction with a camera, characterized in that: The computer program can be executed by a processor to implement the method for acquiring the roll angle of a vehicle-mounted camera as described in any one of claims 1 to 5.
15. An electronic device, characterized in that: include: Camera; one or more processors; Memory; as well as One or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, and the programs include instructions for executing the real-time dynamic correction method for the installation angle of a vehicle-mounted camera as described in any one of claims 6-12.
16. A computer readable storage medium comprising a computer program for use in conjunction with a camera, characterized in that: The computer program can be executed by a processor to implement the real-time dynamic correction method for the installation angle of a vehicle-mounted camera as described in any one of claims 6-12.
Citation Information
Patent Citations
Method for calibrating the orientation of a camera mounted to a vehicle
CN108292439A
Camera external parameter correction system and method
CN110211176A
Camera self-calibration method based on SFM three-dimensional reconstruction
CN110223354A
A camera calibration method based on lane lines and target vehicles
CN110264525B
Camera calibration method based on lane line and target vehicle
CN110264525A