Calibration method, device and storage medium for zoom pan / tilt camera
By constructing a quadratic equation and solving the initial value of the focal length, the problem of low calibration efficiency and dependence on the calibration board of the zoom pan-tilt camera is solved, and online automatic calibration and efficient parameter calibration under continuous changes in focal length are achieved.
Patent Information
- Application Number
- CN202010635685.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-03
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2040-07-03
AI Technical Summary
The existing calibration method of zoom pan-tilt cameras is inefficient, relies on reference objects such as calibration plates, and is difficult to adapt to continuous changes in focal length.
By acquiring two images at the same magnification, extracting and matching feature points, constructing a quadratic equation with the initial value of the focal length as the dependent variable, and solving it to obtain the calibration parameters, using SURF or ORB feature extraction and matching algorithms, combined with the camera imaging model Perform nonlinear optimization and achieve online automatic calibration.
It simplifies the calibration process, improves efficiency and flexibility, realizes parameter calibration under continuous changes in focal length, avoids dependence on the calibration board, and improves calibration accuracy and efficiency.
Smart Images

Figure CN111815715B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to a calibration method, calibration equipment and storage device for a zoom pan / tilt camera. Background Art
[0002] Pan-Tilt-Zoom (PTZ) cameras can automatically adjust and control focal length, posture, aperture, etc., and have the characteristics of flexibility, large field of view, and strong adaptability to lighting conditions. Therefore, they have been widely used in various fields such as video surveillance, electronic security, robot navigation, and smart space. In the existing technology, the calibration of PTZ cameras often needs to rely on reference objects such as calibration plates, and the calibration efficiency is low.
[0003] Therefore, in order to solve the above problems, a new calibration method, calibration device and storage medium for a zoom pan / tilt camera must be provided. Summary of the invention
[0004] To achieve the above-mentioned purpose, the present invention provides a calibration method for a zoom pan / tilt camera, the calibration method comprising: acquiring a first image at a first position and a second image at a second position at the same magnification, the first image and the second image having overlapping fields of view; extracting multiple first feature points of the first image and multiple second feature points of the second image, matching the multiple first feature points with the multiple second feature points to obtain multiple groups of feature point pairs; constructing multiple groups of quadratic equations with initial focal length as dependent variables based on the multiple groups of feature point pairs and a camera imaging model, so as to obtain calibration parameters at the same magnification by solving the quadratic equations.
[0005] As a further improvement of the present invention, constructing a quadratic equation with the initial focal length as the dependent variable based on multiple groups of the feature point pairs and the camera imaging model to obtain calibration parameters based on the quadratic equation, includes: selecting a number of feature point pairs from the multiple groups of the feature point pairs; constructing a plurality of quadratic equations corresponding to each feature point pair based on each feature point pair in the plurality of feature point pairs and the camera imaging model to obtain a plurality of initial focal length values corresponding to each feature point pair based on the plurality of quadratic equations; selecting a preferred focal length value from the plurality of initial focal length values based on a mapping error between the first feature point and the second feature point; and optimizing the preferred focal length value and the principal point parameters of the camera imaging model to obtain the calibrated focal length and the calibrated principal point parameters.
[0006] As a further improvement of the present invention, the method of selecting a plurality of feature point pairs from the plurality of groups of feature point pairs includes: selecting a plurality of feature point pairs from the plurality of groups of feature point pairs based on the areas in which the plurality of groups of feature point pairs are located in the first image and the second image, and the matching degrees of the plurality of groups of feature point pairs.
[0007] As a further improvement of the present invention, according to each feature point pair among the several feature point pairs and the camera imaging model, a plurality of quadratic equations corresponding to the each feature point pair are constructed to obtain a plurality of initial focal length values corresponding to the each feature point pair based on the plurality of quadratic equations, including: according to the first position and the second position, a rotation parameter from the first position to the second position is calculated; a world coordinate system coincident with the first camera coordinate system of the first position is established, and based on the camera imaging model and the rotation parameters, a relationship between the each feature point pair and the initial focal length value is constructed; and the relationship is converted into the quadratic equation with the initial focal length value as the dependent variable.
[0008] As a further improvement of the present invention, the relationship between each feature point pair and the initial focal length value is constructed based on the camera imaging model and the rotation parameter, including: based on the camera imaging model, converting the image point coordinates of the first feature point into a first coordinate in the first camera coordinate system, and normalizing the first coordinate to obtain a first parameter about the initial focal length value; according to the rotation parameter, converting the first parameter into a second coordinate in the second camera coordinate system at the second position, and normalizing the second coordinate to obtain a second parameter about the initial focal length value; based on the first parameter and the second parameter, deriving the relationship.
[0009] As a further improvement of the present invention, based on the mapping error between the first feature point and the second feature point, a preferred focal length value is screened out from the multiple initial focal length values, including: based on the camera imaging model and the second feature point, calculating the corresponding first feature point that matches the second feature point; based on the difference between the corresponding first feature point and the first feature point, screening out the preferred focal length value from the multiple initial focal length values.
[0010] As a further improvement of the present invention, the optimizing the preferred focal length value and the principal point parameters of the camera imaging model to obtain the calibrated focal length and the calibrated principal point parameters includes: based on the LM nonlinear optimization algorithm, performing nonlinear optimization on the preferred focal length value and the principal point parameters to obtain the calibrated focal length and the calibrated principal point parameters.
[0011] As a further improvement of the present invention, the extracting of multiple first feature points of the first image and multiple second feature points of the second image, matching the multiple first feature points with the multiple second feature points to obtain multiple groups of feature point pairs, includes: based on a SURF or ORB feature extraction and matching algorithm, extracting the multiple first feature points and the multiple second feature points and matching them to obtain multiple groups of feature point pairs.
[0012] The present invention also provides a zoom pan-tilt camera device, comprising: a processor, a memory and a communication circuit, wherein the processor is respectively coupled to the memory and the communication circuit; when the processor, the memory and the communication circuit are working, the above-mentioned calibration method can be implemented.
[0013] The present invention also provides a storage device storing program instructions that can be executed by a processor, wherein the program instructions are used to implement the above-mentioned calibration method.
[0014] Compared with the prior art, the present invention has the following beneficial effects:
[0015] The calibration method of the zoom pan-tilt camera provided by the present invention can construct a quadratic equation corresponding to the feature points and with the initial value of the focal length as the dependent variable by using multiple groups of feature points and a camera imaging model. The initial value of the focal length can be directly calculated by solving the quadratic equation without calculating the homography matrix, thereby simplifying the solution process and improving the efficiency and flexibility of the calibration. In addition, the calibration method of the zoom pan-tilt camera provided by the present invention realizes the online automatic calibration of the calibration parameters of the zoom pan-tilt camera, and the calibration process does not rely on reference objects such as calibration plates, thereby further simplifying the calibration process and improving the calibration efficiency. At the same time, the zoom pan-tilt camera of the present invention is suitable for parameter calibration under the condition of continuous focal length change. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:
[0017] Figure 1 It is a schematic diagram of the overall flow of the calibration method of the zoom pan-tilt camera of the present invention;
[0018] Figure 2 For the present invention Figure 1 A schematic flow chart of an implementation method of step S13;
[0019] Figure 3 A schematic diagram of a flow chart of a specific implementation method of a zoom pan / tilt camera of the present invention;
[0020] Figure 4 It is a structural schematic diagram of an embodiment of a zoom pan-tilt camera device of the present invention;
[0021] Figure 5 It is a schematic structural diagram of an implementation manner of a storage device of the present invention. DETAILED DESCRIPTION
[0022] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.
[0023] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.
[0024] The terms "system" and "network" are often used interchangeably in this article. The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship. In addition, "many" in this article means two or more than two.
[0025] Zoom pan-tilt cameras include ball cameras, gun cameras with pan-tilts, and other devices. These devices can adjust the monitoring area by rotating the pan-tilt, and are flexible to use. Specifically, the pan-tilt can move up and down and left and right. By mounting a camera on it, multi-angle monitoring of the camera can be achieved. The pan-tilt can be divided into horizontal pan-tilt and omnidirectional pan-tilt according to the different rotation angles.
[0026] In actual application scenarios, in order to obtain local detail information of the scene, the zoom pan-tilt camera also needs to adjust the camera's magnification, that is, adjust the camera's focal length. While changing the magnification, the corresponding image principal point will also change accordingly. The focal length and principal point parameters are often indispensable in gun-ball linkage, ball camera positioning, and three-dimensional reconstruction. Therefore, the calibration of camera parameters is a very critical link. The accuracy of the calibration results and the stability of the algorithm directly affect the accuracy of the results produced by the camera.
[0027] Based on this, the present invention provides a calibration method for a zoom pan-tilt camera, which can realize online, efficient and high-precision calibration of parameters. The calibration method uses a zoom pan-tilt camera to obtain a first image at a first position and a second image at a second position at the same magnification, and the first image and the second image have overlapping fields of view; extract multiple first feature points of the first image and multiple second feature points of the second image, match the multiple first feature points with the multiple second feature points, and obtain multiple groups of feature point pairs; according to the multiple groups of feature point pairs and the camera imaging model, construct multiple groups of quadratic equations with the initial value of focal length as the dependent variable, so as to obtain the calibration parameters at the same magnification based on the quadratic equations.
[0028] Therefore, in the present invention, the initial value of the focal length can be directly calculated by solving the quadratic equation without calculating the homography matrix, which simplifies the solution process and improves the efficiency and flexibility of calibration; and, compared with the traditional offline calibration method in the prior art that requires the use of a three-dimensional or planar calibration object, that is, a method of calibrating the internal and external parameters of the camera by offline collecting calibration object image data and combining an imaging model, such as Tsai's two-step calibration method and Zhang Zhengyou's plane calibration method, the calibration method provided by the present invention realizes the online automatic calibration of the calibration parameters of the zoom pan-tilt camera, and the calibration process does not rely on reference objects such as calibration plates, further simplifies the calibration process, and improves the calibration efficiency; at the same time, the zoom pan-tilt camera of the present invention is suitable for parameter calibration under the condition of continuous change of focal length.
[0029] Combination Figure 1 The calibration method of the zoom pan / tilt camera provided by the present invention is further described below. The calibration method specifically includes:
[0030] S11: Acquire a first image at a first position and a second image at a second position at the same magnification, wherein the first image and the second image have overlapping fields of view.
[0031] Specifically, in one embodiment, the zoom pan-tilt camera first captures a first image at a first position, and then, by rotating the pan-tilt without changing the magnification, the zoom pan-tilt camera captures a second image at a second position, wherein the first image and the second image have overlapping fields of view. In another embodiment, the zoom pan-tilt camera first captures a second image at a second position, and then, by rotating the pan-tilt without changing the magnification, the zoom pan-tilt camera captures a first image at a first position, wherein the first image and the second image have overlapping fields of view. In other words, the order of capturing the first image and the second image is not limited by the present invention, and whether the first image is captured first and then the second image, or the second image is captured first and then the first image, is within the protection scope of the present invention, and it is only necessary to ensure that the first image and the second image have overlapping fields of view.
[0032] S12: extracting a plurality of first feature points of the first image and a plurality of second feature points of the second image, and matching the plurality of first feature points with the plurality of second feature points to obtain a plurality of groups of feature point pairs.
[0033] Specifically, since the multiple first feature points and the multiple second feature points have a one-to-one matching relationship, the mutually matching first feature points and second feature points are a group of feature point pairs. Therefore, multiple first feature points and multiple second feature points can be matched to obtain multiple groups of feature point pairs. In a specific embodiment, the present invention is based on SURF (Speeded Up Robust Features) or ORB (Oriented FAST and Rotated BRIEF) feature extraction and matching algorithms to extract the multiple first feature points and the multiple second feature points and match them to obtain multiple groups of feature point pairs. Of course, in other embodiments of the present invention, other feature extraction and matching algorithms may also be used, such as SIFT, etc. As long as the first feature points and the second feature points are matched to obtain feature point pairs, the purpose of the present invention can be achieved. For the convenience of description below, the multiple first feature points are recorded as Where i = 1...n, multiple second feature points are recorded as Where i=1…n.
[0034] S13: constructing multiple sets of quadratic equations with initial focal length as dependent variables according to the multiple sets of feature point pairs and the camera imaging model, so as to obtain calibration parameters under the same magnification by solving the quadratic equations.
[0035] According to a set of feature point pairs and a camera imaging model, a quadratic equation with the initial value of focal length as the dependent variable can be constructed, and an initial value of focal length can be obtained by solving the quadratic equation, without calculating the homography matrix, the calculation process is simpler, and the calibration efficiency is improved. Therefore, in the present invention, according to multiple sets of feature point pairs and camera imaging models, multiple quadratic equations with the initial value of focal length as the dependent variable can be constructed, and multiple initial values of focal length can be obtained by solving multiple quadratic equations.
[0036] Combination Figure 2 In a specific implementation manner, the above step S13 specifically includes:
[0037] S131: Filter out a number of feature point pairs from the multiple groups of feature point pairs.
[0038] Taking into account that in step S12, the extraction and matching of the first feature point and the second feature point are easily affected by mismatching and lens distortion, and the focal length error calculated by only any one feature point pair is relatively large, the present invention selects several feature point pairs from the multiple groups of feature point pairs according to the areas where the multiple groups of feature point pairs are located in the first image and the second image, and the matching degrees of the multiple groups of feature point pairs, thereby reducing the impact of mismatching and lens distortion.
[0039] In one embodiment, a plurality of feature point pairs can be screened out by setting a preset coordinate range threshold and a preset matching degree threshold. By setting a preset coordinate range threshold, it is ensured that a plurality of feature point pairs are taken from the middle part of the image, thereby reducing the influence of lens distortion; by setting a preset matching degree threshold, it is ensured that a plurality of feature point pairs have a high matching degree, thereby reducing the influence of mismatching. Of course, in other embodiments of the present invention, other methods other than setting a threshold can also be used for screening, as long as the effect of reducing the influence of mismatching and lens distortion of the feature point pairs is achieved, the purpose of the present invention can be achieved.
[0040] S132: constructing a plurality of quadratic equations corresponding to each feature point pair according to each feature point pair and the camera imaging model, so as to obtain a plurality of initial focal length values corresponding to each feature point pair based on the plurality of quadratic equations.
[0041] Specifically, according to the first position and the second position, the rotation parameters from the first position to the second position are calculated; a world coordinate system coincident with the first camera coordinate system of the first position is established, and based on the camera imaging model and the rotation parameters, a relationship about each feature point pair and the initial focal length value is constructed; the relationship is converted into a quadratic equation with the initial focal length value as the dependent variable.
[0042] Among them, based on the camera imaging model and the rotation parameters, constructing a relationship between each feature point pair and the initial focal length specifically includes: first, based on the camera imaging model, converting the image point coordinates of the first feature point into the first coordinates in the first camera coordinate system, and normalizing the first coordinates to obtain the first parameter about the initial focal length; then, according to the rotation parameters, converting the first parameter into the second coordinates in the second camera coordinate system at the second position, and normalizing the second coordinates to obtain the second parameter about the initial focal length; based on the first parameter and the second parameter, deriving the above relationship.
[0043] In a specific implementation, at the first position, the PT value (P represents the horizontal azimuth, T represents the vertical azimuth, P and T are collectively referred to as the camera's azimuth, expressed by PT value) of the zoom pan / tilt camera is recorded as P0 and T0; at the second position, the PT value of the zoom pan / tilt camera is recorded as P1 and T1. In the process of the zoom pan / tilt camera moving from the first position to the second position, the change in pitch angle is recorded as ΔP, and the corresponding rotation matrix is recorded as R_pitch; the change in yaw angle is recorded as ΔT, and the corresponding rotation matrix is recorded as R_Yaw; the rotation vector from the first position to the second position is recorded as R, that is, the rotation parameter is R, so there is the following relationship between the above parameters:
[0044] ΔP=P 0 -P 1 , ΔT=T 0 -T 1
[0045]
[0046] R=R_Pitch*R_Yaw
[0047] Furthermore, based on the first position, a world coordinate system is established at a position that coincides with the first camera coordinate system of the first position. According to the camera imaging model, a quadratic equation is constructed based on matching points corresponding to the same object points, so as to obtain an initial focal length value by solving the quadratic equation.
[0048] A feature point As an example, take the camera principal point as the image center point (u 0 v 0 ), the focal length is recorded as f. First, the image point coordinates of the first feature point are converted to the first camera coordinate system and normalized to obtain the first parameter about the initial value of the focal length:
[0049]
[0050] Then, the first parameter is converted into the second coordinate in the second camera coordinate system at the second position by the rotation parameter R:
[0051]
[0052] Normalize the second coordinate to obtain the second parameter about the initial value of the focal length:
[0053]
[0054] Based on the first parameter and the second parameter, the following relationship is derived:
[0055]
[0056]
[0057] Since the focal length cannot be a negative value, a simple screening can be performed in combination with the approximate range of the focal length to obtain the initial focal length value. In one embodiment, the initial focal length values calculated according to the above content are three sets of data with large differences, wherein the first set of data is a negative value, the second set of data is very small, and the third set of data is within the range of 2000-3000. At this time, in combination with the approximate range of the focal length (for example, the approximate range of the focal length of a gun camera or a ball camera is between 2000-3000), an initial focal length value can be screened out.
[0058] Thus, based on a feature point pair, an initial focal length value can be obtained through the above deduction. Based on multiple sets of feature point pairs provided by the present invention, multiple initial focal length values can be derived.
[0059] S133: Filtering out a preferred focal length value from a plurality of initial focal length values according to a mapping error between the first feature point and the second feature point.
[0060] Specifically, step S133 includes: calculating the corresponding first feature point matching the second feature point according to the camera imaging model and the second feature point; based on the difference between the corresponding first feature point and the first feature point obtained by the feature extraction and matching algorithm in the previous text, selecting the preferred focal length value from multiple initial focal length values. The difference between the corresponding first feature point and the first feature point is the mapping error. Therefore, according to the size of the mapping error, the preferred focal length value with a smaller mapping error is selected to reduce the influence of the mapping error on the calibration parameters.
[0061] S134: Optimizing the optimal focal length value and the principal point parameters of the camera imaging model to obtain a calibrated focal length and calibrated principal point parameters.
[0062] In order to further improve the calibration accuracy, the LM nonlinear optimization algorithm is used to perform nonlinear optimization on the preferred focal length value and the principal point parameters to obtain the calibrated focal length and the calibration principal point parameters under the same magnification. For the calibration parameters under other magnifications, the above steps can be repeated. Therefore, compared with the existing calibration method applicable to the case of fixed focal length, the zoom pan-tilt camera of the present invention achieves the effect of parameter calibration applicable to the case of continuous change of focal length.
[0063] Combination Figure 3The main working process of a specific implementation method of a zoom pan-tilt camera calibration method provided by the present invention is as follows: at the beginning of calibration, the zoom pan-tilt camera captures a first image at a first position; then, the pan-tilt is rotated, and the zoom pan-tilt camera captures a second image at a second position; then, feature points of the first image and the second image are extracted and matched, and a number of feature point pairs are screened out by setting a preset coordinate range threshold and a preset matching degree threshold; multiple initial focal length values are calculated, and a preferred focal length value is screened out according to the mapping error; finally, the preferred focal length value and the principal point parameters are nonlinearly optimized to obtain calibration parameters, and the calibration ends.
[0064] In summary, the calibration method of the zoom pan-tilt camera provided by the present invention can construct a quadratic equation corresponding to the feature points and with the initial value of the focal length as the dependent variable by utilizing multiple groups of feature points and a camera imaging model. The initial value of the focal length can be directly calculated by solving the quadratic equation without calculating the homography matrix, thereby simplifying the solution process and improving the efficiency and flexibility of the calibration. Furthermore, the calibration method of the zoom pan-tilt camera provided by the present invention realizes the online automatic calibration of the calibration parameters of the zoom pan-tilt camera, and the calibration process does not rely on reference objects such as calibration plates, thereby further simplifying the calibration process and improving the calibration efficiency. Meanwhile, the zoom pan-tilt camera of the present invention is suitable for parameter calibration under the condition of continuous change of focal length.
[0065] The present invention also provides a calibration device, including an acquisition module, an extraction module and a construction module. Specifically, the acquisition module is used to acquire a first image at a first position and a second image at a second position at the same magnification, and the first image and the second image have overlapping fields of view; the extraction module is used to extract multiple first feature points of the first image and multiple second feature points of the second image, and match the multiple first feature points with the multiple second feature points to obtain multiple groups of feature point pairs; the construction module is used to construct multiple groups of quadratic equations with the initial value of focal length as the dependent variable according to the multiple groups of feature point pairs and the camera imaging model, so as to obtain the calibration parameters under the same magnification by solving the quadratic equations.
[0066] See also Figure 4 The present invention also provides a zoom pan-tilt camera device, including a processor 41, a memory 42 and a communication circuit 43, the processor 41 is coupled to the memory 42 and the communication circuit 43 respectively, and the processor 41, the memory 42 and the communication circuit 43 can implement the calibration method in any of the above embodiments when working.
[0067] Specifically, the processor 41 is used to control itself and the memory 42 to implement the steps in any of the above-mentioned calibration method embodiments. The processor 41 can also be called a CPU (Central Processing Unit). The processor 41 may be an integrated circuit chip with signal processing capabilities. The processor 41 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 41 can be implemented by multiple integrated circuit chips.
[0068] Also, see Figure 5 The present invention further provides a storage device, which stores program instructions 600 that can be executed by a processor, and the program instructions 600 are used to implement the calibration method in any of the above embodiments. That is, when the above calibration method is implemented in the form of software and sold or used as an independent product, it can be stored in a storage device 60 that can be read by an electronic device, and the storage device 60 can be a USB flash drive, an optical disk, or a server, etc.
[0069] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0070] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0071] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0072] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0073] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A calibration method for a zoom pan / tilt camera, characterized in that: The calibration method comprises: Acquire a first image at a first position and a second image at a second position at the same magnification, wherein the first image and the second image have overlapping fields of view; Extracting a plurality of first feature points of the first image and a plurality of second feature points of the second image, and matching the plurality of first feature points with the plurality of second feature points to obtain a plurality of groups of feature point pairs; According to the plurality of sets of feature point pairs and the camera imaging model, constructing a plurality of sets of quadratic equations with the initial value of focal length as the dependent variable, so as to obtain the calibration parameters under the same magnification by solving the quadratic equations; According to the plurality of sets of feature point pairs and the camera imaging model, a quadratic equation with the initial value of focal length as the dependent variable is constructed to obtain calibration parameters based on the quadratic equation, including: Selecting a plurality of feature point pairs from the plurality of groups of feature point pairs; According to each feature point pair of the plurality of feature point pairs and the camera imaging model, construct a plurality of quadratic equations corresponding to each feature point pair, so as to obtain a plurality of initial focal length values corresponding to each feature point pair based on the plurality of quadratic equations; Filtering a preferred focal length value from the plurality of initial focal length values according to a mapping error between the first feature point and the second feature point; The preferred focal length value and the principal point parameters of the camera imaging model are optimized to obtain a calibrated focal length and calibrated principal point parameters.
2. The calibration method according to claim 1, characterized in that: The step of selecting a plurality of feature point pairs from the plurality of groups of feature point pairs comprises: According to the regions where the plurality of feature point pairs are located in the first image and the second image and the matching degrees of the plurality of feature point pairs, a plurality of feature point pairs are screened out from the plurality of feature point pairs.
3. The calibration method according to claim 1, characterized in that: The step of constructing a plurality of quadratic equations corresponding to each feature point pair according to each feature point pair in the plurality of feature point pairs and the camera imaging model, so as to obtain a plurality of initial focal length values corresponding to each feature point pair based on the plurality of quadratic equations, comprises: Calculate and obtain a rotation parameter from the first position to the second position according to the first position and the second position; Establishing a world coordinate system that coincides with the first camera coordinate system at the first position, and constructing a relationship between each feature point pair and the initial focal length value based on the camera imaging model and the rotation parameter; The relationship is converted into the quadratic equation with the initial value of focal length as the dependent variable.
4. The calibration method according to claim 3, characterized in that: The constructing a relationship between each feature point pair and the initial focal length value based on the camera imaging model and the rotation parameter includes: Based on the camera imaging model, converting the image point coordinates of the first feature point into first coordinates in the first camera coordinate system, and normalizing the first coordinates to obtain a first parameter related to the initial value of the focal length; According to the rotation parameter, converting the first parameter into a second coordinate in a second camera coordinate system at the second position, and normalizing the second coordinate to obtain a second parameter about the initial value of the focal length; The relationship is derived based on the first parameter and the second parameter.
5. The calibration method according to claim 1, characterized in that: According to the mapping error between the first feature point and the second feature point, selecting a preferred focal length value from the plurality of initial focal length values comprises: Calculating, according to the camera imaging model and the second feature point, a corresponding first feature point that matches the second feature point; Based on the difference between the corresponding first feature point and the first feature point, a preferred focal length value is selected from the multiple initial focal length values.
6. The calibration method according to claim 1, characterized in that: The optimizing the preferred focal length value and the principal point parameters of the camera imaging model to obtain the calibrated focal length and the calibrated principal point parameters includes: Based on the LM nonlinear optimization algorithm, the preferred focal length value and the principal point parameters are nonlinearly optimized to obtain the calibrated focal length and the calibrated principal point parameters.
7. The calibration method according to claim 1, characterized in that: The extracting a plurality of first feature points of the first image and a plurality of second feature points of the second image, and matching the plurality of first feature points with the plurality of second feature points to obtain a plurality of groups of feature point pairs includes: Based on the SURF or ORB feature extraction and matching algorithm, the plurality of first feature points and the plurality of second feature points are extracted and matched to obtain a plurality of groups of feature point pairs.
8. A zoom pan-tilt camera device, characterized in that: include: A processor, a memory and a communication circuit, wherein the processor is coupled to the memory and the communication circuit respectively; When the processor, the memory and the communication circuit are working, the calibration method described in any one of claims 1 to 7 can be implemented.
9. A storage device, characterized in that: Program instructions that can be executed by a processor are stored, and the program instructions are used to implement the calibration method described in any one of claims 1-7.
