Camera calibration verification method, system, readable storage medium and computer device
By using the camera imaging model and sub-pixel feature point detection in the camera calibration verification method, correcting distortion and adjusting the camera optical center to coincide with the rotation center, the problem of optical center offset affecting triangulation measurement is solved, and the accuracy verification of camera calibration is achieved.
Patent Information
- Application Number
- CN202411580533.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2044-11-07
AI Technical Summary
In the existing technology, the exact position of the camera's optical center is affected by the optical structure and components and is offset, making it impossible to directly measure the actual distance from the optical center to the feature point, affecting the accuracy of the triangulation method and making it impossible to accurately verify the accuracy of the camera calibration.
By setting up an experimental environment, images containing targets A and B are captured. The geometric constraints of the camera imaging model are used to determine the offset between the camera's optical center and the rotation center. The camera is adjusted to make the optical center coincide with the rotation center. Multiple images are rotated and captured for triangulation. Combined with sub-pixel feature point detection and distortion correction, the distance from the optical center to the target plane is calculated, and the spatial position of the feature points is reconstructed.
The accuracy of the triangulation method is improved, the spatial position of the target feature points is accurately reconstructed, and the accuracy of camera calibration is improved.
Smart Images

Figure CN119478064B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of camera calibration, and in particular relates to a camera calibration verification method, system, readable storage medium and computer equipment. Background Art
[0002] Camera calibration is the process of calibrating the camera's intrinsic parameters. To effectively evaluate the accuracy of camera calibration, triangulation can be used to verify the results. This method first uses a camera with known intrinsic parameters to image two targets. Next, the pixel coordinates of the target feature points are extracted in the image plane. The spatial coordinates of the feature points on the target are reconstructed using the camera's geometric model. Finally, the reconstructed distance between the two feature points is calculated and compared with the actual distance. The calibration accuracy is verified by the magnitude of the relative error.
[0003] An image is a projection of the three-dimensional world onto a two-dimensional plane, a process that loses depth information. To reconstruct the spatial coordinates of a target feature point during triangulation, the distance from the camera's optical center to the feature point must be measured. The camera's optical center is typically located at the center of the lens. However, due to the lens's complex optical design, its exact position can vary slightly depending on the optical structure and components. Furthermore, the optical center is located internally within the camera structure, making it impossible to directly measure the actual distance from the optical center to the feature point. This impacts the accuracy of the triangulation method and makes it impossible to accurately verify the camera's calibration accuracy. Summary of the Invention
[0004] The present invention provides a camera calibration and verification method, system, readable storage medium and computer device, which are used to solve the problem that the exact position of the optical center during existing camera shooting is affected by the optical structure and components and is offset, and the problem that the actual distance from the optical center to the feature point cannot be directly measured.
[0005] The present invention provides a camera calibration and verification system for implementing a camera calibration and verification method.
[0006] The present invention provides a computer-readable storage medium for implementing the method steps of a camera calibration and verification method.
[0007] The present invention provides a computer device for implementing the method steps of a camera calibration and verification method.
[0008] The present invention is achieved through the following technical solutions:
[0009] A camera calibration verification method, the method comprising the following steps:
[0010] Step 1: Set up and debug experimental equipment to form an experimental environment for triangulation method;
[0011] Step 2: Take an image containing targets A and B, and obtain the offset between the camera optical center and the rotation center based on the geometric constraints of the camera imaging model;
[0012] Step 3: Move the camera according to the offset in step 2 so that the camera's optical center coincides with the rotation center. Rotate the camera to capture multiple images containing targets A and B, and conduct triangulation experiments to improve the accuracy of the triangulation method.
[0013] Furthermore, the step 2 specifically includes the following steps:
[0014] Step 2.1: Capture an image containing target A and target B;
[0015] Step 2.2: Perform sub-pixel feature point detection on the image to obtain the pixel coordinates of the feature points;
[0016] Step 2.3: Dedistort the pixel coordinates of the feature points to obtain the dedistorted pixel coordinates of the feature points;
[0017] Step 2.4: Based on the similar triangle formed by the spatial coordinates of the feature point, the optical center of the camera, and the pixel coordinates of the dedistorted feature point, the distance from the optical center of the camera to the plane where the target is located is obtained;
[0018] Step 2.5: Measure the distance from the rotation center to the target plane, and subtract it from the distance from the camera optical center to the target plane to obtain the offset from the camera optical center to the rotation center.
[0019] Furthermore, step 2.1 is specifically as follows: the camera is mechanically connected to the rotating platform through a fixture, the geometric center of the outer surface of the lens coincides with the rotation center, and the rotating platform is adjusted so that the optical axis of the camera lens is perpendicular to the plane where the target is located, and the plane formed by the geometric center of the outer surface of the lens, the characteristic point of target A, and the characteristic point of target B is perpendicular to the plane where the target is located;
[0020] Adjust the brightness of the experimental light source and capture an image containing target A and target B so that the captured image is as clear as possible.
[0021] Furthermore, step 2.3 is specifically as follows: let the pixel coordinates of the feature points detected on the image be m dist for (u dist ,v dist ), the coordinates of the feature point in the imaging coordinate system are (x dist ,y dist ), on the undistorted image, the pixel coordinate m corresponding to the feature point is (u, v), and the coordinates of the imaging coordinate system are (x, y);
[0022] According to the conversion relationship between the image coordinate system and the imaging coordinate system, we can obtain:
[0023]
[0024] Where, f x 、f y are the focal lengths of the camera in the x and y directions of the imaging coordinate system, respectively; u0 and v0 are the principal point offsets of the camera in the x and y directions of the imaging coordinate system.
[0025] The obtained (x dist ,y dist ) as the initial value (x0,y0),
[0026]
[0027] The coordinates (x, y) of the dedistorted feature point imaging coordinate system can be obtained by repeated iteration of the distortion model.
[0028]
[0029] Where k1, k2, k3, k4, k5, and k6 are radial distortion parameters, and p1 and p2 are tangential distortion parameters.
[0030] When the number of iterations or the iteration accuracy is satisfied, the iteration is exited. n ,y n ) is the imaging coordinate system coordinate on the undistorted image and is (x, y).
[0031] According to the conversion relationship between the image coordinate system and the imaging coordinate system,
[0032]
[0033] The pixel coordinates m of the dedistorted feature point are obtained through the dedistortion model as (u, v);
[0034] The dedistortion model includes a radial distortion model and a tangential distortion model;
[0035] Assume that the pixel coordinates of the feature points of target A and target B are detected Adist 、m Bdist They are (u Adist ,v Adist )、(u Bdist ,v Bdist ), dedistort the pixel coordinates of the feature points to obtain the dedistorted pixel coordinates of the feature points m A 、m B They are (u A ,v A )、(u B ,v B ).
[0036] Furthermore, the step 2.4 is specifically as follows: according to the pinhole imaging model, the feature point object point MA 、M B With the camera optical center O c The triangle formed and the pixel coordinates of the dedistorted feature point m A 、m B With the camera optical center O c The triangles formed are similar triangles, and the distance D from the optical center of the camera to the plane where the target is located can be obtained;
[0037]
[0038] Where L is the distance between the feature point of target A and the feature point of target B, D1 and D2 are respectively x 、f y The calculated distance from the camera's optical center to the target's plane;
[0039]
[0040] Where D is the average value of D1 and D2, that is, the distance from the optical center of the camera to the plane where the target is located.
[0041] Furthermore, the step 2.5 specifically includes obtaining a distance d from the rotation center P to the plane where the target is located;
[0042] The distance D from the camera optical center to the target plane is subtracted from the distance d from the rotation center to the target plane to obtain the offset δ from the camera optical center to the rotation center.
[0043] δ=Dd (7).
[0044] Furthermore, the step 3 is specifically to rotate the camera to capture multiple images containing target A and target B, and the target should cover the entire field of view of the camera as much as possible;
[0045] Select a captured image to perform sub-pixel feature point detection, and obtain the pixel coordinates of the feature points of target A and target B respectively (u Adist ,v Adist )、(u Bdist ,v Bdist );
[0046] The pixel coordinates of the feature points are dedistorted to obtain the pixel coordinates of the dedistorted feature points of target A and target B respectively (u A ,v A )、(u B ,v B );
[0047] According to the internal parameters of the camera, the normalized camera coordinate system coordinates (X Acoff ,Y Acoff ,1)、(XBcoff ,Y Bcoff ,1);
[0048] Measure the distance from the rotation center to the feature points of target A and target B respectively, that is, obtain the distance from the camera optical center to the feature points of target A and target B, and obtain the depth information of the feature points;
[0049] The camera coordinate system coordinates A of the feature points of target A and target B can be reconstructed based on the depth information. c 、B c ;
[0050] Then the reconstruction distance between the feature points of target A and target B is L′ AB ;
[0051] Calculate the relative error between the reconstructed distance and the actual distance of the feature points of target A and target B, and verify the calibration accuracy of the camera by the size of the relative error;
[0052] Calculate the relative error between the reconstructed distance and the actual distance of the feature points of target A and target B in all captured images, and take the arithmetic mean as the distance verification result of triangulation.
[0053] A camera calibration and verification system, the system uses the camera calibration and verification method as described above,
[0054] Acquisition module, used to capture images required for triangulation experiments;
[0055] The calculation module obtains the offset between the camera optical center and the rotation center according to the geometric constraints of the camera imaging model;
[0056] Verification module, used to conduct triangulation experiments.
[0057] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described above is implemented.
[0058] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method described above is implemented.
[0059] The beneficial effects of the present invention are:
[0060] The present invention accurately reconstructs the spatial position of the target feature points, determines the position of the camera optical center according to the geometric constraints of the camera imaging model, improves the measurement accuracy of the depth information, and enhances the accuracy of the triangulation method. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 It is a flow chart of the method of the present invention.
[0062] Figure 2 Schematic diagram of the camera calibration and verification system of the present invention.
[0063] Figure 3 This is a flow chart of the method for calculating the offset between the camera optical center and the rotation center of the present invention.
[0064] Figure 4 It is a schematic diagram of a similar triangle formed by the spatial coordinates of the feature points, the optical center of the camera, and the pixel coordinates of the dedistorted feature points of the present invention.
[0065] Figure 5 Schematic diagram of the triangulation system of the present invention.
[0066] Figure 6 It is a schematic diagram of the target posture photographed by the triangulation system of the present invention.
[0067] Figure 7 Schematic diagram of the camera calibration and verification system of the present invention.
[0068] Figure 8 It is a schematic diagram of a computer device of the present invention. DETAILED DESCRIPTION
[0069] In the following description, specific details such as specific system structures and technologies are provided for illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obstructing the description of the present application with unnecessary details.
[0070] It will be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.
[0071] It should also be understood that the terms used in this specification are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms unless the context clearly indicates otherwise.
[0072] The following is attached to this application specification Figure 1-6, clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of this application.
[0073] In the following description, many specific details are set forth to facilitate a full understanding of the present application. However, the present application may also be implemented in other ways different from those described herein. Those skilled in the art may make similar generalizations without violating the connotation of the present application. Therefore, the present application is not limited to the specific embodiments disclosed below.
[0074] Implementation Method 1
[0075] An embodiment of the present invention provides a camera calibration verification method, the method comprising the following steps:
[0076] Step 1: Set up and debug experimental equipment to form an experimental environment for the triangulation method, including: camera, rotating platform, fixture, target A, target B, wherein the camera has been calibrated to obtain the camera's internal parameters;
[0077] The camera is fixed with a clamp and mechanically connected to the rotating platform;
[0078] The rotating platform realizes rotation and translation of the rotation center through a servo mechanism;
[0079] The targets A and B have the same characteristic pattern and contain at least one characteristic point, and the characteristic pattern includes but is not limited to a checkerboard, a circle, and a ring;
[0080] The target A and the target B are both planar targets, and the target A and the target B are coplanar.
[0081] Step 2: Take an image containing targets A and B, and obtain the offset between the camera optical center and the rotation center based on the geometric constraints of the camera imaging model;
[0082] Step 3: Move the camera according to the offset in step 2 so that the camera's optical center coincides with the rotation center. Rotate the camera to capture multiple images containing targets A and B, and conduct triangulation experiments to improve the accuracy of the triangulation method.
[0083] Furthermore, the step 2 specifically includes the following steps:
[0084] Step 2.1: Capture an image containing target A and target B;
[0085] Step 2.2: Perform sub-pixel feature point detection on the image to obtain the pixel coordinates of the feature points; use corresponding feature point detection algorithms for different pattern feature points, including but not limited to Harris detection algorithm, Shi-Tomasi detection algorithm, centroid method, and ellipse fitting method;
[0086] Step 2.3: Dedistort the pixel coordinates of the feature points to obtain the dedistorted pixel coordinates of the feature points;
[0087] Step 2.4: Based on the similar triangle formed by the spatial coordinates of the feature point, the optical center of the camera, and the pixel coordinates of the dedistorted feature point, the distance from the optical center of the camera to the plane where the target is located is obtained;
[0088] Step 2.5: Measure the distance from the rotation center to the target plane, and subtract it from the distance from the camera optical center to the target plane to obtain the offset from the camera optical center to the rotation center.
[0089] Furthermore, step 2.1 is specifically as follows: the camera is mechanically connected to the rotating platform through a fixture, the geometric center of the outer surface of the lens coincides with the rotation center, and the rotating platform is adjusted so that the optical axis of the camera lens is perpendicular to the plane where the target is located, and the plane formed by the geometric center of the outer surface of the lens, the characteristic point of target A, and the characteristic point of target B is perpendicular to the plane where the target is located;
[0090] Adjust the brightness of the experimental light source (if a reflective target is used, adjust the brightness of the experimental environment light source; if a transmissive target is used, adjust the brightness of the backlight source), and capture an image containing target A and target B so that the captured image is as clear as possible.
[0091] Furthermore, step 2.3 is specifically as follows: let the pixel coordinates of the feature points detected on the image be m dist for (u dist ,v dist ), the coordinates of the feature point in the imaging coordinate system are (x dist ,y dist ), on the undistorted image, the pixel coordinate m corresponding to the feature point is (u, v), and the coordinates of the imaging coordinate system are (x, y); the pixel coordinates of the dedistorted feature point are obtained through the dedistortion model;
[0092] The dedistortion model includes a radial distortion model and a tangential distortion model;
[0093] Specifically, the pixel coordinates of the feature points are dedistorted by obtaining the following equation based on the conversion relationship between the image coordinate system and the imaging coordinate system:
[0094]
[0095] Where, f x 、f yare the focal lengths of the camera in the x and y directions of the imaging coordinate system, respectively; u0 and v0 are the principal point offsets of the camera in the x and y directions of the imaging coordinate system;
[0096] The obtained (x dist ,y dist ) as the initial value (x0,y0),
[0097]
[0098] The coordinates (x, y) of the dedistorted feature point imaging coordinate system can be obtained by repeated iteration of the distortion model.
[0099]
[0100] Where k1, k2, k3, k4, k5, and k6 are radial distortion parameters, and p1 and p2 are tangential distortion parameters;
[0101] When the number of iterations or the iteration accuracy is satisfied, exit the iteration; the iterative (x n ,y n ) is the imaging coordinate system coordinate on the undistorted image (x, y);
[0102] According to the conversion relationship between the image coordinate system and the imaging coordinate system,
[0103]
[0104] Through the above process, the pixel coordinates m of the dedistorted feature point can be obtained as (u, v);
[0105] Assume that the pixel coordinates of the feature points of target A and target B are detected Adist 、m Bdist They are (u Adist ,v Adist )、(u Bdist ,v Bdist ), dedistort the pixel coordinates of the feature points to obtain the dedistorted pixel coordinates of the feature points m A 、m B They are (u A ,v A )、(u B ,v B ).
[0106] Furthermore, the step 2.4 is specifically as follows: according to the pinhole imaging model, the feature point object point M A 、M B With the camera optical center O c The triangle formed and the pixel coordinates of the dedistorted feature point m A 、m B With the camera optical center O cThe triangles formed are similar triangles, and the distance D from the optical center of the camera to the plane where the target is located can be obtained;
[0107]
[0108] Where L is the distance between the feature point of target A and the feature point of target B, D1 and D2 are respectively x 、f y The calculated distance from the camera's optical center to the target's plane;
[0109]
[0110] Where D is the average value of D1 and D2, that is, the distance from the optical center of the camera to the plane where the target is located.
[0111] Furthermore, the step 2.5 specifically includes obtaining a distance d from the rotation center P to the plane where the target is located;
[0112] The distance D from the camera optical center to the target plane is subtracted from the distance d from the rotation center to the target plane to obtain the offset δ from the camera optical center to the rotation center.
[0113] δ=Dd (7).
[0114] Furthermore, step 3 specifically includes mechanically connecting the camera to the rotating platform via a fixture, moving the camera according to the offset so that the camera optical center coincides with the rotation center; adjusting the brightness of the experimental light source (if a reflective target is used, the brightness of the experimental environment light source is adjusted; if a transmissive target is used, the brightness of the backlight source is adjusted) to make the captured image as clear as possible;
[0115] The rotating camera captures multiple images containing target A and target B, where the target should cover the entire field of view of the camera as much as possible. In this embodiment, 12 images are captured with the target located in different areas of the image.
[0116] Select a captured image to perform sub-pixel feature point detection, and obtain the pixel coordinates of the feature points of target A and target B respectively (u Adist ,v Adist )、(u Bdist ,v Bdist );
[0117] The pixel coordinates of the feature points are dedistorted to obtain the pixel coordinates of the dedistorted feature points of target A and target B respectively (u A ,v A )、(u B ,v B );
[0118] According to the internal parameters of the camera, the normalized camera coordinate system coordinates (XAcoff ,Y Acoff ,1)、(X Bcoff ,Y Bcoff ,1);
[0119]
[0120]
[0121] Where, f x 、f y are the focal lengths of the camera in the x and y directions of the imaging coordinate system, respectively; u0 and v0 are the principal point offsets of the camera in the x and y directions of the imaging coordinate system;
[0122] Measure the distances from the rotation center to the feature points of target A and target B respectively, that is, obtain the distances from the camera optical center to the feature points of target A and target B, and obtain the depth information of the feature points according to formula (10);
[0123]
[0124] Where, are the distances from the optical center of the camera to the characteristic points of target A and target B, respectively, Z Ac , Z Bc They are the depth information of the feature points of target A and target B respectively;
[0125] The camera coordinate system coordinates A of the feature points of target A and target B can be reconstructed based on the depth information. c 、B c ;
[0126]
[0127] Then the reconstructed distance L′ between the feature points of target A and target B is AB for:
[0128]
[0129] Calculate the relative error between the reconstructed distance and the actual distance of the feature points of target A and target B, and verify the calibration accuracy of the camera by the size of the relative error.
[0130]
[0131] Where, L AB is the actual distance between the feature points of target A and target B, ε is the relative error between the reconstructed distance and the actual distance between the feature points of target A and target B. The smaller ε is, the higher the camera calibration accuracy is.
[0132] Calculate the relative error between the reconstructed distance and the actual distance of the feature points of target A and target B in all captured images, and take the arithmetic mean as the distance verification result of triangulation.
[0133] Specifically,
[0134] Table 1 Experimental results of camera calibration verification method
[0135] one
[0136] Position: mm
[0137]
[0138] In the existing technology, due to the complex optical design of the lens, the exact position of the optical center may be slightly offset due to the influence of the optical structure and components. In addition, the optical center is located inside the camera structure, and the actual distance from the optical center to the feature point cannot be directly measured. These factors affect the accuracy of the triangulation method and make it impossible to accurately verify the calibration accuracy of the camera.
[0139] Implementation Method 2
[0140] An embodiment of the present invention provides a camera calibration and verification system, wherein the system uses the camera calibration and verification method described in embodiment 1, and the system includes:
[0141] Acquisition module, used to capture images required for triangulation experiments;
[0142] The calculation module obtains the offset between the camera optical center and the rotation center according to the geometric constraints of the camera imaging model;
[0143] Verification module, used to conduct triangulation experiments.
[0144] Implementation Method 3
[0145] An embodiment of the present invention provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. The memory is used to store software programs and modules, and the processor executes various functional applications and data processing by executing the software programs and modules stored in the memory. The memory and processor are connected via a bus. Specifically, the processor implements any step of the first embodiment described above by executing the computer program stored in the memory.
[0146] It should be understood that in the embodiments of the present invention, the processor referred to may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.
[0147] The memory may include a read-only memory, a flash memory, and a random access memory, and provides instructions and data to the processor. A portion or all of the memory may also include a non-volatile random access memory.
[0148] As can be seen from the above, the electronic device provided by the embodiment of the present invention can implement a camera calibration verification method as described in embodiment 1 by running a computer program. In the triangulation experiment for verifying the accuracy of camera calibration, in order to accurately reconstruct the spatial position of the target feature point, the camera optical center position is determined according to the geometric constraint relationship of the camera imaging model, thereby improving the measurement accuracy of the depth information and enhancing the accuracy of the triangulation method.
[0149] It should be understood that if the above-mentioned integrated modules / units are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the present invention can implement all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The above-mentioned computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, it can implement the steps of the above-mentioned various method embodiments. Among them, the above-mentioned computer program includes computer program code, and the above-mentioned computer program code can be in source code form, object code form, executable file or some intermediate form. The above-mentioned computer-readable medium may include: any entity or device capable of carrying the above-mentioned computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the above-mentioned computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction.
[0150] The above description of the disclosed embodiments will enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein, but is to be construed in the widest manner consistent with the principles and novel features disclosed herein.
[0151] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the above-mentioned device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the implementation method can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method implementation method, and will not be repeated here.
[0152] It should be noted that the methods and detailed examples provided in the above embodiments can be combined with the devices and equipment provided in the embodiments, and references can be made to each other, and no further details will be given.
[0153] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.
[0154] In the embodiments provided by the present invention, it should be understood that the disclosed apparatus / terminal equipment and methods can be implemented in other ways. For example, the apparatus / device embodiments described above are merely illustrative. For example, the division of the modules or units described above is merely a logical functional division. In actual implementation, other division methods may be used. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not implemented.
[0155] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention, and should all be included in the scope of protection of the present invention.
Claims
1. A camera calibration and verification method, characterized in that: The method comprises the following steps: Step 1: Set up and debug experimental equipment to form an experimental environment for triangulation method; Step 2: Take an image containing targets A and B, and obtain the offset between the camera optical center and the rotation center based on the geometric constraints of the camera imaging model; Step 3: Move the camera according to the offset in step 2 so that the camera optical center coincides with the rotation center. Rotate the camera to capture multiple images containing targets A and B, and perform triangulation experiments to improve the accuracy of the triangulation method. The step 2 specifically includes the following steps: Step 2.1: Capture an image containing target A and target B; Step 2.2: Perform sub-pixel feature point detection on the image to obtain the pixel coordinates of the feature points; Step 2.3: Dedistort the pixel coordinates of the feature points to obtain the dedistorted pixel coordinates of the feature points; Step 2.4: Based on the similar triangle formed by the spatial coordinates of the feature point, the optical center of the camera, and the pixel coordinates of the dedistorted feature point, the distance from the optical center of the camera to the plane where the target is located is obtained; Step 2.5: Measure the distance from the rotation center to the target plane, and subtract it from the distance from the camera optical center to the target plane to obtain the offset from the camera optical center to the rotation center.
2. The camera calibration and verification method according to claim 1, characterized in that: Specifically, step 2.1 includes mechanically connecting the camera to the rotating platform via a fixture, aligning the geometric center of the outer surface of the lens with the rotation center, and adjusting the rotating platform so that the optical axis of the camera lens is perpendicular to the plane where the target is located, and the plane formed by the geometric center of the outer surface of the lens, the characteristic point of target A, and the characteristic point of target B is perpendicular to the plane where the target is located; Adjust the brightness of the experimental light source and capture an image containing target A and target B so that the captured image is as clear as possible.
3. The camera calibration verification method according to claim 1, characterized in that: Specifically, step 2.3 is as follows: let the pixel coordinates of the feature points detected on the image be m dist for (u dist ,v dist ), the coordinates of the feature point in the imaging coordinate system are (x dist ,y dist ), on the undistorted image, the pixel coordinate m corresponding to the feature point is (u, v), and the coordinates of the imaging coordinate system are (x, y); According to the conversion relationship between the image coordinate system and the imaging coordinate system, we can obtain: Where, f x 、f y are the focal lengths of the camera in the x and y directions of the imaging coordinate system, respectively; u0 and v0 are the principal point offsets of the camera in the x and y directions of the imaging coordinate system; The obtained (x dist ,y dist ) as the initial value (x0,y0), The coordinates (x, y) of the dedistorted feature point imaging coordinate system can be obtained by repeated iteration of the distortion model. Where k1, k2, k3, k4, k5, and k6 are radial distortion parameters, and p1 and p2 are tangential distortion parameters; When the number of iterations or the iteration accuracy is satisfied, exit the iteration; the iterative (x n ,y n ) is the imaging coordinate system coordinate on the undistorted image (x, y); According to the conversion relationship between the image coordinate system and the imaging coordinate system, we can obtain: The pixel coordinates m of the dedistorted feature point are obtained through the dedistortion model as (u, v); The dedistortion model includes a radial distortion model and a tangential distortion model; Assume that the pixel coordinates of the feature points of target A and target B are detected Adist 、m Bdist They are (u Adist ,v Adist )、(u Bdist ,v Bdist ), dedistort the pixel coordinates of the feature points to obtain the dedistorted pixel coordinates of the feature points m A 、m B They are (u A ,v A )、(u B ,v B ).
4. The camera calibration and verification method according to claim 1, wherein: The step 2.4 is specifically as follows: according to the pinhole imaging model, the feature point object point M A 、M B With the camera optical center O c The triangle formed and the pixel coordinates of the dedistorted feature point m A 、m B With the camera optical center O c The triangles formed are similar triangles, and the distance D from the optical center of the camera to the plane where the target is located can be obtained. Where L is the distance between the feature point of target A and the feature point of target B, D1 and D2 are respectively x 、f y The calculated distance from the camera optical center to the target plane, Where D is the average value of D1 and D2, that is, the distance from the optical center of the camera to the plane where the target is located.
5. The camera calibration and verification method according to claim 1, wherein: Specifically, step 2.5 is to obtain the distance d from the rotation center P to the plane where the target is located; The distance D from the camera optical center to the target plane is subtracted from the distance d from the rotation center to the target plane to obtain the offset δ from the camera optical center to the rotation center. δ=Dd (7).
6. The camera calibration and verification method according to claim 1, characterized in that: Specifically, step 3 includes rotating the camera to capture multiple images containing target A and target B, where the target should cover the entire field of view of the camera as much as possible; Select a captured image to perform sub-pixel feature point detection, and obtain the pixel coordinates of the feature points of target A and target B respectively (u Adist ,v Adist )、(u Bdist ,v Bdist ); The pixel coordinates of the feature points are dedistorted to obtain the pixel coordinates of the dedistorted feature points of target A and target B respectively (u A ,v A )、(u B ,v B ); According to the internal parameters of the camera, the normalized camera coordinate system coordinates (X Acoff ,Y Acoff ,1)、(X Bcoff ,Y Bcoff ,1); Measure the distance from the rotation center to the feature points of target A and target B respectively, that is, obtain the distance from the camera optical center to the feature points of target A and target B, and obtain the depth information of the feature points; The camera coordinate system coordinates A of the feature points of target A and target B can be reconstructed based on the depth information. c 、B c ; Then the reconstruction distance between the feature points of target A and target B is L′ AB ; Calculate the relative error between the reconstructed distance and the actual distance of the feature points of target A and target B, and verify the calibration accuracy of the camera by the size of the relative error; Calculate the relative error between the reconstructed distance and the actual distance of the feature points of target A and target B in all captured images, and take the arithmetic mean as the distance verification result of triangulation.
7. A camera calibration and verification system, characterized in that: The system uses the camera calibration and verification method according to any one of claims 1 to 6, and the system includes: Acquisition module, used to capture images required for triangulation experiments; The calculation module obtains the offset between the camera optical center and the rotation center according to the geometric constraints of the camera imaging model; Verification module, used to conduct triangulation experiments.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
9. A computer device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Method, device and system for detecting surface machining quality of component
CN117664029A
Method and system for calibrating binocular camera, and electronic device and storage medium
WO2023045147A1