Method and device for determining azimuth angle of pan-tilt shooting equipment, electronic equipment and medium

Through the gimbal shooting equipment, the calibration objects are photographed and the target azimuth angle is calculated in combination with the world coordinates, the problem of large azimuth angle correction errors under the influence of environmental factors of the gimbal shooting equipment is solved, and the automatic precise azimuth angle determination is achieved, which improves positioning accuracy .

CN119492352APending Publication Date: 2025-02-21ZHEJIANG UNIVIEW TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411097810.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-12
Publication Date
2025-02-21

AI Technical Summary

Technical Problem

During the installation and application of the gimbal shooting equipment, the P value and T value of the true northern azimuth angle of the earth are incorrect due to environmental factors, which in turn affects the accuracy of the target object positioning. In the prior art, the correction method of P value has a problem that there is a large error or depends on manual operation.

Method used

The first calibration object and the second calibration object are photographed through the gimbal shooting device, and combined with the world coordinates of the calibration object, the world coordinates of the gimbal shooting device are determined, and then the target azimuth angle matching the calibration object is calculated, and finally the gimbal shooting is determined. The azimuth of the device.

Benefits of technology

It realizes automatic determination of the precise azimuth angle of the gimbal shooting device, improves positioning accuracy, and avoids positioning accuracy errors of target objects caused by azimuth angle errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119492352A_ABST
    Figure CN119492352A_ABST
Patent Text Reader

Abstract

The invention discloses an azimuth angle determination method and device of a pan-tilt shooting device, electronic equipment and a medium, and the method comprises the steps: obtaining an azimuth angle of a first calibration object and a second calibration object according to images obtained by shooting the first calibration object and the second calibration object through the pan-tilt shooting device, the world coordinates of the first calibration object and the world coordinates of the second calibration object; world coordinates of the holder shooting equipment are determined; determining a first target azimuth angle matched with the first calibration object and / or a second target azimuth angle matched with the second calibration object according to the world coordinates of the holder shooting equipment; and according to the first target azimuth angle and / or the second target azimuth angle, determining the azimuth angle of the pan-tilt shooting equipment. According to the invention, the accurate azimuth angle of the pan-tilt shooting equipment can be automatically determined, and the positioning accuracy of the pan-tilt shooting equipment is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a method, device, electronic equipment and medium for determining the azimuth angle of a pan-tilt camera. Background Art

[0002] The pan-tilt camera is a device that combines a controllable pan-tilt and shooting function. The pan-tilt gives the camera the ability to flexibly rotate and shoot at multiple angles. The pan-tilt camera plays an increasingly important role in security monitoring, traffic monitoring, fire source detection, park production and other scenarios.

[0003] When locating a target object through a pan-tilt camera, it is necessary to obtain the earth's true north azimuth P value and inclination T value of the pan-tilt camera. However, due to environmental factors (such as strong winds, etc.) during the installation and application of the pan-tilt camera, errors may occur in the P value and the T value. This results in errors in the positioning of the target object. The T value can be corrected by an inclination sensor. In the prior art, the correction of the P value can be achieved based on an acceleration sensor and a magnetic sensor, but the true north direction of the earth determined in this way still has a certain error. Alternatively, the P value can also be corrected based on GNSS (Global Navigation Satellite System), but it needs to rely on manual operation. Therefore, there is an urgent need for a method to automatically determine an accurate P value. Summary of the invention

[0004] The present invention provides a method, device, electronic device and medium for determining the azimuth angle of a pan-tilt camera device, so as to automatically determine the precise azimuth angle of the pan-tilt camera device and improve the positioning accuracy of the pan-tilt camera device.

[0005] In a first aspect, an embodiment of the present invention provides a method for determining an azimuth angle of a pan-tilt camera device, the method comprising:

[0006] Determine the world coordinates of the pan-tilt shooting device according to images captured by the pan-tilt shooting device of the first calibration object and the second calibration object, the world coordinates of the first calibration object, and the world coordinates of the second calibration object;

[0007] Determine, according to the world coordinates of the pan / tilt camera device, a first target azimuth matching the first calibration object and / or a second target azimuth matching the second calibration object;

[0008] The azimuth of the pan-tilt camera device is determined according to the first target azimuth and / or the second target azimuth.

[0009] In a second aspect, an embodiment of the present invention further provides an azimuth angle determination device for a pan-tilt camera, the device comprising:

[0010] A world coordinate determination module, used to determine the world coordinates of the pan-tilt shooting device according to the images obtained by the pan-tilt shooting device of the first calibration object and the second calibration object, the world coordinates of the first calibration object and the world coordinates of the second calibration object;

[0011] a target azimuth angle determination module, configured to determine a first target azimuth angle matching the first calibration object and / or a second target azimuth angle matching the second calibration object according to the world coordinates of the pan / tilt camera device;

[0012] An azimuth angle determination module is used to determine the azimuth angle of the pan-tilt camera device according to the first target azimuth angle and / or the second target azimuth angle.

[0013] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a method for determining the azimuth angle of a gimbal shooting device as described in any one of the embodiments of the present invention is implemented.

[0014] In a fourth aspect, an embodiment of the present invention further provides a storage medium storing computer executable instructions, wherein the computer executable instructions, when executed by a computer processor, are used to execute the azimuth angle determination method of a gimbal shooting device as described in any one of the embodiments of the present invention.

[0015] The technical solution of the embodiment of the present invention determines the world coordinates of the pan-tilt shooting device by using the images obtained by shooting the first calibration object and the second calibration object with the pan-tilt shooting device, the world coordinates of the first calibration object, and the world coordinates of the second calibration object, and determines the first target azimuth matching the first calibration object and the second target azimuth matching the second calibration object according to the world coordinates of the pan-tilt shooting device, and determines the azimuth of the pan-tilt shooting device according to the first target azimuth and / or the second target azimuth. The problem of large errors or manual reliance on the azimuth correction method in the prior art is solved, and the precise azimuth of the pan-tilt shooting device is automatically determined, thereby improving the positioning accuracy of the pan-tilt shooting device.

[0016] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0018] Figure 1 is a flow chart of a method for determining an azimuth angle of a pan-tilt camera device provided in Embodiment 1 of the present invention;

[0019] Figure 2 is a schematic diagram of a coordinate system provided in the first embodiment of the present invention;

[0020] Figure 3 is a schematic diagram of a first target azimuth and a second target azimuth provided in Embodiment 1 of the present invention;

[0021] Figure 4 is a flow chart of a method for determining the azimuth angle of a pan-tilt camera device provided in Embodiment 2 of the present invention;

[0022] Figure 5 It is a structural schematic diagram of an azimuth angle determination device for a pan-tilt camera device provided in Embodiment 3 of the present invention;

[0023] Figure 6 It is a structural schematic diagram of an electronic device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION

[0024] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices. In the embodiments of the present application, some existing solutions in the industry such as certain software, components, models, etc. may be mentioned, and they should be considered as exemplary, and their purpose is only to illustrate the feasibility of the implementation of the technical solution of the present application, but it does not mean that the applicant has or must use the solution.

[0026] The acquisition, transmission, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.

[0027] Embodiment 1

[0028] Figure 1 A flowchart of a method for determining the azimuth angle of a gimbal camera device is provided for the first embodiment of the present invention. This embodiment is applicable to the case of determining the precise azimuth angle of the gimbal camera device. The method can be executed by an azimuth angle determination device of the gimbal camera device. The azimuth angle determination device of the gimbal camera device can be implemented in the form of hardware and / or software. The azimuth angle determination device of the gimbal camera device can be configured in a server and used in conjunction with the gimbal camera device.

[0029] like Figure 1 As shown, the method includes:

[0030] S110, determining the world coordinates of the gimbal shooting device according to images captured by the gimbal shooting device of the first calibration object and the second calibration object, the world coordinates of the first calibration object, and the world coordinates of the second calibration object.

[0031] Among them, the pan-tilt shooting device is a device that can realize multi-angle rotation and shooting by controlling the pan-tilt. In a specific application scenario, the pan-tilt shooting device may refer to a thermal imaging pan-tilt shooting device. The thermal imaging pan-tilt shooting device combines thermal imaging shooting technology with pan-tilt control, and can be applied to the security field for intruder monitoring; used in the fire protection field for fire point detection and timely discovery of fire hazards; used in the industrial field for equipment temperature monitoring to prevent equipment failure, etc. In the specific application scenario of the pan-tilt shooting device, a certain installation height is usually set for the pan-tilt shooting device. At this installation height, the pan-tilt shooting device can rotate within a certain inclination range. At a certain inclination angle, the pan-tilt shooting device can rotate 360°.

[0032] The first calibration object and the second calibration object are used to determine the world coordinates of the pan-tilt camera device and to determine the subsequent azimuth. The first marker and the second marker can be in the form of specific objects, such as a conical barrel, or in the form of a specific pattern set on the calibration plate, such as setting a circular area on the calibration plate as a marker. This embodiment does not limit the setting form of the marker.

[0033] Furthermore, the horizontal distance between the marker and the gimbal camera can be set to be within the range of 10m-20m. The advantage of such a setting is that when the gimbal camera takes a picture of the marker, the area occupied by the marker in the field of view of the gimbal camera is more moderate, thereby improving the accuracy of subsequent azimuth angle determination.

[0034] The world coordinates of the pan-tilt shooting device refer to the position coordinates of the pan-tilt shooting device in the world coordinate system. In this embodiment, it can be understood that since the first calibration object and the second calibration object are both set on the ground or near the ground, the world coordinates (x1, y1, z1) of the first calibration object and the world coordinates (x2, y2, z2) of the second calibration object can be directly measured by GNSS or RTK (Real-Time Kinematic) measuring instrument. Specifically, GNSS can receive satellite signals, process and analyze the collected satellite signals, and obtain the world coordinates of the first calibration object and the second calibration object; RTK can simultaneously receive base station signals and satellite signals, and process and analyze data according to the base station position and satellite signals to obtain the world coordinates of the first calibration object and the second calibration object. However, since the pan-tilt shooting device usually has a certain installation height, for example, the pan-tilt shooting device used for fire point detection in the fire protection field is usually set on the observation tower. Therefore, if the world coordinates are still measured by GNSS or RTK measuring instrument, it is necessary to manually carry the GNSS or RTK measuring instrument to the tower for processing. This not only increases labor costs, but manual measurement may also result in poor measurement accuracy.

[0035] In this embodiment, the first calibration object and the second calibration object are photographed by the pan-tilt camera, and the world coordinates of the pan-tilt camera are determined according to the photographed images and the world coordinates of the first calibration object and the second calibration object. This setting not only saves labor costs, but also ensures the accuracy of the world coordinates of the pan-tilt camera.

[0036] Specifically, the pan-tilt camera device can be controlled to adjust the angle of the pan-tilt camera device so that the first calibration object and the second calibration object appear in the field of view of the pan-tilt camera device at the same time, and images of the first calibration object and the second calibration object captured by the pan-tilt camera device at this time can be obtained.

[0037] In an optional embodiment, the world coordinates of the pan-tilt camera device are obtained based on the image obtained by shooting the first calibration object and the second calibration object by the pan-tilt camera device. After obtaining the image, the pixel coordinates of the first calibration object and the second calibration object can be determined, and the conversion relationship between the world coordinate system and the pixel coordinate system can be determined based on the world coordinates and pixel coordinates of the first calibration object and the second calibration object. The world coordinates of the center point of the optical axis of the pan-tilt camera device in the image and the conversion relationship between the world coordinate system and the pixel coordinate system are determined.

[0038] In another optional embodiment, the world coordinates of the gimbal shooting device are obtained according to the images obtained by shooting the first calibration object and the second calibration object by the gimbal shooting device, and the pixel distance between the first calibration object and the second calibration object can be determined according to the pixel coordinates of the first calibration object and the pixel coordinates of the second calibration object; the actual distance between the first calibration object and the second calibration object is determined according to the world coordinates of the first calibration object and the world coordinates of the second calibration object; the distance ratio is determined according to the pixel distance and the actual distance; the pixel coordinates of the center point of the optical axis of the gimbal shooting device are determined, and the pixel vector between the center point of the optical axis and the first calibration object is determined; according to the distance ratio, the pixel vector is converted into a world vector; according to the world coordinates of the first calibration object, and the length and direction of the world vector, the world coordinates of the optical center of the gimbal shooting device, that is, the world coordinates of the gimbal shooting device, are determined.

[0039] In yet another optional embodiment, further, obtaining the world coordinates of the gimbal shooting device according to the image obtained by shooting the first calibration object and the second calibration object by the gimbal shooting device may further include:

[0040] A1. Determine an image obtained by photographing the first calibration object and the second calibration object by a pan / tilt camera;

[0041] A2, determining a conversion relationship between a pixel coordinate system and a world coordinate system according to the pixel coordinates of the first calibration object in the image, the world coordinates of the first calibration object, the pixel coordinates of the second calibration object in the image, and the world coordinates of the second calibration object;

[0042] A3. Determine the external parameter matrix of the gimbal shooting device according to the conversion relationship between the pixel coordinate system and the world coordinate system;

[0043] A4. Determine the world coordinates of the gimbal shooting device according to the external parameter matrix of the gimbal shooting device.

[0044] Figure 2 A coordinate system diagram is provided, such as Figure 2 As shown, P W (X w , Y w , Z w ) represents the position coordinates of the object in the world coordinate system, P C (X C , Y C , Z C ) represents the coordinates of the object in the camera coordinate system. The origin of the camera coordinate system is the optical center of the gimbal camera. The Z axis coincides with the optical axis. The positive directions of the X axis and Y axis are parallel to the world coordinate system. f represents the focal length of the gimbal camera. The image coordinate system represents the pixel position of the object in the image. Figure 2 The o-xy in the image is the intersection of the optical axis of the gimbal and the image plane. The pixel coordinate system uses pixels as units, and the origin is usually set to the first pixel in the upper left corner of the image.

[0045] In this embodiment, the world coordinate system and the camera coordinate system are both three-dimensional coordinate systems. According to the lens imaging principle, the world coordinate P W After translation and rotation, it is converted to the camera coordinate P C , P C =RP W +T, R represents the rotation matrix, and T represents the translation matrix. The origin of the image coordinate system is the intersection of the camera optical axis and the image plane. Therefore, the camera coordinate P C Perform projection transformation to obtain image coordinates, and then translate the image coordinates to obtain pixel coordinates.

[0046] In this embodiment, a conversion relationship between the pixel coordinate system and the world coordinate system is established. The world coordinates and pixel coordinates of two known calibration objects are used to solve the above conversion relationship, and the external parameter matrix of the gimbal shooting device can be obtained. The external parameter matrix includes the world coordinates and orientation of the gimbal shooting device. The world coordinates of the gimbal shooting device can be extracted from the external parameter matrix.

[0047] The technical solution of this embodiment obtains the world coordinates of the pan-tilt shooting device based on the pixel coordinates of the two calibration objects obtained by the pan-tilt shooting device and the actual world coordinates of the two calibration objects. Compared with the method of obtaining the world coordinates of the pan-tilt shooting device based on measurement tools, the technical solution of this embodiment can save labor costs and improve the measurement accuracy of the world coordinates of the pan-tilt shooting device.

[0048] Furthermore, A2 may include:

[0049] A21. Establishing a conversion relationship equation between a pixel coordinate system and a world coordinate system according to an intrinsic parameter matrix, an extrinsic parameter matrix, a rotation matrix, and a translation matrix of the pan / tilt camera device;

[0050] A22. Solve the conversion relationship equation between the pixel coordinate system and the world coordinate system according to the pixel coordinates of the first calibration object in the image, the world coordinates of the first calibration object, the pixel coordinates of the second calibration object in the image, and the world coordinates of the second calibration object to obtain the conversion relationship between the pixel coordinate system and the world coordinate system.

[0051] Specifically, the intrinsic matrix can be determined based on the focal length, principal point coordinates and other parameters of the gimbal camera, or the gimbal camera can be automatically calibrated or calibrated by checkerboard. The extrinsic matrix is ​​determined based on the world coordinates and orientation of the gimbal camera. Set pixel coordinates (Expanding two-dimensional pixel coordinates to three dimensions), world coordinates Since the gimbal camera, the first calibration object, and the second calibration object are in the same plane, the value of the Z axis has no effect on the determination of the conversion relationship, so the Z axis value is set to zero. The intrinsic parameter matrix is ​​represented by M, the extrinsic parameter matrix is ​​represented by S, the rotation matrix is ​​represented by R, and the translation matrix is ​​represented by T. The rotation matrix R and the translation matrix T together form the extrinsic parameter matrix S = [R|T]. The conversion relationship between the pixel coordinate system and the world coordinate system can be expressed as: By performing matrix conversion on the above formula, we get: Will Recorded as R -1 T is denoted as but The final conversion relationship between the world coordinate system and the pixel coordinate system is expressed as:

[0052]

[0053] In this embodiment, the pixel coordinates and world coordinates of the first calibration object and the pixel coordinates and world coordinates of the second calibration object are known, and the above formula is solved to obtain the external parameter matrix. Since the external parameter matrix is ​​determined based on the position coordinates and posture of the pan-tilt camera device in the world coordinate system, the world coordinates of the pan-tilt camera device can be determined based on the external parameter matrix.

[0054] S120: Determine, according to the world coordinates of the gimbal shooting device, a first target azimuth that matches the first calibration object and / or a second target azimuth that matches the second calibration object.

[0055] Among them, the "azimuth" referred to in this embodiment refers to the azimuth of the earth's true north, that is, the angle between the earth's true north direction and the optical axis of the gimbal camera device is determined by taking the earth's true north direction as the reference direction. It should be noted that the "azimuth" referred to in this embodiment can be the angle required to rotate clockwise along the earth's true north direction to the optical axis of the gimbal camera device, or it can be the angle required to rotate counterclockwise along the earth's true north direction to the optical axis of the gimbal camera device. This embodiment does not limit the specific definition of the azimuth, and it can be flexibly set according to actual needs. In this embodiment, for the convenience of explanation, the azimuth is defined as the smaller angle between the angle between the earth's true north direction and the optical axis of the gimbal camera device.

[0056] The first target azimuth that matches the first calibration object may be the actual azimuth of the gimbal shooting device when the optical axis of the gimbal shooting device passes through the first calibration object, that is, when the first calibration object is at the center of the field of view of the gimbal shooting device. In this embodiment, since the world coordinates of the gimbal shooting device and the world coordinates of the first calibration object are known, the first target azimuth that matches the first calibration object can be determined based on the world coordinates of the gimbal shooting device and the world coordinates of the first calibration object.

[0057] Similarly, the second target azimuth that matches the second calibration object can be the actual azimuth of the gimbal shooting device when the optical axis of the gimbal shooting device passes through the second calibration object, that is, when the second calibration object is at the center of the field of view of the gimbal shooting device. In this embodiment, since the world coordinates of the gimbal shooting device and the world coordinates of the second calibration object are known, the second target azimuth that matches the second calibration object can be determined based on the world coordinates of the gimbal shooting device and the world coordinates of the second calibration object.

[0058] Figure 3 A schematic diagram of a first target azimuth and a second target azimuth is provided, such as Figure 3 As shown, A is the first calibration object, B is the second calibration object, C is the pan-tilt camera, θ3 is the first target azimuth, and θ4 is the second target azimuth.

[0059] In an optional embodiment, the first target azimuth matching the first calibration object and / or the second target azimuth matching the second calibration object are determined based on the world coordinates of the pan-tilt camera device. The pan-tilt camera device can be used as the origin to draw a perpendicular line to the true north direction of the earth at the first calibration object. The intersection of the perpendicular line with the true north direction of the earth at the first calibration object, the pan-tilt camera device, and the first calibration object form a right triangle. The size of the first target azimuth θ3 can be determined based on the world coordinates of the pan-tilt camera device and the first calibration object. Similarly, the pan-tilt camera device can be used as the origin to draw a perpendicular line to the true north direction of the earth at the second calibration object. The intersection of the perpendicular line with the true north direction of the earth at the second calibration object, the pan-tilt camera device, and the second calibration object form a right triangle. The size of the second target azimuth θ4 can be determined based on the world coordinates of the pan-tilt camera device and the second calibration object.

[0060] It should be noted that in the above optional embodiments, the gimbal shooting device, the first calibration object and the second calibration object are located in the same plane, but the plane and the true north direction of the earth at the first calibration object and / or the true north direction of the earth at the second calibration object may be in the same plane or not in the same plane, and this embodiment does not limit this.

[0061] In another optional embodiment, the three side lengths a, b and c of the triangle formed by the pan-tilt camera, the first calibration object and the second calibration object can also be determined according to the world coordinates of the pan-tilt camera, the first calibration object and the second calibration object; the three angles of the triangle can be determined according to the three side lengths of the triangle; the size of θ1 can be determined according to the world coordinates of the first calibration object and the second calibration object; the size of the first target azimuth θ3 can be obtained according to the angle corresponding to the side length b and θ1. The size of the second target azimuth θ4 can be determined according to θ2 and θ3 corresponding to the side length a.

[0062] It should be noted that in the above optional embodiment, the gimbal camera, the first marker and the second marker are located in the same plane, and the plane and the true north direction of the earth corresponding to the first marker and the true north direction of the earth at the second marker are all in the same plane. That is, the line between the gimbal camera and the first marker and the line between the gimbal camera and the second marker need to coincide in the horizontal direction.

[0063] In this embodiment, based on the world coordinates of the gimbal shooting device, the actual azimuth angle at the first calibration object and / or the actual azimuth angle at the second calibration object can be determined, thereby achieving azimuth error correction.

[0064] S130. Determine the azimuth of the pan-tilt camera device according to the first target azimuth and / or the second target azimuth.

[0065] In this embodiment, the azimuth of the gimbal shooting device can be determined based on the first target azimuth, the azimuth of the gimbal shooting device can be determined based on the second target azimuth, or the azimuth of the gimbal shooting device can be determined by combining the first target azimuth and the second target azimuth.

[0066] In an optional embodiment, the azimuth of the pan-tilt camera device is determined according to the first target azimuth, and the current angle provided by the pan-tilt camera device can be determined when the optical axis of the pan-tilt camera device passes through the first calibration object, that is, when the first calibration object is at the center of the field of view of the pan-tilt camera device. Specifically, the pan-tilt of the pan-tilt camera device is controlled so that the first calibration object is located at the center of the field of view of the pan-tilt camera device. The pixel coordinates of the first calibration object can be obtained by detecting the first calibration object on the image captured by the pan-tilt camera device, and the pan-tilt control mode is determined according to the pixel coordinates of the first calibration object until the pixel coordinates of the first calibration object are the center of the image. At this time, the current angle provided by the pan-tilt camera device is determined and recorded as the first angle. However, the first angle is not the real azimuth of the pan-tilt camera device at this time, and the azimuth may be incorrect due to certain environmental factors during the installation process or use process. Therefore, according to the first target azimuth and the first angle, the corresponding relationship between the angle provided by the pan-tilt camera device and the actual azimuth when the first calibration object is at the center of the field of view of the pan-tilt camera device can be determined.

[0067] When the gimbal camera device rotates subsequently, the first angle is used as the reference angle, and the actual azimuth angle of the gimbal camera device at each position is determined according to the relationship between the real-time angle and the reference angle of each position after the rotation of the gimbal camera device, and the correspondence between the angle provided by the gimbal camera device and the actual azimuth angle when the first calibration object is at the center of the field of view of the gimbal camera device.

[0068] Similarly, by determining the azimuth of the pan-tilt camera device based on the azimuth of the second target, it is possible to determine the current angle provided by the pan-tilt camera device when the optical axis of the pan-tilt camera device passes through the second calibration object, that is, when the second calibration object is at the center of the field of view of the pan-tilt camera device. Specifically, the pan of the pan-tilt camera device is controlled so that the second calibration object is located at the center of the field of view of the pan-tilt camera device. The pixel coordinates of the second calibration object can be obtained by performing a second calibration object detection on the image captured by the pan-tilt camera device, and the pan-tilt control method can be determined based on the pixel coordinates of the second calibration object until the pixel coordinates of the second calibration object are the center of the image. At this time, the current angle provided by the pan-tilt camera device is determined and recorded as the second angle. Based on the second target azimuth and the second angle, the correspondence between the angle provided by the pan-tilt camera device and the actual azimuth when the second calibration object is at the center of the field of view of the pan-tilt camera device can be determined.

[0069] When the gimbal camera device rotates subsequently, the second angle is used as the reference angle. According to the relationship between the real-time angles and the reference angles at each position after the rotation of the gimbal camera device, and the correspondence between the angle provided by the gimbal camera device and the actual azimuth when the second calibration object is at the center of the field of view of the gimbal camera device, the actual azimuth of the gimbal camera device at each position is determined.

[0070] In another optional embodiment, the azimuth of the gimbal camera device is determined in combination with the first target azimuth and the second target azimuth. The same method as above is used to determine the first actual azimuth of the gimbal camera device at a certain position when the current angle provided by the gimbal camera device when the first calibration object is at the center of the field of view of the gimbal camera device is used as the reference angle, and the second actual azimuth of the gimbal camera device at a certain position when the current angle provided by the gimbal camera device when the second calibration object is at the center of the field of view of the gimbal camera device is used as the reference angle. The actual azimuth of the gimbal camera device at the position can be determined based on the first actual azimuth and the second actual azimuth.

[0071] Furthermore, after the azimuth error value is determined, the azimuth correction is performed according to the azimuth error value. Specifically, when the PTZ camera performs related services, such as fire point detection, intrusion detection, etc., if a target object is detected and the geographic coordinates of the target object need to be determined, the actual azimuth of the PTZ camera is determined according to the corresponding relationship between the reference angle of the PTZ camera and the actual azimuth, and then the actual azimuth is applied to the subsequent positioning of the target object.

[0072] The technical solution of this embodiment determines the correspondence between the angle provided by the gimbal shooting device and the actual azimuth angle based on the actual azimuth angle and the angle provided by the gimbal shooting device, and corrects the azimuth angle, thereby avoiding the target object positioning accuracy error caused by the azimuth angle error and improving the target object positioning accuracy.

[0073] The technical solution of the embodiment of the present invention determines the world coordinates of the pan-tilt shooting device by using the images obtained by shooting the first calibration object and the second calibration object with the pan-tilt shooting device, the world coordinates of the first calibration object, and the world coordinates of the second calibration object, and determines the first target azimuth matching the first calibration object and the second target azimuth matching the second calibration object according to the world coordinates of the pan-tilt shooting device, and determines the azimuth of the pan-tilt shooting device according to the first target azimuth and / or the second target azimuth. The problem of large errors or manual reliance on the azimuth correction method in the prior art is solved, and the accurate azimuth of the pan-tilt shooting device is automatically determined, thereby improving the positioning accuracy of the pan-tilt shooting device.

[0074] Embodiment 2

[0075] Figure 4 A flowchart of a method for determining the azimuth angle of a pan-tilt shooting device provided in Embodiment 2 of the present invention. Based on the above embodiments, this embodiment of the present invention further specifies the process of determining the azimuth angle of a first target and the azimuth angle of a second target, and the process of determining the azimuth angle based on the first target azimuth angle and the second target azimuth angle.

[0076] like Figure 4 As shown, the method includes:

[0077] S210: Determine the world coordinates of the gimbal shooting device according to images captured by the gimbal shooting device of the first calibration object and the second calibration object, the world coordinates of the first calibration object, and the world coordinates of the second calibration object.

[0078] The specific process of determining the world coordinates of the gimbal shooting device based on the images captured by the gimbal shooting device on the first calibration object and the second calibration object has been described in the above embodiments and will not be repeated in this embodiment.

[0079] S220: Determine a rotation angle of the gimbal shooting device relative to the first calibration object and the second calibration object.

[0080] The rotation angle of the pan-tilt camera device relative to the first calibration object and the second calibration object refers to the rotation angle required by the pan-tilt camera device when the pan-tilt camera device rotates from a certain position where the first calibration object is located in the field of view of the pan-tilt camera device to the position where the second calibration object is located in the field of view of the pan-tilt camera device. The above position can be either a central position or a pre-set position, which is not limited in this embodiment. Figure 3 As shown, the rotation angle of the gimbal shooting device relative to the first calibration object and the second calibration object is θ2.

[0081] Furthermore, S220 may include:

[0082] B1, determining a first angle when the pan-tilt camera device photographs the first calibration object to obtain a first image, and determining a second angle when the pan-tilt camera device photographs the second calibration object to obtain a second image;

[0083] The first calibration object in the first image is located at the center of the image, and the second calibration object in the second image is located at the center of the image;

[0084] B2. Taking the absolute value of the difference between the first angle and the second angle as the rotation angle of the gimbal shooting device relative to the first calibration object and the second calibration object.

[0085] Among them, when the first calibration object is located at the center of the image, that is, when the optical axis of the pan-tilt camera passes through the first calibration object, the first angle of the pan-tilt camera at this time is the current angle provided by the pan-tilt camera corresponding to the first calibration object. The specific process of controlling the optical axis of the pan-tilt camera to pass through the first calibration object and the specific process of determining the current azimuth displayed by the pan-tilt camera have been described in the above embodiments, and will not be repeated in this embodiment.

[0086] Similarly, when the second calibration object is located at the center of the image, that is, when the optical axis of the gimbal shooting device passes through the second calibration object, the second angle of the gimbal shooting device at this time is the current angle provided by the gimbal shooting device corresponding to the second calibration object.

[0087] In this embodiment, the optical axis of the gimbal camera is controlled to pass through the first calibration object and the second calibration object in sequence, on the one hand, in order to obtain the first angle and the second angle, so as to subsequently determine the corresponding relationship between the angle provided by the gimbal camera and the actual azimuth. On the other hand, although the first angle and the second angle obtained at this time are not the real azimuth, the difference between the second angle and the first angle can be used to represent the rotation angle of the gimbal camera relative to the first calibration object and the second calibration object.

[0088] S230: Determine a first angle between a line connecting the first calibration object and the second calibration object and the true north direction according to the world coordinates of the first calibration object and the world coordinates of the second calibration object.

[0089] The true north direction in this embodiment is the true north direction of the earth. Figure 3 As shown, the first angle between the line between the first calibration object and the second calibration object and the true north direction is θ1.

[0090] Specifically, the second calibration object can be used as the origin and a perpendicular line can be drawn to the true north direction of the earth at the first calibration object. The intersection of the perpendicular line and the true north direction of the earth at the first calibration object, the first calibration object and the second calibration object form a right triangle. The size of θ1 can be determined based on the world coordinates of the first calibration object and the world coordinates of the second calibration object.

[0091] S240: Determine a second angle between a line between the gimbal shooting device and the first calibration object and a line between the first calibration object and the second calibration object according to the world coordinates of the gimbal shooting device, the world coordinates of the first calibration object, and the world coordinates of the second calibration object.

[0092] Specifically, according to the world coordinates of the pan-tilt camera device, the world coordinates of the first calibration object, and the world coordinates of the second calibration object, the lengths of the three sides of the triangle formed by the pan-tilt camera device, the first calibration object, and the second calibration object can be obtained. Figure 3As shown, the second angle between the line between the gimbal camera and the first calibration object and the line between the first calibration object and the second calibration object is the angle corresponding to the side length b. According to the side lengths a, b and c, the second angle corresponding to the side length b can be obtained by the cosine theorem.

[0093] S250: Subtract the first angle from the second angle to obtain an angle obtained by taking the angle as a first target azimuth angle that matches the first calibration object.

[0094] like Figure 3 As shown, the first target azimuth angle θ3 can be obtained by subtracting the first angle from the second angle.

[0095] S260: Taking the sum of the rotation angle and the first target azimuth as a second target azimuth that matches the second calibration object.

[0096] like Figure 3 As shown, the sum of θ2 and θ3 is θ4, which is the azimuth angle of the second target.

[0097] It should be noted that in order to calculate the angles using the technical solution of this embodiment, it is necessary to ensure that the planes where the gimbal shooting equipment, the first marker and the second marker are located, and the true north direction of the earth corresponding to the first marker and the true north direction of the earth at the second calibration object are all on the same plane.

[0098] S270: Determine the azimuth of the gimbal shooting device according to the first target azimuth and / or the second target azimuth.

[0099] Furthermore, S270 may include:

[0100] C1. Determine a correspondence between an angle provided by a pan / tilt camera and an azimuth according to a difference between the first target azimuth and the first angle, and / or a difference between the second target azimuth and the second angle;

[0101] C2. Determine the azimuth angle of the gimbal camera device according to the current angle of the gimbal camera device and the corresponding relationship between the angle and the azimuth angle provided by the gimbal camera device.

[0102] The difference between the first target azimuth and the first angle is the correspondence between the angle provided by the gimbal camera and the actual azimuth when the first calibration object is at the center of the field of view of the gimbal camera and the difference between the second target azimuth and the second angle is the correspondence between the angle provided by the gimbal camera and the actual azimuth when the second calibration object is at the center of the field of view of the gimbal camera and the difference between the second target azimuth and the second angle.

[0103] In the above embodiments, the actual azimuth of the gimbal camera at each position is determined solely based on the correspondence between the first target azimuth and the first angle, and the actual azimuth of the gimbal camera at each position is determined solely based on the correspondence between the second target azimuth and the second angle. This embodiment further describes the process of determining the actual azimuth of the gimbal camera at each position by combining the correspondence between the first target azimuth and the first angle and the correspondence between the second target azimuth and the second angle.

[0104] Specifically, the first actual azimuth of the gimbal camera device at a certain position is determined based on the correspondence between the first target azimuth and the first angle, and the second actual azimuth of the gimbal camera device at a certain position is determined based on the correspondence between the second target azimuth and the second angle.

[0105] In an optional embodiment, the average value of the first actual azimuth angle and the second actual azimuth angle may be directly used as the final azimuth error value.

[0106] In another optional embodiment, a difference check condition may also be set to determine whether the difference between the first actual azimuth and the second actual azimuth is less than or equal to a preset threshold. It is understandable that if the actual azimuths calculated at the two calibration objects differ greatly, it indicates that there may be errors in the calculation process. Therefore, if the above conditions are not met, the process of the above embodiment is repeated until the difference check condition is met. When the difference check condition is met, the average value of the first actual azimuth and the second actual azimuth is used as the final azimuth error value.

[0107] The technical solution of this embodiment determines the world coordinates of the pan-tilt shooting device based on the image obtained by the pan-tilt shooting device shooting the first calibration object and the second calibration object, which can save labor costs and improve the accuracy of determining the world coordinates. The optical axis center of the pan-tilt shooting device is controlled to pass through the first calibration object, and the first angle at this time is recorded. The optical axis center of the pan-tilt shooting device is controlled to pass through the second calibration object, and the second angle at this time is recorded. According to the absolute value of the difference between the first angle and the second angle, the rotation angle of the pan-tilt shooting device is determined. Based on the world coordinates of the first calibration object and the second calibration object, the first angle between the line between the first calibration object and the second calibration object and the true north direction at the first calibration object is calculated. Based on the world coordinates of the pan-tilt shooting device, the first calibration object and the second calibration object, the second angle between the line between the first calibration object and the second calibration object and the line between the first calibration object and the pan-tilt shooting device is calculated. According to the difference between the second angle and the first angle, the angle between the line between the first calibration object and the pan-tilt shooting device and the true north direction at the first calibration object is determined, that is, the first target azimuth at the first calibration object. The sum of the rotation angle and the first target azimuth is taken as the second target azimuth. According to the difference between the first target azimuth and the first angle, and / or the difference between the second target azimuth and the second angle, the corresponding relationship between the angle provided by the pan-tilt camera device and the actual azimuth is determined, and based on the corresponding relationship, the actual azimuth of the pan-tilt camera device at each position is determined. In the subsequent target object positioning process, the azimuth of the pan-tilt camera device used is the real azimuth, thereby avoiding the target object positioning accuracy error caused by the azimuth error and improving the accuracy of target object positioning.

[0108] Embodiment 3

[0109] Figure 5 This is a schematic diagram of the structure of an azimuth angle determination device for a pan-tilt camera device provided in Embodiment 3 of the present invention. Figure 5 As shown, the device comprises:

[0110] A world coordinate determination module 310, configured to determine the world coordinates of the pan-tilt shooting device according to images captured by the pan-tilt shooting device of the first calibration object and the second calibration object, the world coordinates of the first calibration object, and the world coordinates of the second calibration object;

[0111] A target azimuth angle determination module 320 is used to determine a first target azimuth angle matching the first calibration object and / or a second target azimuth angle matching the second calibration object according to the world coordinates of the pan / tilt shooting device;

[0112] The azimuth angle determination module 330 is used to determine the azimuth angle of the pan-tilt camera device according to the first target azimuth angle and / or the second target azimuth angle.

[0113] The technical solution of the embodiment of the present invention determines the world coordinates of the pan-tilt shooting device by using the images obtained by shooting the first calibration object and the second calibration object with the pan-tilt shooting device, determines the first target azimuth matching the first calibration object and the second target azimuth matching the second calibration object according to the world coordinates of the pan-tilt shooting device, and performs azimuth correction on the pan-tilt shooting device according to the first target azimuth and / or the second target azimuth. The problem of large errors or manual reliance on the azimuth correction method in the prior art is solved, and automatic and accurate azimuth correction of the pan-tilt shooting device is realized, thereby improving the positioning accuracy of the pan-tilt shooting device.

[0114] Based on the above embodiment, optionally, the world coordinate determination module 310 includes:

[0115] An image capturing unit, used to determine an image obtained by capturing the first calibration object and the second calibration object by a pan / tilt camera;

[0116] a conversion relationship determining unit, configured to determine a conversion relationship between a pixel coordinate system and a world coordinate system according to pixel coordinates of the first calibration object in the image, world coordinates of the first calibration object, pixel coordinates of the second calibration object in the image, and world coordinates of the second calibration object;

[0117] An extrinsic parameter matrix determination unit, used to determine the extrinsic parameter matrix of the pan-tilt camera device according to the conversion relationship between the pixel coordinate system and the world coordinate system;

[0118] The world coordinate determination unit is used to determine the world coordinates of the gimbal shooting device according to the external parameter matrix of the gimbal shooting device.

[0119] Based on the above embodiment, optionally, the conversion relationship determination unit is specifically used to:

[0120] Establishing a conversion relationship equation between a pixel coordinate system and a world coordinate system according to an intrinsic parameter matrix, an extrinsic parameter matrix, a rotation matrix, and a translation matrix of the pan / tilt camera device;

[0121] According to the pixel coordinates of the first calibration object in the image, the world coordinates of the first calibration object, the pixel coordinates of the second calibration object in the image, and the world coordinates of the second calibration object, the conversion relationship equation between the pixel coordinate system and the world coordinate system is solved to obtain the conversion relationship between the pixel coordinate system and the world coordinate system.

[0122] Based on the above embodiment, optionally, the target azimuth angle determination module 320 includes:

[0123] A rotation angle determination unit, used to determine the rotation angle of the pan / tilt camera device relative to the first calibration object and the second calibration object;

[0124] A first angle determining unit, configured to determine a first angle between a line connecting the first calibration object and the second calibration object and the true north direction according to the world coordinates of the first calibration object and the world coordinates of the second calibration object;

[0125] a second angle determination unit, configured to determine a second angle between a line between the pan-tilt shooting device and the first calibration object and a line between the first calibration object and the second calibration object according to the world coordinates of the pan-tilt shooting device, the world coordinates of the first calibration object, and the world coordinates of the second calibration object;

[0126] The first target azimuth angle determining unit is configured to obtain an angle by subtracting the first angle from the second angle, as a first target azimuth angle matching the first calibration object.

[0127] Based on the above embodiment, optionally, the rotation angle determination unit is specifically used to:

[0128] Determine a first angle when the pan-tilt camera device photographs the first calibration object to obtain a first image, and determine a second angle when the pan-tilt camera device photographs the second calibration object to obtain a second image;

[0129] The first calibration object in the first image is located at the center of the image, and the second calibration object in the second image is located at the center of the image;

[0130] The absolute value of the difference between the first angle and the second angle is used as the rotation angle of the pan-tilt camera device relative to the first calibration object and the second calibration object.

[0131] Based on the above embodiment, optionally, the target azimuth angle determination module 320 includes:

[0132] The second target azimuth angle determination unit is configured to use the sum of the rotation angle and the first target azimuth angle as the second target azimuth angle matching the second calibration object.

[0133] Based on the above embodiment, optionally, the azimuth angle determination module 330 includes:

[0134] an azimuth error determination unit, configured to determine a correspondence between an angle provided by a pan / tilt camera and an azimuth according to a difference between the first target azimuth and the first angle, and / or a difference between the second target azimuth and the second angle;

[0135] The azimuth correction unit is used to determine the azimuth of the pan-tilt shooting device according to the current angle of the pan-tilt shooting device and the corresponding relationship between the angle provided by the pan-tilt shooting device and the azimuth.

[0136] The azimuth angle determination device of the pan-tilt camera device provided in the embodiment of the present invention can execute the azimuth angle determination method of the pan-tilt camera device provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0137] Embodiment 4

[0138] Figure 6 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0139] like Figure 6 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0140] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0141] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 executes the various methods and processes described above, such as the azimuth angle determination method of the pan-tilt camera device.

[0142] In some embodiments, the azimuth determination method of the pan-tilt camera device may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the azimuth determination method of the pan-tilt camera device described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the azimuth determination method of the pan-tilt camera device in any other appropriate manner (e.g., by means of firmware).

[0143] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0144] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0145] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0146] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0147] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0148] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0149] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0150] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for determining the azimuth angle of a pan-tilt camera, characterized in that: include: Determine the world coordinates of the pan-tilt shooting device according to images captured by the pan-tilt shooting device of the first calibration object and the second calibration object, the world coordinates of the first calibration object, and the world coordinates of the second calibration object; Determine, according to the world coordinates of the pan / tilt camera device, a first target azimuth matching the first calibration object and / or a second target azimuth matching the second calibration object; The azimuth of the pan-tilt camera device is determined according to the first target azimuth and / or the second target azimuth.

2. The method according to claim 1, characterized in that Determining the world coordinates of the gimbal shooting device according to images captured by the gimbal shooting device on the first calibration object and the second calibration object, including: Determine an image obtained by photographing the first calibration object and the second calibration object by a pan / tilt camera; Determine a conversion relationship between a pixel coordinate system and a world coordinate system according to pixel coordinates of the first calibration object in the image, world coordinates of the first calibration object, pixel coordinates of the second calibration object in the image, and world coordinates of the second calibration object; According to the conversion relationship between the pixel coordinate system and the world coordinate system, the external parameter matrix of the gimbal shooting device is determined; Determine the world coordinates of the gimbal shooting device according to the external parameter matrix of the gimbal shooting device.

3. The method according to claim 2, characterized in that Determining a conversion relationship between a pixel coordinate system and a world coordinate system according to pixel coordinates of the first calibration object in the image, world coordinates of the first calibration object, pixel coordinates of the second calibration object in the image, and world coordinates of the second calibration object includes: Establishing a conversion relationship equation between a pixel coordinate system and a world coordinate system according to an intrinsic parameter matrix, an extrinsic parameter matrix, a rotation matrix, and a translation matrix of the pan / tilt camera device; According to the pixel coordinates of the first calibration object in the image, the world coordinates of the first calibration object, the pixel coordinates of the second calibration object in the image, and the world coordinates of the second calibration object, the conversion relationship equation between the pixel coordinate system and the world coordinate system is solved to obtain the conversion relationship between the pixel coordinate system and the world coordinate system.

4. The method according to claim 1, characterized in that Determining a first target azimuth that matches the first calibration object according to the world coordinates of the pan-tilt camera device includes: Determine a rotation angle of the gimbal camera device relative to the first calibration object and the second calibration object; Determine a first angle between a line connecting the first calibration object and the second calibration object and the true north direction according to the world coordinates of the first calibration object and the world coordinates of the second calibration object; Determine a second angle between a line between the pan-tilt shooting device and the first calibration object and a line between the first calibration object and the second calibration object according to the world coordinates of the pan-tilt shooting device, the world coordinates of the first calibration object, and the world coordinates of the second calibration object; An angle obtained by subtracting the first angle from the second angle is used as a first target azimuth angle matching the first calibration object.

5. The method according to claim 4, characterized in that Determining a rotation angle of a gimbal shooting device relative to a first calibration object and a second calibration object includes: Determine a first angle when the pan-tilt camera device photographs the first calibration object to obtain a first image, and determine a second angle when the pan-tilt camera device photographs the second calibration object to obtain a second image; The first calibration object in the first image is located at the center of the image, and the second calibration object in the second image is located at the center of the image; The absolute value of the difference between the first angle and the second angle is used as the rotation angle of the pan-tilt camera device relative to the first calibration object and the second calibration object.

6. The method according to claim 4, characterized in that Determining a second target azimuth matching the second calibration object according to the world coordinates of the pan-tilt camera device includes: The sum of the rotation angle and the first target azimuth is used as a second target azimuth that matches the second calibration object.

7. The method according to claim 5, characterized in that Determining the azimuth of the pan / tilt camera device according to the first target azimuth and / or the second target azimuth includes: Determine a correspondence between an angle provided by a pan / tilt camera and an azimuth angle according to a difference between the first target azimuth angle and the first angle, and / or a difference between the second target azimuth angle and the second angle; The azimuth angle of the pan-tilt camera device is determined according to the current angle of the pan-tilt camera device and the corresponding relationship between the angle provided by the pan-tilt camera device and the azimuth angle.

8. A device for determining the azimuth angle of a pan-tilt camera, characterized in that: include: A world coordinate determination module, used to determine the world coordinates of the pan-tilt shooting device according to the images obtained by the pan-tilt shooting device of the first calibration object and the second calibration object, the world coordinates of the first calibration object and the world coordinates of the second calibration object; a target azimuth angle determination module, configured to determine a first target azimuth angle matching the first calibration object and / or a second target azimuth angle matching the second calibration object according to the world coordinates of the pan / tilt camera device; An azimuth angle determination module is used to determine the azimuth angle of the pan-tilt camera device according to the first target azimuth angle and / or the second target azimuth angle.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the azimuth angle determination method of the gimbal shooting device as described in any one of claims 1-7 is implemented.

10. A storage medium storing computer executable instructions, characterized in that: The computer executable instructions are used to execute the azimuth angle determination method of the gimbal shooting device as described in any one of claims 1-7 when executed by a computer processor.