A method for generating camera calibration data

By setting the basic calibration points and generating derivative calibration points during the camera calibration process, the calibration point data is quickly acquired and verified, and the time-consuming and labor-intensive camera calibration process in the prior art is solved, and fast and accurate calibration data generation is achieved.

CN119417915BActive Publication Date: 2025-03-28GUANGZHOU FUAN DIGITAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510018798.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-07
Publication Date
2025-03-28
Estimated Expiration
2045-01-07

AI Technical Summary

Technical Problem

Existing camera calibration technology requires a lot of manpower and time to find and obtain pixel coordinates and latitude and longitude coordinates of multiple calibration points, resulting in a time-consuming and labor-intensive calibration process.

Method used

By setting basic calibration points, several derivative calibration points are generated, more calibration point group data are quickly obtained, and the accuracy and accuracy of these data are verified, points that do not meet the requirements are eliminated, so as to quickly generate calibration data that meets business needs.

Benefits of technology

On the basis of ensuring the accuracy of calibration points, the calibration data that meets business needs is quickly generated, which reduces the time to obtain calibration data, increases the speed of camera calibration, and solves the problem of time-consuming and labor-intensive acquisition of camera calibration data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119417915B_ABST
    Figure CN119417915B_ABST
Patent Text Reader

Abstract

The present invention relates to a method for generating camera calibration data. By setting basic calibration points and generating a number of derived calibration points based on the basic calibration points, more calibration point groups can be quickly obtained, and the correctness and accuracy of the calibration point groups obtained in this way are verified, and points that do not meet the requirements are eliminated. On the basis of ensuring the accuracy of the calibration points, calibration data that meets business needs can be quickly generated, the time for obtaining calibration data is reduced, the speed of camera calibration is improved, and the problem of time-consuming and labor-intensive acquisition of camera calibration data is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of camera calibration, and in particular to a method for generating camera calibration data. Background Art

[0002] In the field of image measurement and machine vision applications, in order to determine the relationship between the three-dimensional geometric position of a point on the surface of a spatial object and its corresponding point in the image, it is necessary to establish a geometric model of camera imaging. The parameters of the geometric model need to be obtained through experimental calculations, and the process of solving the parameters is camera calibration.

[0003] The existing camera calibration technology mainly uses the calibration plate method. Images of different angles and positions are taken for a calibration plate of known size. The calibration points of the calibration plate are detected in each image and their two-dimensional pixel coordinates are recorded. The three-dimensional spatial coordinates of the calibration points are generated according to the size of the calibration plate. The mapping relationship between the two-dimensional pixel coordinates of the calibration points and the three-dimensional spatial coordinates is obtained through a series of calculations, and then the parameters of the geometric model are obtained to complete the camera calibration.

[0004] In the calibration process of cameras used in natural resource monitoring, finding calibration points and generating pixel coordinates and longitude and latitude coordinate pairs are the prerequisites for establishing the mapping relationship between two-dimensional pixel coordinates and three-dimensional space coordinates. The more coordinate pairs there are, the higher the accuracy of the established coordinate conversion mapping relationship. However, as the number of coordinate pairs increases, the difficulty of finding calibration points also increases, and obtaining the pixel coordinates and longitude and latitude coordinates of the calibration points requires the help of other tools, which requires a lot of manpower and material resources, and greatly increases the time cost. Summary of the invention

[0005] Based on this, the purpose of the present invention is to provide a method for generating camera calibration data, which generates a number of derived calibration points through a small number of basic calibration points, quickly obtains more calibration point group data, and then quickly generates camera calibration data.

[0006] A method for generating camera calibration data comprises the following steps:

[0007] S10: Obtaining a target object imaging area of ​​the camera and a map corresponding to the target object imaging area, determining the zero position angle of the camera according to the pixel coordinates, longitude and latitude coordinates of the target object, and the PTZ value of the camera; generating a search area in the map according to the zero position angle, wherein the search area is linked to the rotation of the camera;

[0008] S20: locate the target calibration point in the center of the search area, use the calibration point as the basic calibration point to obtain the latitude and longitude coordinates of the basic calibration point in the map, and the PTZ value and pixel coordinates of the camera in the corresponding camera area; change the position of the target calibration point in the search area, use the calibration point with the changed position as the derivative point to obtain the PTZ value and pixel coordinates of the derivative calibration point in the corresponding camera area; obtain calibration point group data based on the basic calibration point and the derivative calibration point of the target calibration point; integrate the calibration point group data of different calibration points of the target based on the same data acquisition method to obtain initial calibration data;

[0009] S30: Generate an initial calibration scheme according to the initial calibration data, and obtain a pixel coordinate-longitude and latitude coordinate conversion model according to the initial calibration scheme; input the calibration point group data into the pixel coordinate-longitude and latitude coordinate conversion model to obtain the mapped longitude and latitude coordinates relative to the pixel coordinates; calculate the loss value between the mapped longitude and latitude coordinates of each calibration point and the longitude and latitude coordinates of the corresponding calibration point group:

[0010] If the loss value is less than or equal to the preset loss threshold, it is determined that the initial calibration data meets the requirements, and the initial calibration data is used as the camera calibration data;

[0011] If the loss value is greater than the preset loss threshold, it is determined that there are calibration points with positioning errors in the initial calibration data, and S40 is executed;

[0012] S40: Calculate the relative accuracy of each calibration point, select the calibration points whose relative accuracy is greater than the set accuracy threshold as the erroneous calibration points; delete the erroneous calibration points, and execute S30.

[0013] Compared with the prior art, the present invention sets basic calibration points and generates a number of derived calibration points based on the basic calibration points, so as to quickly obtain more calibration point groups, and verify the correctness and accuracy of the calibration point groups obtained in this way, and eliminate points that do not meet the requirements. On the basis of ensuring the accuracy of the calibration points, calibration data that meets business needs can be quickly generated, which reduces the time for obtaining calibration data, improves the speed of camera calibration, and solves the problem of time-consuming and labor-intensive acquisition of camera calibration data.

[0014] Furthermore, the step S20 includes the following sub-steps:

[0015] S21: Rotate the search area so that the target object is a calibration point Located in the center area of ​​the search area; get the calibration point The latitude and longitude coordinates on the map, and the PTZ value and pixel coordinates of the camera's corresponding camera area; the calibration point located in the center area Set as base calibration point , get the basic calibration point data = ;

[0016] S22: Rotate the search area to make the target object mark the point Located in the non-central area of ​​the search area; get the calibration point In the PTZ value and pixel coordinates of the camera corresponding to the camera area; the calibration point located in the non-center area Set as the jth derivative calibration point , get the jth derivative calibration point data = ; Repeatedly rotate the search area to make the target object mark the point Located in different non-central areas, the derived calibration point group is obtained = , j∈n, n>2, and the derived calibration point group data ;

[0017] S23: Based on the calibration point The basic calibration point data And its derived calibration point group data Combine several groups of calibration point data into one calibration point group data to obtain the initial calibration data .

[0018] Furthermore, the step S21 further includes obtaining basic calibration points The elevation data corresponding to the longitude and latitude coordinates:

[0019] Get the elevation data corresponding to the map, according to the calibration point Filter the elevation values ​​corresponding to the longitude and latitude coordinates in the map from the elevation data , the elevation value Add basic calibration points In the data, we get = ;

[0020] The corresponding derived calibration point group data = .

[0021] Furthermore, the step S20 further includes:

[0022] S24: Based on the calibration point The basic calibration point data And its derived calibration point group data Perform association splicing to obtain a set of calibration point data .

[0023] Furthermore, after deleting the erroneous calibration points in step S40, new calibration points are added according to step S20, and then step S30 is executed.

[0024] Furthermore, the relative accuracy satisfies:

[0025] Relative accuracy

[0026] in,

[0027] In the formula, is the calculated latitude and longitude of the calibration point, , is the latitude and longitude of the calibration point on the map, , Indicates the absolute value of the distance between the calculated longitude and latitude of the calibration point and the longitude and latitude in the map calculated by the spherical cosine theorem. Indicates the horizontal distance between the calibration point and the camera.

[0028] Furthermore, the initial calibration scheme is verified, and the verification steps are as follows:

[0029] SA1 obtains thematic map data provided by users;

[0030] SA2 converts the latitude and longitude coordinates of the thematic map data of the video corresponding to the calibration point search area into corresponding pixel coordinates according to the generated initial calibration scheme, and generates converted pixel coordinates;

[0031] SA3 Overlays the video image and converted pixel coordinates corresponding to the calibration point search area; overlays the latitude and longitude coordinates of the map and thematic map data; determines whether there is a serious offset between the overlay of the calibration point in the video image and the overlay in the map:

[0032] If yes, it is judged that the generated initial calibration scheme is unusable and the initial calibration data contains calibration points with incorrect positioning;

[0033] If not, it is determined that the generated calibration scheme is available.

[0034] Furthermore, the initial calibration scheme is verified, and the verification steps are as follows:

[0035] SC1 obtains the pixel coordinates of any position in the video screen corresponding to the search area as a verification point;

[0036] SC2 calculates the deviation between the calibration position and the actual position corresponding to the verification point according to the initial calibration scheme to see if it is greater than the deviation threshold:

[0037] If yes, it is judged that the generated initial calibration scheme is unusable and the initial calibration data contains calibration points with incorrect positioning;

[0038] If not, it is determined that the generated calibration scheme is available.

[0039] For better understanding and implementation, the present invention is described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 A schematic diagram of a flow chart of a method for generating camera calibration data according to the present invention;

[0041] Figure 2 for Figure 1 The corresponding step-by-step flow chart of S20. DETAILED DESCRIPTION

[0042] The technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention.

[0043] In order to solve the problem that in the existing camera calibration process, when more coordinate point pair data need to be found to establish a coordinate conversion mapping relationship with higher accuracy, the difficulty of finding calibration points increases, and more manpower and time costs are required, the present invention proposes a method for generating camera calibration data. The method for generating camera calibration data sets basic calibration points, generates a number of derivative calibration points based on the basic calibration points, quickly obtains more calibration points, verifies the correctness and accuracy of the calibration points obtained in this way, eliminates points that do not meet the requirements, and then quickly obtains calibration data that meets business needs. Through the above-mentioned method for generating camera calibration data, the present invention can quickly generate calibration data that meets business needs on the basis of ensuring the accuracy of the calibration points, reduces the time for obtaining calibration data, improves the speed of camera calibration, and solves the problem of time-consuming and labor-intensive acquisition of camera calibration data.

[0044] See also Figure 1 The method for generating camera calibration data described in the present invention specifically includes the following steps.

[0045] S10: Obtain the target object imaging area of ​​the camera and the map corresponding to the target object imaging area, determine the zero position angle of the camera according to the pixel coordinates, longitude and latitude coordinates of the target object, and the PTZ value of the camera; generate a search area in the map according to the zero position angle, and the search area is linked to the rotation of the camera.

[0046] In specific implementation, S10 includes the following sub-steps.

[0047] S11: Obtain the target object imaging area of ​​the camera, the camera PTZ value corresponding to the target object imaging area, and the pixel coordinates of the target object; obtain a map corresponding to the target object imaging area, and obtain the longitude and latitude coordinates of the target object in the map; determine the zero angle of the camera according to the PTZ value, the pixel coordinates of the target object, and the longitude and latitude coordinates of the target object.

[0048] The PTZ value includes: the rotation angle Pan of the camera in the horizontal direction; the pitch angle Tilt of the camera in the vertical direction; and the zoom factor Zoom corresponding to the focal length of the camera lens.

[0049] S12: generating a search area of ​​a fixed shape in the map according to the zero angle, wherein the search area is linked to the rotation of the camera.

[0050] Furthermore, in order to facilitate finding the calibration points and speed up the calibration, the search area is a fan-shaped search area, and the fan-shaped search area rotates with the rotation of the camera, and its rotation direction is consistent with the shooting direction of the camera.

[0051] S20: Make the target calibration point located in the center area of ​​the search area, use the calibration point as the basic calibration point to obtain the latitude and longitude coordinates of the basic calibration point in the map, and the PTZ value and pixel coordinates of the camera's corresponding camera area; change the position of the target calibration point in the search area, use the calibration points with changed positions as several derived calibration points to obtain the PTZ value and pixel coordinates of the derived calibration points in the camera's corresponding camera area; obtain calibration point group data of the basic calibration point and the derived calibration point based on the target calibration point; based on the same data acquisition method, integrate the calibration point group data of different calibration points of the target to obtain initial calibration data.

[0052] Furthermore, in order to obtain pixel coordinates and longitude and latitude coordinates more quickly, the camera video screen and the map are displayed on the same page.

[0053] In specific implementation, S20 includes the following sub-steps.

[0054] S21: Rotate the search area so that the target object is a calibration point Located in the center area of ​​the search area; get the calibration point The latitude and longitude coordinates on the map, and the PTZ value and pixel coordinates of the camera's corresponding camera area; the calibration point located in the center area Set as base calibration point , get the basic calibration point data = .

[0055] in, Indicates the PTZ value of the basic calibration point; Represents the pixel coordinates of the basic calibration points, ; Indicates the latitude and longitude coordinates of the basic calibration point, ,in, is the latitude coordinate of the basic calibration point, The longitude coordinate of the basic calibration point.

[0056] Furthermore, in order to improve the precise positioning of the calibration points and avoid the influence of terrain and field of view, at the same time, for cameras in different regions, the corresponding elevation data can be selected to quickly switch the elevation data and speed up the preliminary work of calibration. S21 also includes obtaining basic calibration points. The elevation data corresponding to the longitude and latitude coordinates make the basic calibration point The data is = ,in, Indicates the elevation value.

[0057] Specifically, obtain the elevation data corresponding to the map, according to the calibration point Filter the elevation values ​​corresponding to the longitude and latitude coordinates in the map from the elevation data , the elevation value Add basic calibration points In the data, we get = .

[0058] S22: Rotate the search area to make the target object mark the point Located in the non-central area of ​​the search area; get the calibration point In the PTZ value and pixel coordinates of the camera corresponding to the camera area; the calibration point located in the non-center area Set as the jth derivative calibration point , get the jth derivative calibration point data = ; Repeatedly rotate the search area to make the target object mark the point Located in different non-central areas, the derived calibration point group is obtained = , j∈n, n>2, and the derived calibration point group data .

[0059] Furthermore, if the basic calibration point data = , then the corresponding derived calibration point group data = .

[0060] The position of the same calibration point in the search area is transformed, and the latitude and longitude coordinates and elevation value of the calibration point in the map will not change due to the change of position in the search area. By generating several derived calibration points through basic calibration points, more PTZ values ​​and pixel coordinates of calibration points can be quickly obtained, but there is no need to repeatedly obtain the latitude and longitude coordinates and elevation data of multiple calibration points in the map, which effectively shortens the time for obtaining calibration point data and reduces the amount of data, saving computing space and time for subsequent data processing calculations. For example, when the zoom factor is 4 times, the target object corresponding to the basic calibration point is placed in the upper left, lower left, lower right and upper right positions of the search area, and 4 derivative calibration points can be obtained. By changing the zoom factor and changing the position of the target object in the search area, multiple derived calibration points can be obtained.

[0061] S23: Based on the calibration point The basic calibration point data And its derived calibration point group data Combine several groups of calibration point data into one calibration point group data to obtain the initial calibration data .

[0062] several calibration points satisfy: = , i∈N,N>2.

[0063] Said satisfy:

[0064] = , i∈N,N>2.

[0065] In order to further improve the efficiency of deleting subsequent erroneous calibration points and thus improve the efficiency of generating calibration data, the S20 also includes S24.

[0066] S24: Based on the calibration point The basic calibration point data And its derived calibration point group data Perform association splicing to obtain a set of calibration point data .

[0067] Said satisfy = .

[0068] Based on this, the initial calibration data satisfy:

[0069] = .

[0070] The derived calibration points and the basic calibration points are the same target. If the basic calibration points are wrong, the derived calibration points will also be wrong. According to the nature of the association, if the basic calibration points are deleted, the derived calibration points associated with them can also be deleted together, which reduces the operation time cost of manually clicking and deleting one by one.

[0071] Furthermore, all basic calibration points are displayed on the map, so that the distribution of all basic calibration points can be intuitively seen, so that the selection of basic calibration points can meet the 360° even distribution adjustment as much as possible, thereby improving the efficiency of calibration work.

[0072] S30: Generate an initial calibration scheme according to the initial calibration data, and obtain a pixel coordinate-longitude and latitude coordinate conversion model according to the initial calibration scheme; input the calibration point group data into the pixel coordinate-longitude and latitude coordinate conversion model to obtain the mapped longitude and latitude coordinates relative to the pixel coordinates; calculate the loss value between the mapped longitude and latitude coordinates of each calibration point and the longitude and latitude coordinates of the corresponding calibration point group:

[0073] If the loss value is less than or equal to the preset loss threshold, it is determined that the initial calibration data meets the requirements, and the initial calibration data is used as the camera calibration data;

[0074] If the loss value is greater than a preset loss threshold, it is determined that there are calibration points with positioning errors in the initial calibration data, and S40 is executed.

[0075] The calibration scheme refers to a set of model parameters, which include internal and external parameters of the camera: internal parameters include focal length, principal point coordinates, distortion coefficients, and external parameters include rotation matrix and translation vector, and the position of the camera.

[0076] The intrinsic parameter matrix and extrinsic parameters of the camera are calculated and analyzed by using existing algorithms. The existing algorithms include but are not limited to the CalibrateCamera function in OpenCV and the Camera Calibrator toolbox in Matlab.

[0077] The loss value is calculated as follows: after converting the mapped longitude and latitude coordinates and the longitude and latitude coordinates of the calibration point group into plane coordinates, the difference between the converted plane coordinates is calculated as the loss value.

[0078] The setting range of the loss threshold is 20~25.

[0079] S40: Calculate the relative accuracy of each calibration point, select the calibration points whose relative accuracy is greater than the set accuracy threshold as the erroneous calibration points; delete the erroneous calibration points and execute S30; or after deleting the erroneous calibration points, add new calibration points according to S20 and then execute S30.

[0080] Relative accuracy

[0081] in,

[0082] In the formula, is the calculated latitude and longitude of the calibration point, , is the latitude and longitude of the calibration point on the map, , Indicates the absolute value of the distance between the calculated longitude and latitude of the calibration point and the longitude and latitude in the map calculated by the spherical cosine theorem (Haversine formula), Indicates the horizontal distance between the calibration point and the camera.

[0083] The accuracy threshold is determined according to the following method:

[0084] Select the camera with the smallest loss value, calculate the relative accuracy corresponding to each calibration point group of the camera, take the average value to get Ω, and use 3×Ω as the accuracy threshold. The threshold at this time is used as the accuracy threshold for all cameras.

[0085] Furthermore, in order to improve the accuracy of the calibration data, the present invention also includes verifying the generated initial calibration scheme. The verification method includes a layer overlay verification method and / or a random calibration point verification method.

[0086] The layer overlay verification method specifically includes the following steps:

[0087] SA1 obtains thematic map data provided by users;

[0088] SA2 converts the latitude and longitude coordinates of the thematic map data of the video corresponding to the calibration point search area into corresponding pixel coordinates according to the generated initial calibration scheme, and generates converted pixel coordinates;

[0089] SA3 Overlays the video image and converted pixel coordinates corresponding to the calibration point search area; overlays the latitude and longitude coordinates of the map and thematic map data; determines whether there is a serious offset between the overlay of the calibration point in the video image and the overlay in the map:

[0090] If yes, it is judged that the generated initial calibration scheme is unusable and the initial calibration data contains calibration points with incorrect positioning;

[0091] If not, it is determined that the generated calibration scheme is available.

[0092] For example, some points in the thematic map data are superimposed on the edge of a house on the map, but in the video the superimposed position is on the road next to the edge of the house. This is a serious deviation.

[0093] The random calibration point verification method specifically comprises the following steps:

[0094] SC1 obtains the pixel coordinates of any position in the video screen corresponding to the search area as a verification point;

[0095] SC2 calculates the deviation between the calibration position and the actual position corresponding to the verification point according to the initial calibration scheme to see if it is greater than the deviation threshold:

[0096] If yes, it is judged that the generated initial calibration scheme is unusable and the initial calibration data contains calibration points with incorrect positioning;

[0097] If not, it is determined that the generated calibration scheme is available.

[0098] The verification point can obtain the pixel coordinates of any position on the video screen by clicking on the position.

[0099] The deviation threshold needs to be given in combination with business requirements. Generally, for a range of 500 meters, the deviation threshold is less than or equal to 50 meters; for a range of 1500 meters, the deviation threshold is less than or equal to 100 meters.

[0100] The present invention generates a number of derived calibration points from basic calibration points, and can quickly obtain more calibration point groups, and verify the correctness and accuracy of the calibration point groups obtained in this way, and eliminate points that do not meet the requirements. On the basis of ensuring the accuracy of the calibration points, calibration data that meets business needs can be quickly generated, which reduces the time for obtaining calibration data, improves the speed of camera calibration, and solves the problem of time-consuming and labor-intensive acquisition of camera calibration data. Further, by associating and splicing the basic calibration points and the number of derived calibration points, a series of calibration points with calibration errors can be quickly deleted, thereby improving the deletion efficiency. Further, by verifying the calibration scheme generated according to the number of calibration point groups, the precision and accuracy of the calibration data can be improved. The present invention uses the above-mentioned method for generating camera calibration data.

[0101] The above method for generating camera calibration data is stored in an electronic device and executed by the electronic device to generate camera calibration data. The electronic device includes but is not limited to a memory, a processor, and a network interface that can be interconnected through a system bus.

[0102] The electronic device may be a computing device such as a rack server, a blade server, a tower server or a cabinet server, etc. The electronic device may be an independent server or a server cluster composed of multiple servers.

[0103] The memory includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. The memory can be an internal storage unit of the electronic device, such as a hard disk or memory of the electronic device. The memory can also be an external storage device of the electronic device, such as a plug-in hard disk equipped on the electronic device, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. The memory can also include both the internal storage unit of the electronic device and its external storage device.

[0104] The processor may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor is generally used to control the overall operation of the electronic device, such as performing control and processing related to data interaction or communication with the electronic device. The processor is used to run the program code stored in the memory or process data, such as running the method for generating camera calibration data.

[0105] The network interface may include a wireless network interface or a wired network interface, which is generally used to establish a communication connection between the electronic device and other electronic devices. For example, the network interface is used to connect the electronic device to an external data platform through a network, and to establish a data transmission channel and a communication connection between the electronic device and the external data platform. The network may be an intranet, the Internet, a global system of mobile communications (GSM), a wideband code division multiple access (WCDMA), a 4G network, a 5G network, Bluetooth, a Wi-Fi or other wireless or wired network.

[0106] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the embodiments of the present application. The singular forms of "a", "said" and "the" used in the embodiments of the present application and the claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that, unless otherwise specified, "multiple" and "several" refer to two or more; "and / or" refers to and includes any or all possible combinations of one or more associated listed items; "first", "second", "third", etc. are only used to distinguish, rather than to describe a specific order or sequence, and cannot be understood as indicating or implying relative importance. When the above description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. In the description of the present application, for those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to the specific circumstances.

[0107] The above-mentioned embodiments only express several implementation methods of the present invention, and the description is relatively specific and detailed, but it cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, and the present invention is also intended to include these modifications and modifications.

Claims

1. A method for generating camera calibration data, characterized in that: The following steps are involved: S10: Obtaining a target object imaging area of ​​the camera and a map corresponding to the target object imaging area, determining the zero position angle of the camera according to the pixel coordinates, longitude and latitude coordinates of the target object, and the PTZ value of the camera; generating a search area in the map according to the zero position angle, wherein the search area is linked to the rotation of the camera; S21: Rotate the search area so that the target object is a calibration point Located in the center area of ​​the search area; get the calibration point The latitude and longitude coordinates on the map, and the PTZ value and pixel coordinates of the camera's corresponding camera area; the calibration point located in the center area Set as base calibration point , get the basic calibration point data = ,in, Indicates the PTZ value of the basic calibration point; Represents the pixel coordinates of the basic calibration points, Indicates the latitude and longitude coordinates of the basic calibration point; S22: Rotate the search area to make the target object mark the point Located in the non-central area of ​​the search area; get the calibration point In the PTZ value and pixel coordinates of the camera corresponding to the camera area; the calibration point located in the non-center area Set as the jth derivative calibration point , get the jth derivative calibration point data = ,in, represents the PTZ value of the j-th derived calibration point, Represents the pixel coordinates of the jth derived calibration point; repeatedly rotate the search area so that the target calibration point Located in different non-central areas, the derived calibration point group is obtained = , j∈n, n>2, and the derived calibration point group data ; S23: Based on the calibration point The basic calibration point data And its derived calibration point group data Combine several groups of calibration point data into one calibration point group data to obtain the initial calibration data ; S30: Generate an initial calibration scheme according to the initial calibration data, and obtain a pixel coordinate-longitude and latitude coordinate conversion model according to the initial calibration scheme; input the calibration point group data into the pixel coordinate-longitude and latitude coordinate conversion model to obtain the mapped longitude and latitude coordinates relative to the pixel coordinates; calculate the loss value between the mapped longitude and latitude coordinates of each calibration point and the longitude and latitude coordinates of the corresponding calibration point group: If the loss value is less than or equal to the preset loss threshold, it is determined that the initial calibration data meets the requirements, and the initial calibration data is used as the camera calibration data; If the loss value is greater than the preset loss threshold, it is determined that there are calibration points with positioning errors in the initial calibration data, and S40 is executed; S40: Calculate the relative accuracy of each calibration point, select the calibration points whose relative accuracy is greater than the set accuracy threshold as the erroneous calibration points; delete the erroneous calibration points, and execute S30.

2. The method for generating camera calibration data according to claim 1, characterized in that: The step S21 also includes obtaining basic calibration points The elevation data corresponding to the longitude and latitude coordinates: Get the elevation data corresponding to the map, according to the calibration point Filter the elevation values ​​corresponding to the longitude and latitude coordinates in the map from the elevation data , the elevation value Add basic calibration points In the data, we get = ,in, Indicates the PTZ value of the basic calibration point; Represents the pixel coordinates of the basic calibration points, Indicates the latitude and longitude coordinates of the basic calibration point, Indicates the elevation value of the basic calibration point; The corresponding derived calibration point group data = ,in, represents the PTZ value of the j-th derived calibration point, Represents the pixel coordinates of the j-th derived calibration point.

3. The method for generating camera calibration data according to claim 1 or 2, characterized in that: The step S24 is also included: S24: Based on the calibration point The basic calibration point data And its derived calibration point group data Perform associated splicing to obtain a set of calibration point data .

4. The method for generating camera calibration data according to claim 3, characterized in that: After deleting the erroneous calibration points, step S40 adds new calibration points according to steps S21 to S23, and then executes S30.

5. The method for generating camera calibration data according to claim 1, characterized in that: The relative accuracy satisfies: Relative accuracy in, In the formula, is the calculated latitude and longitude of the calibration point, , Indicates the latitude coordinates of the calibration point calculation, Indicates the longitude coordinates calculated for the calibration point; is the latitude and longitude of the calibration point on the map, , Indicates the latitude coordinate of the calibration point in the map. Indicates the longitude coordinate of the calibration point in the map. Indicates the absolute value of the distance between the calculated longitude and latitude of the calibration point and the longitude and latitude in the map calculated by the spherical cosine theorem. Indicates the horizontal distance between the calibration point and the camera.

6. The method for generating camera calibration data according to claim 1, characterized in that: The setting range of the loss threshold is 20~25.

7. The method for generating camera calibration data according to claim 1, characterized in that: The search area is a fan-shaped search area, and the fan-shaped search area rotates with the rotation of the camera, and its rotation direction is consistent with the shooting direction of the camera.

8. The method for generating camera calibration data according to any one of claims 1, 2, 4, 5, 6, and 7, characterized in that: It also includes verification of the initial calibration plan, the verification steps are as follows: SA1 obtains thematic map data provided by users; SA2 converts the latitude and longitude coordinates of the thematic map data of the video corresponding to the calibration point search area into corresponding pixel coordinates according to the generated initial calibration scheme, and generates converted pixel coordinates; SA3 superimposes the video image and the converted pixel coordinates corresponding to the calibration point search area; Overlay the longitude and latitude coordinates of the map and thematic map data; Determine whether the superposition of the calibration points in the video image is seriously offset from the superposition in the map: If yes, it is judged that the generated initial calibration scheme is unusable and the initial calibration data contains calibration points with incorrect positioning; If not, it is determined that the generated calibration scheme is available.

9. The method for generating camera calibration data according to any one of claims 1, 2, 4, 5, 6, and 7, characterized in that: It also includes verification of the initial calibration plan, the verification steps are as follows: SC1 obtains the pixel coordinates of any position in the video screen corresponding to the search area as a verification point; SC2 calculates the deviation between the calibration position and the actual position corresponding to the verification point according to the initial calibration scheme to see if it is greater than the deviation threshold: If yes, it is judged that the generated initial calibration scheme is unusable and the initial calibration data contains calibration points with incorrect positioning; If not, it is determined that the generated calibration scheme is available.

Citation Information

Patent Citations

  • Vehicle queue length measurement method based on PTZ (Pan / Tilt / Zoom) camera fast calibration

    CN102867414A

  • Automatic generation method for corresponding points of longitude and latitude coordinates and image coordinates

    CN111914048A