Camera parameter calibration method, system and device
By capturing reference whiteboard images at multiple distances to obtain pixel parameters and center coordinates, camera intrinsic parameters and distortion relationship equations are constructed. The camera parameters are then solved using the LM method, which addresses the issues of accuracy and efficiency in low-resolution camera calibration and achieves efficient and accurate camera parameter calibration.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANGHAI JUYOU SMART INTELLIGENCE TECH CO LTD
- Filing Date
- 2023-04-26
- Publication Date
- 2026-07-07
AI Technical Summary
Traditional camera parameter calibration methods are not suitable for low-resolution cameras. Feature point extraction is difficult and inaccurate, resulting in large errors in the calculation results.
By taking pictures of the reference whiteboard at multiple distances with the camera, multiple sets of pixel parameters are obtained, the intrinsic parameter relationship is constructed and the camera intrinsic parameters are calculated. At the same time, the distortion correspondence and error equation are constructed using multiple sets of circle center coordinates, and the distortion coefficient and extrinsic parameter data are solved iteratively using the LM method.
It improves the efficiency and accuracy of intrinsic parameter calibration for low-resolution cameras, and can accurately obtain intrinsic and extrinsic parameters. It is suitable for the calibration of various cameras, including low-resolution TOF cameras.
Smart Images

Figure CN116503487B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of signal processing technology, specifically to a camera parameter calibration method, system, and device. Background Technology
[0002] Currently, the most commonly used camera calibration methods are Zhang Zhengyou's camera calibration method and the use of 3D stereo targets. Regardless of the method used, feature point extraction is essential, and sufficient quantity and accuracy must be ensured. Feature point extraction is particularly difficult for low-resolution cameras. Currently, checkerboard and circular pattern calibration boards are commonly used. However, with a resolution of 80*60, capturing a checkerboard image and performing corner detection will mostly fail, succeeding only in a few cases, but the extracted corner points will have poor accuracy. Using a circular pattern calibration board requires image preprocessing to extract the center of the circle. When the area of a circle is small in the image, both binarization and edge detection are difficult. Increasing the area while decreasing the number of circles further complicates optimization. Zhang Zhengyou's camera calibration method uses the following formula to calculate the homography matrix, thereby decomposing the homography matrix and calculating the initial values of the intrinsic and extrinsic parameters.
[0003] The camera's internal parameters total f x f y There are six parameters to be solved: cx, cy, k1, and k2. The extrinsic parameters include three rotation angles and three translation distances, for a total of six parameters, resulting in a total of 12 parameters to be solved. One feature point can yield two equations, and at least six marker points are needed to obtain the corresponding solution. However, due to the small number of equations, errors in feature point extraction, and inaccurate initial values, the final calculated result may have a large error.
[0004] For low-resolution cameras with a resolution below 100*100, it is difficult to guarantee the number of features and the extraction accuracy. A larger number of feature points makes extraction more difficult and accuracy harder to guarantee; a smaller number of feature points makes extraction easier and increases accuracy, but insufficient numbers prevent final optimization. Therefore, traditional camera parameter calibration methods are not suitable for these low-resolution cameras. Summary of the Invention
[0005] In view of this, this application provides a camera parameter calibration method, system, and device to solve the problem that traditional camera parameter calibration methods are not suitable for low-resolution cameras.
[0006] This application discloses a camera parameter calibration method, which includes the following steps:
[0007] The camera is positioned directly in front of the reference whiteboard at multiple distances to capture multiple sets of pixel parameters.
[0008] Construct an intrinsic parameter relationship based on each distance and its corresponding pixel parameter;
[0009] The camera's intrinsic parameters are calculated based on the aforementioned intrinsic parameter relationship.
[0010] Optionally, the intrinsic parameter relationship includes:
[0011]
[0012] In the formula, Z k D represents the distance from the k-th pixel in the captured pixel parameters to the reference white board. k Let (i,j) represent the distance value acquired by the k-th pixel in the captured pixel parameters, (i,j) represent the coordinates of the pixel in the image plane, cx represent the coordinates of the principal point in the x-direction, cy represent the coordinates of the principal point in the y-direction, and f x f represents the focal length of the first camera. y This indicates the focal length of the second camera.
[0013] Optionally, the reference whiteboard may include a white wall or a diffuse whiteboard.
[0014] Optionally, the camera parameter calibration method further includes the following steps:
[0015] Obtain multiple sets of circle center coordinates collected by the camera facing multiple circles on the calibration plate;
[0016] Based on the coordinates of each set of circle centers, construct corresponding relationship equations and error equations respectively, and solve for the camera's distortion coefficients and extrinsic parameters based on the corresponding relationship equations and error equations.
[0017] Optionally, obtaining multiple sets of circle center coordinates acquired by the camera facing multiple circles on the calibration plate includes:
[0018] Acquire grayscale images of multiple circles on a calibration plate using a camera;
[0019] Each of the grayscale images is binarized, and the outlines of the circular marker points in the binarized images are extracted respectively.
[0020] The contours of each circular marker point are fitted with a least-squares ellipse to obtain the coordinates of the center of each circle.
[0021] Optionally, the step of constructing corresponding relationship equations and error equations based on the coordinates of each set of circle centers, and solving for the camera's distortion coefficients and extrinsic parameters based on the corresponding relationship equations and the error equations, includes:
[0022] Based on the coordinates of each set of circle centers, an initial correspondence equation is constructed without considering the distortion coefficient. The initial values of the rotation matrix and translation matrix between the camera and the calibration plate are calculated based on the initial correspondence equation.
[0023] Based on the coordinates of each group of circle centers, construct the distortion correspondence equation and error equation considering the distortion coefficients respectively;
[0024] Based on the initial values of the rotation matrix and the translation matrix, the distortion correspondence equation and the error equation are solved iteratively using the LM method to obtain the distortion coefficients and extrinsic parameter data of the camera.
[0025] Optionally, the distortion correspondence equation includes:
[0026]
[0027]
[0028] x d =x(1+k1*r+k2*r) 2 ),
[0029] y d =y(1+k1*r+k2*r) 2 ),
[0030] u d =f x *x d +cx,
[0031] v d =f y *y d +cy,
[0032] Where (x,y) represents the coordinate parameters obtained by transforming the coordinates on the calibration board to the camera coordinate system and then normalizing the points, (x... d ,y d Let (x, y) represent the point after distortion is applied to (x, y), where r0, r1, r2, r2, r2, r2, r6, r7, and r8 are elements of the rotation matrix R, and X0, Y0, and Z0 are elements of the translation matrix T, where r = x 2 +y 2 , (X W ,Y W Z w () represents the origin coordinates of the coordinate system where the calibration plate is located, k1 represents the first distortion coefficient, k2 represents the second distortion coefficient, fx represents the focal length of the first camera, fy represents the focal length of the second camera, (u d ,v d ) represents the coordinates of the center of the corresponding circle obtained by least-squares elliptic fitting, cx represents the coordinates of the principal point in the x-direction, and cy represents the coordinates of the principal point in the y-direction.
[0033] Optionally, the error equation includes:
[0034] u′ d -u d =0,
[0035] v′ d -v d =0,
[0036] Among them, (u' d ,v' d ) represents the coordinates of the center of the corresponding circle on the calibration plate.
[0037] This application also provides a camera parameter calibration system, the camera parameter calibration system comprising:
[0038] The acquisition module is used to enable the camera to take pictures of the reference whiteboard at multiple distances to obtain multiple sets of pixel parameters;
[0039] The construction module is used to construct intrinsic parameter relationships based on each distance and the corresponding pixel parameters;
[0040] The calculation module is used to calculate the camera's intrinsic parameters based on the intrinsic parameter relationship.
[0041] This application also provides a camera parameter calibration device, which includes a processor and a storage medium; the storage medium stores program code; the processor is used to call the program code stored in the storage medium to execute any of the above-described camera parameter calibration methods.
[0042] The camera parameter calibration method, system, and device described in this application obtain multiple sets of pixel parameters by taking pictures of a reference white board at multiple distances. Based on each distance and the corresponding pixel parameters, an intrinsic parameter relationship is constructed, and the camera's intrinsic parameters are calculated according to the intrinsic parameter relationship. The entire intrinsic parameter calculation process is based on the specific characteristics of the camera itself and is applicable to the intrinsic parameter calibration of various cameras such as low-resolution TOF cameras. It can accurately obtain the intrinsic parameters and improve the efficiency and accuracy of the intrinsic parameter calibration process.
[0043] Furthermore, this application can also linearize the error equation based on the distortion correspondence formulas corresponding to multiple sets of circle center coordinates, and solve it using the LM method, gradually adjusting the distortion coefficients and extrinsic parameter data to obtain accurate distortion coefficients and extrinsic parameter data. This enables the calibration of camera data such as intrinsic and extrinsic parameters of low-resolution TOF cameras, and offers high application flexibility. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0045] Figure 1 This is a schematic flowchart of a camera parameter calibration method according to an embodiment of this application;
[0046] Figure 2 This is a distance diagram according to an embodiment of this application;
[0047] Figure 3 This is a schematic diagram of a camera parameter calibration system according to an embodiment of this application. Detailed Implementation
[0048] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. In the absence of conflict, the following embodiments and their technical features can be combined with each other.
[0049] The first aspect of this application provides a camera parameter calibration method, referring to... Figure 1 As shown, the camera parameter calibration method includes steps S110 to S130.
[0050] S110 enables the camera to take pictures of the reference white board at multiple distances to obtain multiple sets of pixel parameters. The pixel parameters may include parameters such as the coordinates of the corresponding pixel and the distance between the corresponding pixel and the reference white board.
[0051] Optionally, the camera may include a low-resolution TOF camera, where low resolution may include a resolution lower than 100*100. Optionally, the reference whiteboard may include a white wall or a diffuse whiteboard.
[0052] Specifically, in step S110 above, a low-resolution TOF camera can be used to face the white wall at two different distances, and the corresponding pixel parameters can be collected at these two distances, which can be denoted as Z1 and Z2, respectively. The pixel parameters collected by the TOF camera can include distance values, which are the lengths of a ray in space, such as... Figure 2 As shown, the distance between the TOF camera and the white wall is the depth value.
[0053] S120, construct an intrinsic parameter relationship based on each of the distances and the corresponding pixel parameters. This intrinsic parameter relationship can be derived from the relationship between the distance between the camera and the reference whiteboard and the camera's intrinsic parameters.
[0054] S130, calculate the camera's intrinsic parameters based on the aforementioned intrinsic parameter relationships to directly and accurately obtain the intrinsic parameters, thereby improving the efficiency and accuracy of the intrinsic parameter calibration process. Specifically, this step can construct intrinsic parameter relationships for each distance between the camera and the reference whiteboard and the corresponding pixel parameters, and solve the various intrinsic parameter relationships together to accurately calculate the corresponding intrinsic parameters.
[0055] The above-described camera parameter calibration method involves taking photos of a reference white board at multiple distances to obtain multiple sets of pixel parameters. Based on each distance and the corresponding pixel parameters, an intrinsic parameter relationship is constructed. The camera's intrinsic parameters are then calculated based on this relationship, allowing for direct and accurate determination of the intrinsic parameters. This method improves the efficiency and accuracy of the intrinsic parameter calibration process and enables accurate calibration even for low-resolution cameras.
[0056] In one embodiment, the intrinsic parameter relationship includes:
[0057]
[0058] In the formula, Z k This represents the distance from the k-th pixel in the captured pixel parameters to the reference white board. This distance is the depth value corresponding to the k-th pixel. (D) k Let (i,j) represent the distance value acquired by the k-th pixel in the captured pixel parameters, (i,j) represent the coordinates of the pixel in the image plane, cx represent the coordinates of the principal point in the x-direction, cy represent the coordinates of the principal point in the y-direction, and f x f represents the focal length of the first camera. y This indicates the focal length of the second camera.
[0059] Specifically, in this embodiment, the least squares method can be used to calculate the above intrinsic parameter relationship to solve for the camera's intrinsic parameters (such as f). x f y The obtained intrinsic parameters (cx and cy) have high accuracy and can be considered as true values, without needing to be adjusted later.
[0060] Specifically, the pixel parameters include the distance value D acquired by the k-th pixel. k The coordinates (X, Y, F) of the k-th pixel in the coordinate system of the image plane k Y k Z k The derivation process of the above internal parameter relationship is as follows.
[0061] For a set of pixel parameters obtained by a camera shooting directly at a reference whiteboard at a certain distance, the following relationship holds, where if the distance is Z1, then Z... k =Z1.
[0062]
[0063]
[0064]
[0065] Based on the above equations, we can obtain:
[0066]
[0067] Simplifying this formula yields the aforementioned intrinsic parameter relationship.
[0068] In one embodiment, the camera parameter calibration method further includes steps S140 and S150.
[0069] S140, acquire multiple sets of circle center coordinates collected by the camera facing multiple circles (also called circular markers) on the calibration plate.
[0070] The calibration plate includes at least three circles or circular markers. Step S140 allows the camera to collect one set of center coordinates for each circular marker on the calibration plate, resulting in at least three sets of center coordinates. Correspondence equations and error equations are then constructed for each set of center coordinates. The distortion coefficients and external parameters of the camera are then solved based on the correspondence equations and error equations.
[0071] Preferably, the calibration plate may include at least 6 circles. The camera can collect 8 sets of circle center coordinates for each circular marker on the calibration plate, so that in subsequent steps, corresponding relationship equations and error equations can be constructed for the 8 sets of circle center coordinates, and the distortion coefficients and extrinsic parameter data of the camera can be solved to ensure the accuracy of the obtained distortion coefficients and extrinsic parameter data.
[0072] S150, construct corresponding relationship equations and error equations based on the center coordinates of each group, and solve for the camera's distortion coefficients and external parameter data based on the corresponding relationship equations and error equations.
[0073] In one example, obtaining multiple sets of circle center coordinates collected by the camera facing multiple circles on the calibration plate includes steps S141 to S143.
[0074] S141, acquire grayscale images captured by the camera facing multiple circles on the calibration plate.
[0075] S142, binarize each of the grayscale images and extract the outlines of the circular marker points in the binarized images respectively. This step can be performed using Otsu's method to binarize each grayscale image and extract the outlines of the circular marker points in the binarized image.
[0076] S143, perform least-squares ellipse fitting on the contours of each circular marker point to obtain the coordinates of the center of each circle.
[0077] Furthermore, after performing least-squares ellipse fitting on the contours of each circular marker point to obtain the center coordinates of each set of circles, the above-mentioned acquisition of multiple sets of center coordinates collected by the camera on the calibration plate may also include: mapping each set of center coordinates to each circle on the calibration plate to clarify the correspondence between the center coordinates and each circle on the calibration plate.
[0078] In one example, the step of constructing a correspondence equation and an error equation based on the coordinates of each set of circles, and solving for the camera's distortion coefficients and extrinsic parameters based on the correspondence equation and the error equation includes steps S151 to S153.
[0079] S151: Based on the coordinates of each set of circle centers, an initial correspondence equation is constructed without considering distortion coefficients. The initial values of the rotation matrix and translation matrix between the camera and the calibration plate are then calculated based on this initial correspondence equation. Step S151 uses the coordinates of each set of circle centers and the camera intrinsic parameters obtained in the previous embodiment to calculate the initial values of the rotation matrix and translation matrix between the camera and the calibration plate using an optimized PNP algorithm. The initial values of the camera's extrinsic parameters can also be calculated. All these initial values are calculated based on the initial correspondence equation without considering distortion coefficients.
[0080] S152, construct distortion correspondence equations and error equations considering distortion coefficients based on the center coordinates of each group of circles.
[0081] S153, based on the initial values of the rotation matrix and the translation matrix, the LM method is used to iteratively solve the distortion correspondence equation and the error equation to obtain the distortion coefficients and extrinsic parameter data of the camera. Specifically, in step S153, the initial values of extrinsic parameters calculated by PNP, the camera intrinsic parameters, and considering radial distortions k1 and k2, are used to construct the error equation, and the LM method is used to solve it to obtain accurate distortion coefficients and extrinsic parameter data.
[0082] In one example, step S151, the initial correspondence equation may include:
[0083]
[0084]
[0085] x d '=x,
[0086] y d '=y,
[0087] u d0 =f x *x d '+cx,
[0088] v d0 =f y *y d '+cy,
[0089] Where (x,y) represents the coordinate parameters obtained by transforming the coordinates on the calibration board to the camera coordinate system and then normalizing the points, (x... d ',y d ') represents the point without distortion applied to (x,y), (u d0 ,v d0 () represents the coordinates of the center of the corresponding circle obtained by least-squares elliptic fitting without considering distortion coefficients. r0, r1, r2, r2, r2, r6, r7, and r8 are elements in the rotation matrix R, and X0, Y0, and Z0 are elements in the translation matrix T, (X... W ,Y W Z w () represents the coordinates of the origin of the coordinate system in which the calibration plate is located, where:
[0090]
[0091] The optimized PNP algorithm solves the aforementioned initial correspondence equations to obtain initial values for the rotation matrix, translation matrix, and extrinsic parameters. Optionally, this example can also construct constraint equations (also known as error equations) based on factors such as the relationship between the camera and the calibration board to obtain initial values for the rotation matrix, translation matrix, and extrinsic parameters that conform to the constraint equations during the calculation process, thereby improving the accuracy of the obtained initial values for the rotation matrix, translation matrix, and extrinsic parameters.
[0092] In one example, the distortion correspondence equation includes:
[0093]
[0094]
[0095] x d =x(1+k1*r+k2*r) 2 ),
[0096] y d =y(1+k1*r+k2*r)2 ),
[0097] u d =f x *x d +cx,
[0098] v d =f y *y d +cy,
[0099] Where (x,y) represents the coordinate parameters obtained by transforming the coordinates on the calibration board to the camera coordinate system and then normalizing the points, (x... d ,y d Let (x, y) represent the point after distortion is applied to (x, y), where r0, r1, r2, r2, r2, r2, r6, r7, and r8 are elements of the rotation matrix R, and X0, Y0, and Z0 are elements of the translation matrix T, where r = x 2 +y 2 , (X W ,Y W Z w () represents the origin coordinates of the coordinate system where the calibration plate is located, k1 represents the first distortion coefficient, k2 represents the second distortion coefficient, the initial values of the first distortion coefficient k1 and the second distortion coefficient k2 can be 0, fx represents the focal length of the first camera, fy represents the focal length of the second camera, (u d ,v d ) represents the coordinates of the center of the corresponding circle obtained by least-squares elliptic fitting, cx represents the coordinates of the principal point in the x-direction, and cy represents the coordinates of the principal point in the y-direction.
[0100] Furthermore, the error equation includes:
[0101] u′ d -u d =0,
[0102] v′ d -v d =0,
[0103] Among them, (u' d ,v' d ) represents the coordinates of the center of the corresponding circle on the calibration plate.
[0104] Specifically, in this example, the eight sets of center coordinates collected are substituted into the distortion correspondence to obtain the distortion correspondence formulas corresponding to the eight sets of center coordinates. The error equation is linearized and solved using the LM method. The distortion coefficients and extrinsic parameters can then be gradually adjusted. The parameters obtained at this time are the distortion coefficients and extrinsic parameters of the camera.
[0105] Specifically, the derivation and solution processes of the above-mentioned distortion correspondence and error equation can be described as follows.
[0106] The coordinates of the origin of the coordinate system in which the calibration plate is located are: (X W ,Y W Z w ).
[0107]
[0108] Transform the coordinates on the calibration plate to the camera coordinate system and normalize them to obtain:
[0109]
[0110]
[0111] By applying distortion to the ideal normalized coordinates, we can obtain:
[0112] x d =x(1+k1*r+k2*r) 2 ),
[0113] y d =y(1+k1*r+k2*r) 2 ),
[0114] The image plane coordinates with added distortion can be calculated using the following formula:
[0115] u d =f x *x d +cx,
[0116] v d =f y *y d +cy,
[0117] Based on the above derivation, the error equation is constructed as follows:
[0118] u′ d -u d =0,
[0119] v′ d -v d =0,
[0120] The above equation can be expanded as follows:
[0121]
[0122]
[0123] Based on the distortion correspondence formulas corresponding to the center coordinates of each group, the error equation is linearized and solved using the LM method, thus obtaining the camera's distortion coefficients and extrinsic parameter data.
[0124] The above camera parameter calibration method involves taking photos of a reference white board at multiple distances to obtain multiple sets of pixel parameters. Based on each distance and the corresponding pixel parameters, an intrinsic parameter relationship is constructed. The camera's intrinsic parameters are then calculated using this relationship. This entire intrinsic parameter calculation process is based on the specific characteristics of the camera itself and is applicable to the intrinsic parameter calibration of various cameras, including low-resolution TOF cameras. It can accurately obtain intrinsic parameters, improving the efficiency and accuracy of the calibration process. Furthermore, based on the distortion correspondence relationships corresponding to multiple sets of circle center coordinates, the error equation can be linearized and solved using the LM method. This allows for gradual adjustment of the distortion coefficients and extrinsic parameter data to obtain accurate distortion coefficients and extrinsic parameter data. This camera parameter calibration method can calibrate the intrinsic and extrinsic parameters of low-resolution TOF cameras.
[0125] This application provides a camera parameter calibration device in a second aspect, such as Figure 3 As shown, the camera parameter calibration device includes:
[0126] The acquisition module 110 is used to enable the camera to take pictures of the reference white board at multiple distances to obtain multiple sets of pixel parameters;
[0127] Construction module 120 is used to construct intrinsic parameter relationships based on each distance and the corresponding pixel parameters;
[0128] The calculation module 130 is used to calculate the intrinsic parameters of the camera based on the intrinsic parameter relationship.
[0129] For specific limitations regarding the camera parameter calibration device, please refer to the limitations on the camera parameter calibration method above, which will not be repeated here. Each unit in the aforementioned camera parameter calibration device can be implemented entirely or partially through software, hardware, or a combination thereof. These units can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each unit.
[0130] In a third aspect, this application provides a camera parameter calibration device, which includes a processor and a storage medium; the storage medium stores program code; the processor is used to call the program code stored in the storage medium to execute the camera parameter calibration method described in any of the above embodiments.
[0131] Although this application has been shown and described with respect to one or more implementations, equivalent variations and modifications will occur to those skilled in the art based on a reading and understanding of this specification and drawings. This application includes all such modifications and variations and is limited only by the scope of the appended claims. In particular, with respect to the various functions performed by the aforementioned components, the terminology used to describe such components is intended to correspond to any component (unless otherwise indicated) that performs the specified function of said component (e.g., is functionally equivalent to it), even if structurally not equivalent to the disclosed structure performing the functions in the exemplary implementations of this specification shown herein.
[0132] That is, the above description is only an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural changes made using the content of this application’s specification and drawings, such as the combination of technical features between different embodiments, or direct or indirect application in other related technical fields, are similarly included within the patent protection scope of this application.
[0133] Furthermore, it should be understood that in the description of this application, the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application. Additionally, for structural elements with the same or similar characteristics, this application may use the same or different reference numerals for identification. Moreover, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more features. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0134] In this application, the term "exemplary" is used to mean "serving as an example, illustration, or description." Any embodiment described as "exemplary" in this application is not necessarily to be construed as more preferred or advantageous than other embodiments. This application has been provided above to enable any person skilled in the art to implement and use it. Various details have been set forth in the above description for purposes of explanation. It should be understood that those skilled in the art will recognize that this application can be implemented without using these specific details. In other embodiments, well-known structures and processes will not be described in detail to avoid obscuring the description of this application with unnecessary detail. Therefore, this application is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed herein.
Claims
1. A method for calibrating camera parameters, characterized in that, The camera parameter calibration method includes the following steps: The camera is positioned directly in front of the reference whiteboard at multiple distances to capture multiple sets of pixel parameters. Construct an intrinsic parameter relationship based on each distance and its corresponding pixel parameter; The camera's intrinsic parameters are calculated based on the aforementioned intrinsic parameter relationship. The intrinsic parameter relationships include: , In the formula, This represents the distance from the k-th pixel in the captured pixel parameters to the reference white board. This represents the distance value acquired from the k-th pixel in the captured pixel parameters. Represents the coordinates of a pixel in the image plane. This represents the coordinates of the principal point in the x-direction. This represents the coordinates of the principal point in the y-direction. Indicates the focal length of the first camera. Indicates the focal length of the second camera; The camera parameter calibration method further includes the following steps: obtaining multiple sets of circle center coordinates collected by the camera facing multiple circles on the calibration plate; constructing a correspondence equation and an error equation based on each set of circle center coordinates; and solving for the camera's distortion coefficients and external parameter data based on the correspondence equation and the error equation. The step of constructing correspondence equations and error equations based on the center coordinates of each set of circles, and solving for the distortion coefficients and extrinsic parameters of the camera based on the correspondence equations and error equations, includes: constructing initial correspondence equations without considering distortion coefficients based on the center coordinates of each set of circles; calculating initial values of the rotation matrix and translation matrix between the camera and the calibration board based on the initial correspondence equations; constructing distortion correspondence equations and error equations considering distortion coefficients based on the center coordinates of each set of circles; and iteratively solving the distortion correspondence equations and error equations using the LM method based on the initial values of the rotation matrix and the translation matrix to obtain the distortion coefficients and extrinsic parameters of the camera.
2. The camera parameter calibration method according to claim 1, characterized in that, The reference whiteboard may be a white wall or a diffuse whiteboard.
3. The camera parameter calibration method according to claim 1, characterized in that, The acquisition of multiple sets of circle center coordinates collected by the camera facing multiple circles on the calibration plate includes: Acquire grayscale images of multiple circles on a calibration plate using a camera; Each of the grayscale images is binarized, and the outlines of the circular marker points in the binarized images are extracted respectively. The contours of each circular marker point are fitted with a least-squares ellipse to obtain the coordinates of the center of each circle.
4. The camera parameter calibration method according to claim 1, characterized in that, The distortion correspondence equation includes: , , , , , , Where (x,y) represents the coordinate parameters obtained by transforming the coordinates on the calibration board to the camera coordinate system and then normalizing the points. , () represents the point after applying distortion to (x,y). , , , , , , , and These are rotation matrices. The elements in , and These are translation matrices. The elements in , ( , , () represents the coordinates of the origin of the coordinate system in which the calibration plate is located. Indicates the first distortion coefficient. f represents the second distortion coefficient. x f represents the focal length of the first camera. y Indicates the focal length of the second camera, ( , The coordinates of the center of the corresponding circle are obtained by performing least-squares elliptic fitting. This represents the coordinates of the principal point in the x-direction. This represents the coordinates of the principal point in the y-direction.
5. The camera parameter calibration method according to claim 4, characterized in that, The error equation includes: , , in,( , ) represents the coordinates of the center of the corresponding circle on the calibration plate.
6. A camera parameter calibration system, characterized in that, The camera parameter calibration system includes: The acquisition module is used to enable the camera to take pictures of the reference whiteboard at multiple distances to obtain multiple sets of pixel parameters; The construction module is used to construct intrinsic parameter relationships based on each distance and the corresponding pixel parameters; The calculation module is used to calculate the camera's intrinsic parameters based on the intrinsic parameter relationship. The intrinsic parameter relationships include: , In the formula, This represents the distance from the k-th pixel in the captured pixel parameters to the reference white board. This represents the distance value acquired from the k-th pixel in the captured pixel parameters. Represents the coordinates of a pixel in the image plane. This represents the coordinates of the principal point in the x-direction. This represents the coordinates of the principal point in the y-direction. Indicates the focal length of the first camera. Indicates the focal length of the second camera; The camera parameter calibration system further includes: acquiring multiple sets of circle center coordinates collected by the camera facing multiple circles on the calibration plate; constructing a correspondence equation and an error equation based on each set of circle center coordinates; and solving for the camera's distortion coefficients and external parameter data based on the correspondence equation and the error equation. The step of constructing correspondence equations and error equations based on the center coordinates of each set of circles, and solving for the distortion coefficients and extrinsic parameters of the camera based on the correspondence equations and error equations, includes: constructing initial correspondence equations without considering distortion coefficients based on the center coordinates of each set of circles; calculating initial values of the rotation matrix and translation matrix between the camera and the calibration board based on the initial correspondence equations; constructing distortion correspondence equations and error equations considering distortion coefficients based on the center coordinates of each set of circles; and iteratively solving the distortion correspondence equations and error equations using the LM method based on the initial values of the rotation matrix and the translation matrix to obtain the distortion coefficients and extrinsic parameters of the camera.
7. A camera parameter calibration device, characterized in that, The camera parameter calibration device includes a processor and a storage medium; the storage medium stores program code; the processor is used to call the program code stored in the storage medium to execute the camera parameter calibration method according to any one of claims 1 to 5.