A method, apparatus and electronic device for measuring radial distortion parameters

By obtaining the first coordinates and multiple sets of parameter values ​​of the inner corner point from an image, determining the second coordinates of the inner corner point and fitting a curve, the problem of cumbersome operation in traditional methods is solved, and efficient radial distortion parameter measurement is achieved.

CN115631099BActive Publication Date: 2025-11-14GOERTEK OPTICAL TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211138959.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-19
Publication Date
2025-11-14
Estimated Expiration
2042-09-19

AI Technical Summary

Technical Problem

Traditional radial distortion parameter testing methods require taking and processing multiple images, which is cumbersome and affects the imaging quality of the camera module and the accuracy of other parameter tests.

Method used

By obtaining the first coordinate of the inner corner point in the image of the calibration board, the second coordinate of the inner corner point is determined using multiple sets of parameter values, a curve is fitted, and the distortion data is obtained based on the distance from the first coordinate of the inner corner point to the fitted curve. The target distortion data is then determined to obtain the radial distortion parameter.

Benefits of technology

The process of measuring radial distortion parameters has been simplified, avoiding the need to take multiple images and improving measurement efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115631099B_ABST
    Figure CN115631099B_ABST
Patent Text Reader

Abstract

This application provides a method, apparatus, and electronic device for measuring radial distortion parameters. The measurement method includes: acquiring an image of a calibration plate and obtaining the first coordinates of an interior corner point in the image; acquiring multiple sets of parameter values, and obtaining the second coordinates of the interior corner point in the image based on each set of parameter values ​​and the first coordinates of the interior corner point, wherein the second coordinates of the interior corner point correspond to the parameter values; obtaining a fitted curve based on the second coordinates of the interior corner point in the image, and obtaining distortion data based on the distance from the first coordinates of the interior corner point in the image to the fitted curve; and determining target distortion data based on the distortion data, wherein the parameter value corresponding to the target distortion data is used as the target parameter value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and more specifically, to a radial distortion parameter measurement method, apparatus, and electronic device. Background Technology

[0002] Radial distortion of camera lenses is widespread in wide-angle cameras, fisheye cameras, and short focal length cameras, making it an important issue to consider when analyzing images.

[0003] Radial distortion affects the image quality of a camera module and also impacts the accuracy of tests for other parameters (Tilt, Rotation, Shift, etc.). Therefore, testing the distortion parameters of a camera module is crucial. Traditional distortion parameter testing methods require capturing and processing multiple images, which is inconvenient and cumbersome. Summary of the Invention

[0004] The purpose of this application is to provide a method for measuring radial distortion parameters. The measurement method includes:

[0005] Obtain an image of the calibration board and obtain the first coordinates of the inner corner points in the image;

[0006] Multiple sets of parameter values ​​are obtained, and the second coordinates of the inner corner points in the image are obtained based on each set of parameter values ​​and the first coordinates of the inner corner points, wherein the second coordinates of the inner corner points correspond to the parameter values;

[0007] The fitted curve is obtained based on the second coordinate of the inner corner point in the image, and the distorted variable data is obtained based on the distance from the first coordinate of the inner corner point in the image to the fitted curve.

[0008] Based on the distorted variable data, the target distorted variable data is determined, and the parameter value corresponding to the target distorted variable data is used as the target parameter value.

[0009] Optionally, obtaining multiple sets of parameter values ​​specifically includes:

[0010] The parameter values ​​are adjusted according to the preset initial value and preset range value to obtain multiple sets of parameter values; the parameter values ​​include the optical center position coordinates, the first distortion correction parameter and the second distortion correction parameter.

[0011] Optionally, the second coordinates of the interior corner points in the image are obtained based on each set of parameter values ​​and the first coordinates of the interior corner points, specifically including:

[0012] The second coordinates of the interior corner points in the image are obtained using a distortion mathematical model.

[0013] Optionally, the fitted curve is obtained based on the second coordinates of the interior corner points in the image, specifically including:

[0014] The first fitted curve is obtained based on the ideal coordinates of the first pixel group, where the ideal coordinates of the first pixel group are: the second coordinates corresponding to each inner corner point set along the first direction of the image;

[0015] The second fitted curve is obtained based on the ideal coordinates of the second pixel group, where the ideal coordinates of the second pixel group are the second coordinates corresponding to each inner corner point set along the second direction of the image.

[0016] Optionally, obtaining the distortion data based on the distance from the first coordinate of the inner corner point in the image to the fitted curve specifically includes:

[0017] The first distortion data is obtained by summing the distances from the actual coordinates of the first pixel group to its corresponding fitted curve, where the actual coordinates of the first pixel group are: the first coordinates corresponding to each inner corner point set along the first direction of the image;

[0018] The second distortion data is obtained by summing the distances from the actual coordinates of the second pixel group to its corresponding fitted curve, where the actual coordinates of the second pixel group are: the first coordinates corresponding to each inner corner point set along the second direction of the image;

[0019] The distorted variable data is obtained by summing the first distorted variable data and the second distorted variable data.

[0020] Secondly, a radial distortion parameter measuring device is provided. The measuring device includes:

[0021] The acquisition module acquires an image of the calibration board and obtains the first coordinates of the inner corner points in the image;

[0022] The first calculation module obtains multiple sets of parameter values, and based on each set of parameter values ​​and the first coordinates of the inner corner point, obtains the second coordinates of the inner corner point in the image, wherein the second coordinates of the inner corner point correspond to the parameter values;

[0023] The data fitting module obtains the fitted curve based on the second coordinates of the inner corner points in the image;

[0024] The second calculation module obtains the distorted variable data based on the distance from the first coordinate of the inner corner point in the image to the fitted curve;

[0025] The parameter determination module determines the target distorted variable data based on the distorted variable data, where the parameter values ​​corresponding to the target distorted variable data are used as the target parameter values.

[0026] Optionally, the first calculation module is specifically used for:

[0027] The parameter values ​​are adjusted according to the preset initial value and preset range value to obtain multiple sets of parameter values; the parameter values ​​include the optical center position coordinates, the first distortion correction parameter and the second distortion correction parameter.

[0028] Optionally, the first computing module is also used for:

[0029] The second coordinates of the interior corner points in the image are obtained using a distortion mathematical model.

[0030] Optionally, the data fitting module is specifically used for:

[0031] The first fitted curve is obtained based on the ideal coordinates of the first pixel group, where the ideal coordinates of the first pixel group are: the second coordinates corresponding to each inner corner point set along the first direction of the image;

[0032] The second fitted curve is obtained based on the ideal coordinates of the second pixel group, where the ideal coordinates of the second pixel group are the second coordinates corresponding to each inner corner point set along the second direction of the image.

[0033] Optionally, the second calculation module is specifically used for:

[0034] The first distortion data is obtained by summing the distances from the actual coordinates of the first pixel group to its corresponding fitted curve, where the actual coordinates of the first pixel group are: the first coordinates corresponding to each inner corner point set along the first direction of the image;

[0035] The second distortion data is obtained by summing the distances from the actual coordinates of the second pixel group to its corresponding fitted curve, where the actual coordinates of the second pixel group are: the first coordinates corresponding to each inner corner point set along the second direction of the image;

[0036] The distorted variable data is obtained by summing the first distorted variable data and the second distorted variable data.

[0037] Thirdly, an electronic device is provided. The electronic device includes a memory and a processor, the memory and the processor being communicatively connected via an internal bus. The memory stores program instructions executable by the processor, and when executed by the processor, the program instructions are able to implement the radial distortion parameter measurement method described in the first aspect.

[0038] The technical solution provided in this application embodiment proposes a radial distortion parameter measurement method. Given an image (distorted image), the method determines the second coordinates of the inner corner point using the first coordinates of the inner corner point in the distorted image and multiple sets of parameter values. A fitting curve is then obtained based on the second coordinates of the inner corner point. Distortion data is obtained based on the distance from the first coordinates of the inner corner point in the image to the fitting curve. A target parameter value is then obtained based on the distortion data, where the target parameter value corresponds to the radial distortion parameter of the camera module.

[0039] Therefore, in this embodiment, it is only necessary to continuously adjust the parameter values ​​so that the distorted variable data obtained from the distance from the first coordinate of the inner corner point in the image to the fitted curve is the target distorted variable data among multiple sets of distorted variable data. The target parameter value can be obtained from the target distorted variable data, thus avoiding the operation of taking multiple images for processing.

[0040] Other features and advantages of this specification will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description

[0041] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments of this specification and, together with their description, serve to explain the principles of this specification.

[0042] Figure 1 The diagram shows a flowchart of a radial distortion parameter measurement method according to one embodiment of the application.

[0043] Figure 2 The diagram shown is a block diagram of a radial distortion parameter measurement method according to an embodiment of this application.

[0044] Figure 3 The diagram shown is a structural schematic of an electronic device according to an embodiment of this application.

[0045] Figure 4 This is a schematic diagram of the interior corner points on a standard chessboard.

[0046] Figure 5 The above is a schematic diagram of the structure of the obtained calibration plate. Detailed Implementation

[0047] Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values ​​of the components and steps set forth in these embodiments do not limit the scope of the present application.

[0048] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the scope of this application and its application or use.

[0049] Technologies and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such technologies and equipment should be considered part of the specification.

[0050] In all the examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values.

[0051] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.

[0052] The distortion that occurs in images captured by a camera module is generally radial distortion. Radial distortion is the positional deviation of image pixels along the radial direction with the distortion center as the center point, resulting in image distortion. Radial distortion mainly includes two types: pincushion distortion and barrel distortion.

[0053] In radial distortion, the distortion at the center of the camera module's optical axis is 0, and the radial distortion becomes increasingly severe as it moves towards the edges along the camera module's radius. The mathematical model of radial distortion can be described by the first few terms of a Taylor series expansion around the principal point (the point at the center of the optical axis, where the distortion is 0), typically using the first two terms.

[0054] The adjustment formula for a point on the imaging module, based on its radial distribution, is as follows:

[0055] x=x0(1+k1r 2 +k2r 4 )

[0056] y = y0(1 + k1r 2 +k2r 4 )

[0057] Where: (x, y) is the original position of the distorted point on the camera module, i.e., the coordinate position of a point in the image; (x0, y0) is the new coordinate position after distortion correction; r is the radius with the optical axis center as the origin (the distance between a point in the image and the optical center); k1 and k2 are distortion correction parameters. The farther away from the optical center, the greater the radial displacement, indicating a greater distortion; near the optical center, there is almost no offset.

[0058] In existing technologies, traditional methods for testing distortion parameters require taking and processing multiple images, which is quite cumbersome.

[0059] To address the aforementioned issues, this application proposes a method, apparatus, and electronic device for measuring radial distortion parameters. After acquiring a distorted image, the second coordinates of the inner corner points are determined using the first coordinates of these points and multiple sets of acquired parameter values. A fitted curve is then obtained based on the second coordinates of the inner corner points. Distortion data is obtained based on the distance from the first coordinates of the inner corner points to the fitted curve. A target parameter value is then obtained based on the distortion data, where the target parameter value corresponds to the radial distortion parameter of the camera module.

[0060] Hereinafter, various embodiments and examples according to the present disclosure will be described with reference to the accompanying drawings.

[0061] <Method Implementation>

[0062] Please see Figure 1 As shown in the figure, this application provides a method for measuring radial distortion parameters. The measurement method includes steps S101 to S105.

[0063] Step S101: Obtain the image of the calibration board and get the first coordinates of the inner corner points in the image;

[0064] Step S102: Obtain multiple sets of parameter values. Based on each set of parameter values ​​and the first coordinate of the inner corner point, obtain the second coordinate of the inner corner point in the image, where the second coordinate of the inner corner point corresponds to the parameter value.

[0065] Step S103: Obtain the fitted curve based on the second coordinates of the interior corner points in the image;

[0066] Step S104: Obtain the distorted variable data based on the distance from the first coordinate of the inner corner point in the image to the fitted curve;

[0067] Step S105: Based on the distorted variable data, determine the target distorted variable data, wherein the parameter value corresponding to the target distorted variable data is used as the target parameter value.

[0068] In step S101, an image of the calibration board is captured by the camera module. When the distortion correction parameter of the camera module is very small, the distortion in the acquired image of the calibration board is not obvious. When the distortion correction parameter of the camera module is very large, the distortion in the acquired image of the calibration board is obvious, meaning the acquired image is a distorted image.

[0069] In step S101, for example, if the calibration board is a checkerboard calibration board, a calibration algorithm is used to detect the interior corner points on the image of the checkerboard calibration board. For example, the OpenCV checkerboard calibration board corner finding algorithm cvFindChessboardCorners is used to detect the interior corner points of the captured image, which can determine the position and first coordinates of the interior corner points of the captured image. (Refer to...) Figure 4 As shown in the figure, the point marked "x" is the interior corner point.

[0070] In one specific embodiment, the camera module under test is placed in a fixture, and an image of a checkerboard calibration board is captured by the camera module. The camera module is placed on the fixture with its photosensitive surface parallel to the plane of the checkerboard calibration board, and the line connecting the center of the camera module and the center of the checkerboard calibration board is perpendicular to the plane of the checkerboard calibration board. This positioning of the camera module and the checkerboard calibration board limits the relative positions of the two components, preventing image distortion caused by misalignment.

[0071] In addition, the positions of the camera module under test and the checkerboard calibration board are limited to ensure that the camera module can capture the entire image of the checkerboard calibration board, rather than just a part of the image. This ensures that the number of interior corner points in the calibration board image captured by the camera module is consistent with the actual number of interior corner points in the checkerboard calibration board.

[0072] In step S102, multiple sets of parameter values ​​are obtained, and each set of parameter values ​​is different. For example, three sets of parameter values ​​are obtained, including a first set of parameter values, a second set of parameter values, and a third set of parameter values, wherein the parameter values ​​in the first set of parameter values, the parameter values ​​in the second set of parameter values, and the parameter values ​​in the third set of parameter values ​​are all different.

[0073] In step S102, the second coordinates of the interior corner points in the image are obtained based on each set of parameter values ​​and the first coordinates of the interior corner points. Specifically, the second coordinates of the interior corner points in the image are obtained based on each set of parameter values ​​and the first coordinates of the interior corner points. During the calculation of the second coordinates of the interior corner points in the image, the first coordinates of the interior corner points remain constant; that is, the first coordinates of the interior corner points are always the same as the first coordinates of the interior corner points in the distorted image obtained by the camera module in step S101.

[0074] In one specific embodiment, three sets of parameter values ​​were obtained, including a first set of parameter values, a second set of parameter values, and a third set of parameter values.

[0075] Based on the first set of parameter values ​​and the first coordinates of the interior corner points, the second coordinates of the interior corner points in the image are obtained. For example, based on the first set of parameter values ​​and the first coordinates of each interior corner point, the second coordinates of the corresponding interior corner point in the image are obtained.

[0076] Based on the second set of parameter values ​​and the first coordinates of the interior corner points, the second coordinates of the interior corner points in the image are obtained. For example, based on the second set of parameter values ​​and the first coordinates of each interior corner point, the second coordinates of the corresponding interior corner point in the image are obtained.

[0077] Based on the third set of parameter values ​​and the first coordinates of the interior corner points, the second coordinates of the interior corner points in the image are obtained. For example, based on the third set of parameter values ​​and the first coordinates of each interior corner point, the second coordinates of the corresponding interior corner point in the image are obtained.

[0078] The second coordinates of each interior corner point in the image calculated based on the first set of parameter values, the second coordinates of each interior corner point calculated based on the second set of parameter values, and the second coordinates of each interior corner point calculated based on the third set of parameter values ​​are all different. That is, the second coordinates of the interior corner points in the image correspond one-to-one with the parameter values; different second coordinates of the interior corner points can be calculated based on different sets of parameter values.

[0079] In step S103, a fitted curve is obtained based on the second coordinates of the interior corner points in the image. For example, the least squares method can be used to fit a straight line to the second coordinates of the interior corner points in the image to obtain a fitted curve. For example, based on the specific position of the interior corner point in the image (the first coordinate of the interior corner point) and the second coordinate of the interior corner point (where the second coordinate of the interior corner point corresponds to the first coordinate of the interior corner point), a straight line can be fitted to the second coordinates corresponding to the interior corner points in the same row of the image to obtain a fitted curve; or a straight line can be fitted to the second coordinates corresponding to the interior corner points in the same column of the image to obtain a fitted curve.

[0080] Therefore, in this step, the fitted curve can be obtained based on the second coordinates of the interior corner points in the image. Specifically, multiple sets of parameter values ​​correspond to multiple sets of second coordinates of the interior corner points, and multiple sets of fitted curves can be fitted from these multiple sets of second coordinates of the interior corner points.

[0081] In step S104, distorted variable data is obtained based on the distance from the first coordinate of the interior corner point in the image to the fitted curve. Specifically, distorted variable data is obtained based on the distance from the first coordinate of the interior corner point in the image to the fitted curve corresponding to the interior corner point. For example, the distance from the first coordinate of each interior corner point to its corresponding fitted curve can be further processed (e.g., the distance from the first coordinate of each interior corner point to the fitted curve can be added) to obtain distorted variable data.

[0082] Since multiple sets of fitting curves were obtained in step S103, multiple sets of distorted variable data can be obtained based on the distance from the first coordinate of the inner corner point in the image to its corresponding fitting curve.

[0083] In step S105, the target distorted variable data is determined based on the calculated distorted variable data. For example, the smallest distorted variable data is determined from multiple sets of distorted variable data, and the smallest distorted variable data is the target distorted variable data.

[0084] The parameter values ​​corresponding to the target distorted variable data are used as target parameter values, that is, the target parameter values ​​are included in the multiple sets of parameter values ​​obtained in step S102.

[0085] When the parameter value is the target parameter value, the second coordinate of the interior corner point in the image is obtained based on the target parameter value and the first coordinate of the interior corner point. The second coordinate of the interior corner point at this point represents the optimal coordinate position after the distortion image has been corrected. The distorted data obtained by using the fitted curve derived from the second coordinate of the interior corner point in the image, and the distance between the first coordinate of the interior corner point and the fitted curve, represents the data with the minimum distorted data.

[0086] Specifically, repeat steps S101-S104, adjust the parameter values ​​to obtain multiple sets of parameter values, calculate the distance from the first coordinate of the inner corner point to the fitted curve to obtain the distortion data, and the parameter value corresponding to the smallest distortion data is the distortion correction parameter corresponding to the camera module.

[0087] This application proposes a method for measuring radial distortion parameters. After acquiring an image (distorted image) through a camera module, the second coordinates of the inner corner points are determined using the first coordinates of the inner corner points in the distorted image and multiple sets of parameter values. A fitted curve is then obtained based on the second coordinates of the inner corner points. Distortion data is obtained based on the distance from the first coordinates of the inner corner points in the image to the fitted curve. A target parameter value is then obtained based on the distortion data, where the target parameter value corresponds to the radial distortion parameter of the camera module.

[0088] Therefore, in this embodiment, it is only necessary to continuously adjust the parameter values ​​so that the distorted variable data obtained from the distance from the first coordinate of the inner corner point in the image to the fitted curve is the smallest distorted variable data among multiple sets of distorted variable data. The target parameter value can be obtained based on the smallest distorted variable data, thus avoiding the operation of taking multiple images for processing.

[0089] In one embodiment, obtaining multiple sets of parameter values ​​specifically includes:

[0090] The parameter values ​​are adjusted according to the preset initial value and preset range value to obtain multiple sets of parameter values; the parameter values ​​include the optical center position coordinates, the first distortion correction parameter and the second distortion correction parameter.

[0091] In this embodiment, the parameter values ​​are defined as the optical center position coordinates, a first distortion correction parameter, and a second distortion correction parameter. The first and second distortion correction parameters correspond to the radial distortion parameters of the camera module.

[0092] The parameter values ​​include the optical center coordinates, the first distortion correction parameter, and the second distortion correction parameter. That is, a set of parameter values ​​includes the optical center coordinates, the first distortion correction parameter, and the second distortion correction parameter. By simultaneously adjusting the optical center coordinates, the first distortion correction parameter, and the second distortion correction parameter, the second coordinates of the inner corner points in the image are obtained. For example, in the process of obtaining multiple sets of parameter values, multiple optical center coordinates, multiple first distortion correction parameters, and multiple second distortion correction parameters are obtained.

[0093] Adjusting the optical center position coordinates specifically includes: adjusting the optical center position coordinates according to the preset initial value and preset range value.

[0094] Specifically, for a camera module with a resolution of width*height, its ideal optical center position coordinates are (width / 2, height / 2). However, due to factors such as the assembly process of the camera module, the optical center position of the camera module may be slightly deviated. Therefore, it is necessary to adjust the optical center position to find the actual optical center position coordinates of the camera module under test.

[0095] For example, the initial preset value of the optical center position coordinates is its ideal optical center position coordinates (oc_x, oc_y) = (width / 2, height / 2). The actual optical center position coordinates are found around the ideal optical center position coordinates. Each adjustment step is ocstepvalue, and the total number of adjustment steps is ocstep. The horizontal coordinate can be adjusted first, followed by the vertical coordinate. Each adjustment determines an optical center position coordinate.

[0096] For example, the adjustment range is: with the ideal optical center position coordinates (oc_x, oc_y) = (width / 2, height / 2) as the origin, adjust within the range of (oc_x-ocstep*ocstepvalue / 2, oc_y+ocstep*ocstepvalue / 2), (oc_x+ocstep*ocstepvalue / 2, oc_y+ocstep*ocstepvalue / 2), (oc_x-ocstep*ocstepvalue / 2, oc_y-ocstep*ocstepvalue / 2), and (oc_x+ocstep*ocstepvalue / 2, oc_y-ocstep*ocstepvalue / 2).

[0097] It should be noted that adjusting the step size ocstepvalue and the total number of steps ocstep are related to the characteristics of the camera module itself. The golden module can be selected for experimentation to reasonably select the largest possible step size and the fewest possible steps in order to reduce the time complexity of the algorithm.

[0098] The adjustment of the first distortion correction parameter specifically includes: adjusting the first distortion correction parameter according to the preset initial value and preset range of the first distortion correction parameter.

[0099] Specifically, the camera module has no distortion under ideal conditions, so the initial value of the first distortion correction parameter is set to 0, and the predetermined range is: k1stepvalue*k1step. The adjustment step size is k1stepvalue, and the total number of adjustment steps is k1step. Each time it is adjusted, a first distortion correction parameter is determined.

[0100] It should be noted that adjusting the step size k1stepvalue and the total number of steps k1step is related to the characteristics of the camera module itself. The golden module can be selected for experimentation to reasonably select the largest possible step size and the fewest possible steps in order to reduce the time complexity of the algorithm.

[0101] The adjustment of the second distortion correction parameter specifically includes: adjusting the second distortion correction parameter according to the preset initial value and preset range of the second distortion correction parameter.

[0102] Specifically, the camera module has no distortion under ideal conditions, so the initial value of the second distortion correction parameter is set to 0, and the predetermined range is: k2stepvalue*k2step. The adjustment step size is k2stepvalue, and the total number of adjustment steps is k2step. Each time it is adjusted, a second distortion correction parameter is determined.

[0103] It should be noted that adjusting the step size k2stepvalue and the total number of steps k2step are related to the characteristics of the module itself. The Golden module can be selected for experimentation to reasonably select the largest possible step size and the fewest possible steps in order to reduce the time complexity of the algorithm.

[0104] In one embodiment, obtaining the second coordinates of the interior corner point in the image based on each set of parameter values ​​and the first coordinates of the interior corner point specifically includes:

[0105] The second coordinates of the interior corner points in the image are obtained using a distortion mathematical model.

[0106] In this embodiment, the obtained parameter values ​​and the first coordinates of the inner corner points are substituted into the distortion mathematical model to obtain the second coordinates of the inner corner points in the image.

[0107] For example, if the obtained optical center coordinates are (ocxk, ocyk), the first distortion correction parameter is k1i, the second distortion correction parameter is k2j, the first coordinate of the interior corner is (u0, v0), and assuming the second coordinate of the interior corner is (u, v), and the obtained optical center coordinates are (ocxk, ocyk), the first distortion correction parameter is k1i, the second distortion correction parameter is k2j, and the first coordinate of the interior corner is (u0, v0), then substitute these values ​​into the following distortion mathematical model:

[0108] u-ocxk=(u0-ocxk)(1+k1i((u0-ocxk) 2 +(v0-ocyk) 2 )+k2j((u0-ocxk) 2 +(v0-ocyk) 2 ) 2 (1)

[0109] v-ocyk=(v0-ocyk)(1+k1i((u0-ocxk) 2 +(v0-ocyk) 2 )+k2j((u0-ocxk) 2 +(v0-ocyk) 2 ) 2 (2)

[0110] The second coordinates of the inner corner points in the image can be obtained from the above formulas (1) and (2).

[0111] Based on the different optical center coordinates, the first distortion correction parameter, and the second distortion correction parameter, different second coordinates of the inner corner points in the image can be obtained.

[0112] In one embodiment, obtaining the fitted curve based on the second coordinates of the interior corner points in the image specifically includes:

[0113] The first fitted curve is obtained based on the ideal coordinates of the first pixel group, where the ideal coordinates of the first pixel group are: the second coordinates corresponding to each inner corner point set along the first direction of the image;

[0114] The second fitted curve is obtained based on the ideal coordinates of the second pixel group, where the ideal coordinates of the second pixel group are the second coordinates corresponding to each inner corner point set along the second direction of the image.

[0115] In this embodiment, the fitting curve obtained based on the second coordinates of the inner corner points in the image includes a first fitting curve and a second fitting curve. Specifically, the obtained image of the calibration plate is a two-dimensional image, and the inner corner points in the image are also distributed in two dimensions.

[0116] The second coordinates of each interior corner point set along the first direction (X-direction) of the image are directly fitted to obtain a first fitted curve, which is roughly distributed along the X-direction of the image. Each interior corner point set along the first direction corresponds to a first pixel group, and the ideal coordinates of the first pixel group correspond to the second coordinates of each interior corner point set along the first direction. (Refer to...) Figure 5 As shown, the first pixel group comprises seven rows. The inner corner points of each row form a single row of the first pixel group. The second coordinates corresponding to the inner corner points of each row are directly fitted to form the first fitted curve. (Refer to...) Figure 5 As shown, by fitting the second coordinates of the first pixel group in the seven rows, seven first fitted lines can be obtained.

[0117] The second fitting curve is obtained by directly fitting the second coordinates of each interior corner point set along the second direction (Y direction) of the image. The second fitting curve is distributed approximately along the Y direction of the image. Each interior corner point set along the second direction of the image corresponds to a second pixel group, and the ideal coordinates of the second pixel group correspond to the second coordinates of each interior corner point set along the second direction of the image. (Refer to...) Figure 5 As shown, the second pixel group comprises seven columns. Each column's inner corner points form a second pixel group, and the second coordinates corresponding to each column's inner corner points are directly fitted to create a second fitted curve. (Refer to...) Figure 5 As shown, by fitting the second coordinates of the seven columns of the second pixel group, seven second fitted lines can be obtained.

[0118] Reference Figure 5 As shown, by fitting the second coordinates of the seven rows of the first pixel group, seven first fitted lines can be obtained. By fitting the second coordinates of the seven columns of the second pixel group, seven second fitted lines can be obtained. One of the first fitted lines and one of the second fitted lines form a set of fitted lines, therefore, referring to... Figure 5 As shown, seven sets of fitted lines can be obtained.

[0119] In one embodiment, obtaining the distortion data based on the distance from the first coordinate of the inner corner point in the image to the fitted curve specifically includes:

[0120] The first distortion data is obtained by summing the distances from the actual coordinates of the first pixel group to its corresponding fitted curve, where the actual coordinates of the first pixel group are: the first coordinates corresponding to each inner corner point set along the first direction of the image;

[0121] The second distortion data is obtained by summing the distances from the actual coordinates of the second pixel group to its corresponding fitted curve, where the actual coordinates of the second pixel group are: the first coordinates corresponding to each inner corner point set along the second direction of the image;

[0122] The distorted variable data is obtained by summing the first distorted variable data and the second distorted variable data.

[0123] In this embodiment, the first pixel group corresponds to each inner corner point set along the first direction of the image, and the actual coordinates of the first pixel group are: the first coordinates corresponding to each inner corner point set along the first direction of the image.

[0124] Reference Figure 5As shown, the first pixel group comprises seven rows of first pixel groups. Each row's interior corner points form a single row of first pixel groups. The second coordinates corresponding to each row's interior corner points are directly fitted to form the first fitted curve. By fitting the second coordinates of the seven rows of first pixel groups, seven first fitted straight lines can be obtained.

[0125] The first distortion data is obtained by calculating and summing the distances from the first pixel group in each row to its corresponding first fitted line. Specifically, the first distortion data is obtained by calculating and summing the distances from the first coordinate of each interior corner point in each row to its corresponding first fitted line.

[0126] In this embodiment, the second pixel group corresponds to each inner corner point set along the second direction of the image, and the actual coordinates of the second pixel group are: the first coordinates corresponding to each inner corner point set along the first direction of the image.

[0127] Reference Figure 5 As shown, the second pixel group comprises seven columns of second pixel groups. Each column's interior corner points form a second pixel group, and the second coordinates corresponding to each column's interior corner points are directly fitted to form a second fitted curve. By fitting the second coordinates of the seven columns of second pixel groups, seven second fitted lines can be obtained.

[0128] The second distortion data is obtained by calculating and summing the distances from the first pixel group in each column to its corresponding second fitted line. Specifically, the second distortion data is obtained by calculating and summing the distances from the first coordinate of each corner point in each column to its corresponding first fitted line.

[0129] In this embodiment, the sum of the first distorted variable data and the second distorted variable data is the distance sum under the current distortion correction parameters (first distortion correction parameter and second distortion correction parameter).

[0130] <Device Embodiment>

[0131] Please see Figure 2 This application also provides a radial distortion parameter measuring device 200. The measuring device includes: an acquisition module 201, a first calculation module 202, a data fitting module 203, a second calculation module 204, and a parameter determination module 205.

[0132] The acquisition module 201 is used to acquire an image of the calibration board and obtain the first coordinates of the inner corner points in the image;

[0133] The first calculation module 202 is used to obtain multiple sets of parameter values, and according to each set of parameter values ​​and the first coordinates of the inner corner point, obtain the second coordinates of the inner corner point in the image, wherein the second coordinates of the inner corner point correspond to the parameter values;

[0134] The data fitting module 203 is used to obtain the fitting curve based on the second coordinates of the inner corner points in the image;

[0135] The second calculation module 204 is used to obtain the distortion data based on the distance from the first coordinate of the inner corner point in the image to the fitted curve;

[0136] The parameter determination module 205 is used to determine the target distorted variable data based on the distorted variable data, wherein the parameter value corresponding to the target distorted variable data is used as the target parameter value.

[0137] In this embodiment, the acquisition module 201 is used to acquire an image of the calibration board, for example, by taking a picture. The acquisition module can use a calibration algorithm to detect the interior corner points on the chessboard calibration board image. For example, it can use the OpenCV chessboard calibration board corner finding algorithm cvFindChessboardCorners to detect the interior corner points of the captured image, thereby determining the position and first coordinates of the interior corner points in the captured image. (Refer to...) Figure 4 As shown in the figure, the point marked "x" is the interior corner point.

[0138] In this embodiment, the first calculation module 202 can obtain multiple sets of parameter values ​​and calculate the second coordinates of the inner corner points in the image based on each set of parameter values ​​and the first coordinates of the inner corner points.

[0139] In this embodiment, the data fitting module 203 can obtain different fitting curves based on different second coordinates of the inner corner points in the image.

[0140] In this embodiment, the distance from the first coordinate of the inner corner point to the fitted curve can be calculated by the second calculation module 204 to obtain the distorted variable data.

[0141] In this embodiment, the parameter determination module 205 can compare multiple distorted variable data and determine the target distorted variable data through comparison. The parameter value corresponding to the target distorted variable data can be used as the target parameter value.

[0142] In this application embodiment, a radial distortion parameter measurement device is proposed. When an image (distorted image) is acquired by acquiring an agricultural reclamation site, the device calculates the second coordinate of the inner corner point using the first coordinate of the inner corner point in the distorted image and multiple sets of parameter values ​​obtained by the first calculation module; then, a fitting curve is obtained based on the second coordinate of the inner corner point; distortion data is obtained based on the distance from the first coordinate of the inner corner point in the image to the fitting curve; and a target parameter value is obtained based on the distortion data, wherein the target parameter value corresponds to the radial distortion parameter of the camera module.

[0143] Therefore, in this embodiment, it is only necessary to continuously adjust the parameter values ​​through the first calculation module so that the distorted variable data obtained from the distance from the first coordinate of the inner corner point in the image to the fitted curve is the target distorted variable data among multiple sets of distorted variable data. The target parameter value can be obtained based on the target distorted variable data, thus avoiding the operation of taking multiple images for processing.

[0144] It should be noted that the working process of the radial distortion parameter measuring device in this embodiment corresponds to the implementation steps of the aforementioned radial distortion parameter measuring method. Therefore, the parts not described in this embodiment can be referred to the descriptions in the aforementioned embodiments, and will not be repeated here.

[0145] In one embodiment, the first computing module 202 is specifically used for:

[0146] The parameter values ​​are adjusted according to the preset initial value and preset range value to obtain multiple sets of parameter values; the parameter values ​​include the optical center position coordinates, the first distortion correction parameter and the second distortion correction parameter.

[0147] In this embodiment, the first calculation module can adjust the parameter value according to the preset initial value and preset range value of the parameter value.

[0148] For example, the first calculation module adjusts the optical center position coordinates by adjusting the optical center position coordinates according to the preset initial value and preset range value.

[0149] The adjustment of the first distortion correction parameter by the first calculation module specifically includes: adjusting the first distortion correction parameter according to the preset initial value and preset range of the first distortion correction parameter.

[0150] The adjustment of the second distortion correction parameter by the first calculation module specifically includes: adjusting the second distortion correction parameter according to the preset initial value and preset range of the second distortion correction parameter.

[0151] In one embodiment, the first calculation module 202 is further configured to: obtain the second coordinates of the interior corner points in the image using a distortion mathematical model. In this embodiment, the first calculation module uses the distortion mathematical model, substituting the adjusted parameter values ​​and the first coordinates of the interior corner points into the distortion mathematical model, to calculate the second coordinates of the interior corner points in the image.

[0152] In one embodiment, the data fitting module 203 is specifically used for:

[0153] The first fitted curve is obtained based on the ideal coordinates of the first pixel group, where the ideal coordinates of the first pixel group are: the second coordinates corresponding to each inner corner point set along the first direction of the image;

[0154] The second fitted curve is obtained based on the ideal coordinates of the second pixel group, where the ideal coordinates of the second pixel group are the second coordinates corresponding to each inner corner point set along the second direction of the image.

[0155] In this embodiment, the data fitting module is used to fit the ideal coordinates of the first pixel group to obtain a first fitting curve, and the data fitting module can also be used to fit the ideal coordinates of the second pixel group to obtain a second fitting curve.

[0156] In one embodiment, the second computing module 204 is specifically used for:

[0157] The first distortion data is obtained by summing the distances from the actual coordinates of the first pixel group to its corresponding fitted curve, where the actual coordinates of the first pixel group are: the first coordinates corresponding to each inner corner point set along the first direction of the image;

[0158] The second distortion data is obtained by summing the distances from the actual coordinates of the second pixel group to its corresponding fitted curve, where the actual coordinates of the second pixel group are: the first coordinates corresponding to each inner corner point set along the second direction of the image;

[0159] The distorted variable data is obtained by summing the first distorted variable data and the second distorted variable data.

[0160] In this embodiment, the second calculation module 204 is used to calculate the first distorted variable data, the second distorted variable data, and calculate the sum of the first distorted variable data and the second distorted variable data to obtain the distorted variable data.

[0161] It should be noted that the working process of the radial distortion parameter measuring device in this embodiment corresponds to the implementation steps of the aforementioned radial distortion parameter measuring method. Therefore, the parts not described in this embodiment can be referred to the descriptions in the aforementioned embodiments, and will not be repeated here.

[0162] This embodiment also provides an electronic device including a memory 301 and a processor 302. The memory 301 is used to store an executable computer program. The processor 302 is used to execute a radial distortion parameter measurement method according to an embodiment of the method of this application, under the control of the executable computer program.

[0163] Furthermore, the logical instructions in the aforementioned memory can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.

[0164] In one embodiment, each module of the radial distortion parameter measuring device described above can be implemented by a processor running computer instructions stored in memory.

[0165] <Media Example>

[0166] In this embodiment, a computer-readable storage medium is also provided, which stores a computer program that can be read and executed by a computer. The computer program is used to execute the radial distortion parameter measurement method as described in any of the above method embodiments of the present invention when read and executed by the computer.

[0167] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on its differences from other embodiments. However, those skilled in the art should understand that the above embodiments can be used individually or in combination as needed. Furthermore, for the apparatus embodiments, since they correspond to the method embodiments, the description is relatively simple; relevant parts can be referred to the corresponding parts of the method embodiments. The system embodiments described above are merely illustrative, and the modules described as separate components may or may not be physically separate.

[0168] This invention can be a system, method, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of the invention.

[0169] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.

[0170] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.

[0171] The computer program instructions used to perform the operations of this invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, etc., and conventional procedural programming languages ​​such as "e.g." or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing state information from the computer-readable program instructions. This electronic circuitry can execute the computer-readable program instructions to implement various aspects of the invention.

[0172] Various aspects of the present invention are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.

[0173] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.

[0174] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.

[0175] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions. It will be known to those skilled in the art that implementation in hardware, implementation in software, and implementation using a combination of software and hardware are equivalent.

[0176] The various embodiments of the present invention have been described above. These descriptions are exemplary and not exhaustive, and are not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or technical improvements to the embodiments in the market, or to enable others skilled in the art to understand the embodiments disclosed herein. The scope of the invention is defined by the appended claims.

Claims

1. A method for measuring radial distortion parameters, characterized in that, The measurement method includes: Obtain an image of the calibration board and get the first coordinates of the interior corner points in the image; Multiple sets of parameter values ​​are obtained, and each set of parameter values ​​corresponds to a different value. Based on each set of parameter values ​​and the first coordinate of the inner corner point, multiple sets of second coordinates of the inner corner point in the image are obtained, where each set of second coordinates of the inner corner point corresponds to the parameter value. Obtaining multiple sets of parameter values ​​specifically includes: The parameter values ​​are adjusted according to the preset initial value and preset range value to obtain multiple sets of parameter values; the parameter values ​​include the optical center position coordinates, the first distortion correction parameter and the second distortion correction parameter; Multiple sets of fitted curves are obtained based on multiple sets of second coordinates of the interior corner points in the image; Multiple sets of distorted variable data are obtained based on the distance from the first coordinate of the inner corner point in the image to its corresponding fitted curve; The smallest distorted variable data is determined based on multiple sets of distorted variable data. The smallest distorted variable data is the target distorted variable data, and the parameter value corresponding to the target distorted variable data is used as the target parameter value.

2. The radial distortion parameter measurement method according to claim 1, characterized in that, The second coordinates of the interior corner points in the image are obtained based on each set of parameter values ​​and the first coordinates of the interior corner points. Specifically, this involves using a distortion mathematical model to obtain the second coordinates of the interior corner points in the image.

3. The radial distortion parameter measurement method according to claim 1, characterized in that, Based on the second coordinates of the interior corner points in the image, the fitted curve is obtained specifically as follows: The first fitted curve is obtained based on the ideal coordinates of the first pixel group, where the ideal coordinates of the first pixel group are: the second coordinates corresponding to each inner corner point set along the first direction of the image; The second fitted curve is obtained based on the ideal coordinates of the second pixel group, where the ideal coordinates of the second pixel group are the second coordinates corresponding to each inner corner point set along the second direction of the image.

4. The radial distortion parameter measurement method according to claim 1 or 3, characterized in that, The distortion data obtained based on the distance from the first coordinate of the inner corner point in the image to the fitted curve specifically includes: The first distortion data is obtained by summing the distances from the actual coordinates of the first pixel group to its corresponding fitted curve, where the actual coordinates of the first pixel group are: the first coordinates corresponding to each inner corner point set along the first direction of the image; The second distortion data is obtained by summing the distances from the actual coordinates of the second pixel group to its corresponding fitted curve, where the actual coordinates of the second pixel group are: the first coordinates corresponding to each inner corner point set along the second direction of the image; The distorted variable data is obtained by summing the first distorted variable data and the second distorted variable data.

5. A radial distortion parameter measuring device, characterized in that, The measuring device includes: The acquisition module acquires an image of the calibration board and obtains the first coordinates of the inner corner points in the image; The first calculation module obtains multiple sets of parameter values, each set of parameter values ​​having a different numerical value. Based on each set of parameter values ​​and the first coordinates of the inner corner point, it obtains multiple sets of second coordinates of the inner corner point in the image, wherein each set of second coordinates of the inner corner point corresponds to a parameter value. The first calculation module is specifically used for: The parameter values ​​are adjusted according to the preset initial value and preset range value to obtain multiple sets of parameter values; the parameter values ​​include the optical center position coordinates, the first distortion correction parameter and the second distortion correction parameter; The data fitting module obtains multiple sets of fitted curves based on multiple sets of second coordinates of the inner corner points in the image; The second calculation module obtains multiple sets of distorted variable data based on the distance from the first coordinate of the inner corner point in the image to its corresponding fitted curve; The parameter determination module determines the smallest distorted variable data based on multiple sets of distorted variable data. The smallest distorted variable data is the target distorted variable data, and the parameter value corresponding to the target distorted variable data is used as the target parameter value.

6. The radial distortion parameter measuring device according to claim 5, characterized in that, The first calculation module is also used for: The second coordinates of the interior corner points in the image are obtained using a distortion mathematical model.

7. The radial distortion parameter measuring device according to claim 5, characterized in that, The data fitting module is specifically used for: The first fitted curve is obtained based on the ideal coordinates of the first pixel group, where the ideal coordinates of the first pixel group are: the second coordinates corresponding to each inner corner point set along the first direction of the image; The second fitted curve is obtained based on the ideal coordinates of the second pixel group, where the ideal coordinates of the second pixel group are the second coordinates corresponding to each inner corner point set along the second direction of the image.

8. The radial distortion parameter measuring device according to claim 5, characterized in that, The second calculation module is specifically used for: The first distortion data is obtained by summing the distances from the actual coordinates of the first pixel group to its corresponding fitted curve, where the actual coordinates of the first pixel group are: the first coordinates corresponding to each inner corner point set along the first direction of the image; The second distortion data is obtained by summing the distances from the actual coordinates of the second pixel group to its corresponding fitted curve, where the actual coordinates of the second pixel group are: the first coordinates corresponding to each inner corner point set along the second direction of the image; The distorted variable data is obtained by summing the first distorted variable data and the second distorted variable data.

9. An electronic device, characterized in that, The electronic device includes a memory and a processor, which are connected via an internal bus. The memory stores program instructions that can be executed by the processor, and when the program instructions are executed by the processor, they can implement the radial distortion parameter measurement method according to any one of claims 1-4.

Citation Information

Patent Citations

  • Method and system for correcting distortion of ultra-wide-angle camera device and camera device comprising system

    CN112907462A