Master-slave camera tracking automatic calibration method

By automatically acquiring image pairs and solving the mapping matrix using SIFT and RANSAC algorithms, the problems of insufficient accuracy and cumbersome operation in the calibration of wide-angle cameras and PTZ cameras are solved, realizing an efficient and automated calibration process.

CN115731299BActive Publication Date: 2026-05-12INGENIC SEMICON CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INGENIC SEMICON CO LTD
Filing Date
2021-09-02
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing calibration methods for wide-angle cameras and PTZ cameras suffer from problems such as large edge tracking position deviations and cumbersome manual data acquisition, resulting in poor calibration results.

Method used

The SIFT algorithm is used to automatically acquire image pairs and RANSAC is used to estimate the homography matrix. The least squares method is then used to solve the mapping matrix to achieve an automated calibration process.

Benefits of technology

It improves calibration accuracy, reduces the tedious process of manual data collection, and achieves efficient and automated master-slave camera calibration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115731299B_ABST
    Figure CN115731299B_ABST
Patent Text Reader

Abstract

This invention provides an automatic calibration method for master-slave camera tracking, comprising: S1 Initializing device state: manually controlling the PTZ camera to place the center of the PTZ camera image within the center range of the wide-angle camera image; S2 Data acquisition: the algorithm automatically controls the PTZ camera, simultaneously acquiring images from both the PTZ and wide-angle cameras and the P and T values ​​of the PTZ camera at each position, and saving them as a set of image pairs; S3 Data matching: using the SIFT matching algorithm to match the image pairs acquired in step S2, estimating the homography matrix of each image pair using the RANSAC method based on the matching results, and then solving for the coordinates u and v of the PTZ camera image center point corresponding to the wide-angle camera image; at this point, the PTZ camera P and T values ​​and u and v are matched to form a data pair (u... i v i P i T i ), n>6; S4 performs coordinate mapping solution: establish a geometric space model, and after solving, finally solve for the coordinate rotation matrix R.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent video processing technology, and in particular to an automatic calibration method for master-slave camera tracking. Background Technology

[0002] With the development of computer technology and the widespread application of computer vision principles, the use of computer image processing technology to detect and track targets in real time has become increasingly popular.

[0003] With the continuous development of panoramic imaging technology in recent years, wide-angle cameras are increasingly widely used in security monitoring, driver assistance, on-site inspection, and vehicle inspection. The combined application of wide-angle cameras with other monitoring equipment greatly improves the observation effect and meets monitoring requirements. Wide-angle and PTZ master-slave cameras consist of two parts: a wide-angle camera and a PTZ camera. Wide-angle cameras have the ability to monitor large scenes, but their resolution is too low and the effect is poor when observing local scenes. PTZ cameras have the ability to quickly locate and zoom, but their limited field of view cannot cover multiple scenes simultaneously. Master-slave cameras combine the advantages of both, enabling both overall monitoring and local observation, thus achieving the best monitoring effect.

[0004] To achieve coordinated control between the wide-angle camera and the PTZ camera, a mapping relationship between the two cameras needs to be established. This allows the PTZ camera to accurately capture the target of interest from the wide-angle camera image by obtaining the location of the target of interest in the wide-angle camera image.

[0005] To obtain the mapping relationship between the wide-angle camera and the PTZ camera, existing technologies use geometric mapping calibration methods to calibrate the master and slave cameras. This involves rotating the PTZ camera to the center of the wide-angle camera's image, making the centers of both the wide-angle and PTZ cameras the same target. The P0 and T0 values ​​of the PTZ camera and the u0 and v0 values ​​of the wide-angle camera are recorded. Then, the deviation values ​​of any point in the wide-angle camera from u0 and v0 can be obtained. By converting these values ​​using the field of view, the corresponding P and T values ​​under the PTZ camera can be obtained. This allows the PTZ camera to be controlled to rotate to the target position given by the wide-angle camera.

[0006] The above method suffers from poor tracking performance due to insufficient point data leading to significant edge tracking position deviations. Another commonly used calibration method is manual calibration using data fitting. This involves first uniformly pre-setting M*N sampling points within the wide-angle camera's image, then controlling the PTZ camera so that the center of the PTZ camera's image aligns with each sampling point and recording the P and T values. Then, the P and T values ​​of the PTZ camera corresponding to any point within the wide-angle camera can be obtained using bilinear interpolation.

[0007] Therefore, the shortcomings of the existing technology are:

[0008] 1. The center point geometric calibration method suffers from image distortion, which leads to a greater deviation from the center of the wide-angle camera the further away from the image.

[0009] 2. The bilinear interpolation method based on data fitting requires a certain number of sampling points to be collected manually, and the whole operation process is cumbersome and not conducive to practical use.

[0010] In addition, the following are commonly used terms in the prior art:

[0011] 1. PTZ camera: PTZ is short for Pan / Tilt / Zoom, which means that the camera's pan / tilt head can move in all directions (left / right / up / down) and the lens can zoom and zoom. It is mainly used in security monitoring.

[0012] 2. Wide-angle camera: A camera equipped with a wide-angle lens. A wide-angle lens is a photographic lens with a shorter focal length than a standard lens, a wider angle of view than a standard lens, a longer focal length than a fisheye lens, and a narrower angle of view than a fisheye lens. Wide-angle lenses are further divided into ordinary wide-angle lenses and ultra-wide-angle lenses.

[0013] 3. SIFT: Scale Invariant Feature Transform, is a descriptor used in image processing. This descriptor is scale invariant and can detect key points in an image; it is a local feature descriptor.

[0014] 4. RANSAC: RANSAC stands for Random Sample Consensus. It is an algorithm that calculates the mathematical model parameters of a dataset containing outliers to obtain valid sample data. It was first proposed by Fischler and Bolles in 1981. The RANSAC algorithm is frequently used in computer vision. For example, in stereo vision, it simultaneously solves the problem of matching points between a pair of cameras and calculating the fundamental matrix.

[0015] 5. Spherical coordinate system: A spherical coordinate system is a three-dimensional orthogonal coordinate system that uses spherical coordinates to represent the position of a point p in three-dimensional space.

[0016] 6. Camera image coordinate system: Unit pixels are represented by u and v on the horizontal and vertical axes, respectively, with the origin at the top left of the image.

[0017] 7. Camera image plane coordinate system: unit is millimeter, using physical units to represent the position of image pixels, defining a coordinate system OXY, with the origin O defined at the intersection of the camera and the image plane.

[0018] 8. Camera coordinate system: unit millimeters, with the optical center of the camera as the origin, the Zc axis coincides with the optical axis and is perpendicular to the imaging plane, and the shooting direction is taken as the positive direction, Xc and Yc axes.

[0019] 9. World coordinates: Determined by the specific circumstances, this coordinate system describes the position of any object in the environment and follows the right-hand rule.

[0020] 10. Least Squares Method: The least squares method (also known as the least squares method) is a mathematical optimization technique. It finds the best function match for data by minimizing the sum of squares of the errors. The least squares method can be used to easily obtain unknown data while minimizing the sum of squares of the errors between the obtained data and the actual data.

[0021] 11. Homography Matrix: Simply put, it describes the positional mapping relationship between an object in the world coordinate system and the pixel coordinate system. The corresponding transformation matrix is ​​called the homography matrix. Summary of the Invention

[0022] To address the problems in the prior art, the purpose of this application is to provide an automated calibration process, a method for solving the mapping matrix (i.e., a method for solving the homography matrix using SI FT), an automatic image pair acquisition method, and a method for obtaining the correspondence between the center points of wide-angle and PTZ camera images using RANSAC.

[0023] Specifically, the present invention provides an automatic calibration method for master-slave camera tracking, the method comprising the following steps:

[0024] S1, Initialize device status: Enable manual control of the PTZ camera to place the center of the PTZ camera image onto the center of the wide-angle camera image;

[0025] S2, Data Acquisition Module: The algorithm automatically controls the PTZ camera. When the PTZ camera reaches a certain position, it will simultaneously acquire images from the PTZ camera and the wide-angle camera, as well as the P and T values ​​of the PTZ camera, and save them as a set of image pairs. This module needs to acquire at least n pairs of images, where n>6.

[0026] S3, Data Matching Module: The SIFT matching algorithm is used to match the image pairs acquired in step S2. Based on the matching results, the RANSAC method is used to estimate the homography matrix of each image pair, and then the coordinates u and v of the center point coordinates of the PTZ camera image in the wide-angle camera image are calculated. At this time, the PTZ camera P and T and u and v are matched to form the acquired data pairs (u... i v i P i T i ),in

[0027] S4, Coordinate Mapping Solution Module: Establishes a geometric space model, where the wide-angle camera is positioned at O... w Using a three-dimensional rectangular coordinate system with the origin as the origin, the coordinate rotation matrix R is finally obtained after solving the problem.

[0028] Step S4 further includes:

[0029] Let the coordinates of point P in a three-dimensional rectangular coordinate system be (X, X). w Y w Z w Point P is located at the center of the PTZ camera O. p The coordinates in a spherical coordinate system with the origin at (ρ, θ, β) are assumed to be (ρ, θ, β). Assume the origin of the wide-angle camera is O. w and the origin O of the PTZ camera spherical coordinate system p The distance is small enough, much smaller than ρ, then the point (X) in the wide-angle camera coordinate system w Y w Z w The correspondence between the PTZ camera spherical coordinate system (ρ, θ, β) and its corresponding PTZ camera spherical coordinate system is as follows:

[0030]

[0031] Where R is the coordinate rotation matrix Image plane of wide-angle camera to center O of wide-angle camera w The distance is the focal length f of the wide-angle camera, and the point (X) w Y w Z w The coordinates of the imaging point on the image plane are (x*, y*), which are also the projections of the center of the pan-tilt camera onto that plane; (x*, y*) and (X... w Y w Z w The relationship is as follows:

[0032]

[0033] Substituting equation (2) into equation (1), we get:

[0034]

[0035]

[0036] The origin of the wide-angle camera's image coordinate system is located at the top left corner of the image. The pixel sizes of the wide-angle camera are dx and dy, and the coordinates of the origin of the wide-angle camera's image plane coordinate system are u0 and v0. Therefore, (x*, y*) can be represented as:

[0037]

[0038] Substituting equation (4) into equation (3), we get:

[0039]

[0040]

[0041]

[0042] For ease of representation, equation (5) can be simplified to obtain the following simplified formula:

[0043] A = R -1 ,

[0044]

[0045]

[0046] AX = Y (6);

[0047] Based on the data obtained in step S3, equation (6) can be solved using the least squares method. For ease of solving, equation (6) can be rewritten as follows:

[0048] X′A′=Y′ (7);

[0049] The solution can be obtained using the least squares method:

[0050] A′=(X′TX′) -1 X′ T Y′ formula (8);

[0051] Equation (8) can be expanded into the following form:

[0052]

[0053] Substitute n sets of data, where n>6, into equation (9) to finally solve for the coordinate rotation matrix R.

[0054] In step S1, the PTZ camera is manually controlled to place the center of the PTZ camera image within the center range of the wide-angle camera image, preferably with the two centers overlapping.

[0055] In step S2, the algorithm automatically controls the PTZ camera to ensure that the PTZ camera's image evenly covers the wide-angle camera's image.

[0056] In step S3, the SIFT matching algorithm matches the image pairs acquired in step S2, and further includes:

[0057] a) Scale-space extremum detection: Search for image locations at all scales and identify potential scale- and rotation-invariant points of interest using a Gaussian differential function;

[0058] b) Key point localization: At each candidate location, the position and scale of the key point are accurately determined by fitting a three-dimensional quadratic function, while removing low-contrast key points and unstable edge response points;

[0059] c) Orientation determination: Based on the gradient orientation of the local image, one or more orientations are assigned to each keypoint location; all subsequent operations on the image data are transformed relative to the orientation, scale, and position of the keypoints, thus providing invariance to these transformations;

[0060] d) Keypoint description: Measure the local gradient of the image at a selected scale within the neighborhood around each keypoint.

[0061] In step S3, the homography matrix of each image pair is estimated using the RANSAC method based on the matching results. The RANSAC algorithm achieves its goal by repeatedly selecting a random subset of the data. The selected subset is assumed to be inliers and is verified using the following method:

[0062] 1) It is suitable for the homography matrix model of the assumed inliers, that is, all unknown parameters can be calculated from the assumed inliers;

[0063] 2) Use the model obtained in 1) to test all other data. If a point fits the estimated model, it is considered an inlier.

[0064] 3) If enough points are classified as assumed inliers, then the estimated model is reasonable enough.

[0065] 4) Then, re-estimate the model using all the assumed inliers, since it has only been estimated by the initial assumed inliers.

[0066] 5) Finally, the model is evaluated by estimating the error rate of the in-place points and the model.

[0067] This process is repeated a fixed number of times, and each time the generated model is either discarded because it has too few inliers or selected because it is better than the existing models.

[0068] Therefore, the advantage of this application is that it proposes a new master-slave camera calibration method that can achieve automatic calibration, which can solve the problem of poor accuracy caused by insufficient sampling points and reduce the tedious process of manually collecting data during calibration. Attached Figure Description

[0069] The accompanying drawings, which are provided to further illustrate the invention and form part of this application, are not intended to limit the scope of the invention.

[0070] Figure 1 This is a flowchart of the method of the present invention.

[0071] Figure 2 This is a schematic diagram of the electric vehicle detection system in an embodiment of the present invention.

[0072] Figure 3 This is a schematic diagram showing the result of matching the acquired image pairs using the SIFT matching algorithm of this invention.

[0073] Figure 4(1) is a schematic diagram of the center of the PTZ camera image.

[0074] Figure 4(2) is a schematic diagram of the corresponding points in the wide-angle camera image.

[0075] Figure 5 This is a schematic diagram of establishing a geometric space model in the coordinate mapping solution module of this invention. Detailed Implementation

[0076] To better understand the technical content and advantages of the present invention, the present invention will now be described in further detail with reference to the accompanying drawings.

[0077] like Figure 1 As shown, the method of this application relates to an automatic calibration method for master-slave camera tracking, the method comprising the following steps:

[0078] S1, Initialize device status: Enable manual control of the PTZ camera to place the center of the PTZ camera image onto the center of the wide-angle camera image;

[0079] S2, Data Acquisition Module: The algorithm automatically controls the PTZ camera. When the PTZ camera reaches a certain position, it will simultaneously acquire images from the PTZ camera and the wide-angle camera, as well as the P and T values ​​of the PTZ camera, and save them as a set of image pairs. This module needs to acquire at least n pairs of images, where n>6.

[0080] S3, Data Matching Module: The SIFT matching algorithm is used to match the image pairs acquired in step S2 (matching results are attached). Figure 3 Based on the matching results, the RANSAC method is used to estimate the homography matrix of each image pair, and then the coordinates u and v of the center point of the PTZ camera image in the wide-angle camera image are solved (see Figure 4(1) and Figure 4(2) for the coordinate point correspondence); at this time, the PTZ camera P, T and u, v are matched to form the acquisition data pair (u i v i P i Ti ),in

[0081] S4, Coordinate Mapping Solution Module: Establishing the Geometric Space Model (see...) Figure 5 ), of which the wide-angle camera is O w Using a three-dimensional rectangular coordinate system with the origin as the origin, the coordinate rotation matrix R is finally obtained after solving the problem.

[0082] For ease of understanding, the method described in this application can also be described as follows:

[0083] like Figure 2 As shown, the process of this application can also be briefly described as follows:

[0084] From the beginning, through initializing the device state, performing data acquisition, data matching, and coordinate mapping solutions, to the end.

[0085] Furthermore, this method includes:

[0086] 1. Initialize device status: The main function of this module is to manually control the PTZ camera so that the center of the PTZ camera image is approximately near the center of the wide-angle camera image.

[0087] 2. Data Acquisition Module: The algorithm automatically controls the PTZ camera so that the PTZ camera's image can evenly traverse the wide-angle camera's image. When the PTZ camera reaches a position, it will simultaneously acquire the images from both the PTZ camera and the wide-angle camera, as well as the P and T values ​​of the PTZ camera, and save them as a set of image pairs. This module needs to acquire at least n (n>6) pairs of images.

[0088] 3. Data Matching Module: The SIFT matching algorithm is used to match the image pairs acquired in step 2 (matching results are attached). Figure 3 SIFT (Scale Invariant Feature Transform) is a local feature description algorithm in image processing that extracts feature points from an image. The simplified process is as follows: 1) Detect scale-space extrema; 2) Accurately locate extrema points; 3) Assign orientation parameters to each keypoint; 4) Generate keypoint descriptors. Then, a matching algorithm is used to match the extracted feature points to find matching points between two images. (See appendix.) Figure 3 The two endpoints connected by each line are the matching points on the two graphs.

[0089] Based on the matching results, the homography matrix of each image pair is estimated using the RANSAC method. Then, the coordinates u and v of the center point of the PTZ camera image in the wide-angle camera image are calculated (see Figure 4(1) and Figure 4(2) for the coordinate point correspondence). At this point, the P and T coordinates of the PTZ camera and u and v can be matched to form a data acquisition pair (u i v i P i T i ) RANSAC (Random Sampling Consensus) iteratively estimates the parameters of a mathematical model from a set of observed data containing outliers. Specifically, the input to RANSAC is a set of observed data, a parameterized model that can interpret or adapt to the observed data, and some reliable parameters. RANSAC achieves its goal by repeatedly selecting a random subset of the data. The selected subset is assumed to be inliers and verified using the following method:

[0090] 1) First, we randomly assume a small set of in-place points as initial values. Then, we fit a model using these in-place points. This model is suitable for the assumed in-place points, and all unknown parameters can be calculated from the assumed in-place points.

[0091] 2). Use the model obtained in 1) to test all other data. If a point fits the estimated model, consider it an inlier and expand the inliers.

[0092] 3) If enough points are classified as the hypothetical inliers, then the estimated model is reasonable enough;

[0093] 4) Then, re-estimate the model using all the assumed inliers, because this model is only estimated using the initial assumed inliers and needs to be updated as it is expanded.

[0094] 5) Finally, the model is evaluated by estimating the error rate of the in-place points and the model.

[0095] The entire process consists of one iteration, which is repeated a fixed number of times. Each iteration produces a model with two possible outcomes:

[0096] 1) Either because there are too few in-game points, making it inferior to the previous model, it is discarded;

[0097] 2) It is selected either because it is better than existing models.

[0098] The SIFT matching algorithm yields n corresponding point pairs in two images, where a pair of points is denoted as Pa(ua,va) and Pb(ub,vb). The RANSAC algorithm is used to solve for an optimal transformation matrix from Pa to Pb, denoted as H, which is the homography matrix.

[0099] Homography transformation can be simply understood as describing the positional mapping between a point in one image and the same point in another image. The corresponding transformation matrix is ​​called the homography matrix.

[0100] 4. Coordinate Mapping Solution Module: See [link to module for establishing the geometric space model] Figure 5 Among them, the wide-angle camera is O w Let P be a three-dimensional rectangular coordinate system with the origin as its point. w Y w Z w Point P is located at the center of the PTZ camera O. p The coordinates in the spherical coordinate system with the origin at (ρ, θ, β) are assumed to be (ρ, θ, β). Assume the origin of the wide-angle camera is O. w and the origin O of the PTZ camera spherical coordinate system p The distance is small enough, much smaller than ρ, then the point (X) in the wide-angle camera coordinate system w Y w Z w The correspondence between the PTZ camera spherical coordinate system (ρ, θ, β) and its corresponding PTZ camera spherical coordinate system is as follows:

[0101]

[0102] Where R is the coordinate rotation matrix

[0103] The distance from the image plane of the wide-angle camera to the center Ow of the wide-angle camera is the focal length f of the wide-angle camera, and the point (X) w Y w Z w The coordinates of the imaging point on the image plane are (x*, y*), where, for example... Figure 5 As shown, O* is the optical center of the image plane of the fixed camera, and also the projection of the center of the pan-tilt camera onto that plane. (x*, y*) and (X w Y w Z w The relationship is as follows:

[0104]

[0105] Substituting equation (2) into equation (1), we get:

[0106]

[0107]

[0108] The origin of the wide-angle camera's image coordinate system is located at the top left corner of the image. The pixel sizes of the wide-angle camera are dx and dy, and the coordinates of the origin of the wide-angle camera's image plane coordinate system are u0 and v0. Therefore, (x*, y*) can be represented as:

[0109]

[0110] Substituting equation (4) into equation (3), we get:

[0111]

[0112]

[0113]

[0114] For ease of representation, equation (5) can be simplified to obtain the following simplified formula:

[0115] A = R -1

[0116]

[0117]

[0118] AX = Y (6)

[0119] Based on the data obtained from module 3, equation (6) can be solved using the least squares method. For ease of solving, equation (6) can be rewritten as follows:

[0120] X′A′=Y′ (7)

[0121] The solution can be obtained using the least squares method:

[0122] A′=(X′ T X′) -1 X′ T Y′ formula (8)

[0123] Equation (8) can be expanded into the following form:

[0124]

[0125] Substituting the n (n>6) sets of data into equation (9) will finally yield the solution for R.

[0126] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, various modifications and variations can be made to the embodiments of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for automatic calibration of master-slave camera tracking, characterized in that, The method includes the following steps: S1, Initialize device status: Enable manual control of the PTZ camera to place the center of the PTZ camera image onto the center range of the wide-angle camera image; the center range is defined as a rectangular area at the center of the image, with the center of the image as the origin; S2, Data Acquisition Module: The algorithm automatically controls the PTZ camera. The algorithm controls the PTZ camera motor to rotate at a set position, so that the PTZ camera image evenly covers the wide-angle camera's image. It controls the PTZ camera to rotate along the X and Y axes to preset points {Q1, Q2...Qn}, where Q is defined as (P, T), where P represents the rotation angle of the X-axis motor and T represents the rotation angle of the Y-axis motor. When the PTZ camera reaches a position, it simultaneously acquires the images from both the PTZ camera and the wide-angle camera, as well as the P and T values ​​of the PTZ camera, and saves them as a pair of images. This module needs to acquire at least n pairs of images, where n>6. S3, Data Matching Module: The SIFT matching algorithm is used to match the image pairs acquired in step S2. Based on the matching results, the RANSAC method is used to estimate the homography matrix of each image pair, and then the coordinates u and v of the center point coordinates of the PTZ camera image in the wide-angle camera image are calculated. At this time, the PTZ camera P and T and u and v are matched to form the acquired data pairs (u... i v i P i T i ), where i n, n>6; S4, Coordinate Mapping Solution Module: Establishes a geometric space model, where the wide-angle camera is positioned at O... w Using a three-dimensional rectangular coordinate system with the origin as the origin, the coordinate rotation matrix R is finally obtained after solving; step S4 further includes: Let the coordinates of point P in a three-dimensional rectangular coordinate system be... Point P is located at the center of the PTZ camera O. p The coordinates in a spherical coordinate system with the origin are: Assume the origin O of the wide-angle camera w and the origin O of the PTZ camera spherical coordinate system p The distance is small enough, much smaller than Then the point in the wide-angle camera coordinate system and its corresponding PTZ camera spherical coordinate system The correspondence is as follows: Equation (1); Where R is the coordinate rotation matrix , The image plane of the wide-angle camera is O from the center of the wide-angle camera. w The distance is the focal length f of the wide-angle camera, and the point... The coordinates of the imaging point on the image plane are (x*, y*), which is also the projection of the center of the pan-tilt camera onto that plane; (x*, y*) and The relationship is as follows: Equation (2); Substituting equation (2) into equation (1), we get: Equation (3); The origin of the wide-angle camera's image coordinate system is located at the top left corner of the image. The pixel sizes of the wide-angle camera are dx and dy, and the coordinates of the origin of the wide-angle camera's image plane coordinate system are u0 and v0. Therefore, (x*, y*) can be represented as: Equation (4); Substituting equation (4) into equation (3), we get: , , Equation (5); For ease of representation, equation (5) can be simplified to obtain the following simplified formula: , , , Equation (6); Based on the data obtained in step S3, equation (6) can be solved using the least squares method. For ease of solving, equation (6) can be rewritten as follows: Equation (7); The solution can be obtained using the least squares method: Equation (8); Equation (8) can be expanded into the following form: Equation (9); Substitute n sets of data, where n>6, into equation (9) to finally solve for the coordinate rotation matrix R.

2. The automatic calibration method for master-slave camera tracking according to claim 1, characterized in that, In step S1, the height of the rectangular area is 10% to 50% of the height of the screen area, and the width of the rectangular area is 10% to 50% of the width of the screen area.

3. The automatic calibration method for master-slave camera tracking according to claim 2, characterized in that, The manual control of the PTZ camera ensures that the center of the PTZ camera image falls within the center range of the wide-angle camera image, resulting in an overlap of the two centers; the image area height and image area width are both 20%.

4. The automatic calibration method for master-slave camera tracking according to claim 1, characterized in that, In step S3, the SIFT matching algorithm matches the image pairs acquired in step S2, further including: a) Scale-space extremum detection: Search for image locations at all scales and identify potential scale- and rotation-invariant interest points using a Gaussian differential function; b) Keypoint localization: At each candidate location, the position and scale of the keypoint are determined by fitting a 3D quadratic function, while removing low-contrast keypoints and unstable edge response points; c) Orientation determination: Based on the local gradient orientation of the image, one or more orientations are assigned to each keypoint location; all subsequent operations on the image data are transformed relative to the orientation, scale, and location of the keypoints, thus providing invariance to these transformations; d) Keypoint description: Measure the local gradient of the image at a selected scale within the neighborhood around each keypoint.

5. The automatic calibration method for master-slave camera tracking according to claim 1, characterized in that, In step S3, the homography matrix of each image pair is estimated using the RANSAC method based on the matching results. The RANSAC algorithm achieves its goal by repeatedly selecting a random subset of the data; the selected subset is assumed to be inliers and is verified using the following method: 1) Adaptable to the homography matrix model of assumed in-place points, i.e., all unknown parameters can be calculated from assumed in-place points; 2) Use the model obtained in 1) to test all other data. If a point fits the estimated model, it is considered an inlier. 3) If enough points are classified as the assumed inliers, then the estimated model is reasonable enough. 4) Then, re-estimate the model using all the assumed inliers, since it has only been estimated by the initial assumed inliers; 5) Finally, the model is evaluated by estimating the error rate of the in-place points and the model.