Camera intrinsic parameter calibration method, device, storage medium and electronic device
By dividing and initial calibration of the camera imaging area, and adjusting the distortion coefficient using Euclidean distance and boundary constraints, the problem of poor camera internal parameter calibration accuracy in the prior art is solved, and high-precision internal parameter calibration and better measurement accuracy are achieved.
Patent Information
- Application Number
- CN202310731230.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-20
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2043-06-20
AI Technical Summary
In the prior art, the accuracy of internal parameter calibration of the camera for digital measurement is poor, which affects the system measurement accuracy.
By dividing the camera imaging areas, initial calibration is performed to obtain distortion coefficients of different regions, the Euclidean distance of the distortion coefficients of adjacent imaging areas is used to measure the degree of change of distortion parameters in different regions, the demarcation distance threshold adjusts the distortion coefficients of the imaging areas corresponding to the Euclidean distance greater than this threshold, and the target distortion coefficients are obtained in combination with boundary constraints to complete the high-precision calibration of the camera internal parameters.
The accuracy of camera internal parameter calibration is improved, making the calibration more in line with the characteristics of distortion distribution, the measurement accuracy is improved, and the continuity problem of the junction line of different imaging areas is solved, so as to obtain better imaging effects.
Smart Images

Figure CN116645426B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of digital measurement technology, and in particular to a camera intrinsic parameter calibration method, device, storage medium and electronic device. Background Art
[0002] Photogrammetry has the characteristics of high efficiency and low cost, and has been applied in many fields. However, the system errors such as nonlinear distortion generated by the camera lens during the imaging process will seriously affect the measurement accuracy of the system. Therefore, the internal parameters of the camera need to be calibrated before the measurement to reduce the influence of the system error and improve the measurement accuracy.
[0003] Traditional intrinsic calibration mainly builds a distortion model, takes several photos of the calibration object with known relative position relationship of feature points, solves the distortion model according to the pixel coordinates of the imaging point, obtains the distortion parameters, and corrects the imaging model to improve the imaging accuracy. However, the distortion coefficients of different imaging areas are usually inconsistent, resulting in poor accuracy of this method of calibrating the camera using the same standard intrinsic parameter. Summary of the invention
[0004] The main purpose of the present application is to provide a camera intrinsic parameter calibration method, device, storage medium and electronic device, aiming to solve the problem of poor accuracy of intrinsic parameter calibration of cameras used for digital measurement in the prior art.
[0005] To achieve the above objectives, the technical solutions adopted in the embodiments of the present application are as follows:
[0006] In a first aspect, an embodiment of the present application provides a camera intrinsic parameter calibration method, comprising the following steps:
[0007] Perform initial internal calibration on the target camera to obtain the distortion coefficients of different imaging areas of the target camera;
[0008] According to the distortion coefficients, the Euclidean distances of the distortion coefficients of the imaging region groups are respectively obtained; wherein the imaging region groups include adjacent imaging regions;
[0009] When the Euclidean distance is greater than the distance threshold, the target distortion coefficient is obtained according to the boundary constraint conditions and the distortion coefficient of the imaging area group to complete the intrinsic calibration of the target camera.
[0010] In a possible implementation manner of the first aspect, when the Euclidean distance is greater than the distance threshold, obtaining the target distortion coefficient according to the boundary constraint condition and the distortion coefficient of the imaging area group to complete the intrinsic calibration of the target camera, the camera intrinsic calibration method further includes:
[0011] According to the conversion relation and the distortion coefficient of any imaging area in the imaging area group, the relationship between the distortion coefficients of another imaging area in the imaging area group is calculated to obtain the boundary constraint condition.
[0012] In a possible implementation manner of the first aspect, when the Euclidean distance is greater than a distance threshold, obtaining a target distortion coefficient according to a boundary constraint condition and a distortion coefficient of an imaging region group to complete an intrinsic calibration of a target camera includes:
[0013] When the Euclidean distance is greater than the distance threshold, a target distortion model is obtained according to the boundary constraint conditions of the imaging region group and the distortion model corresponding to the distortion coefficient;
[0014] The target distortion model is used to solve the distortion coefficient of the imaging area group and obtain the target distortion coefficient to complete the intrinsic calibration of the target camera.
[0015] In a possible implementation manner of the first aspect, after obtaining the Euclidean distances of the distortion coefficients of the imaging area groups respectively according to the distortion coefficients, the camera intrinsic parameter calibration method further includes:
[0016] When the Euclidean distance is less than or equal to the distance threshold, a distortion coefficient of any imaging region in the imaging region group is determined to obtain a target distortion coefficient.
[0017] In a possible implementation manner of the first aspect, before performing an initial calibration of the internal parameters of the target camera to respectively obtain the distortion coefficients of different imaging areas of the target camera, the camera internal parameter calibration method further includes:
[0018] According to the image area of the target camera, several imaging areas of the target camera distributed in an annular shape are obtained.
[0019] In a possible implementation manner of the first aspect, obtaining, according to an image area of the target camera, a plurality of annularly distributed imaging areas of the target camera includes:
[0020] According to the number of image pixels and the center point of the image area of the target camera, a first imaging area is obtained; wherein the first imaging area is circular and located at the center of the image area;
[0021] According to the coordinates of the first imaging area, a plurality of second imaging areas are obtained; wherein the second imaging area is an annular area having the same center point as the first imaging area.
[0022] In a possible implementation manner of the first aspect, obtaining the first imaging area according to the number of image pixels and the center point of the image area of the target camera includes:
[0023] According to the number of pixels of the short side of the image, the radius range of the first imaging area is obtained;
[0024] The first imaging area is obtained according to the radius range of the first imaging area and the center point of the image area of the target camera.
[0025] In a second aspect, an embodiment of the present application provides a camera intrinsic parameter calibration device, comprising:
[0026] An initial calibration module is used to perform an initial calibration of the internal parameters of the target camera to obtain the distortion coefficients of different imaging areas of the target camera;
[0027] An acquisition module, the acquisition module is used to respectively obtain the Euclidean distances of the distortion coefficients of the imaging area group according to the distortion coefficients; wherein the imaging area group includes adjacent imaging areas;
[0028] The target calibration module is used to obtain the target distortion coefficient according to the boundary constraint conditions and distortion coefficient of the imaging area group when the Euclidean distance is greater than the distance threshold, so as to complete the internal parameter calibration of the target camera.
[0029] In a third aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program. When the computer program is loaded and executed by a processor, the camera intrinsic parameter calibration method provided in any one of the first aspects above is implemented.
[0030] In a fourth aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, wherein:
[0031] The memory is used to store computer programs;
[0032] The processor is used to load and execute a computer program so that the electronic device executes the camera intrinsic parameter calibration method provided in any one of the first aspects above.
[0033] Compared with the prior art, the beneficial effects of this application are:
[0034] The embodiment of the present application proposes a camera intrinsic parameter calibration method, device, storage medium and electronic device, the method comprising: performing an initial calibration of the intrinsic parameters of the target camera to obtain the distortion coefficients of different imaging areas of the target camera respectively; obtaining the Euclidean distance of the distortion coefficients of the imaging area group respectively according to the distortion coefficients; wherein the imaging area group includes adjacent imaging areas; when the Euclidean distance is greater than the distance threshold, obtaining the target distortion coefficient according to the boundary constraint conditions and the distortion coefficients of the imaging area group to complete the intrinsic parameter calibration of the target camera. The present application divides the imaging area, performs an initial calibration to obtain the distortion coefficients corresponding to the different areas respectively, measures the degree of change of the distortion parameters of the different areas by the Euclidean distance of the distortion coefficients of the adjacent imaging areas, sets a distance threshold to adjust the distortion coefficients of the imaging area corresponding to the Euclidean distance greater than the threshold, so that the calibration is more in line with the characteristics of the distortion distribution, improves the calibration accuracy, and considers the continuity problem of the boundary line of different imaging areas, sets boundary constraints to adjust the distortion coefficients of this part of the area, so as to obtain better imaging effects, and finally completes the high-precision calibration of the camera intrinsic parameters. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 A schematic diagram of the structure of an electronic device of a hardware operating environment involved in an embodiment of the present application;
[0036] Figure 2 A schematic diagram of a flow chart of a camera intrinsic parameter calibration method provided in an embodiment of the present application;
[0037] Figure 3 A schematic diagram of dividing the imaging area in the camera intrinsic parameter calibration method provided in an embodiment of the present application;
[0038] Figure 4 A schematic diagram of a module of a camera intrinsic parameter calibration device provided in an embodiment of the present application;
[0039] Markings in the figure: 101 - processor, 102 - communication bus, 103 - network interface, 104 - user interface, 105 - memory. DETAILED DESCRIPTION
[0040] 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.
[0041] The main solution of the embodiment of the present application is: perform initial internal parameter calibration on the target camera to obtain the distortion coefficients of different imaging areas of the target camera respectively; obtain the Euclidean distance of the distortion coefficients of the imaging area group respectively according to the distortion coefficients; wherein the imaging area group includes adjacent imaging areas; when the Euclidean distance is greater than the distance threshold, obtain the target distortion coefficient according to the boundary constraints and the distortion coefficient of the imaging area group to complete the internal parameter calibration of the target camera.
[0042] Photogrammetry is characterized by high efficiency and low cost, and has been applied in many fields. System errors such as nonlinear distortion generated by the camera lens during the imaging process will seriously affect the measurement accuracy of the system. Therefore, the camera's internal parameters need to be calibrated before the measurement begins to reduce the impact of system errors and improve measurement accuracy.
[0043] Traditional internal parameter calibration mainly builds a distortion model, takes several photos of the calibration object with known relative position relationship of feature points, solves the distortion model according to the pixel coordinates of the imaging point, obtains the distortion parameters, and corrects the imaging model to improve the imaging accuracy. However, the distortion coefficients of different imaging areas are usually inconsistent, so the accuracy of this method of calibrating the camera using a set of internal parameters is poor.
[0044] Some scholars proposed a partition calibration scheme in "Block-based Camera Internal and External Parameter Calibration Method". This scheme divides the image area into several rectangular frames along the x and y axes of the image coordinate system and calibrates them separately. Although it can improve the calibration accuracy compared with the traditional calibration method, its partitioning method does not take into account the camera distortion distribution characteristics, so that the accuracy of some areas is still not high, and there will be discontinuities on the intersection of the partitions, affecting the measurement accuracy.
[0045] To this end, the present application provides a solution, by dividing the imaging area, performing initial calibration to obtain the distortion coefficients corresponding to different areas respectively, using the Euclidean distance of the distortion coefficients of adjacent imaging areas to measure the degree of change of the distortion parameters of different areas, defining a distance threshold to adjust the distortion coefficient of the imaging area corresponding to the Euclidean distance greater than the threshold, so that the calibration is more in line with the characteristics of the distortion distribution, improving the calibration accuracy, and considering the continuity problem of the boundary line of different imaging areas, setting boundary constraints to adjust the distortion coefficient of this part of the area, so as to obtain better imaging effect, and finally complete the high-precision calibration of the camera intrinsic parameters.
[0046] Refer to the attached Figure 1 , attached Figure 1This is a schematic diagram of the structure of an electronic device of the hardware operating environment involved in the embodiment of the present application. The electronic device may include: a processor 101, such as a central processing unit (CPU), a communication bus 102, a user interface 104, a network interface 103, and a memory 105. Among them, the communication bus 102 is used to realize the connection and communication between these components. The user interface 104 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the user interface 104 may also include a standard wired interface and a wireless interface. The network interface 103 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface). The memory 105 may optionally be a storage device independent of the aforementioned processor 101. The memory 105 may be a high-speed random access memory (RAM) memory, or it may be a stable non-volatile memory (NVM), such as at least one disk storage; the processor 101 may be a general-purpose processor, including a central processing unit, a network processor, etc., or it may be a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component.
[0047] Those skilled in the art will appreciate that Figure 1 The structure shown in the figure does not constitute a limitation on the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0048] As attached Figure 1 As shown, the memory 105 as a storage medium may include an operating system, a network communication module, a user interface module, and a camera intrinsic parameter calibration device.
[0049] In the attached Figure 1 In the electronic device shown, the network interface 103 is mainly used for data communication with the network server; the user interface 104 is mainly used for data interaction with the user; the processor 101 and the memory 105 in the present application can be set in the electronic device, and the electronic device calls the camera intrinsic parameter calibration device stored in the memory 105 through the processor 101, and executes the camera intrinsic parameter calibration method provided in the embodiment of the present application.
[0050] Refer to the attached Figure 2 Based on the hardware device of the aforementioned embodiment, an embodiment of the present application provides a camera intrinsic parameter calibration method, comprising the following steps:
[0051] S10: According to the image area of the target camera, obtaining imaging areas of a plurality of target cameras distributed in a ring shape.
[0052] In the specific implementation process, the target camera is the camera that needs to be calibrated. First, its image area is divided. Since the distortion spreads evenly in a ring shape from the center to the outside, in order to conform to the change law of distortion, the imaging area of the first central part is first delineated, and then the other imaging areas are divided in a ring distribution, as shown in the attached figure. Figure 3 As shown. That is:
[0053] According to the image area of the target camera, several annularly distributed imaging areas of the target camera are obtained, including:
[0054] According to the number of image pixels and the center point of the image area of the target camera, a first imaging area is obtained; wherein the first imaging area is circular and located at the center of the image area;
[0055] According to the coordinates of the first imaging area, a plurality of second imaging areas are obtained; wherein the second imaging area is an annular area having the same center point as the first imaging area.
[0056] Specifically, according to the number of image pixels and the center point of the image area of the target camera, a first imaging area is obtained, including:
[0057] Obtaining the radius range of the first imaging area according to the number of pixels of the short side of the image;
[0058] The first imaging area is obtained according to the radius range of the first imaging area and the center point of the image area of the target camera.
[0059] In the specific implementation process, the center o of the image area is taken as the origin, and the x and y directions are parallel to the horizontal and vertical axes of the image coordinate system respectively, and the coordinate system o-xy is established. Assume that in the image coordinate system, the number of pixels on the long side of the image is u, the number of pixels on the short side is v, and the initial center radius is R 1 , R 1 Select according to parameters such as camera resolution and satisfy the following formula:
[0060]
[0061] Then there is the first imaging area A 1 The expression in the coordinate system o-xy:
[0062]
[0063] The remaining area of the image is divided into different imaging areas A according to the formula i (where i = 2, ..., n):
[0064] And there is in
[0065] S20: Performing an initial internal calibration on the target camera to obtain distortion coefficients of different imaging areas of the target camera.
[0066] In the specific implementation process, the initial calibration is to use the camera to shoot a calibration plate with dense feature points, collect multiple photos from different angles, and try to cover as many imaging areas as possible with the feature points of the calibration plate in the photos. i The distortion parameters are solved by using the coordinates of the marker points in (where i = 1, 2, ..., n), and the nonlinear distortion model used is as follows:
[0067]
[0068] Then we get n groups of distortion coefficients δ i =[k i ,p 1i ,p 2i ,s 1i ,s 2i ] T (where i=1,2,...,n).
[0069] S30: obtaining the Euclidean distances of the distortion coefficients of the imaging region groups respectively according to the distortion coefficients; wherein the imaging region groups include adjacent imaging regions.
[0070] In the specific implementation process, Euclidean distance, also known as Euclidean metric, is a commonly used distance definition, which refers to the real distance between two points in m-dimensional space, or the natural length of a vector. The Euclidean distance in two-dimensional and three-dimensional space is the actual distance between two points. The Euclidean distance between distortion coefficients used in this implementation can also be used as a measure of similarity between distortion coefficients. i calculates the adjacent regions A one by one from 1 to n i With A i+1 The Euclidean distance d between the distortion coefficients i :
[0071]
[0072] The imaging area group is the adjacent area A mentioned above i With A i+1 The imaging area group is formed.
[0073] S40: When the Euclidean distance is greater than the distance threshold, a target distortion coefficient is obtained according to the boundary constraint condition and the distortion coefficient of the imaging region group to complete the internal calibration of the target camera.
[0074] In the specific implementation process, a threshold can be set to measure the size of the Euclidean distance, that is, the distance threshold λ is set according to the actual situation; if d i ≤λ, then region A i With A i+1 It can be regarded as the same area and use the same distortion coefficient δ i That is, after obtaining the Euclidean distances of the distortion coefficients of the imaging area groups respectively according to the distortion coefficients, the camera intrinsic parameter calibration method further includes:
[0075] When the Euclidean distance is less than or equal to the distance threshold, a distortion coefficient of any imaging region in the imaging region group is determined to obtain a target distortion coefficient.
[0076] If d i >λ, then area A i With A i+1 Different distortion coefficients need to be used between them, and the continuity of the boundary lines of different regions should be considered. In order to obtain better imaging, a continuity constraint can be imposed on the intersection line of the two regions to re-solve the distortion parameters. That is:
[0077] When the Euclidean distance is greater than the distance threshold, the target distortion coefficient is obtained according to the boundary constraint condition and the distortion coefficient of the imaging region group to complete the intrinsic calibration of the target camera. The camera intrinsic calibration method further includes:
[0078] According to the conversion relation and the distortion coefficient of any imaging area in the imaging area group, the relationship between the distortion coefficients of another imaging area in the imaging area group is calculated to obtain the boundary constraint condition.
[0079] In the specific implementation process, area A i The distortion coefficient is δ i =[k i ,p 1i ,p 2i ,s 1i ,s 2i ] T , then in area A i With A i+1 On the boundary line, the following holds true:
[0080] in
[0081] Where R i Indicates area A i With A i+1 Radius of the boundary circle, x i With y i Indicates area A i With A i+1 Coordinate point on the boundary line; k iIndicates area A i Calibrated radial distortion coefficient, p 1i With p 2i Indicates area A i The calibrated centrifugal distortion coefficient, s 1i With s 2i Indicates area A i Calibrated thin edge diameter distortion coefficient; k i+1 Indicates area A i+1 Calibrated radial distortion coefficient, p 1(i+1) With p 2(i+1) Indicates area A (i+1) The calibrated centrifugal distortion coefficient, s 1(i+1) With s 2(i+1) Indicates area A (i+1) The calibrated thin edge diameter distortion coefficient.
[0082] According to the conversion relationship, we can calculate the area A i+1 The relationship between the distortion coefficients is:
[0083]
[0084] Using this formula as a constraint condition, a new distortion model can be obtained again, that is, when the Euclidean distance is greater than the distance threshold, the target distortion coefficient is obtained according to the boundary constraint condition and the distortion coefficient of the imaging area group to complete the intrinsic calibration of the target camera, including:
[0085] When the Euclidean distance is greater than the distance threshold, a target distortion model is obtained according to the boundary constraint conditions of the imaging region group and the distortion model corresponding to the distortion coefficient;
[0086] The target distortion model is used to solve the distortion coefficient of the imaging area group and obtain the target distortion coefficient to complete the intrinsic calibration of the target camera.
[0087] In the specific implementation process, the above formula is used as a constraint condition and the original distortion model is introduced to obtain region A i+1 The new distortion model, namely the target distortion model:
[0088]
[0089] Using the new distortion model above, we can i+1 The distortion coefficient of area A is solved i+1 The new distortion coefficient [k i ',p 1i ',p 2i ',s 1i ',s 2i '] T, that is, the target distortion coefficient; after calculating the distortion coefficients of all regions, the internal reference calibration is completed.
[0090] In this embodiment, the imaging area is divided and the initial calibration is performed to obtain the distortion coefficients corresponding to different areas respectively. The Euclidean distance of the distortion coefficients of adjacent imaging areas is used to measure the degree of change of the distortion parameters of different areas. A distance threshold is defined to adjust the distortion coefficient of the imaging area corresponding to the Euclidean distance greater than the threshold, so that the calibration is more in line with the characteristics of the distortion distribution and the calibration accuracy is improved. In addition, the continuity problem of the boundary line of different imaging areas is considered, and the boundary constraint condition is set to adjust the distortion coefficient of this part of the area to obtain a better imaging effect, and finally complete the high-precision calibration of the camera intrinsic parameters.
[0091] Refer to the attached Figure 4 Based on the same inventive concept as in the above-mentioned embodiment, the embodiment of the present application further provides a camera intrinsic parameter calibration device, which includes:
[0092] An initial calibration module is used to perform an initial calibration of the internal parameters of the target camera to obtain the distortion coefficients of different imaging areas of the target camera;
[0093] An acquisition module, the acquisition module is used to respectively obtain the Euclidean distances of the distortion coefficients of the imaging area group according to the distortion coefficients; wherein the imaging area group includes adjacent imaging areas;
[0094] The target calibration module is used to obtain the target distortion coefficient according to the boundary constraint conditions and distortion coefficient of the imaging area group when the Euclidean distance is greater than the distance threshold, so as to complete the internal parameter calibration of the target camera.
[0095] Those skilled in the art should understand that the division of the various modules in the embodiment is only a division of logical functions, and can be fully or partially integrated into one or more actual carriers in actual application, and these modules can be implemented entirely in the form of software called by a processing unit, or entirely in the form of hardware, or in the form of a combination of software and hardware. It should be noted that the modules in the camera intrinsic parameter calibration device in this embodiment correspond one-to-one to the steps in the camera intrinsic parameter calibration method in the aforementioned embodiment. Therefore, the specific implementation of this embodiment can refer to the implementation of the aforementioned camera intrinsic parameter calibration method, which will not be repeated here.
[0096] Based on the same inventive concept as in the aforementioned embodiment, an embodiment of the present application further provides a computer-readable storage medium storing a computer program. When the computer program is loaded and executed by a processor, a camera intrinsic parameter calibration method as provided in the embodiment of the present application is implemented.
[0097] Based on the same inventive concept as in the above-mentioned embodiment, an embodiment of the present application further provides an electronic device, including a processor and a memory, wherein:
[0098] The memory is used to store computer programs;
[0099] The processor is used to load and execute a computer program so that the electronic device executes the camera intrinsic parameter calibration method provided in the embodiment of the present application.
[0100] In some embodiments, the computer readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or various devices including one or any combination of the above memories. The computer may be various computing devices including intelligent terminals and servers.
[0101] In some embodiments, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.
[0102] As an example, executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).
[0103] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.
[0104] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0105] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0106] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory / random access memory, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a multimedia terminal device (which can be a mobile phone, a computer, a television receiver, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0107] In summary, the present application provides a camera intrinsic parameter calibration method, device, storage medium and electronic device, including: performing an initial calibration of the intrinsic parameters of the target camera to obtain the distortion coefficients of different imaging areas of the target camera respectively; obtaining the Euclidean distance of the distortion coefficients of the imaging area group respectively according to the distortion coefficients; wherein the imaging area group includes adjacent imaging areas; when the Euclidean distance is greater than the distance threshold, obtaining the target distortion coefficient according to the boundary constraints of the imaging area group and the distortion coefficients to complete the intrinsic parameter calibration of the target camera. The present application divides the imaging area, performs an initial calibration to obtain the distortion coefficients corresponding to the different areas respectively, measures the degree of change of the distortion parameters of the different areas by the Euclidean distance of the distortion coefficients of the adjacent imaging areas, sets a distance threshold to adjust the distortion coefficients of the imaging area corresponding to the Euclidean distance greater than the threshold, so that the calibration is more in line with the characteristics of the distortion distribution, improves the calibration accuracy, and considers the continuity problem of the boundary line of different imaging areas, sets boundary constraints to adjust the distortion coefficients of this part of the area, so as to obtain better imaging effects, and finally completes the high-precision calibration of the camera intrinsic parameters.
[0108] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A camera intrinsic parameter calibration method, characterized in that: The following steps are involved: Performing an initial internal calibration on the target camera to obtain distortion coefficients of different imaging areas of the target camera; Before performing initial calibration of the target camera's internal parameters to obtain the distortion coefficients of different imaging areas of the target camera, the camera internal parameter calibration method further includes: According to the image area of the target camera, obtaining a plurality of annularly distributed imaging areas of the target camera; According to the distortion coefficients, respectively obtaining the Euclidean distances of the distortion coefficients of the imaging area groups; wherein the adjacent imaging areas constitute one imaging area group; When the Euclidean distance is greater than the distance threshold, a target distortion coefficient is obtained according to the boundary constraint of the imaging area group and the distortion coefficient to complete the intrinsic calibration of the target camera; before obtaining the target distortion coefficient according to the boundary constraint of the imaging area group and the distortion coefficient to complete the intrinsic calibration of the target camera when the Euclidean distance is greater than the distance threshold, the camera intrinsic calibration method further includes: According to the conversion relationship and the distortion coefficient of any imaging area in the imaging area group, a relationship between the distortion coefficients of another imaging area in the imaging area group is calculated to obtain the boundary constraint condition; When the Euclidean distance is greater than a distance threshold, obtaining a target distortion coefficient according to the boundary constraint of the imaging region group and the distortion coefficient to complete the intrinsic calibration of the target camera includes: When the Euclidean distance is greater than a distance threshold, obtaining a target distortion model according to the boundary constraint of the imaging region group and the distortion model corresponding to the distortion coefficient; The distortion coefficient of the imaging region group is solved by using the target distortion model to obtain the target distortion coefficient, so as to complete the internal parameter calibration of the target camera.
2. The camera intrinsic parameter calibration method according to claim 1, characterized in that: After obtaining the Euclidean distances of the distortion coefficients of the imaging area groups respectively according to the distortion coefficients, the camera intrinsic parameter calibration method further includes: When the Euclidean distance is less than or equal to the distance threshold, a distortion coefficient of any imaging area in the imaging area group is determined to obtain a target distortion coefficient.
3. The camera intrinsic parameter calibration method according to claim 1, characterized in that: The step of obtaining a plurality of annularly distributed imaging areas of the target camera according to the image area of the target camera comprises: Obtaining a first imaging area according to the number of image pixels and the center point of the image area of the target camera; wherein the first imaging area is circular and located at the center of the image area; According to the coordinates of the first imaging area, a plurality of second imaging areas are obtained; wherein the second imaging area is an annular area having the same center point as the first imaging area.
4. The camera intrinsic parameter calibration method according to claim 3, characterized in that: The step of obtaining a first imaging area according to the number of image pixels and the center point of the image area of the target camera comprises: Obtaining a radius range of the first imaging area according to the number of pixels of the short side of the image; The first imaging area is obtained according to the radius range of the first imaging area and the center point of the image area of the target camera.
5. A camera intrinsic parameter calibration device, characterized in that: include: An initial calibration module, which is used to perform an initial calibration of the internal parameters of the target camera to obtain the distortion coefficients of different imaging areas of the target camera; Before the target camera is initially calibrated with internal parameters to obtain the distortion coefficients of different imaging areas of the target camera respectively, the method further includes: According to the image area of the target camera, obtaining a plurality of annularly distributed imaging areas of the target camera; An acquisition module, the acquisition module is used to respectively obtain the Euclidean distances of the distortion coefficients of the imaging area group according to the distortion coefficients; wherein the adjacent imaging areas constitute one imaging area group; A target calibration module, wherein the target calibration module is used to obtain a target distortion coefficient according to the boundary constraint condition of the imaging area group and the distortion coefficient when the Euclidean distance is greater than the distance threshold, so as to complete the intrinsic calibration of the target camera; before obtaining the target distortion coefficient according to the boundary constraint condition of the imaging area group and the distortion coefficient when the Euclidean distance is greater than the distance threshold, so as to complete the intrinsic calibration of the target camera, the method further includes: According to the conversion relationship and the distortion coefficient of any imaging area in the imaging area group, the relationship between the distortion coefficients of another imaging area in the imaging area group is calculated to obtain the boundary constraint condition; when the Euclidean distance is greater than the distance threshold, the target distortion coefficient is obtained according to the boundary constraint condition of the imaging area group and the distortion coefficient to complete the internal parameter calibration of the target camera, including: When the Euclidean distance is greater than a distance threshold, obtaining a target distortion model according to the boundary constraint of the imaging region group and the distortion model corresponding to the distortion coefficient; The distortion coefficient of the imaging region group is solved by using the target distortion model to obtain the target distortion coefficient, so as to complete the internal parameter calibration of the target camera.
6. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is loaded and executed by a processor, the camera intrinsic parameter calibration method according to any one of claims 1 to 4 is implemented.
7. An electronic device, characterized in that: comprising a processor and a memory, wherein: The memory is used to store computer programs; The processor is used to load and execute the computer program so that the electronic device executes the camera intrinsic parameter calibration method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Image distortion removal method and device, electronic equipment and computer readable storage medium
CN113256540A
Camera calibration method and device, image splicing method and device, medium, camera and vehicle
CN115439548A