High-precision alarm positioning method and device based on PTZ (Pan / Tilt / Zoom) camera calibration

Through the observer viewpoint model and viewing analysis method of PTZ camera combined with DEM data, the high-precision positioning of PTZ camera is achieved, the complex calibration process and high labor cost are solved, and the applicability and efficiency are improved.

CN119131150APending Publication Date: 2024-12-13WUHAN UNIV

Patent Information

Application Number
CN202411058786.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-02
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

The calibration process of existing PTZ cameras is complicated and labor costs are high. The camera preset point needs to be recalibrated after changing, which affects the actual use efficiency.

Method used

The observer viewpoint model and viewing analysis method based on PTZ camera are adopted, combined with DEM data, and the mutual conversion of spatial coordinates and frame coordinates is achieved through a small number of measurement control points, and the altitude of the alarm point is estimated.

Benefits of technology

The PTZ camera calibration process is simplified, labor costs are reduced, calibration accuracy and applicability are improved, and it can quickly adapt when the camera preset point changes, reducing the need for recalibration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119131150A_ABST
    Figure CN119131150A_ABST
Patent Text Reader

Abstract

The invention relates to an alarm high-precision positioning method and device based on PTZ camera calibration. The method comprises the steps of obtaining pixel coordinates of a point to be corrected, external parameters of a PTZ camera and internal parameters of the PTZ camera; based on a preset observer viewpoint model, the external parameters of the PTZ camera and the internal parameters of the PTZ camera, converting the pixel coordinates of the to-be-corrected point into geographic coordinates of the to-be-corrected point; and on the basis of a preset intervisibility analysis method, performing DEM intervisibility positioning and coordinate correction on the geographic coordinates of the to-be-corrected point by combining the external parameters of the PTZ camera, the internal parameters of the PTZ camera and the DEM data to obtain the actual coordinates of the to-be-corrected point. Therefore, the pixel coordinates are converted into the corresponding geographic coordinates through the preset observer viewpoint model and are corrected, mutual conversion between the space coordinates and the frame coordinates is achieved only through a small number of measurement control points, and higher applicability is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer vision and remote sensing, and in particular to a high-precision alarm positioning method and device based on PTZ camera calibration. Background Art

[0002] PTZ camera (Pan-Tilt-Zoom Camera) is a device widely used in monitoring, security and other fields. It has pan, tilt and zoom functions, and can achieve flexible coverage of the monitoring area. In order to ensure that the PTZ camera can accurately capture images and restore scenes, calibration is particularly important. The goal of calibration is to determine the internal parameters of the camera (such as focal length, optical center position and lens distortion coefficient) and external parameters (the position and orientation of the camera in space). The acquisition of these parameters can reduce geometric distortion and distortion in the image, improve the accuracy of the image, and lay the foundation for subsequent high-precision positioning work. In the actual calibration process, images of the camera at different positions and viewing angles are usually collected, and specific calibration templates (such as chessboards) or natural feature points are used to perform initial estimation and optimization of parameters. With the parameter changes caused by the zoom function and the consistency requirements of calibration accuracy for large-scale movements, PTZ camera calibration has certain difficulties.

[0003] In the related art, usually based on the calibration of fixed PTZ values ​​(preset points), all calculations need to be completed under the currently determined picture.

[0004] However, the calibration process in the above technical means requires finding corresponding points of the same name on the video and the map image. The operation is complicated, requires stronger professional knowledge, has high labor costs, and the camera preset points need to be recalibrated after changing, which is not conducive to practical use and needs to be solved urgently. Summary of the invention

[0005] The present invention provides a high-precision alarm positioning method and device based on PTZ camera calibration to solve the problems of complicated operation and high labor cost caused by fixed PTZ value calibration in related technologies. Only a small number of measurement control points are used to realize the mutual conversion between spatial coordinates and frame coordinates, which has higher applicability. On the basis of combining DEM data, the altitude of the location of the alarm point can be further calculated.

[0006] To achieve the above object, the first embodiment of the present invention proposes a high-precision alarm positioning method based on PTZ camera calibration, comprising the following steps:

[0007] Obtain the pixel coordinates of the point to be corrected, the external parameters of the PTZ camera, and the internal parameters of the PTZ camera;

[0008] Based on a preset observer viewpoint model, external parameters of the PTZ camera, and internal parameters of the PTZ camera, converting the pixel coordinates of the point to be corrected into the geographic coordinates of the point to be corrected;

[0009] Based on a preset line-of-sight analysis method, the DEM line-of-sight positioning and coordinate correction are performed on the geographic coordinates of the point to be corrected in combination with the external parameters of the PTZ camera, the internal parameters of the PTZ camera and the DEM data to obtain the actual coordinates of the point to be corrected.

[0010] According to one embodiment of the present invention, the external parameters of the PTZ camera include azimuth and pitch angles, and the internal parameters of the PTZ camera include focal length, field of view angle, and image distortion;

[0011] The azimuth is the angle formed by rotating clockwise from east to south to west with the north as the starting point of 0°;

[0012] The pitch angle is the angle between the Z axis of the PTZ camera coordinate system and the horizontal plane.

[0013] According to an embodiment of the present invention, the step of obtaining external parameters of a PTZ camera includes:

[0014] Adjusting the PTZ camera to a preset horizontal state;

[0015] Determine the position coordinates and geographic orientation of the control point relative to the PTZ camera, and calculate the spherical distance between the control point and the PTZ camera;

[0016] Obtaining the angle between the line of sight of the PTZ camera and the geographical north direction when the horizontal azimuth angle is 0°, and calculating the azimuth angle according to the geometric angle output by the PTZ camera;

[0017] The straight-line distance and the actual pitch angle between the PTZ camera and the control point are calculated according to the position and elevation of the PTZ camera and the position and elevation of the control point, and the correction value of the pitch angle is obtained according to the pitch angle returned by the PTZ camera and the correction value of the actual pitch angle.

[0018] According to an embodiment of the present invention, the step of obtaining the internal parameters of the PTZ camera includes:

[0019] Obtaining the intrinsic parameter matrix and distortion parameters of the PTZ camera;

[0020] The correction value functions of the internal parameter matrix and the distortion parameters under different magnifications are fitted, and the internal parameter matrix and the distortion parameters when the loss function is minimized are determined by a gradient descent algorithm.

[0021] According to an embodiment of the present invention, the converting the pixel coordinates of the point to be corrected into geographic coordinates based on a preset observer viewpoint model, external parameters of the PTZ camera, and internal parameters of the PTZ camera includes:

[0022] Calculating a rotation matrix between a world coordinate system and a camera coordinate system based on external parameters of the PTZ camera and internal parameters of the PTZ camera;

[0023] Based on the calibrated vertical field of view angle parameters and the calibrated horizontal field of view angle parameters, a projection transformation matrix is ​​established, and a transformation matrix is ​​obtained according to the rotation matrix and the projection transformation matrix;

[0024] Based on the transformation matrix, an inverse transformation matrix of the transformation matrix is ​​obtained, and according to the inverse transformation matrix, the coordinates of the point to be corrected in the camera coordinate system are calculated;

[0025] Based on the inverse transformation matrix of the rotation matrix and the negative translation vector, the coordinates of the point to be corrected in the camera coordinate system are converted into geodetic coordinates, and the geographic coordinates of the point to be corrected are obtained according to the geodetic coordinates.

[0026] According to an embodiment of the present invention, the preset line-of-sight analysis method combines the external parameters of the PTZ camera, the internal parameters of the PTZ camera and the DEM data to perform line-of-sight positioning and coordinate correction on the geographic coordinates of the point to be corrected to obtain the actual coordinates of the point to be corrected, including:

[0027] Determine the sight line direction of the PTZ camera according to the external parameters of the PTZ camera, the internal parameters of the PTZ camera, and the angle between the viewpoint of the PTZ camera and the center of the PTZ camera, and determine the first intersection point between the sight line direction of the PTZ camera and the DEM surface;

[0028] Calculate the height of the PTZ camera on the ground according to the longitude and latitude coordinates of the PTZ camera and the DEM data, calculate the three-dimensional coordinates of the PTZ camera according to the hanging height of the PTZ camera, and convert the longitude and latitude coordinates of the point to be corrected and the PTZ camera into plane coordinates;

[0029] The actual coordinates of the point to be corrected are obtained according to the first intersection point of the sight line direction of the PTZ camera and the DEM surface, the pixel coordinates of the point to be corrected and the plane coordinates.

[0030] According to the alarm high-precision positioning method based on PTZ camera calibration and inspection proposed in the embodiment of the present invention, the pixel coordinates of the point to be corrected are converted into the geographic coordinates of the point to be corrected according to the obtained pixel coordinates of the point to be corrected, the external parameters of the PTZ camera and the internal parameters of the PTZ camera by presetting the observer viewpoint model; the line of sight analysis method is preset, and the geographic coordinates of the point to be corrected are positioned by DEM line of sight and the coordinates are corrected in combination with the external parameters of the PTZ camera, the internal parameters of the PTZ camera and the DEM data to obtain the actual coordinates of the point to be corrected. Thus, the pixel coordinates are converted into geographic coordinates and corrected by the preset observer viewpoint model, and the mutual conversion between spatial coordinates and frame coordinates is realized by using only a small number of measurement control points, which has higher applicability. On the basis of combining with the DEM data, the altitude of the location of the alarm point can be further calculated.

[0031] To achieve the above-mentioned purpose, the second embodiment of the present invention proposes a high-precision alarm positioning device based on PTZ camera calibration, comprising:

[0032] An acquisition module, used to acquire the pixel coordinates of the point to be corrected, the external parameters of the PTZ camera and the internal parameters of the PTZ camera;

[0033] A conversion module, configured to convert the pixel coordinates of the point to be corrected into the geographic coordinates of the point to be corrected based on a preset observer viewpoint model, external parameters of the PTZ camera and internal parameters of the PTZ camera;

[0034] The correction module is used to perform DEM line-of-sight positioning and coordinate correction on the geographic coordinates of the point to be corrected based on a preset line-of-sight analysis method, combined with the external parameters of the PTZ camera, the internal parameters of the PTZ camera and the DEM data, to obtain the actual coordinates of the point to be corrected.

[0035] According to one embodiment of the present invention, the external parameters of the PTZ camera include azimuth and pitch angles, and the internal parameters of the PTZ camera include focal length, field of view angle, and image distortion;

[0036] The azimuth is the angle formed by rotating clockwise from east to south to west with the north as the starting point of 0°;

[0037] The pitch angle is the angle between the Z axis of the PTZ camera coordinate system and the horizontal plane.

[0038] According to an embodiment of the present invention, the acquisition module is specifically used to:

[0039] Adjusting the PTZ camera to a preset horizontal state;

[0040] Determine the position coordinates and geographic orientation of the control point relative to the PTZ camera, and calculate the spherical distance between the control point and the PTZ camera;

[0041] Obtaining the angle between the line of sight of the PTZ camera and the geographical north direction when the horizontal azimuth angle is 0°, and calculating the azimuth angle according to the geometric angle output by the PTZ camera;

[0042] The straight-line distance and the actual pitch angle between the PTZ camera and the control point are calculated according to the position and elevation of the PTZ camera and the position and elevation of the control point, and the correction value of the pitch angle is obtained according to the pitch angle returned by the PTZ camera and the correction value of the actual pitch angle.

[0043] According to an embodiment of the present invention, the acquisition module is specifically used to:

[0044] Obtaining the intrinsic parameter matrix and distortion parameters of the PTZ camera;

[0045] The correction value functions of the internal parameter matrix and the distortion parameters under different magnifications are fitted, and the internal parameter matrix and the distortion parameters when the loss function is minimized are determined by a gradient descent algorithm.

[0046] According to an embodiment of the present invention, the conversion module is specifically used to:

[0047] Calculating a rotation matrix between a world coordinate system and a camera coordinate system based on external parameters of the PTZ camera and internal parameters of the PTZ camera;

[0048] Based on the calibrated vertical field of view angle parameters and the calibrated horizontal field of view angle parameters, a projection transformation matrix is ​​established, and a transformation matrix is ​​obtained according to the rotation matrix and the projection transformation matrix;

[0049] Based on the transformation matrix, an inverse transformation matrix of the transformation matrix is ​​obtained, and according to the inverse transformation matrix, the coordinates of the point to be corrected in the camera coordinate system are calculated;

[0050] Based on the inverse transformation matrix of the rotation matrix and the negative translation vector, the coordinates of the point to be corrected in the camera coordinate system are converted into geodetic coordinates, and the geographic coordinates of the point to be corrected are obtained according to the geodetic coordinates.

[0051] According to one embodiment of the present invention, the correction module is specifically used to:

[0052] Determine the sight line direction of the PTZ camera according to the external parameters of the PTZ camera, the internal parameters of the PTZ camera, and the angle between the viewpoint of the PTZ camera and the center of the PTZ camera, and determine the first intersection point between the sight line direction of the PTZ camera and the DEM surface;

[0053] Calculate the height of the PTZ camera on the ground according to the longitude and latitude coordinates of the PTZ camera and the DEM data, calculate the three-dimensional coordinates of the PTZ camera according to the hanging height of the PTZ camera, and convert the longitude and latitude coordinates of the point to be corrected and the PTZ camera into plane coordinates;

[0054] The actual coordinates of the point to be corrected are obtained according to the first intersection point of the sight line direction of the PTZ camera and the DEM surface, the pixel coordinates of the point to be corrected and the plane coordinates.

[0055] According to the alarm high-precision positioning device based on PTZ camera calibration and inspection proposed in the embodiment of the present invention, the pixel coordinates of the point to be corrected are converted into the geographic coordinates of the point to be corrected according to the obtained pixel coordinates of the point to be corrected, the external parameters of the PTZ camera and the internal parameters of the PTZ camera by presetting the observer viewpoint model; the line of sight analysis method is preset, and the geographic coordinates of the point to be corrected are positioned by DEM line of sight and the coordinates are corrected in combination with the external parameters of the PTZ camera, the internal parameters of the PTZ camera and the DEM data to obtain the actual coordinates of the point to be corrected. Thus, the pixel coordinates are converted into geographic coordinates and corrected by the preset observer viewpoint model, and the mutual conversion between spatial coordinates and frame coordinates is realized by using only a small number of measurement control points, which has higher applicability. On the basis of combining with the DEM data, the altitude of the location of the alarm point can be further calculated.

[0056] To achieve the above-mentioned purpose, the third aspect of the present invention proposes an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the high-precision alarm positioning method based on PTZ camera calibration as described in the above-mentioned embodiment.

[0057] To achieve the above objectives, the fourth aspect of the present invention proposes a computer-readable storage medium having a computer program stored thereon, which is executed by a processor to implement the high-precision alarm positioning method based on PTZ camera calibration as described in the above embodiments.

[0058] To achieve the above objectives, a fifth aspect of the present invention proposes a computer program product, including a computer program, which, when executed by a processor, is used to implement the high-precision alarm positioning method based on PTZ camera calibration as described in the above embodiments.

[0059] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0061] Figure 1 A flowchart of a high-precision alarm positioning method based on PTZ camera calibration is provided in accordance with an embodiment of the present invention;

[0062] Figure 2 A schematic diagram of four coordinate systems in a camera imaging process provided by an embodiment of the present invention;

[0063] Figure 3 A schematic diagram of an "observer viewpoint" model provided for an embodiment of the present invention;

[0064] Figure 4 A schematic diagram of DEM line-of-sight positioning according to an embodiment of the present invention;

[0065] Figure 5 A flowchart of a high-precision alarm positioning method based on PTZ camera calibration according to a specific embodiment of the present invention;

[0066] Figure 6 A block diagram of a high-precision alarm positioning device based on PTZ camera calibration and verification according to an embodiment of the present invention;

[0067] Figure 7 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention.

[0068] Reference numerals:

[0069] 10-alarm high-precision positioning device based on PTZ camera calibration, 100-acquisition module, 200-conversion module, 300-correction module, 701-memory, 702-processor, 703-communication interface. DETAILED DESCRIPTION

[0070] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.

[0071] A method and device for high-precision positioning of alarms based on PTZ camera calibration and inspection according to an embodiment of the present invention will be described below with reference to the accompanying drawings. First, a method and device for high-precision positioning of alarms based on PTZ camera calibration and inspection according to an embodiment of the present invention will be described with reference to the accompanying drawings.

[0072] In view of the problems of complicated operation and high labor cost caused by the calibration based on fixed PTZ values ​​in the background technology, the present invention provides a high-precision alarm positioning method based on PTZ camera calibration, which converts the pixel coordinates of the point to be corrected into the geographic coordinates of the point to be corrected according to the obtained pixel coordinates of the point to be corrected, the external parameters of the PTZ camera and the internal parameters of the PTZ camera by presetting the observer viewpoint model; and presets the line of sight analysis method, combines the external parameters of the PTZ camera, the internal parameters of the PTZ camera and the DEM data to perform DEM line of sight positioning and coordinate correction on the geographic coordinates of the point to be corrected to obtain the actual coordinates of the point to be corrected. Thus, the pixel coordinates are converted into geographic coordinates and corrected by the preset observer viewpoint model, and the mutual conversion between spatial coordinates and frame coordinates is realized by using only a small number of measurement control points, which has higher applicability. On the basis of combining with DEM data, the altitude of the location of the alarm point can be further calculated.

[0073] Figure 1 The present invention provides a flowchart of a method for high-precision positioning of alarms based on PTZ camera calibration.

[0074] like Figure 1 As shown, the alarm high-precision positioning method based on PTZ camera calibration includes the following steps:

[0075] In step S101, the pixel coordinates of the point to be corrected, the external parameters of the PTZ camera, and the internal parameters of the PTZ camera are obtained.

[0076] It should be noted that if Figure 2 As shown, Figure 2 Schematic diagram of four coordinate systems in the camera imaging process provided by an embodiment of the present invention. W -X W Y W Z W Represents the world coordinate system, which can be used to represent the position of any object; C -X C Y C Z C represents the camera coordinate system, with the optical center of the camera as the origin, the Z axis coincides with the optical axis, that is, the Z axis points to the front of the camera, and the positive directions of the X axis and the Y axis are parallel to the object coordinate system, where f in the above figure is the focal length of the camera; xy represents the image physical coordinate system (also called the plane coordinate system), which is used to represent the position of the pixel, and the coordinate origin is the focal position of the camera optical axis and the image physical coordinate system; μν represents the pixel coordinate system, which is used to represent the coordinates of the pixel in the image after imaging, where the μ axis and the ν axis are parallel to the x axis and the y axis of the image physical coordinate system, respectively.

[0077] Specifically, among the four coordinate systems of camera imaging, geographic coordinates are coordinate data that use longitude and latitude to describe a certain position in the world coordinate system. They are used to describe the location information of a certain place on the earth. In order to determine the location information of the point to be corrected, the embodiment of the present invention can obtain the geographic coordinates of the control point through tools such as GPS (Global Positioning System) and radar detectors. The external parameters of the PTZ camera are obtained through the calibration and correction of the external parameters of the PTZ camera. The purpose of obtaining the external parameters of the PTZ camera is to standardize the installation of the PTZ camera and ensure that the external parameters of the PTZ camera are within a certain error range; the internal parameters of the PTZ camera are obtained through the calibration and correction of the internal parameters of the PTZ camera. The purpose of obtaining the internal parameters of the PTZ camera is to determine the internal parameters of the PTZ camera and its correction parameters through a small number of measured control points.

[0078] Wherein, in some embodiments, the external parameters of the PTZ camera include azimuth and pitch angles, and the internal parameters of the PTZ camera include focal length, field of view angle, and image distortion;

[0079] The azimuth angle is the angle formed by rotating clockwise from east to south to west with due north as the starting point at 0°; the pitch angle is the angle between the Z axis of the PTZ camera coordinate system and the horizontal plane.

[0080] Specifically, a PTZ camera can obtain a larger field of view by rotating the lens in the horizontal and vertical directions. When the PTZ camera rotates, the rotation angles in the horizontal and vertical directions will affect the imaging, so the embodiment of the present invention needs to obtain the rotation angles of the PTZ camera in the horizontal and vertical directions. In the horizontal direction, the rotation angle of the PTZ camera is usually determined by the azimuth angle, which is the angle formed by rotating clockwise from east to south to west with the north as the starting point of 0°; in the vertical direction, the rotation angle of the PTZ camera is usually determined by the pitch angle, which is the angle between the Z axis of the PTZ camera coordinate system and the horizontal plane.

[0081] Optionally, in some embodiments, the external parameters of the PTZ camera are obtained, including: adjusting the PTZ camera to a preset horizontal state; determining the position coordinates and geographic orientation of the control point relative to the PTZ camera, and calculating the spherical distance between the control point and the PTZ camera; obtaining the angle between the line of sight of the PTZ camera and the geographical north direction when the horizontal azimuth angle is 0°, and calculating the azimuth angle based on the geometric angle output by the PTZ camera; calculating the straight-line distance and the actual pitch angle between the PTZ camera and the control point based on the position and elevation of the PTZ camera and the position and elevation of the control point, and obtaining the pitch angle correction value based on the pitch angle returned by the PTZ camera and the correction value of the actual pitch angle.

[0082] Among them, the control point is a certain position in the area to be measured. The camera is calibrated by setting the control point as a reference standard; the elevation refers to the vertical distance from the position of the PTZ camera to the ground.

[0083] Specifically, when installing a PTZ camera, the inclination of the bracket can be adjusted by a level meter or the PTZ camera can be adjusted to a preset horizontal state by the level calibration function of the PTZ camera. After the position coordinates and geographic orientation of the control point are determined by radar or GPS, the control point is calculated according to the spherical distance formula. The angle between the line of sight and the geographic north direction when the azimuth of the PTZ camera in the horizontal direction is 0° is obtained, the geometric angle output by the PTZ camera is obtained, and the azimuth of the PTZ camera is calculated by the formula. If the geometric angle is greater than 90°, 360° needs to be added to the calculated result to ensure that the azimuth is a positive value. The position and elevation of the PTZ camera and the position and elevation of the control point are obtained, and the straight-line distance and actual pitch angle between the PTZ camera and the control point are calculated according to the formula. The pitch angle is corrected according to the difference between the pitch angle returned by the PTZ camera itself and the actual pitch angle, and the corrected value of the pitch angle is obtained.

[0084] For example, to determine the position coordinates and geographic orientation of the control point relative to the camera, and calculate the spherical distance D between the control point A and the camera B, the calculation formula is as follows:

[0085] c=arccos(90-B w )*cos(90-A w )+sin(90-B w )*sin(90-A w )*cos(B j -A j )(1)

[0086]

[0087] Among them, A w is the latitude of point A, j is the longitude of point A, B w is the latitude of point B, w is the latitude of point B, and R is the radius of the Earth.

[0088] Determine the angle between the line of sight and the geographic north direction when the horizontal azimuth angle of the PTZ camera is 0°. According to the geometric angle output by the PTZ camera as Pan, the azimuth angle is calculated by the following formula:

[0089] Azimuth = 90°-Pan (3)

[0090] If the Pan value is greater than 90.0°, the final result Azimuth is added with 360.0° to ensure that the azimuth is a positive value;

[0091] Correct the azimuth and pitch angles, measure the elevation h1 according to the control point coordinates S1 (Lon1, Lat1), calculate the elevation difference h between the control point and the PTZ camera, and calculate the exact height (hanging height) h from the PTZ camera location to the ground. G Calculate the accurate elevation difference, the calculation formula is as follows (4):

[0092] h=h G +h0-h1(4)

[0093] According to the location S0 (Lon0, Lat0) and the elevation h0 of the PTZ camera installation site, and the location S1 (Lon1, Lat1) and the elevation h1 of the control point, the straight-line distance D between the installation site and the control point can be obtained according to formula (2). The actual pitch angle T at this time is calculated according to formula (5), and the pitch angle T' returned by the PTZ camera is read to calculate the correction value of the pitch angle ΔT = T-T';

[0094]

[0095] Similarly, calculate the correction value of the azimuth at different magnifications.

[0096] Optionally, in some embodiments, the internal parameters of the PTZ camera are obtained, including: obtaining the internal parameter matrix and distortion parameters of the PTZ camera; fitting the correction value function of the internal parameter matrix and distortion parameters at different magnifications, and determining the internal parameter matrix and distortion parameters when the loss function is minimized through a gradient descent algorithm.

[0097] Specifically, the embodiment of the present invention can obtain the intrinsic parameter matrix and distortion parameters of the camera by using the Zhang Zhengyou calibration method, that is, using a checkerboard calibration plate, after taking an image of the checkerboard calibration plate with a PTZ camera, using a corner detection algorithm to obtain the pixel coordinates of each black and white grid corner point, and calculating the distortion parameters of the image. By fitting the correction value function of the intrinsic parameter matrix and distortion parameters under different magnifications, the intrinsic parameter matrix and distortion parameters when the loss function is minimized are determined by the gradient descent method.

[0098] For example, using a checkerboard calibration plate, after obtaining an image of the calibration plate, the corner detection algorithm is used to obtain the pixel coordinates (u, v) of each black and white grid corner point. Since the tangential distortion has a small effect, it is not considered here. Only radial distortion is considered. The calculation formula is as follows (6):

[0099]

[0100] Among them, (u', v') is the pixel coordinate of the corrected image, k1, k2, k3 are the distortion parameters. When an image is distorted, the correct coordinates of each pixel in the image can be calculated by the above formula to restore the image to its pre-distortion state. Then, the correction value function of the intrinsic parameter matrix and the distortion parameters under different magnifications is fitted, and the intrinsic parameter matrix and distortion parameters with the minimum loss function are found through the gradient descent algorithm, which can realize automatic calibration of parameters.

[0101] In step S102, based on a preset observer viewpoint model, external parameters of the PTZ camera, and internal parameters of the PTZ camera, the pixel coordinates of the point to be corrected are converted into geographic coordinates of the point to be corrected.

[0102] It should be noted that, according to the principle of the "observer viewpoint model", if the pixel point on the imaging coordinates comes from a point at an elevation or below the ground, then the geographic coordinates (alarm position) obtained by converting the pixel coordinates to the space → coordinates are the intersection of the line of sight and the ground, rather than the projection of the position point vertically to the ground. There is an error, and this error will increase rapidly with the smaller elevation angle. In order to solve the error that occurs when converting geographic coordinates and pixel coordinates, the embodiment of the present invention needs to preset and optimize the observer viewpoint model.

[0103] Specifically, if Figure 3 As shown, Figure 3 A schematic diagram of the "observer viewpoint" model provided for an embodiment of the present invention. Among them, lat refers to the latitude value in the geodetic coordinate system, lon refers to the longitude value, and alt refers to the altitude. A set of (lat, lon, alt) can locate a certain point in the real world. When used, the camera is usually rotated around three axes to set the direction in 3D space, so three rotation parameters are introduced: fov is the field of view angle, pitch is the pitch angle, and roll is the roll angle. In addition to the diagram of the observer viewpoint model parameters, Figure 3 The principle of camera operation using an imaginary "picture plane" is also described. i ,lon i , alt i ) is projected onto the image plane (u i , v i ) to form an image. In digital photography, the output is a digital image with a certain width (w) and height (h) in pixels, so the image coordinates (u i , v i) can also be expressed in pixels. Through the acquired control point coordinates and the internal and external parameters of the PTZ camera, based on the observer viewpoint model, the pixel coordinates and geographic space coordinates are converted to each other, that is, the pixel coordinates of any pixel point in the image are converted to geographic coordinates and the geographic location coordinates on the map are converted to obtain its pixel coordinates in the video image.

[0104] As a possible implementation method, in some embodiments, based on a preset observer viewpoint model, external parameters of the PTZ camera, and internal parameters of the PTZ camera, the pixel coordinates of the point to be corrected are converted into geographic coordinates, including: calculating the rotation matrix between the geodetic coordinate system and the camera coordinate system based on the external parameters of the PTZ camera and the internal parameters of the PTZ camera; establishing a projection transformation matrix based on calibrated vertical field of view angle parameters and calibrated horizontal field of view angle parameters, and obtaining a transformation matrix based on the rotation matrix and the projection transformation matrix; obtaining an inverse transformation matrix of the transformation matrix based on the transformation matrix, and calculating the coordinates of the point to be corrected in the camera coordinate system based on the inverse transformation matrix; converting the coordinates of the point to be corrected in the camera coordinate system into geodetic coordinates based on the inverse transformation matrix of the rotation matrix and a negative translation vector, and obtaining the geographic coordinates of the point to be corrected based on the geodetic coordinates.

[0105] Specifically, the embodiment of the present invention can obtain the transformation matrix of converting video pixel coordinates into geographic space coordinates by obtaining the inverse transformation matrix of each step of converting geographic space coordinates into pixel coordinates, and use the inverse transformation matrix of the projection transformation matrix to calculate the coordinates of the image pixels converted into the camera coordinate system, and then calculate the inverse matrix of the rotation matrix and the negative translation vector to convert the camera coordinate system coordinates into geodetic coordinates.

[0106] For example, to define the georeference of a video frame, i.e. the camera viewpoint at the time the frame was captured, seven parameters are specified, such as Figure 3 As shown in the figure: latitude (lat), longitude (lon), altitude (alt), azimuth, field of view (fov), pitch and roll, which are applied to the video geo-registration model of PTZ cameras; to convert geographic space coordinates into pixel coordinates, first convert the longitude and latitude coordinates of the control point into the camera coordinate system coordinates, and the calculation formulas are as follows (7)-(8):

[0107]

[0108] Among them, a is the semi-major axis of the earth, e is the first eccentricity of the earth, N is the radius of curvature of the yoke,

[0109] Based on the P and T parameters of the camera, the rotation matrix R between the two coordinate systems is calculated. The rotation matrix is ​​used to describe the conversion relationship between the coordinates. Then, the elevation data of the control point is substituted to calculate the translation component t between the coordinate systems. The calculation formula is as follows (9):

[0110]

[0111] Based on the calibrated vertical field of view angle parameters and horizontal field of view angle parameters, a projection transformation matrix is ​​established to describe the transformation relationship between the two-dimensional image coordinates and the camera coordinate system coordinates. The calculation formulas are as follows (10)-(11):

[0112]

[0113] Among them, K is the intrinsic parameter matrix of the camera, (x img ,y img ) is the coordinate in the image coordinate system, (x pixel ,y pixel ) is the coordinate in the pixel coordinate system;

[0114] Finally, the dimensions of the above transformation relationships are unified and the calculation process is merged into one formula. In order to facilitate the algorithm implementation and optimize efficiency, homogeneous coordinates and matrix operations are introduced to obtain the transformation matrix for converting geographic space coordinates into video coordinates. The coordinates of any point in the geographic space can be substituted into it to calculate its coordinates on the video screen.

[0115] In step S103, based on the preset line of sight analysis method, the geographical coordinates of the point to be corrected are positioned and corrected by DEM line of sight in combination with the external parameters of the PTZ camera, the internal parameters of the PTZ camera and the DEM data to obtain the actual coordinates of the point to be corrected.

[0116] Specifically, line of sight analysis refers to a terrain analysis that uses a certain point as an observation point to study the line of sight of a certain area, and uses DEM to determine whether any two points on the terrain are visible to each other. The embodiment of the present invention determines whether the PTZ camera and the point to be corrected are visible to each other by judging whether there is a corner point between the line of sight direction of the PTZ camera and the DEM surface based on the line of sight analysis method. When the PTZ camera and the point to be corrected are visible to each other, the three-dimensional coordinates of the PTZ camera are calculated, and the longitude and latitude coordinates of the point to be corrected and the PTZ camera are converted into plane coordinates; based on a preset search algorithm, the actual coordinates of the point to be corrected are obtained according to the first intersection of the line of sight direction of the PTZ camera and the DEM surface, the pixel coordinates of the point to be corrected, and the plane coordinates, which are used to determine the actual position of the point to be corrected.

[0117] As a possible implementation method, in some embodiments, a preset line of sight analysis method combines the external parameters of the PTZ camera, the internal parameters of the PTZ camera and the DEM data to perform line of sight positioning and coordinate correction on the geographic coordinates of the point to be corrected to obtain the actual coordinates of the point to be corrected, including: determining the line of sight direction of the PTZ camera according to the external parameters of the PTZ camera, the internal parameters of the PTZ camera, and the angle between the viewpoint of the PTZ camera and the center of the PTZ camera, and determining the first intersection point of the line of sight direction of the PTZ camera and the DEM surface; calculating the height of the PTZ camera at the ground according to the longitude and latitude coordinates of the PTZ camera and the DEM data, and then calculating the three-dimensional coordinates of the PTZ camera according to the hanging height of the PTZ camera, and converting the longitude and latitude coordinates of the point to be corrected and the PTZ camera into plane coordinates; obtaining the actual coordinates of the point to be corrected according to the first intersection point of the line of sight direction of the PTZ camera with the DEM surface, the pixel coordinates of the point to be corrected and the plane coordinates.

[0118] Specifically, if Figure 4 As shown, Figure 4 The figure is a schematic diagram of DEM line-of-sight positioning according to an embodiment of the present invention. For hilly and plateau terrain, a line-of-sight algorithm based on DEM (digital elevation model) data is used to correct the elevation and spatial position of the positioning point, according to the longitude and latitude (LON, LAT) of the camera, the hanging height H, the PTZ (Pan, Tilt, Zoom) corresponding to the center of the camera at this time, and the internal parameter of the camera sensor width Width sensor 、Sensor heightHeight sensor , minimum focal length f min and maximum focal length f max , the normalized coordinates of the camera's target point on the imaging plane are (x, y), and the PTZ parameters of its viewpoint are calculated using the following formula and steps:

[0119] The focal length f of the camera at this time is calculated by formula (12):

[0120]

[0121] The offset Δx and Δy of the target point relative to the center are calculated by formula (13):

[0122]

[0123] The rotation matrix R of the target point relative to the center is calculated by the following formula (14):

[0124]

[0125] in

[0126] The unit vector of the camera center in the set coordinate axis is obtained by formulas (15)-(17): and the unit vector of the target point in the set coordinate axis Then inversely calculate the P, T, and Z parameters of the target point:

[0127]

[0128] tilt target = -arcsin(k3)

[0129]

[0130] zoom target =zoom (17)

[0131] After calculating the PTZ of the target point, the bilinear interpolation method is used to calculate the elevation of the longitude and latitude coordinates (LON, LAT). Combined with the camera hanging height H, the camera elevation Z is calculated using formula (18):

[0132] Z=DEM(LON,LAT)+H(18)

[0133] Convert the longitude and latitude coordinates into plane coordinates, that is, convert the WGS84 coordinates into UTM coordinates. Use the following formula to convert the longitude and latitude into UTM coordinates. The calculation formulas are as follows (19)-(20):

[0134]

[0135] k0 = 0.9996 (UTM scaling factor)

[0136] E = (longitude-λ0)*π / 180 (convert longitude to radians)

[0137] N=(ab) / (a+b)*(1+n 2 / 4+n 4 / 64)(Calculate the meridian curvature radius)

[0138] A=(1-n+5 / 4*(n 2 -n 3 / 16)+81 / 64*(n 4 -n 5 / 64))

[0139] B=(3 / 2*(nn 2 +7 / 8*(n 3 -n 4 / 4)+55 / 64*n 5 ))

[0140] C=(15 / 16*(n2 -n 3 +3 / 4*(n 4 -n 5 / 4)))

[0141] D=(35 / 48*(n 3 -n 4 +11 / 16*n 5 )) (20)

[0142] Among them, x is the easting component of the UTM coordinate, y is the northing component, a is the major semi-axis of the WGS84 ellipsoid, b is the minor semi-axis of the WGS84 ellipsoid, n is the inverse of the flattening of the WGS84 ellipsoid, and λ0 is the longitude of the central meridian of the UTM area. After the coordinate conversion, the pixel coordinates of the point to be corrected are positioned using the DEM line of sight. According to the completed PTZ camera calibration work, the orientation of the camera at this time is corrected. According to the longitude and latitude (LON, LAT) of the camera, combined with the DEM data and the hanging height H, the three-dimensional coordinates (LON, LAT, Z) of the camera are calculated according to formula (18). The longitude and latitude coordinates of the point to be corrected and the camera are converted into plane coordinates, that is, the WGS84 coordinates are converted into UTM coordinates. The conversion formulas are as follows (19)-(20):

[0143] The coordinates of the point to be corrected and the camera coordinates are used as input to calculate the azimuth angle pan and pitch angle tilt of the gimbal, using formulas (21)-(22):

[0144]

[0145] Among them, pan refers to the azimuth angle of the camera when it is facing the point to be corrected, and tilt refers to the pitch angle of the camera when it is facing the point to be corrected. target ,Y target ,Z target ) is the three-dimensional coordinate of the point to be corrected in the UTM projection coordinate system, (X camera ,Y camera , Z camera ) is the three-dimensional coordinate of the camera in the UTM projection coordinate system. Next, initialize the target point as the camera position; predict the next target point position (X t ,Y t ), calculated by formula (23):

[0146]

[0147] Among them, (X t ,Y t ) is the UTM plane coordinate of the target point in step t, and length is the step length of each search;

[0148] Calculate and compare the elevation of the target point on the line of sight with the elevation on the DEM and The calculation formulas are as follows (24)-(26):

[0149]

[0150] distance=(X t -X camera ) 2 +(Y t -Y camera ) 2 (25)

[0151]

[0152] in, is the height of the target point on the line of sight at step t, is the height of the target point on the DEM at step t, and distance represents the plane distance between the target point and the camera; if Greater than Recalibrate the internal parameters of the PTZ camera and obtain the recalibrated internal parameters, and execute steps S102-S104, t plus 1; otherwise, it means that an intersection occurs, and the line of sight equation and the neighborhood equation of the DEM at the target point are combined to solve the equation to calculate the coordinates of the intersection; according to the inverse projection transformation, the longitude and latitude of the target point are calculated as the actual coordinates of the point to be corrected.

[0153] In order to enable those skilled in the art to further understand the high-precision alarm positioning method based on PTZ camera calibration and inspection in the embodiment of the present application, it is elaborated in detail below in conjunction with specific embodiments.

[0154] Specifically, Figure 5 As shown, the alarm high-precision positioning method based on PTZ camera calibration includes the following steps:

[0155] S501, obtaining external parameters through PTZ camera external parameter calibration and correction.

[0156] S502, obtaining internal parameters through PTZ camera internal parameter calibration and correction.

[0157] S503, converting pixel coordinates into geographic space coordinates based on the observer viewpoint model through the acquired control point coordinates and the internal and external parameters of the PTZ camera.

[0158] S504, based on the line-of-sight analysis method, the line-of-sight positioning and coordinate correction are performed in combination with the internal and external parameters of the PTZ camera and the DEM data.

[0159] According to the alarm high-precision positioning method based on PTZ camera calibration and inspection proposed in the embodiment of the present invention, the pixel coordinates of the point to be corrected are converted into the geographic coordinates of the point to be corrected according to the obtained pixel coordinates of the point to be corrected, the external parameters of the PTZ camera and the internal parameters of the PTZ camera by presetting the observer viewpoint model; the line of sight analysis method is preset, and the geographic coordinates of the point to be corrected are positioned by DEM line of sight and the coordinates are corrected in combination with the external parameters of the PTZ camera, the internal parameters of the PTZ camera and the DEM data to obtain the actual coordinates of the point to be corrected. Thus, the pixel coordinates are converted into geographic coordinates and corrected by the preset observer viewpoint model, and the mutual conversion between spatial coordinates and frame coordinates is realized by using only a small number of measurement control points, which has higher applicability. On the basis of combining with the DEM data, the altitude of the location of the alarm point can be further calculated.

[0160] Next, a high-precision alarm positioning device based on PTZ camera calibration and inspection proposed in accordance with an embodiment of the present invention will be described with reference to the accompanying drawings.

[0161] Figure 6 It is a block diagram of a high-precision alarm positioning device based on PTZ camera calibration and verification provided according to an embodiment of the present invention.

[0162] like Figure 6 As shown, the alarm high-precision positioning device 10 based on PTZ camera calibration includes: an acquisition module 100, a conversion module 200 and a correction module 300.

[0163] The acquisition module 100 is used to acquire the pixel coordinates of the point to be corrected, the external parameters of the PTZ camera and the internal parameters of the PTZ camera;

[0164] The conversion module 200 is used to convert the pixel coordinates of the point to be corrected into the geographic coordinates of the point to be corrected based on the preset observer viewpoint model, the external parameters of the PTZ camera and the internal parameters of the PTZ camera;

[0165] The correction module 300 is used to perform DEM line-of-sight positioning and coordinate correction on the geographic coordinates of the point to be corrected based on a preset line-of-sight analysis method, combined with external parameters of the PTZ camera, internal parameters of the PTZ camera and DEM data to obtain the actual coordinates of the point to be corrected.

[0166] According to one embodiment of the present invention, the external parameters of the PTZ camera include azimuth and pitch angles, and the internal parameters of the PTZ camera include focal length, field of view angle, and image distortion;

[0167] The azimuth angle is the angle formed by rotating clockwise from east to south to west with due north as the starting point at 0°; the pitch angle is the angle between the Z axis of the PTZ camera coordinate system and the horizontal plane.

[0168] According to one embodiment of the present invention, the acquisition module 100 is specifically used to: adjust the PTZ camera to a preset horizontal state; determine the position coordinates and geographical orientation of the control point relative to the PTZ camera, and calculate the spherical distance between the control point and the PTZ camera; obtain the angle between the line of sight of the PTZ camera and the geographical north direction when the horizontal azimuth angle is 0°, and calculate the azimuth angle according to the geometric angle output by the PTZ camera; calculate the straight-line distance and the actual pitch angle between the PTZ camera and the control point according to the position and elevation of the PTZ camera and the position and elevation of the control point, and obtain the pitch angle correction value according to the pitch angle returned by the PTZ camera and the correction value of the actual pitch angle.

[0169] According to one embodiment of the present invention, the acquisition module 100 is specifically used to: obtain the intrinsic parameter matrix and distortion parameters of the PTZ camera; fit the correction value function of the intrinsic parameter matrix and distortion parameters under different magnifications, and determine the intrinsic parameter matrix and distortion parameters when the loss function is minimized through a gradient descent algorithm.

[0170] According to one embodiment of the present invention, the conversion module 200 is specifically used to: calculate the rotation matrix between the geodetic coordinate system and the camera coordinate system based on the external parameters of the PTZ camera and the internal parameters of the PTZ camera; establish a projection transformation matrix based on the calibrated vertical field of view angle parameters and the calibrated horizontal field of view angle parameters, and obtain the transformation matrix according to the rotation matrix and the projection transformation matrix; obtain the inverse transformation matrix of the transformation matrix based on the transformation matrix, and calculate the coordinates of the point to be corrected in the camera coordinate system according to the inverse transformation matrix; convert the coordinates of the point to be corrected in the camera coordinate system into geodetic coordinates based on the inverse transformation matrix of the rotation matrix and the negative translation vector, and obtain the geographic coordinates of the point to be corrected according to the geodetic coordinates.

[0171] According to one embodiment of the present invention, the correction module 300 is specifically used to: determine the line of sight direction of the PTZ camera according to the external parameters of the PTZ camera, the internal parameters of the PTZ camera, and the angle between the viewpoint of the PTZ camera and the center of the PTZ camera, and determine the first intersection point of the line of sight direction of the PTZ camera and the DEM surface; calculate the height of the PTZ camera at the ground according to the latitude and longitude coordinates of the PTZ camera and the DEM data, and then calculate the three-dimensional coordinates of the PTZ camera according to the hanging height of the PTZ camera, and convert the latitude and longitude coordinates of the point to be corrected and the PTZ camera into plane coordinates; obtain the actual coordinates of the point to be corrected according to the first intersection point of the line of sight direction of the PTZ camera and the DEM surface, the pixel coordinates of the point to be corrected and the plane coordinates.

[0172] According to the alarm high-precision positioning device based on PTZ camera calibration and inspection proposed in the embodiment of the present invention, the pixel coordinates of the point to be corrected are converted into the geographic coordinates of the point to be corrected according to the obtained pixel coordinates of the point to be corrected, the external parameters of the PTZ camera and the internal parameters of the PTZ camera by presetting the observer viewpoint model; the line of sight analysis method is preset, and the geographic coordinates of the point to be corrected are positioned by DEM line of sight and the coordinates are corrected in combination with the external parameters of the PTZ camera, the internal parameters of the PTZ camera and the DEM data to obtain the actual coordinates of the point to be corrected. Thus, the pixel coordinates are converted into geographic coordinates and corrected by the preset observer viewpoint model, and the mutual conversion between spatial coordinates and frame coordinates is realized by using only a small number of measurement control points, which has higher applicability. On the basis of combining with the DEM data, the altitude of the location of the alarm point can be further calculated.

[0173] Figure 7 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. The electronic device may include:

[0174] A memory 701 , a processor 702 , and a computer program stored in the memory 701 and executable on the processor 702 .

[0175] When the processor 702 executes the program, the high-precision alarm positioning method based on PTZ camera calibration provided in the above embodiment is implemented.

[0176] Furthermore, the electronic device further comprises:

[0177] The communication interface 703 is used for communication between the memory 701 and the processor 702 .

[0178] The memory 701 is used to store computer programs that can be executed on the processor 702 .

[0179] The memory 701 may include a high-speed RAM (Random Access Memory) memory, and may also include a non-volatile memory, such as at least one disk memory.

[0180] If the memory 701, the processor 702 and the communication interface 703 are implemented independently, the communication interface 703, the memory 701 and the processor 702 can be connected to each other through a bus and communicate with each other. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0181] Optionally, in a specific implementation, if the memory 701, the processor 702 and the communication interface 703 are integrated on a chip, the memory 701, the processor 702 and the communication interface 703 can communicate with each other through an internal interface.

[0182] The processor 702 may be a CPU (Central Processing Unit), or an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention.

[0183] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned high-precision alarm positioning method based on PTZ camera calibration.

[0184] An embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the above-mentioned high-precision alarm positioning method based on PTZ camera calibration.

[0185] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0186] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms are not necessarily directed to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0187] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.

Claims

1. A high-precision alarm positioning method based on PTZ camera calibration, characterized in that: The following steps are involved: Obtain the pixel coordinates of the point to be corrected, the external parameters of the PTZ camera, and the internal parameters of the PTZ camera; Based on a preset observer viewpoint model, external parameters of the PTZ camera, and internal parameters of the PTZ camera, converting the pixel coordinates of the point to be corrected into the geographic coordinates of the point to be corrected; Based on a preset line-of-sight analysis method, the DEM line-of-sight positioning and coordinate correction are performed on the geographic coordinates of the point to be corrected in combination with the external parameters of the PTZ camera, the internal parameters of the PTZ camera and the DEM data to obtain the actual coordinates of the point to be corrected.

2. The method according to claim 1, characterized in that: The external parameters of the PTZ camera include azimuth and pitch angle, and the internal parameters of the PTZ camera include focal length, field of view and image distortion; The azimuth is the angle formed by rotating clockwise from east to south to west with the north as the starting point at 0°; The pitch angle is the angle between the Z axis of the PTZ camera coordinate system and the horizontal plane.

3. The method according to claim 1, characterized in that The obtaining of external parameters of the PTZ camera includes: Adjusting the PTZ camera to a preset horizontal state; Determine the position coordinates and geographic orientation of the control point relative to the PTZ camera, and calculate the spherical distance between the control point and the PTZ camera; Obtaining the angle between the line of sight of the PTZ camera and the geographical north direction when the horizontal azimuth angle is 0°, and calculating the azimuth angle according to the geometric angle output by the PTZ camera; The straight-line distance and the actual pitch angle between the PTZ camera and the control point are calculated according to the position and elevation of the PTZ camera and the position and elevation of the control point, and the correction value of the pitch angle is obtained according to the pitch angle returned by the PTZ camera and the correction value of the actual pitch angle.

4. The method according to claim 2, characterized in that: The obtaining of the internal parameters of the PTZ camera includes: Obtaining the intrinsic parameter matrix and distortion parameters of the PTZ camera; The correction value functions of the internal parameter matrix and the distortion parameters under different magnifications are fitted, and the internal parameter matrix and the distortion parameters when the loss function is minimized are determined by a gradient descent algorithm.

5. The method according to claim 1, characterized in that The step of converting the pixel coordinates of the point to be corrected into geographic coordinates based on a preset observer viewpoint model, external parameters of the PTZ camera, and internal parameters of the PTZ camera includes: Calculating a rotation matrix between a world coordinate system and a camera coordinate system based on external parameters of the PTZ camera and internal parameters of the PTZ camera; Based on the calibrated vertical field of view angle parameters and the calibrated horizontal field of view angle parameters, a projection transformation matrix is ​​established, and a transformation matrix is ​​obtained according to the rotation matrix and the projection transformation matrix; Based on the transformation matrix, an inverse transformation matrix of the transformation matrix is ​​obtained, and according to the inverse transformation matrix, the coordinates of the point to be corrected in the camera coordinate system are calculated; Based on the inverse transformation matrix of the rotation matrix and the negative translation vector, the coordinates of the point to be corrected in the camera coordinate system are converted into geodetic coordinates, and the geographic coordinates of the point to be corrected are obtained according to the geodetic coordinates.

6. The method according to claim 1, characterized in that The preset line-of-sight analysis method combines the external parameters of the PTZ camera, the internal parameters of the PTZ camera and the DEM data to perform line-of-sight positioning and coordinate correction on the geographic coordinates of the point to be corrected to obtain the actual coordinates of the point to be corrected, including: Determine the sight line direction of the PTZ camera according to the external parameters of the PTZ camera, the internal parameters of the PTZ camera, and the angle between the viewpoint of the PTZ camera and the center of the PTZ camera, and determine the first intersection point between the sight line direction of the PTZ camera and the DEM surface; Calculate the height of the PTZ camera on the ground according to the longitude and latitude coordinates of the PTZ camera and the DEM data, calculate the three-dimensional coordinates of the PTZ camera according to the hanging height of the PTZ camera, and convert the longitude and latitude coordinates of the point to be corrected and the PTZ camera into plane coordinates; The actual coordinates of the point to be corrected are obtained according to the first intersection point of the sight line direction of the PTZ camera and the DEM surface, the pixel coordinates of the point to be corrected and the plane coordinates.

7. A high-precision alarm positioning device based on PTZ camera calibration, characterized in that: include: An acquisition module, used to acquire the pixel coordinates of the point to be corrected, the external parameters of the PTZ camera and the internal parameters of the PTZ camera; A conversion module, configured to convert the pixel coordinates of the point to be corrected into the geographic coordinates of the point to be corrected based on a preset observer viewpoint model, external parameters of the PTZ camera and internal parameters of the PTZ camera; The correction module is used to perform DEM line-of-sight positioning and coordinate correction on the geographic coordinates of the point to be corrected based on a preset line-of-sight analysis method, combined with the external parameters of the PTZ camera, the internal parameters of the PTZ camera and the DEM data, to obtain the actual coordinates of the point to be corrected.

8. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the high-precision alarm positioning method based on PTZ camera calibration as described in any one of claims 1 to 6.

9. A computer storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the high-precision alarm positioning method based on PTZ camera calibration as described in any one of claims 1-6.

10. A computer program product, characterized in that It comprises a computer program, which, when executed by a processor, is used to implement the high-precision alarm positioning method based on PTZ camera calibration and inspection as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • PTZ camera target tracking method, system and device based on RFID tag position information

    CN109509233A

  • High-precision alarm positioning method based on PTZ (Pan / Tilt / Zoom) camera

    CN117058253A

  • Ship video positioning method and device based on artificial intelligence and Beidou satellite navigation

    CN117132649A

  • Warning positioning method based on monocular zooming of PTZ camera

    CN117152243A

  • Monocular PTZ (Pan / Tilt / Zoom)-based straw incineration smoke image fusion terrain distance measurement method

    CN117853590A

Cited By

  • Digital twin scene dynamic mapping generation method and device based on standard band correction

    CN119918154A

  • Method and apparatus for dynamically mapping and generating digital twin scenarios based on standard band calibration

    CN119918154B

  • PTZ camera calibration method and device based on attitude correction

    CN120008649A

  • Unmanned aerial vehicle-based river channel management method and computer readable storage medium

    CN120726493A

  • Target measurement method and device, electronic equipment and storage medium

    CN120740429A