An automatic calibration method for dynamic camera coordinate mapping

Through the combination of SIFT algorithm and genetic algorithm, camera feature points are automatically paired and parameters are optimized, which solves the position mismatch problem caused by camera posture offset and realizes automatic calibration of dynamic camera coordinate mapping without intervention, improving efficiency and reducing costs. cost.

CN116993830BActive Publication Date: 2024-09-27GUANGZHOU FUAN DIGITAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311036498.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-17
Publication Date
2024-09-27
Estimated Expiration
2043-08-17

AI Technical Summary

Technical Problem

Existing cameras will cause attitude deviation after long-term rotation, resulting in a mismatch between the geographical location coordinates of the target and the corresponding position in the video surveillance screen. Currently, deviation correction mainly relies on manual operation, which is time-consuming, labor-intensive, and increases costs.

Method used

The automatic calibration method of dynamic camera coordinate mapping is adopted, and the SIFT algorithm is used to pair the feature points of the camera picture and the offset picture, calculate the camera parameters, use the genetic algorithm to optimize the parameters, set the weights, and realize automatic correction.

Benefits of technology

Automatic calibration of dynamic camera coordinate mapping without human intervention is realized, which improves efficiency, reduces the consumption of human resources, and reduces costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116993830B
    Figure CN116993830B
Patent Text Reader

Abstract

The present invention provides an automatic calibration method for dynamic camera coordinate mapping, comprising the following steps: S1, collecting data before and after camera offset to obtain a set of picture pairs; S2, based on the SIFT algorithm, pairing the feature points of the camera picture and the picture after offset to obtain a set of feature point pairs corresponding to different camera pictures; S3, using the feature point pair sets of all picture pairs to calculate a set of camera parameters; S4, setting weights for each group of camera parameters to obtain camera parameters for deviation correction, and realizing automatic calibration of dynamic camera coordinate mapping. The present invention adopts the above-mentioned automatic calibration method for dynamic camera coordinate mapping, does not require manual intervention, and realizes automatic calibration of dynamic camera coordinate mapping through automatic optimization of camera parameters, thereby reducing waste of human resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of video surveillance, and in particular to an automatic calibration method for dynamic camera coordinate mapping. Background Art

[0002] The spacing of the mechanical gears of the drive motor and the accuracy of the structural parts will cause errors in the preset position accuracy, and the long-term rotation of the camera will accumulate errors, causing the image in the current posture of the camera to deviate to a certain extent from the image in the original posture, changing the position of the object in the image. When the camera image is offset, the geographic coordinates of the target object will not match the corresponding position in the video surveillance image. At present, camera image correction is mainly completed by manual operation, which is time-consuming and labor-intensive, wasting a lot of human resources and increasing costs. Summary of the invention

[0003] In order to overcome the deficiencies of the prior art, the purpose of the present invention is to provide an automatic calibration method for dynamic camera coordinate mapping, which does not require human intervention and realizes automatic calibration of dynamic camera coordinate mapping through automatic optimization of camera parameters.

[0004] To achieve the above object, the present invention provides the following solution: an automatic calibration method for dynamic camera coordinate mapping, comprising the following steps:

[0005] S1, collect data before and after the camera is offset to obtain a set of picture pairs;

[0006] S2. Based on the SIFT algorithm, the feature points of the camera image and the offset image are matched to obtain a set of feature point pairs corresponding to different camera images;

[0007] S3, using the feature point pair set of all image pairs, calculate and obtain the camera parameter set;

[0008] S4. Set weights for each group of camera parameters to obtain camera parameters for deviation correction, thereby achieving automatic calibration of dynamic camera coordinate mapping.

[0009] Preferably, in step S1, the following steps are included:

[0010] S11, before collecting the data of the camera offset, set the zoom factor of the camera to Z, and obtain pictures in different directions within the 360° range of the camera to obtain a picture set T1, and then record the camera posture information corresponding to each picture to obtain a posture information set:

[0011] M={(p1,t1,z1),(p2,t2,z2),(p3,t3,z3),…,(p n ,t n ,zn )},n>0

[0012] Among them, p n is the azimuth angle corresponding to the time when the nth picture was taken, t n is the pitch angle corresponding to the time when the nth picture was taken, z n is the zoom factor corresponding to taking the nth picture;

[0013] S12, after collecting the data after the camera is offset, set the zoom factor of the camera to Z, rotate the camera to the corresponding position in M ​​according to the posture information set M, obtain the picture of the position, and obtain the picture set T2;

[0014] S13, pair the pictures in the same posture in T1 and T2 to obtain a set of picture pairs:

[0015] T={(T 11 ,T 21 ),(T 12 ,T 22 ),(T 13 ,T 23 ),…,(T 1n ,T 2n )},n>0

[0016] Among them, T 1n is the nth picture in the picture set T1, T 2n is the nth picture in the picture set T2.

[0017] Preferably, in step S2, pairing the feature points of the camera image and the offset image includes the following steps:

[0018] S21, establishing a multi-scale space and Gaussian pyramid image of the image;

[0019] S22, subtracting two Gaussian images of adjacent scales to obtain a Gaussian difference multi-scale space, and finding local extreme points;

[0020] S23, accurately locating the obtained extreme points by using a surface fitting method, and using the Hessian matrix of the Gaussian difference image to eliminate edge points and points with low contrast in the initial feature points to obtain feature points of the image.

[0021] S24. After obtaining the feature points of the image, the Euclidean distance is used as the similarity criterion of the multidimensional vector to match the two feature points, achieve pairing between the feature points, and obtain a set of feature point pairs:

[0022] P={[(x 11 ,y 11 ),(x 12 ,y 12)],[(x 21 ,y 21 ),(x 22 ,y 22 )],…,[(x n1 ,y n1 ),(x n2 ,y n2 )]},n>0

[0023] Among them, [(x n1 ,y n1 ),(x n2 ,y n2 )] is the pixel coordinate pair of the nth feature point pair.

[0024] Preferably, feature point pairing is performed on each group of pictures in the picture pair set T to obtain a feature point pair set of all picture pairs:

[0025] Ω={P1,P2,P3,…,P m},m>0

[0026] Among them, P m is the set of feature point pairs of the mth group of image pairs.

[0027] Preferably, in step S3, the camera parameters include the initial azimuth angle, initial pitch angle and initial roll angle of the camera. In order to realize the deviation correction of the camera, the parameters after the camera is offset are calculated, including the following steps:

[0028] S31. Before the camera is offset, the conversion relationship between pixel coordinates and longitude and latitude coordinates is:

[0029]

[0030] S32, after the camera is offset, the conversion relationship between pixel coordinates and longitude and latitude coordinates is:

[0031]

[0032] Among them, H (α,β,θ) is the transformation matrix related to the initial azimuth, initial pitch and initial roll, Δ1, Δ2 and Δ3 are the changes of the initial azimuth, initial pitch and initial roll respectively, (x, y) and (x′, y′) are the pixel coordinates of the same geographical location in the two pictures before and after the camera is offset, (lon, lat) and (lon′, lat′) are the plane coordinates after the conversion of (x, y) and (x′, y′).

[0033] Preferably, step S3 also includes:

[0034] S33, using a genetic algorithm or other algorithm to find the optimal solution, calculate the optimal solution of the three variables (Δ1, Δ2, Δ3) in the conversion relationship between the pixel coordinates after the camera is offset and the longitude and latitude coordinates, and calculate the camera parameter set according to the feature point pair set P, including the following steps:

[0035] S331. Set a threshold I and use Loss as the loss function:

[0036]

[0037] S332, if Loss ≥ I, repeat step S33 to obtain the optimal solution;

[0038] S333, if Loss < I, obtain the corresponding camera parameters X = {a, b, c}, where a = α + Δ1, b = β + Δ2, c = θ + Δ3;

[0039] S34, perform step S33 on the feature point pair set Ω of all the image pairs to obtain the camera parameter set K = {X1, X2, X3, ..., X m}, m>0, loss function value set L={Loss1, Loss2,…, Loss m},m>0;

[0040] Among them, X m is the camera parameter of the mth group of images, Loss m is the loss function value of the mth group of image pairs.

[0041] Preferably, in step S4, in order to reduce the impact of strong winds and foggy weather conditions, a weight W is set for each set of optimized camera parameters. m :

[0042]

[0043] Among them, i is the total number of loss function value sets;

[0044] According to the weight of each group of camera parameters, the camera parameters X′=(A, B, C) used for correction are calculated as follows:

[0045]

[0046] Among them, A, B, and C are the initial azimuth, initial pitch, and initial roll angles after the camera is corrected. m ,b m ,c m ) is the camera parameter corresponding to the mth group of pictures.

[0047] Preferably, after the camera is corrected, the conversion relationship between pixel coordinates and latitude and longitude coordinates is:

[0048]

[0049] The operations from step S1 to step S4 are performed once every certain period of time to achieve automatic calibration of the dynamic camera coordinate mapping.

[0050] Therefore, the present invention adopts the above-mentioned automatic calibration method of dynamic camera coordinate mapping, which does not require human intervention and realizes automatic calibration of dynamic camera coordinate mapping through automatic optimization of camera parameters. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0052] Figure 1 A principle flow chart of an automatic calibration method for dynamic camera coordinate mapping provided by the present invention. DETAILED DESCRIPTION

[0053] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0054] The purpose of the present invention is to provide an automatic calibration method for dynamic camera coordinate mapping, which does not require human intervention and realizes automatic calibration of dynamic camera coordinate mapping through automatic optimization of camera parameters.

[0055] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0056] Figure 1 The present invention is an automatic calibration method for dynamic camera coordinate mapping, such as Figure 1 As shown, the present invention provides an automatic calibration method for dynamic camera coordinate mapping, comprising the following steps:

[0057] S1, collect data before and after the camera is offset to obtain a set of picture pairs;

[0058] In step S1, the following steps are specifically included:

[0059] S11, before collecting the data of the camera offset, set the zoom factor of the camera to Z, and obtain pictures in different directions within the 360° range of the camera to obtain a picture set T1, and then record the camera posture information corresponding to each picture to obtain a posture information set:

[0060] M={(p1,t1,z1),(p2,t2,z2),(p3,t3,z3),…,(p n ,t n ,z n )},n>0

[0061] Among them, p n is the azimuth angle corresponding to the time when the nth picture was taken, t n is the pitch angle corresponding to the time when the nth picture was taken, z n is the zoom factor corresponding to taking the nth picture;

[0062] S12, after collecting the data after the camera is offset, set the zoom factor of the camera to Z, rotate the camera to the corresponding position in M ​​according to the posture information set M, obtain the picture of the position, and obtain the picture set T2;

[0063] S13, pair the pictures in the same posture in T1 and T2 to obtain a set of picture pairs:

[0064] T={(T 11 ,T 21 ),(T 12 ,T 22 ),(T 13 ,T 23 ),…,(T 1n ,T 2n )},n>0

[0065] Among them, T 1n is the nth picture in the picture set T1, T 2n is the nth picture in the picture set T2.

[0066] S2. Based on the SIFT algorithm, the feature points of the camera image and the offset image are matched to obtain a set of feature point pairs corresponding to different camera images;

[0067] In step S2, the pairing of feature points of the camera image and the offset image includes the following steps:

[0068] S21, establishing a multi-scale space and Gaussian pyramid image of the image;

[0069] S22, subtracting two Gaussian images of adjacent scales to obtain a Gaussian difference multi-scale space, and finding local extreme points;

[0070] S23, accurately locating the obtained extreme points by a surface fitting method, and using the Hessian matrix of the Gaussian difference image to eliminate edge points and points with low contrast in the initial feature points to obtain feature points of the image;

[0071] S24. After obtaining the feature points of the image, the Euclidean distance is used as the similarity criterion of the multidimensional vector to match the two feature points, achieve pairing between the feature points, and obtain a set of feature point pairs:

[0072] P={[(x 11 ,y 11 ),(x 12 ,y 12 )],[(x 21 ,y 21 ),(x 22 ,y 22 )],…,[(x n1 ,y n1 ),(x n2 ,y n2 )]},n>0

[0073] Among them, [(x n1 ,y n1 ),(x n2 ,y n2 )] is the pixel coordinate pair of the nth feature point pair;

[0074] Pair the feature points of each group of pictures in the picture pair set T to obtain the feature point pair set of all picture pairs:

[0075] Ω={P1,P2,P3,…,P m},m>0

[0076] Among them, P m is the set of feature point pairs of the mth group of image pairs.

[0077] S3, using the feature point pair set of all image pairs, calculate and obtain the camera parameter set;

[0078] In step S3, the camera parameters include the initial azimuth angle, initial pitch angle and initial roll angle of the camera. In order to realize the deviation correction of the camera, the parameters of the camera after offset are calculated, including the following steps:

[0079] S31. Before the camera is offset, the conversion relationship between pixel coordinates and longitude and latitude coordinates is:

[0080]

[0081] S32, after the camera is offset, the conversion relationship between pixel coordinates and longitude and latitude coordinates is:

[0082]

[0083] Among them, H (α,β,θ) is the transformation matrix related to the initial azimuth, initial pitch and initial roll, Δ1, Δ2 and Δ3 are the changes of the initial azimuth, initial pitch and initial roll respectively, (x, y) and (x′, y′) are the pixel coordinates of the same geographical location in the two pictures before and after the camera is offset, (lon, lat) and (lon′, lat′) are the plane coordinates after the conversion of (x, y) and (x′, y′).

[0084] In addition, step S3 also includes:

[0085] S33, using a genetic algorithm or other algorithm to find the optimal solution, calculate the optimal solution of the three variables (Δ1, Δ2, Δ3) in the conversion relationship between the pixel coordinates after the camera is offset and the longitude and latitude coordinates, and calculate the camera parameter set according to the feature point pair set P, including the following steps:

[0086] S331. Set a threshold I and use Loss as the loss function:

[0087]

[0088] S332, if Loss ≥ I, repeat step S33 to obtain the optimal solution;

[0089] S333, if Loss < I, obtain the corresponding camera parameters X = {a, b, c}, where a = α + Δ1, b = β + Δ2, c = θ + Δ3;

[0090] S34, perform step S33 on the feature point pair set Ω of all the image pairs to obtain the camera parameter set K = {X1, X2, X3, ..., X m}, m>0, loss function value set L={Loss1, Loss2,…, Loss m},m>0;

[0091] Among them, X m is the camera parameter of the mth group of pictures, Loss m is the loss function value of the mth group of image pairs.

[0092] S4. Setting weights for each group of camera parameters to obtain camera parameters for deviation correction, thereby achieving automatic calibration of dynamic camera coordinate mapping;

[0093] In step S4, in order to reduce the impact of strong winds and foggy weather, a weight W is set for each set of optimized camera parameters. m :

[0094]

[0095] Among them, i is the total number of loss function value sets;

[0096] According to the weight of each group of camera parameters, the camera parameters X′=(A, B, C) used for correction are calculated as follows:

[0097]

[0098] Among them, A, B, and C are the initial azimuth, initial pitch, and initial roll angles after the camera is corrected. m ,b m ,c m ) is the camera parameter corresponding to the mth group of pictures;

[0099] After the camera is corrected, the conversion relationship between pixel coordinates and longitude and latitude coordinates is:

[0100]

[0101] The operations from step S1 to step S4 are performed once every certain period of time to achieve automatic calibration of the dynamic camera coordinate mapping.

[0102] Therefore, the present invention adopts the above-mentioned automatic calibration method of dynamic camera coordinate mapping, which does not require human intervention and realizes automatic calibration of dynamic camera coordinate mapping through automatic optimization of camera parameters.

[0103] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0104] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of ​​the present invention. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. An automatic calibration method for dynamic camera coordinate mapping, characterized in that: The following steps are involved: S1, collect data before and after the camera is offset to obtain a set of picture pairs; S2. Based on the SIFT algorithm, the feature points of the camera image and the offset image are matched to obtain a set of feature point pairs corresponding to different camera images; S3, using the feature point pair set of all image pairs, calculate and obtain the camera parameter set; In step S3, the camera parameters include the initial azimuth angle, initial pitch angle and initial roll angle of the camera. In order to realize the deviation correction of the camera, the parameters of the camera after offset are calculated, including the following steps: S31. Before the camera is offset, the conversion relationship between pixel coordinates and longitude and latitude coordinates is: ; S32, after the camera is offset, the conversion relationship between pixel coordinates and longitude and latitude coordinates is: ; in, is the transformation matrix related to the initial azimuth, initial pitch and initial roll angles, are the changes of initial azimuth, initial pitch and initial roll angles, respectively. and are the pixel coordinates of the same geographic location in two pictures before and after the camera is offset. and They are and The transformed plane coordinates; The step S3 also includes: S33, using a genetic algorithm to calculate the pixel coordinates after the camera is offset and the conversion relationship between the longitude and latitude coordinates The optimal solution of the three variables is based on the set of feature points , calculate the camera parameter set, including the following steps: S331. Set a threshold I ,by Loss As a loss function: ; S332, if Loss , then repeat step S33 to obtain the optimal solution; S333, if Loss < I , get the corresponding camera parameters ,in, , , ; S34. Collect all feature point pairs of all image pairs Go to step S33 to obtain the camera parameter set , loss function value set ; in, For the m The camera parameters of the group image pair, For the m The loss function value of the group image pair; S4. Setting weights for each group of camera parameters to obtain camera parameters for deviation correction, thereby achieving automatic calibration of dynamic camera coordinate mapping; In step S4, in order to reduce the impact of strong winds and foggy weather conditions, weights are set for each set of optimized camera parameters. : ; in, i is the total number of loss function value sets; According to the weight of each group of camera parameters, the camera parameters used for correction are calculated. , calculated as follows: ; in, A , B , C They are the initial azimuth, initial pitch and initial roll angles after camera correction. For the m The camera parameters corresponding to the group picture pair; After the camera is corrected, the conversion relationship between pixel coordinates and longitude and latitude coordinates is: ; The operations from step S1 to step S4 are performed once every certain period of time to achieve automatic calibration of the dynamic camera coordinate mapping.

2. The automatic calibration method for dynamic camera coordinate mapping according to claim 1, characterized in that: In step S1, the following steps are included: S11. Before collecting the data of the camera offset, set the zoom factor of the camera to Z , and obtain pictures of different directions within the 360° range of the camera to obtain a picture collection T 1. Then record the camera posture information corresponding to each picture to obtain the posture information set: ; in, For shooting n The azimuth corresponding to the image is For shooting n The corresponding pitch angle when taking the picture, For shooting n The corresponding zoom factor when the image is displayed; S12, after collecting the data of the camera offset, set the zoom factor of the camera to Z , according to the posture information set M , turn the camera to M Get the corresponding position in the image, and get the image collection T 2; S13. T 1 and T Pair the pictures in the same posture in 2 to get a set of picture pairs: ; in, For picture collection T 1 of 1 n pictures, For picture collection T 2 of 2 n pictures.

3. The automatic calibration method for dynamic camera coordinate mapping according to claim 1, characterized in that: In step S2, pairing the feature points of the camera image and the offset image includes the following steps: S21, establishing a multi-scale space and Gaussian pyramid image of the image; S22, subtracting two Gaussian images of adjacent scales to obtain a Gaussian difference multi-scale space, and finding local extreme points; S23, accurately locating the obtained extreme points by a surface fitting method, and using the Hessian matrix of the Gaussian difference image to eliminate edge points and points with low contrast in the initial feature points to obtain feature points of the image; S24. After obtaining the feature points of the image, the Euclidean distance is used as the similarity criterion of the multidimensional vector to match the two feature points, achieve pairing between the feature points, and obtain a set of feature point pairs: ; in, For the n The pixel coordinate pairs of feature point pairs.

4. The automatic calibration method for dynamic camera coordinate mapping according to claim 3, characterized in that: Group pictures together T Pair the feature points of each group of pictures in to get the set of feature point pairs of all picture pairs: ; in, For the m A set of feature point pairs for a group of images.