Camera calibration method and device, computer equipment and readable storage medium
By using calibration objects with luminous marks and camera calibration methods, the initial parameters are adjusted to obtain more accurate camera parameters, and the problems of cumbersome and low accuracy in the prior art are solved, thereby achieving more efficient and accurate camera calibration.
Patent Information
- Application Number
- CN202411742522.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-14
AI Technical Summary
The existing camera calibration methods are cumbersome, the calibration accuracy is poor, and the shooting range and angle are limited by the checkerboard.
By obtaining the initial parameters of the camera to be calibrated, the first calibration object and the second calibration object with the luminous mark are calibrated, and the initial parameters are adjusted to obtain more accurate camera parameters according to the difference between the initial distance between the second luminous mark on the second image and the preset distance.
The camera calibration process is simplified, calibration accuracy and efficiency are improved, and is suitable for a variety of application scenarios, especially in unfixed test sites.
Smart Images

Figure CN119625082A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer vision technology, and in particular to a camera calibration method, apparatus, computer device, and computer-readable storage medium. Background Art
[0002] The camera's internal parameters and external parameters are two important concepts that describe the camera's imaging process. The internal parameters are used to describe the camera's imaging characteristics, including focal length, principal point, distortion coefficient, etc. The external parameters are used to describe the camera's position and direction in the three-dimensional world, including rotation matrix, translation vector, etc. Camera calibration, which is used to determine the camera's internal and external parameters, is an important task in the field of computer vision and can effectively improve the accuracy and reliability of computer vision systems.
[0003] In the related art, a checkerboard can be printed out and pasted on a plane, the checkerboard can be photographed with a camera, and the camera parameters can be calculated based on the photographed image to complete the calibration. However, with this method, the camera shooting range and shooting angle are greatly affected by the printed checkerboard, the calibration process is cumbersome, and the calibration accuracy is poor. Summary of the invention
[0004] Based on this, it is necessary to provide a camera calibration method, device, computer equipment, computer-readable storage medium and computer program product that can simplify the process and improve the calibration accuracy in response to the above technical problems.
[0005] In a first aspect, the present application provides a camera calibration method, comprising:
[0006] Acquire initial parameters of the camera to be calibrated, where the initial parameters are determined based on a first image of a first calibration object captured by the camera to be calibrated, where a plurality of first luminous marks are provided on the first calibration object;
[0007] Acquire a second image of a second calibration object using the camera to be calibrated, wherein the second calibration object is provided with at least two second luminous marks arranged at a preset distance;
[0008] According to the second image, the initial distance between the second luminous signs on the second image is calculated using the initial parameters, and according to the difference between the initial distance and the preset distance, the initial parameters are adjusted to obtain adjusted parameters.
[0009] In one embodiment, the method for determining the initial parameters includes:
[0010] Acquire a first image of a first calibration object using the camera to be calibrated, wherein at least four first luminous marks arranged in an L shape are provided on the first calibration object;
[0011] The initial parameters of the camera to be calibrated are determined according to the position information of the first luminous mark on the first image.
[0012] In one embodiment, determining the initial parameters of the camera to be calibrated according to the position information of the first luminous mark on the first image includes:
[0013] Determine a target luminous mark from the first luminous marks;
[0014] The position of the target luminous mark is determined as the origin, and the initial parameters of the camera to be calibrated are determined according to the positional relationship between the first luminous marks on the first image.
[0015] In one embodiment, the step of acquiring a first image of a first calibration object using a camera to be calibrated includes:
[0016] In response to a first calibration object being located at a preset position in a collection range of the camera to be calibrated, a first image of the first calibration object is acquired by using the camera to be calibrated.
[0017] In one embodiment, the second image includes a plurality of images, and the step of acquiring the second image of the second calibration object by using the camera to be calibrated includes:
[0018] When the second calibration object is located at different positions, a plurality of second images of the second calibration object are acquired by using the camera to be calibrated.
[0019] In one embodiment, the initial distance between the second luminous signs on the second image is calculated using the initial parameter, and the initial parameter is adjusted according to the difference between the initial distance and the preset distance, and the adjusted parameter includes:
[0020] Using the initial parameters, respectively calculating the distances between the second luminous marks on the plurality of second images to obtain a plurality of groups of initial distances;
[0021] Determining a parameter adjustment amount according to differences between the multiple groups of initial distances and the preset distances;
[0022] The initial parameters are adjusted according to the parameter adjustment amount to obtain adjusted parameters.
[0023] In a second aspect, the present application further provides a camera calibration device, the device comprising:
[0024] A first acquisition module, used to acquire initial parameters of the camera to be calibrated, wherein the initial parameters are determined based on a first image of a first calibration object captured by the camera to be calibrated, wherein the first calibration object is provided with a plurality of first luminous marks;
[0025] A second acquisition module, configured to acquire a second image of a second calibration object using the camera to be calibrated, wherein the second calibration object is provided with at least two second luminous marks arranged at a preset distance;
[0026] An adjustment module is used to calculate the initial distance between the second luminous signs on the second image using the initial parameters according to the second image, and adjust the initial parameters according to the difference between the initial distance and the preset distance to obtain adjusted parameters.
[0027] In one of the embodiments, the device further includes a module for determining the initial parameters, and the module for determining the initial parameters is used to:
[0028] Acquire a first image of a first calibration object using the camera to be calibrated, wherein at least four first luminous marks arranged in an L shape are provided on the first calibration object;
[0029] The initial parameters of the camera to be calibrated are determined according to the position information of the first luminous mark on the first image.
[0030] In one embodiment, the initial parameter determination module is further used for:
[0031] Determine a target luminous mark from the first luminous marks;
[0032] The position of the target luminous mark is determined as the origin, and the initial parameters of the camera to be calibrated are determined according to the positional relationship between the first luminous marks on the first image.
[0033] In one embodiment, the initial parameter determination module is further used for:
[0034] In response to a first calibration object being located at a preset position in a collection range of the camera to be calibrated, a first image of the first calibration object is acquired by using the camera to be calibrated.
[0035] In one embodiment, the second image includes a plurality of images, and the second acquisition module is further used for:
[0036] When the second calibration object is located at different positions, a plurality of second images of the second calibration object are acquired by using the camera to be calibrated.
[0037] In one embodiment, the adjustment module is further used for:
[0038] Using the initial parameters, respectively calculating the distances between the second luminous marks on the plurality of second images to obtain a plurality of groups of initial distances;
[0039] Determining a parameter adjustment amount according to differences between the multiple groups of initial distances and the preset distances;
[0040] The initial parameters are adjusted according to the parameter adjustment amount to obtain adjusted parameters.
[0041] In a third aspect, an embodiment of the present disclosure further provides a camera calibration device, which is used to implement the steps of any one of the methods in the embodiments of the present disclosure, and the device includes:
[0042] A first calibration object, on which at least four first luminous marks arranged in an L shape are provided;
[0043] A second calibration object is provided with at least two second luminous marks arranged at a preset distance.
[0044] In one embodiment, the length of the horizontal side and the length of the vertical side of the L-shaped structure formed by the first luminous signs are not equal.
[0045] In one embodiment, in the L-shaped structure composed of the first luminous signs, at least two first luminous signs are arranged on the horizontal side, and at least two first luminous signs are arranged on the vertical side.
[0046] In one embodiment, the second calibration object is set as a T-shaped structure, the length of the horizontal side of the T-shaped structure is set to the preset distance, and the second luminous mark is set at the end point of the horizontal side.
[0047] In a fourth aspect, an embodiment of the present disclosure further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of any one of the methods in the embodiments of the present disclosure when executing the computer program.
[0048] In a fifth aspect, the embodiments of the present disclosure further provide a computer-readable storage medium, wherein a computer program is stored thereon, and when the computer program is executed by a processor, the steps of any one of the methods in the embodiments of the present disclosure are implemented.
[0049] In a sixth aspect, the embodiments of the present disclosure further provide a computer program product, wherein the computer program product includes a computer program, and when the computer program is executed by a processor, the steps of any one of the methods in the embodiments of the present disclosure are implemented.
[0050] The camera calibration method, device, computer equipment, computer-readable storage medium and computer program product described above perform camera calibration through the first calibration object and the second calibration object with a luminous mark during the camera calibration process. The method is easy to carry and set up. In the scenario where the test site is not fixed, the assembly and disassembly process is effectively simplified, thereby improving the camera calibration efficiency. The initial parameters are determined using the first calibration object, and then the initial distance is calculated based on the collected image of the second luminous mark on the second calibration object. The initial parameters are adjusted and calibrated based on the difference between the initial distance and the preset distance. The camera parameters can be adjusted and optimized quickly and accurately to ensure the accuracy and reliability of the adjusted parameters. Moreover, by setting the luminous mark, the recognition rate in low-light and strong-light environments is guaranteed, so that the camera to be calibrated can more accurately capture the spatial position and direction of the luminous mark, thereby enhancing flexibility and practicality. In this embodiment, when performing camera calibration, a second luminous mark arranged at a preset distance is provided on the second calibration object, which can provide more angle identification points and is not limited to the printed plane, thereby effectively improving the spatial recognition capability and ensuring the accuracy of the parameters obtained by calibration; the operation is simple, and the shooting angle and range of the camera to be calibrated are less affected by the calibration object, which is suitable for more application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0052] Figure 1 is a schematic flow chart of a camera calibration method in one embodiment;
[0053] Figure 2 is a flow chart of a method for determining initial parameters in an embodiment;
[0054] Figure 3 is a flow chart of a method for determining initial parameters in another embodiment;
[0055] Figure 4 is a structural block diagram of a camera calibration device in one embodiment;
[0056] Figure 5 is a schematic structural diagram of a first calibration object in an embodiment;
[0057] Figure 6 is a schematic structural diagram of a second calibration object in one embodiment;
[0058] Figure 7FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0059] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0060] In one embodiment, Figure 1 As shown, a camera calibration method is provided. This embodiment takes the method applied to a terminal as an example. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0061] Step S110, obtaining initial parameters of the camera to be calibrated, wherein the initial parameters are determined based on a first image of a first calibration object captured by the camera to be calibrated, and a plurality of first luminous marks are provided on the first calibration object;
[0062] Exemplarily, the initial parameters of the camera to be calibrated can be determined based on the first image of the first calibration object captured by the camera. In one example, the initial parameters may include but are not limited to the internal parameters of the camera and the external parameters of the camera, wherein the internal parameters include but are not limited to the focal length, the principal point, the distortion coefficient, etc., and the external parameters include but are not limited to the rotation matrix, the translation vector, etc.
[0063] In one example, a plurality of first luminous marks are provided on the first calibration object, and the first luminous marks may include but are not limited to infrared LEDs, OLEDs, etc., and may be specifically set according to actual application scenarios. In one example, the first image may include one or more, for example, the camera to be calibrated may capture images of the first calibration object from different angles and orientations to obtain multiple first images.
[0064] Optionally, the initial parameters of the camera to be calibrated are determined based on the positional relationship between the first luminous signs on the first image and the actual positional relationship between the first luminous signs. In one example, a relationship corresponding to the parameters of the camera to be calibrated can be established based on the positional relationship between the first luminous signs on the first image and the actual positional relationship between the first luminous signs, and the initial parameters can be obtained by solving the relationship.
[0065] In one example, when determining the initial parameters, a preset first luminous mark on the first calibration object may be determined as the origin of the space coordinate system and calculation may be performed.
[0066] Step S120, using the camera to be calibrated to obtain a second image of a second calibration object, wherein the second calibration object is provided with at least two second luminous marks arranged at a preset distance;
[0067] Exemplarily, a second image of a second calibration object is acquired by using the camera to be calibrated, wherein the second calibration object is provided with at least two second luminous marks arranged at a preset distance. In one example, the second luminous mark may include but is not limited to an infrared LED, an OLED, etc., which may be determined according to an actual application scenario.
[0068] In one example, the preset distance is determined according to an actual application scenario. In order to ensure the accuracy of the calibrated camera parameters, the accuracy of the preset distance needs to meet preset conditions, and the preset conditions can be determined according to the accuracy requirements of the camera parameters.
[0069] Optionally, when three or more second luminous marks are provided on the second calibration object, the second luminous marks may be provided at unequal distances, that is, the preset distance may include a plurality of different distances, which may be specifically provided according to actual application scenarios.
[0070] Step S130, according to the second image, using the initial parameters to calculate the initial distance between the second luminous signs on the second image, and adjusting the initial parameters according to the difference between the initial distance and the preset distance to obtain adjusted parameters.
[0071] Exemplarily, based on the second image, the initial distance between the second luminous signs on the second image is calculated using initial parameters, wherein since the initial parameters are uncalibrated parameters, there may be errors, and therefore, there may be a difference between the calculated initial distance and the actual distance (i.e., the preset distance), and the initial parameters are adjusted based on the difference to obtain adjusted parameters.
[0072] In one example, the parameter adjustment method can be set according to the actual application scenario. For example, the initial parameters can be adjusted based on the above differences according to the association between the camera parameters and the coordinates to reduce the difference between the distance calculated by the adjusted parameters and the actual distance.
[0073] Optionally, the distance between the second luminous signs can be calculated again according to the adjusted parameters, and the adjusted parameters can be adjusted again according to the difference between the distance and the preset distance, until the difference between the distance calculated by the adjusted parameters and the preset distance meets preset requirements, wherein the preset requirements can be determined according to the actual application scenario, for example, the preset requirements can be set according to the accuracy requirements of the camera parameters in the actual application scenario, etc.
[0074] In the embodiment of the present disclosure, during the camera calibration process, the camera calibration is performed by using the first calibration object and the second calibration object with the luminous mark, which is easy to carry and set up. In the scenario where the test site is not fixed, the assembly and disassembly process is effectively simplified, and the camera calibration efficiency is improved. The initial parameters are determined by using the first calibration object, and then the initial distance is calculated according to the image of the second luminous mark on the second calibration object collected, and the initial parameters are adjusted and calibrated according to the difference between the initial distance and the preset distance, so that the camera parameters can be adjusted and optimized quickly and accurately to ensure the accuracy and reliability of the adjusted parameters. And by setting the luminous mark, the recognition rate in low light environment and strong light environment is guaranteed, which is convenient for the camera to be calibrated to more accurately capture the spatial position and direction of the luminous mark, and enhance flexibility and practicality. In this embodiment, when performing camera calibration, the second luminous mark arranged according to the preset distance is set on the second calibration object, which can provide more angle recognition points, not limited to the printed plane, effectively improve the spatial recognition ability, and ensure the accuracy of the parameters obtained by calibration; the operation is simple, and the shooting angle and range of the camera to be calibrated are less affected by the calibration object, which is suitable for more application scenarios.
[0075] In one embodiment, Figure 2 As shown, the method for determining the initial parameters includes:
[0076] Step S210, using the camera to be calibrated to obtain a first image of a first calibration object, wherein at least four first luminous marks arranged in an L shape are provided on the first calibration object;
[0077] Step S220: determining initial parameters of the camera to be calibrated according to the position information of the first luminous mark on the first image.
[0078] Exemplarily, the initial parameters may be determined according to the first image of the first calibration object. The first calibration object is provided with at least four first luminous marks arranged in an L shape. In one example, in the L-shaped structure formed by the first luminous marks, at least two first luminous marks are provided on the horizontal side and the vertical side, respectively, so as to ensure accurate recognition of the L-shaped structure.
[0079] Optionally, the initial parameters of the camera to be calibrated are determined based on the position information of the first luminous mark on the first image, wherein the position relationship between the first luminous marks on the first image can be calculated and compared with the actual position relationship between the first luminous marks on the actual first calibration object to obtain the initial parameters of the camera to be calibrated.
[0080] In the disclosed embodiment, a first luminous mark arranged in an L shape is provided on the first calibration object, and a first image of the first mark is acquired by using the camera to be calibrated, and initial parameters of the camera to be calibrated are determined based on position information of the first luminous mark on the first image. Due to the right angle and asymmetric structure of the L-shape, more direct feedback is provided for camera positioning and spatial angle recognition, and the accuracy of the calculated parameters can be guaranteed in a closed or complex environment. In addition, the structure is simple and the operation difficulty is low, which reduces the operation difficulty and effectively improves the calibration efficiency and accuracy.
[0081] In one embodiment, Figure 3 As shown, determining the initial parameters of the camera to be calibrated according to the position information of the first luminous mark on the first image includes:
[0082] Step S221, determining a target luminous mark from the first luminous marks;
[0083] Step S222: determining the position of the target luminous mark as the origin, and determining the initial parameters of the camera to be calibrated according to the positional relationship between the first luminous marks on the first image.
[0084] Exemplarily, the target luminous mark is determined from the first luminous mark. In one example, the target luminous mark can be set according to an actual application scenario, for example, the first luminous mark corresponding to the vertex position of the L-shaped structure is determined as the target luminous mark.
[0085] Optionally, the position of the target luminous sign is determined as the origin, which is the origin of the spatial coordinate system, and the initial parameters of the camera to be calibrated are calculated based on the positional relationship between the first luminous signs on the first image. In one example, the actual spatial coordinates of each first luminous sign are determined based on the origin, and the image space coordinates of each first luminous sign on the first image are calculated, and the initial parameters of the camera to be calibrated are calculated based on the actual spatial coordinates and the image space coordinates.
[0086] In the disclosed embodiment, a target luminous mark is determined from the first luminous mark as the origin, and the initial parameters of the camera to be calibrated are calculated, so that the spatial relationship can be defined and calibrated more accurately, a reference for the spatial coordinate system is provided, and the accuracy and reliability of the camera calibration are further improved.
[0087] In one embodiment, the step of acquiring a first image of a first calibration object using a camera to be calibrated includes:
[0088] In response to a first calibration object being located at a preset position in a collection range of the camera to be calibrated, a first image of the first calibration object is acquired by using the camera to be calibrated.
[0089] Exemplarily, when the first marker is located at a preset position of the acquisition range of the camera to be calibrated, the first image is acquired. The preset position may be set according to an actual application scenario. In one example, the preset position may be set to the center of the acquisition range, and when the first marker is located at the preset position, the first image is acquired, so that the spatial relationship can be more accurately defined and calibrated.
[0090] Optionally, the first luminous mark includes a target luminous mark. When the target luminous mark is located at a preset position of the acquisition range of the camera to be calibrated, it is determined that the first calibration object is located at the preset position of the acquisition range of the camera to be calibrated. At this time, the first image of the first calibration object is acquired using the camera to be calibrated.
[0091] In the embodiment of the present disclosure, when the first calibration object is located at a preset position, a first image is acquired. When initial parameters are calculated based on the first image, a more reasonable and accurate origin position can be set according to actual needs, so as to more accurately define and calibrate the spatial relationship; and the position of the first calibration object can be adjusted according to the actual application scenario, and the camera shooting angle and shooting range are not affected, which is suitable for more application scenarios.
[0092] In one embodiment, the second image includes a plurality of images, and the step of acquiring the second image of the second calibration object by using the camera to be calibrated includes:
[0093] When the second calibration object is located at different positions, a plurality of second images of the second calibration object are acquired by using the camera to be calibrated.
[0094] Exemplarily, the second image may include multiple images, and when the second calibration object is located at different positions, the images of the second calibration object are respectively acquired to obtain multiple second images. The different positions may be determined according to actual application scenarios. In one example, the different positions do not need to be limited in advance, and the second calibration object can be located within the acquisition range of the camera to be calibrated.
[0095] Optionally, the second calibration object may be moved within the acquisition range of the camera to be calibrated, and image acquisition may be performed to obtain second images at different positions, thereby obtaining a plurality of second images.
[0096] In the embodiment of the present disclosure, when the second calibration object is located at different positions, multiple second images are acquired, thereby providing more angle recognition points to adjust the initial parameters, optimizing the recognition error of the motion capture area, and improving the spatial recognition capability of the entire system through more directional information; avoiding recognition errors caused by occlusion and other problems, reducing the problem of limited camera shooting angle and shooting range due to the calibration object, and further improving the accuracy and reliability of the determined parameters.
[0097] In one embodiment, the initial distance between the second luminous signs on the second image is calculated using the initial parameter, and the initial parameter is adjusted according to the difference between the initial distance and the preset distance, and the adjusted parameter includes:
[0098] Using the initial parameters, respectively calculating the distances between the second luminous marks on the plurality of second images to obtain a plurality of groups of initial distances;
[0099] Determining a parameter adjustment amount according to differences between the multiple groups of initial distances and the preset distances;
[0100] The initial parameters are adjusted according to the parameter adjustment amount to obtain adjusted parameters.
[0101] Exemplarily, when adjusting parameters according to multiple second images, multiple groups of initial distances are obtained by using the distances between the second luminous marks on the multiple second images. Among them, one second image corresponds to a group of initial distances, and each group of initial distances may include one or more initial distances, which can be determined according to the actual application scenario. In one example, when two second luminous marks are set on the second calibration object, each group of initial distances includes an initial distance, that is, the initial distance between the two second luminous marks.
[0102] Optionally, the number of each group of initial distances is the same as the number of preset distances, and the initial distances in each group of initial distances correspond to the preset distances one by one. Based on the difference between each group of initial distances and the corresponding preset distances, multiple groups of differences can be calculated, and the parameter adjustment amount is determined based on the multiple groups of differences. In one example, the parameter adjustment amount can be determined based on the mean of the multiple groups of differences; in another example, the parameter adjustment amount can be determined based on factors such as the angle and orientation of each group of differences and the corresponding second image; in another example, multiple parameter adjustment amounts can also be determined based on each group of differences, and multiple adjustments can be made according to the multiple parameter adjustment amounts; other parameter adjustment amount determination methods can also be determined based on actual application scenarios, and the present disclosure does not limit this.
[0103] The initial parameters are adjusted according to the determined parameter adjustment amount to obtain adjusted parameters. In one example, the parameters may be adjusted iteratively for multiple times to ensure the accuracy and reliability of the adjusted parameters.
[0104] In the disclosed embodiment, initial parameters are used to respectively calculate the distances between the second luminous marks on multiple second images to obtain multiple groups of initial distances. Parameter adjustment amounts are determined according to the differences between the multiple initial distances and the preset distances. The initial parameters are adjusted to obtain adjusted parameters. More accurate parameter adjustment amounts can be obtained through the differences between the multiple initial distances and the preset distances. Multiple initial distances provide more angle recognition points, which help to optimize the recognition errors in the motion capture area and improve the spatial recognition capability of the entire system, thereby obtaining more accurate camera parameters suitable for more application scenarios.
[0105] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0106] Based on the same inventive concept, the embodiment of the present application also provides a camera calibration device for implementing the camera calibration method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more camera calibration device embodiments provided below can refer to the limitations of the camera calibration method above, and will not be repeated here.
[0107] In an exemplary embodiment, Figure 4 As shown, a camera calibration device 400 is provided, comprising:
[0108] A first acquisition module 410 is used to acquire initial parameters of the camera to be calibrated, where the initial parameters are determined based on a first image of a first calibration object captured by the camera to be calibrated, where a plurality of first luminous marks are provided on the first calibration object;
[0109] A second acquisition module 420, configured to acquire a second image of a second calibration object using the camera to be calibrated, wherein the second calibration object is provided with at least two second luminous marks arranged at a preset distance;
[0110] The adjustment module 430 is used to calculate the initial distance between the second luminous signs on the second image according to the second image using the initial parameters, and adjust the initial parameters according to the difference between the initial distance and the preset distance to obtain adjusted parameters.
[0111] In one of the embodiments, the device further includes a module for determining the initial parameters, and the module for determining the initial parameters is used to:
[0112] Acquire a first image of a first calibration object using the camera to be calibrated, wherein at least four first luminous marks arranged in an L shape are provided on the first calibration object;
[0113] The initial parameters of the camera to be calibrated are determined according to the position information of the first luminous mark on the first image.
[0114] In one embodiment, the initial parameter determination module is further used for:
[0115] Determine a target luminous mark from the first luminous marks;
[0116] The position of the target luminous mark is determined as the origin, and the initial parameters of the camera to be calibrated are determined according to the positional relationship between the first luminous marks on the first image.
[0117] In one embodiment, the initial parameter determination module is further used for:
[0118] In response to a first calibration object being located at a preset position in a collection range of the camera to be calibrated, a first image of the first calibration object is acquired by using the camera to be calibrated.
[0119] In one embodiment, the second image includes a plurality of images, and the second acquisition module is further used for:
[0120] When the second calibration object is located at different positions, a plurality of second images of the second calibration object are acquired by using the camera to be calibrated.
[0121] In one embodiment, the adjustment module is further used for:
[0122] Using the initial parameters, respectively calculating the distances between the second luminous marks on the plurality of second images to obtain a plurality of groups of initial distances;
[0123] Determining a parameter adjustment amount according to differences between the multiple groups of initial distances and the preset distances;
[0124] The initial parameters are adjusted according to the parameter adjustment amount to obtain adjusted parameters.
[0125] Each module in the above camera calibration device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.
[0126] In one embodiment, a camera calibration device is further provided, for implementing the steps of any one of the methods in the embodiments of the present disclosure, the device comprising:
[0127] A first calibration object, on which at least four first luminous marks arranged in an L shape are provided;
[0128] A second calibration object is provided with at least two second luminous marks arranged at a preset distance.
[0129] In one embodiment, the length of the horizontal side and the length of the vertical side of the L-shaped structure formed by the first luminous signs are not equal.
[0130] In the disclosed embodiment, the lengths of the horizontal and vertical sides of the L-shaped structure are set to be unequal, which can provide more direct feedback for camera positioning and spatial angle recognition, and further improve the accuracy and reliability of camera calibration.
[0131] In one embodiment, in the L-shaped structure composed of the first luminous signs, at least two first luminous signs are arranged on the horizontal side, and at least two first luminous signs are arranged on the vertical side.
[0132] In the disclosed embodiment, at least two first luminous marks are arranged on the horizontal and vertical edges, so that the correspondence between the luminous mark image and the actual luminous mark can be quickly and accurately determined on the first image based on the luminous marks. This is suitable for complex scenes such as low-light environments and strong-light environments, and ensures the accuracy and reliability of camera calibration.
[0133] In one embodiment, the second calibration object is set as a T-shaped structure, the length of the horizontal side of the T-shaped structure is set to the preset distance, and the second luminous mark is set at the end point of the horizontal side.
[0134] In the disclosed embodiment, the second calibration object can be set as a T-shaped structure, and the second luminous mark is set at the end point of the horizontal edge, which helps the camera to more accurately capture the spatial position and direction of the calibration object. The structure is simple, which simplifies the assembly and disassembly processes, makes it easy to carry and set up, reduces the difficulty of operation, and can be quickly calibrated in different scenarios.
[0135] The disclosed embodiment optimizes the shape of the calibration object. Through the L-shaped and T-shaped settings, the error during use is effectively reduced and the calibration accuracy is improved. The setting and operation process are simple, which reduces the technical threshold and allows non-professionals to operate and calibrate more easily. Through the setting of luminous marks, the recognition rate in low-light environments and strong light conditions can be improved. In addition, the setting of luminous marks can be at the end points of the T-shaped rod or the key angle position of the L-shaped rod, which helps the camera to more accurately capture the spatial position and direction of the two calibration rods, and maintain high accuracy under any ambient light conditions, allowing the system to work under more diverse environmental conditions, and enhancing the applicability and flexibility of the system. The second calibration object adopts a T-shaped structure, which provides more angle recognition points in the motion capture area to avoid occlusion problems, and helps to optimize recognition errors; the first calibration object adopts an L-shaped structure. The L-shaped calibration object is used as the origin of the spatial coordinate system, providing more accurate spatial relationship calibration. Its 90-degree angle and long and short side design help to better identify and calibrate spatial angles in complex environments.
[0136] Figure 5 is a schematic diagram of the structure of a first calibration object according to an exemplary embodiment, referring to Figure 5 As shown, the black dot is the first luminous mark, and five first luminous marks arranged in an L shape are provided on the first calibration object, and the lengths of the horizontal sides and the vertical sides are not equal. Figure 6 is a schematic diagram of the structure of a second calibration object according to an exemplary embodiment, referring to Figure 6 As shown, the black dot is the second luminous mark, and the second calibration object is set as a T-shaped structure, on which two second luminous marks are arranged, located at the two end points of the horizontal edge.
[0137] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 7As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the first image, the second image and other data involved in the method described in this embodiment. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a camera calibration method is implemented.
[0138] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0139] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0140] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0141] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0142] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0143] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0144] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0145] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A camera calibration method, characterized in that: The method comprises: Acquire initial parameters of the camera to be calibrated, where the initial parameters are determined based on a first image of a first calibration object captured by the camera to be calibrated, where a plurality of first luminous marks are provided on the first calibration object; Acquire a second image of a second calibration object using the camera to be calibrated, wherein the second calibration object is provided with at least two second luminous marks arranged at a preset distance; The initial distance between the second luminous signs on the second image is calculated using the initial parameter, and the initial parameter is adjusted according to a difference between the initial distance and the preset distance to obtain an adjusted parameter.
2. The method according to claim 1, characterized in that The method for determining the initial parameters includes: Acquire a first image of a first calibration object using the camera to be calibrated, wherein at least four first luminous marks arranged in an L shape are provided on the first calibration object; The initial parameters of the camera to be calibrated are determined according to the position information of the first luminous mark on the first image.
3. The method according to claim 2, characterized in that The step of determining the initial parameters of the camera to be calibrated according to the position information of the first luminous mark on the first image includes: Determine a target luminous mark from the first luminous marks; The position of the target luminous mark is determined as the origin, and the initial parameters of the camera to be calibrated are determined according to the positional relationship between the first luminous marks on the first image.
4. The method according to claim 1, characterized in that: The second image includes a plurality of images, and the step of acquiring the second image of the second calibration object by using the camera to be calibrated includes: When the second calibration object is located at different positions, a plurality of second images of the second calibration object are acquired by using the camera to be calibrated.
5. The method according to claim 1, characterized in that The step of calculating the initial distance between the second luminous signs on the second image by using the initial parameters, and adjusting the initial parameters according to the difference between the initial distance and the preset distance, to obtain the adjusted parameters includes: Using the initial parameters, respectively calculating the distances between the second luminous marks on the plurality of second images to obtain a plurality of groups of initial distances; Determining a parameter adjustment amount according to differences between the multiple groups of initial distances and the preset distances; The initial parameters are adjusted according to the parameter adjustment amount to obtain adjusted parameters.
6. A camera calibration device, characterized in that: The device comprises: A first acquisition module, used to acquire initial parameters of the camera to be calibrated, wherein the initial parameters are determined based on a first image of a first calibration object captured by the camera to be calibrated, wherein the first calibration object is provided with a plurality of first luminous marks; A second acquisition module, configured to acquire a second image of a second calibration object using the camera to be calibrated, wherein the second calibration object is provided with at least two second luminous marks arranged at a preset distance; An adjustment module is used to calculate the initial distance between the second luminous signs on the second image using the initial parameters, and adjust the initial parameters according to the difference between the initial distance and the preset distance to obtain adjusted parameters.
7. A camera calibration device, used to implement the method according to any one of claims 1 to 5, characterized in that: The device comprises: A first calibration object, on which at least four first luminous marks arranged in an L shape are provided; A second calibration object is provided with at least two second luminous marks arranged at a preset distance.
8. The device according to claim 7, characterized in that The length of the horizontal side and the length of the vertical side of the L-shaped structure formed by the first luminous signs are not equal.
9. The device according to claim 7, characterized in that In the L-shaped structure composed of the first luminous signs, at least two first luminous signs are arranged on the horizontal side, and at least two first luminous signs are arranged on the vertical side.
10. The device according to claim 7, characterized in that The second calibration object is set as a T-shaped structure, the length of the horizontal side of the T-shaped structure is set to the preset distance, and the second luminous mark is set at the end point of the horizontal side.