Camera lens rotation calibration method and apparatus and storage medium
By screening the camera lens rotation calibration method in the polar coordinate system and determining the lens rotation amount, the problem of insufficient camera lens calibration accuracy is solved and the camera's anti-shake effect is improved.
Patent Information
- Application Number
- PCT/CN2024/085816
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-03-26
- Filing Date
- 2024-04-03
- Publication Date
- 2025-10-02
AI Technical Summary
In the existing technology, the accuracy of camera lens rotation calibration is insufficient, resulting in unsatisfactory camera anti-shake effect. The IMU data does not correctly correspond to the posture of the lens module and camera housing, and effective anti-shake cannot be achieved.
By obtaining the calibration line segments in the initial calibration image, converting them into the polar coordinate system to generate the initial curve, filtering out the target line segments, and determining the lens rotation amount according to the inclination relationship between the target line segments and the standard direction for calibration.
Improves the accuracy of camera lens rotation calibration, improves the camera's anti-shake effect, and ensures the correct correspondence between IMU data and the posture of the lens module and camera housing.
Smart Images

Figure CN2024085816_02102025_PF_FP_ABST
Abstract
Description
Camera lens rotation calibration method, device and storage medium Technical Field
[0001] The present application relates to the technical field of camera parameter calibration, and in particular to a camera lens rotation calibration method, device, and storage medium. Background Art
[0002] After a panoramic image is captured by a panoramic camera, it can be converted into a two-dimensional form using an unwrapping algorithm. A key input parameter for the unwrapping algorithm is inertial measurement unit (IMU) data. This IMU data can be used to infer the camera's pose at the time each frame is captured. Incorporating IMU data into the unwrapping process ensures that the background of each frame changes smoothly with the motion, while the background itself experiences irregular jitter due to motion changes. This unwrapping process is also known as stabilization. To achieve optimal stabilization, accurate camera calibration parameters are also required, particularly the lens rotation matrix. This ensures that the IMU data accurately corresponds to the pose of the lens module and camera housing. Otherwise, the camera pose captured by the IMU will differ from the actual pose of the lens module, rendering stabilization ineffective. Therefore, improving the accuracy of lens rotation calibration by enhancing camera stabilization has become a pressing technical challenge. Technical issues
[0003] The present application provides a camera lens rotation calibration method, device and storage medium, which improve the accuracy of camera lens rotation calibration by improving the anti-shake effect of the camera.
[0004] In a first aspect, the present application provides a camera lens rotation calibration method, the method comprising:
[0005] Acquire calibration line segments in the initial calibration image; wherein the calibration line segments are multiple parallel line segments set based on standard directions in a Cartesian coordinate system;
[0006] Extracting all initial points in the calibration line segment, and converting each initial point into a polar coordinate system to generate an initial curve corresponding to the initial point;
[0007] screening each of the initial curves, and determining a plurality of target line segments in the Cartesian coordinate system according to the screened initial curves;
[0008] Based on the inclination relationship between the plurality of target line segments and the straight line of the standard direction, the lens rotation amount of the camera lens is determined, and the camera lens is calibrated according to the lens rotation amount.
[0009] In a second aspect, the present application further provides a camera lens rotation calibration device, the device comprising:
[0010] A calibration line segment acquisition module, configured to acquire calibration line segments in the initial calibration image; wherein the calibration line segments are multiple parallel line segments set based on standard directions in a Cartesian coordinate system;
[0011] An initial curve generating module is used to extract all initial points in the calibration line segment, convert each initial point into a polar coordinate system, and generate an initial curve corresponding to the initial point;
[0012] a target line segment determination module, configured to screen each of the initial curves and determine a plurality of target line segments in the Cartesian coordinate system according to the screened initial curves;
[0013] The lens rotation amount determination module is used to determine the lens rotation amount of the camera lens based on the inclination relationship between the multiple target line segments and the straight line of the standard direction, and calibrate the camera lens according to the lens rotation amount.
[0014] In a third aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the camera lens rotation calibration method as described above.
[0015] The present application discloses a camera lens rotation calibration method, device and storage medium, the camera lens rotation calibration method comprising obtaining calibration line segments in an initial calibration image; wherein the calibration line segments are multiple parallel line segments set based on standard directions in a Cartesian coordinate system; extracting all initial points in the calibration line segments, and converting each of the initial points into a polar coordinate system to generate an initial curve corresponding to the initial point; screening each of the initial curves, and determining multiple target line segments in the Cartesian coordinate system based on the screened initial curves; determining the lens rotation amount of the camera lens based on the inclination relationship between the multiple target line segments and the straight line in the standard direction, and calibrating the camera lens according to the lens rotation amount. Through the above method, the present application converts the calibration line segment in the Cartesian coordinate system into the polar coordinate system, generates an initial curve corresponding to the initial point, and screens the initial curve, that is, excludes the messy points corresponding to the Cartesian coordinate system to determine the target line segment, and finally determines the lens rotation amount according to the inclination relationship between the target line segment and the standard direction so that the camera lens can be rotated and calibrated according to the lens rotation amount, thereby improving the accuracy of the camera lens rotation calibration. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0017] FIG1 is a schematic flow chart of a camera lens rotation calibration method provided in an embodiment of the present application.
[0018] FIG2 is an image of a camera calibration jig for a camera lens rotation calibration method provided in an embodiment of the present application.
[0019] FIG3 is a schematic diagram of calibration line segments of a camera lens rotation calibration method provided in an embodiment of the present application.
[0020] FIG4 is a schematic diagram of an initial curve of a camera lens rotation calibration method provided in an embodiment of the present application.
[0021] FIG5 is a schematic diagram of a target line segment of a camera lens rotation calibration method provided in an embodiment of the present application.
[0022] FIG6 is a schematic diagram of a Hough transform of a camera lens rotation calibration method provided in an embodiment of the present application.
[0023] FIG7 is a schematic block diagram of a camera lens rotation calibration device provided in an embodiment of the present application.
[0024] FIG8 is a schematic block diagram of the structure of a computer device provided in an embodiment of the present application. Best Mode for Carrying Out the Invention
[0025] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0026] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, combined, or partially merged, so the actual execution order may vary depending on the actual situation.
[0027] It should be understood that the terms used in this specification are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms unless the context clearly indicates otherwise.
[0028] It will also be understood that the term "and / or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0029] The following describes some embodiments of the present application in detail with reference to the accompanying drawings. In the absence of conflict, the following embodiments and features therein may be combined with each other.
[0030] Please refer to Figure 1, which is a schematic flow chart of a camera lens rotation calibration method provided by an embodiment of the present application. The camera lens rotation calibration method specifically includes steps S10 to S40.
[0031] Step S10: obtaining calibration line segments in the initial calibration image; wherein the calibration line segments are multiple parallel line segments set based on standard directions in a Cartesian coordinate system;
[0032] Step S20: extract all initial points in the calibration line segment, and convert each initial point into a polar coordinate system to generate an initial curve corresponding to the initial point;
[0033] Step S30: screening each of the initial curves, and determining a plurality of target line segments in the Cartesian coordinate system according to the screened initial curves;
[0034] Step S40: determining a lens rotation amount of the camera lens based on the inclination relationship between the plurality of target line segments and the straight line in the standard direction, and calibrating the camera lens according to the lens rotation amount.
[0035] Specifically, as shown in Figure 2, Figure 2 is an image of a camera calibration jig for a camera lens rotation calibration method provided by an embodiment of the present application. Camera calibration first requires preparing a jig for rotation calibration. The calibration plane of the jig is drawn with preset line segments with clear and parallel lines based on a standard direction. The standard direction can be any direction. These preset line segments serve as reference lines to subsequently indicate the rotation amount of the lens module. Then, the camera and jig are fixed to the calibration bracket respectively. The top is the camera placement table, and the calibration jig is fixed to the table in the middle of the bracket. When collecting calibration materials, it is necessary to first fix the camera on the top placement table. It should be noted that since the lens is being calibrated, it is necessary to confirm that the camera lens is facing downwards in the direction of the jig. In addition, the plane of the camera lens and the calibration plane must be set parallel to each other to avoid the preset line segments on the calibration plane becoming non-parallel radially distributed straight lines and forming a certain angle with the top edge of the camera housing, which will no longer indicate the lens rotation amount, thus causing calibration failure. At the same time, the projection of the camera lens center onto the calibration plane is roughly aligned with the center of the calibration plane to ensure that the captured calibration line segment is centered in the primary lens' field of view. Also, confirm that the top edge of the camera housing is parallel to the preset line segment to ensure that the calibration line segment in the calibration fixture is oriented in the standard direction of the housing top edge during footage capture. At this point, press the camera's capture button to capture the footage required for calibration.
[0036] Since the calibration plane is fixed in a position approximately aligned with the camera lens before collecting footage, the pitch, yaw, and roll angles can all be set to 0. In other words, the viewing angle is selected in the direction facing the lens, and the horizontal and vertical field of view angles are both around 20°.
[0037] Specifically, once the target line segment is determined, the tilt angle of each line relative to the standard direction is the camera lens's rotation angle. If there is only one target line segment, the camera lens can be calibrated directly based on this rotation angle. If there are more than one target line segment, the camera lens must be calibrated based on the rotation angles corresponding to multiple target line segments.
[0038] Based on the embodiment shown in FIG1 , this embodiment is shown in FIG5 , and step S10 includes:
[0039] Obtaining pre-calibrated line segments in the initial calibration image;
[0040] If the line width of the pre-calibrated line segment is greater than or equal to a preset line width threshold, edge detection is performed on the pre-calibrated line segment using a preset edge algorithm to generate an edge line segment, and the edge line segment is used as the calibration line segment;
[0041] If the line width of the pre-calibrated line segment is smaller than the preset line width threshold, the pre-calibrated line segment is determined as the calibration line segment.
[0042] Furthermore, obtaining the pre-calibrated line segments in the initial calibration image includes:
[0043] Providing a calibration plane with preset line segments;
[0044] The plane of the camera lens is arranged parallel to the calibration plane, and the projection of the center of the camera lens on the calibration plane substantially coincides with the center of the calibration plane;
[0045] Performing a distance adjustment operation on the camera lens based on the calibration plane so that the camera lens can capture a clear pattern on the calibration plane;
[0046] The initial calibration image is captured using the distance-adjusted camera lens to obtain the pre-calibrated line segment.
[0047] Based on the embodiment shown in FIG1 , in this embodiment, step S20 includes:
[0048] Obtaining the initial coordinates of all the initial points;
[0049] Each of the initial coordinates is converted into the corresponding initial curve in the polar coordinate system according to the preset Hough transform formula; wherein the expression of the initial curve is , x is the horizontal coordinate of the initial coordinate, y is the vertical coordinate of the initial coordinate, is the polar radius of the initial curve, is the polar angle of the initial curve.
[0050] More preferably, step S30 includes:
[0051] Obtaining the number of the initial curves that each polar coordinate point in the polar coordinate system passes through;
[0052] Setting the polar coordinate points of the initial curve whose number is greater than a preset threshold as target polar coordinate points;
[0053] Based on the preset Hough transform formula, each of the target polar coordinate points is converted into the target line segment in the Cartesian coordinate system, wherein the expression of the target line segment is y=kx+b, k is the slope of the target line segment, and b is the intercept of the target line segment.
[0054] Furthermore, the preset threshold is 100-300.
[0055] More preferably, step S30 further includes:
[0056] Obtaining the number of the initial curves that each polar coordinate point in the polar coordinate system passes through;
[0057] The polar coordinate points are sorted from large to small according to the number of corresponding initial curves, and the polar coordinate points that are in the first set proportion after sorting and have passed through a number of initial curves greater than a set value are set as target polar coordinate points; for example, the polar coordinate points that are in the first 10% after sorting and have passed through a number of initial curves greater than 100 are set as target polar coordinate points.
[0058] Based on the preset Hough transform formula, each of the target polar coordinate points is converted into the target line segment in the Cartesian coordinate system, wherein the expression of the target line segment is y=kx+b, k is the slope of the target line segment, and b is the intercept of the target line segment.
[0059] Based on any of the above embodiments, in this embodiment, step S40 includes:
[0060] Calculating the average slope of each target line segment;
[0061] Calculating a calibration inclination angle between an average slope line segment corresponding to the average slope and a straight line corresponding to the standard direction, and determining the calibration inclination angle as the lens rotation amount;
[0062] The camera lens is calibrated based on the lens rotation amount.
[0063] The technical solution of this application is described below:
[0064] Specifically, as shown in Figure 3, which is a schematic diagram of calibration line segments for a camera lens rotation calibration method provided by an embodiment of the present application, because edge detection algorithms cannot generate ideal edge segments for real images, uneven colors may appear near the calibration line segments due to factors such as lighting, which are then detected as noise by the edge detection algorithm. Alternatively, problems with the material of the calibration jig may cause noise to appear during camera capture.
[0065] As shown in Figure 3, the calibration line segment y = kx + b contains five points numbered 1-5, corresponding to the initial curves numbered 1-5 in Figure 4. Beyond this line segment, there are three points (A, B, and C). These three points are considered artifacts relative to the calibration line segment and affect the final determination of the target line segment, so they need to be removed.
[0066] Correspondingly, the line segment y=kx+b in the Cartesian coordinate system has the following conversion relationship with the polar angle and polar diameter in the polar coordinate system: , the polar angle can be calculated through this conversion relationship and polar diameter , so the expression of the initial curve in the polar coordinate system can be determined .
[0067] As shown in FIG4 , FIG4 is a schematic diagram of the initial curves of a camera lens rotation calibration method provided by an embodiment of the present application. The screening of each initial curve, that is, the number of initial curves passing through each point according to the preset polar angle range (for example, 0-π) in the polar coordinate system. The preset threshold can be set to 100-300, that is, when the number of initial curves passing through a single polar coordinate point is greater than 100-300, the polar coordinate point is determined as the target polar coordinate point. As can be seen from FIG4 , the five initial curves correspond to the five points numbered 1-5 in the line segment in FIG3 , and the five initial curves intersect at one point. Converting this point to the Cartesian coordinate system is a target line segment represented by y=kx+b.
[0068] As shown in Figure 5, Figure 5 is a schematic diagram of a target line segment of a camera lens rotation calibration method provided by an embodiment of the present application. As shown in Figure 5, according to the screening rule for the initial curve, the three points A, B, and C in Figure 3 are removed, and the line segment is the target line segment.
[0069] Figure 6 is a schematic diagram of a Hough transform for a camera lens rotation calibration method provided in an embodiment of the present application. As shown in Figure 6(a), a pre-calibrated line segment is captured by the camera lens. The pre-calibrated line segment has a certain width and requires edge detection using an edge algorithm to compare it with the calibration line segment to obtain an edge segment, as shown in Figure 6(b). The edge algorithm can be the Canny algorithm.
[0070] Figure 6(c) is a schematic diagram of the target line segments determined after the Hough transform of the initial curve. Specifically, based on the slopes of the target line segments in Figure 6(c), the average slope is determined, and then the inclination angle between the line segment with the average slope and the standard direction is calculated to calibrate the camera lens. Figure 6(d) is a schematic diagram of the pre-calibrated line segments captured by the calibrated camera lens, where the extension direction of the pre-calibrated line segments is parallel to the standard direction.
[0071] Specifically, when there are more than one target line segment, the camera lens is rotationally calibrated by comprehensively considering each target line segment. For example, if there are three target line segments with slopes k1, k2, and k3, the average slope kn = (k1+k2+k3) / 3. Based on β = arctankn, the inclination angle β between the line with slope kn and the standard direction is calculated. The camera lens is then rotated by β to complete the camera lens calibration.
[0072] In one embodiment, the initial curves are screened, and a plurality of target line segments are determined in the Cartesian coordinate system according to the screened initial curves, further comprising the following steps:
[0073] In the polar coordinate system, the more initial curves that pass through a single polar point, the more initial points that are located in the target segment when converted to the Cartesian coordinate system, and the more accurate the target segment. The number of initial curves that pass through each polar point is sorted from large to small, and then, based on the user-set ratio, the polar points with the largest number of curves passing through are used as target polar points. The target segment in the Cartesian coordinate system is determined based on these polar points. At a specific resolution, this can better ensure that all target segments are obtained.
[0074] Please refer to Figure 7, which is a schematic block diagram of a camera lens rotation calibration device provided by an embodiment of the present application, wherein the camera lens rotation calibration device is used to perform the aforementioned camera lens rotation calibration method. The camera lens rotation calibration device can be configured on a server.
[0075] As shown in FIG7 , the camera lens rotation calibration device includes:
[0076] A calibration line segment acquisition module 410 is configured to acquire calibration line segments in the initial calibration image; wherein the calibration line segments are multiple parallel line segments set based on standard directions in a Cartesian coordinate system;
[0077] An initial curve generating module 420 is configured to extract all initial points in the calibration line segment, convert each initial point into a polar coordinate system, and generate an initial curve corresponding to the initial point;
[0078] The target line segment determination module 430 is used to screen each of the initial curves and determine multiple target line segments in the Cartesian coordinate system based on the screened initial curves.
[0079] The lens rotation amount determining module 440 is configured to determine the lens rotation amount of the camera lens based on the tilt relationship between the plurality of target line segments and the straight line of the standard direction, and calibrate the camera lens according to the lens rotation amount.
[0080] Furthermore, the calibration line segment acquisition module 410 includes:
[0081] A pre-calibrated line segment acquisition unit, configured to acquire pre-calibrated line segments in an initial calibration image;
[0082] an edge segment generating unit, configured to, if the line width of the pre-calibrated line segment is greater than or equal to a preset line width threshold, perform edge detection on the pre-calibrated line segment using a preset edge algorithm, generate an edge line segment, and use the edge line segment as the calibration line segment;
[0083] The calibration line segment determining unit is configured to determine the pre-calibrated line segment as the calibration line segment if the line width of the pre-calibrated line segment is smaller than the preset line width threshold.
[0084] Furthermore, the pre-calibrated line segment acquisition unit includes:
[0085] A calibration plane acquisition subunit, configured to provide a calibration plane provided with preset line segments;
[0086] a lens setting subunit, configured to set the plane of the camera lens parallel to the calibration plane, and to ensure that the projection of the center of the camera lens on the calibration plane substantially coincides with the center of the calibration plane;
[0087] a distance adjustment subunit, configured to perform a distance adjustment operation on the camera lens based on the calibration plane;
[0088] The pre-calibrated line segment determination subunit is configured to use the distance-adjusted camera lens to capture the initial calibration image to obtain the pre-calibrated line segment.
[0089] Furthermore, the initial curve generating module 420 includes:
[0090] an initial coordinate obtaining unit, configured to obtain the initial coordinates of all the initial points;
[0091] The initial curve generating unit is used to convert each of the initial coordinates into the corresponding initial curve in the polar coordinate system according to the preset Hough transform formula; wherein the expression of the initial curve is , x is the horizontal coordinate of the initial coordinate, y is the vertical coordinate of the initial coordinate, is the polar radius of the initial curve, is the polar angle of the initial curve.
[0092] Furthermore, the target line segment determination module 430 includes:
[0093] a curve number determining unit, configured to obtain the number of the initial curves passed by each polar coordinate point in the polar coordinate system;
[0094] a target polar coordinate point determination unit, configured to set the polar coordinate points of the initial curve whose number is greater than a preset threshold as target polar coordinate points;
[0095] A target line segment generating unit is used to convert each of the target polar coordinate points into the target line segment in the Cartesian coordinate system based on the preset Hough transform formula, wherein the expression of the target line segment is y=kx+b, k is the slope of the target line segment, and b is the intercept of the target line segment.
[0096] Furthermore, the target line segment determination module 430 further includes:
[0097] a curve number determining unit, configured to obtain the number of the initial curves passed by each polar coordinate point in the polar coordinate system;
[0098] A sorting unit is used to sort the polar coordinate points from large to small according to the number of corresponding initial curves, and set the polar coordinate points with a set ratio before sorting and a number of initial curves greater than a set value as target polar coordinate points;
[0099] A target line segment generating unit is used to convert each of the target polar coordinate points into the target line segment in the Cartesian coordinate system based on the preset Hough transform formula, wherein the expression of the target line segment is y=kx+b, k is the slope of the target line segment, and b is the intercept of the target line segment.
[0100] Furthermore, the lens rotation amount determination module 440 includes:
[0101] an average slope calculation unit, configured to calculate the average slope of each target line segment;
[0102] a lens rotation amount determining unit, configured to calculate a calibration inclination angle between an average slope line segment corresponding to the average slope and a straight line corresponding to the standard direction, and determine the calibration inclination angle as the lens rotation amount;
[0103] A calibration unit is used to calibrate the camera lens based on the lens rotation amount.
[0104] This application converts the calibration line segment in the Cartesian coordinate system into the polar coordinate system, generates an initial curve corresponding to the initial point, and screens the initial curve, that is, excludes the messy points corresponding to the Cartesian coordinate system to determine the target line segment. Finally, based on the inclination relationship between the target line segment and the standard direction, the lens rotation amount is determined so that the camera lens can be rotated and calibrated according to the lens rotation amount, thereby improving the accuracy of the camera lens rotation calibration.
[0105] It should be noted that those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0106] The above-mentioned apparatus may be implemented in the form of a computer program, and the computer program may be run on a computer device as shown in FIG8 .
[0107] Please refer to Figure 8, which is a schematic block diagram of the structure of a computer device provided in an embodiment of the present application. The computer device may be a server.
[0108] 8 , the computer device includes a processor, a memory, and a network interface connected via a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.
[0109] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, which, when executed, can enable the processor to perform any camera lens rotation calibration method.
[0110] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
[0111] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any camera lens rotation calibration method.
[0112] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will understand that the structure shown in FIG8 is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. A specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0113] It should be understood that the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.
[0114] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and the processor executes the program instructions to implement any camera lens rotation calibration method provided in the embodiments of the present application.
[0115] The computer-readable storage medium may be an internal storage unit of the computer device described in the aforementioned embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the computer device.
[0116] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present application, and such modifications or substitutions should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A camera lens rotation calibration method, comprising: Obtain the calibration line segments in the initial calibration image; The calibration line segments are multiple parallel line segments set based on standard directions in a Cartesian coordinate system; Extracting all initial points in the calibration line segment, and converting each initial point into a polar coordinate system to generate an initial curve corresponding to the initial point; screening each of the initial curves, and determining a plurality of target line segments in the Cartesian coordinate system according to the screened initial curves; Based on the inclination relationship between the plurality of target line segments and the straight line of the standard direction, the lens rotation amount of the camera lens is determined, and the camera lens is calibrated according to the lens rotation amount.
2. The camera lens rotation calibration method according to claim 1, wherein obtaining calibration line segments in the initial calibration image comprises: Obtaining pre-calibrated line segments in the initial calibration image; If the line width of the pre-calibrated line segment is greater than or equal to a preset line width threshold, edge detection is performed on the pre-calibrated line segment using a preset edge algorithm to generate an edge line segment, and the edge line segment is used as the calibration line segment; If the line width of the pre-calibrated line segment is smaller than the preset line width threshold, the pre-calibrated line segment is determined as the calibration line segment.
3. The camera lens rotation calibration method according to claim 2, wherein obtaining the pre-calibrated line segments in the initial calibration image comprises: Providing a calibration plane with preset line segments; The plane of the camera lens is arranged parallel to the calibration plane, and the projection of the center of the camera lens on the calibration plane substantially coincides with the center of the calibration plane; Performing a distance adjustment operation on the camera lens based on the calibration plane; The initial calibration image is captured using the distance-adjusted camera lens to obtain the pre-calibrated line segment.
4. The camera lens rotation calibration method according to claim 1 , wherein extracting all initial points in the calibration line segment and converting each initial point into a polar coordinate system to generate an initial curve corresponding to the initial point comprises: Obtaining the initial coordinates of all the initial points; Each of the initial coordinates is converted into the corresponding initial curve in the polar coordinate system according to the preset Hough transform formula; wherein the expression of the initial curve is , x is the horizontal coordinate of the initial coordinate, y is the vertical coordinate of the initial coordinate, is the polar radius of the initial curve, is the polar angle of the initial curve.
5. The camera lens rotation calibration method according to claim 4 , wherein screening each of the initial curves and determining a plurality of target line segments in the Cartesian coordinate system according to the screened initial curves comprises: Obtaining the number of the initial curves that each polar coordinate point in the polar coordinate system passes through; Setting the polar coordinate points of the initial curve whose number is greater than a preset threshold as target polar coordinate points; Based on the preset Hough transform formula, each of the target polar coordinate points is converted into the target line segment in the Cartesian coordinate system, wherein the expression of the target line segment is y=kx+b, k is the slope of the target line segment, and b is the intercept of the target line segment. The camera lens rotation calibration method according to claim 5 , wherein the preset threshold is 100-300.
7. The camera lens rotation calibration method according to claim 4, wherein said screening each of the initial curves and determining a plurality of target line segments in the Cartesian coordinate system according to the screened initial curves comprises: Obtaining the number of the initial curves that each polar coordinate point in the polar coordinate system passes through; The polar coordinate points are sorted from large to small according to the number of corresponding initial curves, and the polar coordinate points with a set ratio before sorting and a number of initial curves greater than a set value are set as target polar coordinate points; Based on the preset Hough transform formula, each of the target polar coordinate points is converted into the target line segment in the Cartesian coordinate system, wherein the expression of the target line segment is y=kx+b, k is the slope of the target line segment, and b is the intercept of the target line segment.
8. The camera lens rotation calibration method according to any one of claims 1 to 7, wherein determining the lens rotation amount of the camera lens based on the tilt relationship between the plurality of target line segments and the straight line of the standard direction, and calibrating the camera lens according to the lens rotation amount comprises: Calculating the average slope of each target line segment; Calculating a calibration inclination angle between an average slope line segment corresponding to the average slope and a straight line corresponding to the standard direction, and determining the calibration inclination angle as the lens rotation amount; The camera lens is calibrated based on the lens rotation amount.
9. A camera lens rotation calibration device, comprising: A calibration line segment acquisition module, used to acquire calibration line segments in the initial calibration image; The calibration line segments are multiple parallel line segments set based on standard directions in a Cartesian coordinate system; An initial curve generating module is used to extract all initial points in the calibration line segment, convert each initial point into a polar coordinate system, and generate an initial curve corresponding to the initial point; A target line segment determination module is used to screen each of the initial curves and determine multiple target line segments in the Cartesian coordinate system based on the screened initial curves. The lens rotation amount determination module is used to determine the lens rotation amount of the camera lens based on the inclination relationship between the multiple target line segments and the straight line of the standard direction, and calibrate the camera lens according to the lens rotation amount. 10 . A computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the camera lens rotation calibration method according to claim 1 .
Citation Information
Patent Citations
Smart phone camera defect detection method and detection system
CN111257329A
Calibration method for external parameters of vehicle-mounted camera and related device
CN114730472A
Pitch angle determination method and device of camera, equipment and computer storage medium
CN116258773A
Calibration method, image correction method and device, electronic equipment and storage medium
CN116721161A
Vehicle camera calibration method and device, electronic equipment and storage medium
CN117392240A