Pan-tilt camera azimuth angle identification method and device, electronic equipment and storage medium
By performing zoom and pan-tilt adjustments on the PTZ camera, combined with the position recording of reference markers, optical axis deviation is identified and corrected, solving the problem of large calculation errors in electronic compasses and achieving higher-precision fire point positioning.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG UNIVIEW TECH CO LTD
- Filing Date
- 2024-12-05
- Publication Date
- 2026-06-05
AI Technical Summary
When existing PTZ cameras calculate azimuth using electronic compasses, the geomagnetic information is weak and easily interfered with by electromagnetic noise, resulting in large azimuth calculation errors. This fails to meet the accuracy requirements for fire point location and affects the timeliness and accuracy of fire monitoring and firefighting efforts.
By controlling the target PTZ camera to perform zoom adjustment and PTZ rotation adjustment, the reference mark on the reference device is located in the preset area in the center of the image. The reference angle information after each adjustment is recorded, the offset of the zoom lens and the horizontal rotation of the PTZ is analyzed, and the optical axis deviation is corrected.
It improves target positioning accuracy, ensures the direction accuracy of camera shooting, adapts to performance tests under different distances and angles, and enhances the accuracy of fire point positioning and the reliability of the camera.
Smart Images

Figure CN122160628A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of camera control technology, and in particular to a method, device, electronic device, and storage medium for identifying the azimuth angle of a pan-tilt camera. Background Technology
[0002] Forests and grasslands play a crucial role in maintaining ecological balance, providing services, and promoting economic development. Pan-tilt-zoom (PTZ) cameras, due to their flexible adjustable shooting angles, are widely used for forest and grassland fire monitoring, enabling real-time monitoring of large areas. When a fire is detected, accurate camera angle and orientation are needed to calculate its geographical location.
[0003] The proposed solution involves installing an electronic compass on a PTZ camera to obtain geomagnetic information and calculate the azimuth angle. However, this method suffers from several drawbacks. The geomagnetic information is weak, and the electromagnetic noise generated by the camera's operation is strong, easily interfering with the geomagnetic information and leading to large errors in the azimuth angle calculation. For targets 10 kilometers away, the deviation can reach 3.47 kilometers to 6.84 kilometers, failing to meet the accuracy requirements for fire location and severely impacting the timeliness and accuracy of fire monitoring and firefighting efforts. Summary of the Invention
[0004] This invention provides a method, device, electronic device, and storage medium for azimuth angle recognition of a PTZ camera, which can automatically identify the azimuth angle corresponding to the optical axis of the image and correct errors caused by optical axis deviation, thereby significantly improving the target positioning accuracy when capturing images.
[0005] According to one aspect of the present invention, a method for identifying the azimuth angle of a PTZ camera is provided, the method comprising:
[0006] The target PTZ camera is controlled to perform each reference adjustment operation so that the reference mark on the reference device is within a preset area in the center of the image of the target PTZ camera. The reference adjustment operation is to perform a zoom adjustment on the PTZ camera and then perform a PTZ rotation adjustment on the PTZ camera. The reference device keeps its position unchanged during each reference adjustment operation.
[0007] Determine the reference angle information after the target PTZ camera performs each reference adjustment operation. The reference angle information includes the azimuth angle corresponding to the optical axis of the imaging screen and the azimuth angle corresponding to the horizontal angle of the PTZ camera relative to true north when the target PTZ camera completes each reference adjustment operation.
[0008] Based on the reference angle information after each reference adjustment operation performed by the target PTZ camera, the reference offset information of the target PTZ camera is determined. This information is used to identify the azimuth angle of the target PTZ camera. The reference offset information is used to indicate the optical axis offset of the imaging image of the target PTZ camera's zoom lens at different magnifications and the horizontal angle deviation of the PTZ camera relative to true north when the PTZ camera performs horizontal rotation at each magnification.
[0009] According to another aspect of the present invention, a PTZ camera azimuth angle recognition device is provided, the device comprising:
[0010] The control module is used to control the target PTZ camera to perform each reference adjustment operation so that the reference mark on the reference device is within a preset area in the center of the imaging screen of the target PTZ camera. The reference adjustment operation is to perform a zoom adjustment on the PTZ camera and then perform a PTZ rotation adjustment on the PTZ camera. The reference device keeps its position unchanged during each reference adjustment operation.
[0011] The first determining module is used to determine the reference angle information after the target PTZ camera performs each reference adjustment operation. The reference angle information includes the azimuth angle corresponding to the optical axis of the imaging screen and the azimuth angle corresponding to the horizontal angle of the PTZ camera relative to due north when the target PTZ camera completes each reference adjustment operation.
[0012] The second determining module is used to determine the reference offset information of the target PTZ camera based on the reference angle information after each reference adjustment operation. It is used to identify the azimuth angle of the target PTZ camera. The reference offset information is used to indicate the optical axis offset of the imaging image of the zoom lens of the target PTZ camera at different magnifications and the horizontal angle deviation of the PTZ camera relative to due north when the PTZ camera performs horizontal rotation at each magnification.
[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0014] At least one processor; and
[0015] A memory communicatively connected to the at least one processor; wherein,
[0016] The memory stores a computer program that can be executed by the at least one processor, which is then executed by the at least one processor to enable the at least one processor to perform the azimuth angle recognition method for a PTZ camera according to any embodiment of the present invention.
[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions, the computer instructions being configured to cause a processor to execute and implement the azimuth angle recognition method of a PTZ camera according to any embodiment of the present invention.
[0018] The technical solution of this invention involves placing a reference marker on the reference device within a preset area at the center of the target PTZ camera's image frame during each reference adjustment operation. This establishes a baseline for identifying the azimuth deviation of the PTZ camera. Simultaneously, this baseline is used to comprehensively record the reference angle information after each reference adjustment operation, including the azimuth angle corresponding to the optical axis of the image frame and the azimuth angle corresponding to the PTZ horizontal angle relative to true north. By recording and analyzing these azimuth angles after different reference adjustment operations, the azimuth angle variation patterns of the target PTZ camera under various magnifications and rotation states can be thoroughly investigated. This clarifies the offset of the optical axis of the target PTZ camera's zoom lens at different magnifications, as well as the PTZ horizontal angle deviation relative to true north when the PTZ camera rotates horizontally at each magnification. This facilitates more accurate azimuth angle adjustment and compensation, ensuring the camera's shooting direction meets the expected requirements.
[0019] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a flowchart of a pan-tilt camera azimuth angle recognition method according to an embodiment of the present invention;
[0022] Figure 2 This is a schematic diagram illustrating the error between fire point positions applicable to an embodiment of the present invention;
[0023] Figure 3 This is a schematic diagram of an example process for azimuth angle recognition of a PTZ camera according to an embodiment of the present invention;
[0024] Figure 4This is a schematic diagram of the azimuth angle of the optical axis of an imaging image according to an embodiment of the present invention;
[0025] Figure 5 This is a schematic diagram of the azimuth angle of a gimbal horizontal angle applicable according to an embodiment of the present invention;
[0026] Figure 6 This is a schematic diagram of the structure of a PTZ camera azimuth angle recognition device according to an embodiment of the present invention;
[0027] Figure 7 This is a schematic diagram of the structure of an electronic device that implements the azimuth angle recognition method of a PTZ camera according to an embodiment of the present invention. Detailed Implementation
[0028] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0029] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0030] Figure 1 This is a flowchart illustrating a method for identifying the azimuth angle of a PTZ camera according to an embodiment of the present invention. This embodiment is applicable to situations where the azimuth angle of a PTZ camera is precisely controlled when the zoom lens of the PTZ camera is zoomed and the PTZ is rotated horizontally. The azimuth angle identification method can be executed by a PTZ camera azimuth angle identification device, which can be implemented in hardware and / or software. The PTZ camera azimuth angle identification device can be configured in any electronic device with network communication capabilities.
[0031] like Figure 1As shown, the azimuth angle recognition method for a PTZ camera in this embodiment includes the following process:
[0032] S110. Control the target PTZ camera to perform each reference adjustment operation so that the reference mark on the reference device is within the preset area of the center of the target PTZ camera's image. The reference adjustment operation is to perform a zoom adjustment on the PTZ camera and then perform a PTZ rotation adjustment on the PTZ camera. The reference device keeps its position unchanged during each reference adjustment operation.
[0033] See Figure 2 The electronic compass on a PTZ camera calculates its azimuth angle by acquiring geomagnetic information. However, geomagnetic information is very weak, and the electromagnetic noise generated by the PTZ camera during operation easily affects this information, resulting in significant errors in the azimuth angle calculated by the electronic compass. Therefore, the fire point location determined by the azimuth angle calculated by the electronic compass differs from the actual fire point location by an angular error θ, which can reach 10°-20°. For a target 10 kilometers away, the calculated deviation L1 is as high as 3.47 kilometers to 6.84 kilometers, making it impossible to use the calculated azimuth angle of the PTZ camera for fire point location. The specific calculation formula is as follows:
[0034]
[0035] Based on the above, reference adjustment operations can be performed on the target PTZ camera. Each reference adjustment operation can include zoom adjustment and PTZ rotation adjustment. Performing zoom adjustment on the target PTZ camera changes its magnification. Zoom adjustment means changing the focal length of the camera lens, thereby magnifying or reducing the size of the subject being photographed. For example, when a distant target needs to be observed more clearly, the focal length may be increased for zoom magnification; conversely, when a wider field of view is needed to observe the target's position within the entire frame, the focal length may be decreased for zoom reduction.
[0036] After zooming the target PTZ camera's zoom lens in the same reference adjustment operation, the PTZ camera's rotation adjustment is performed immediately afterwards. PTZ rotation adjustment refers to controlling the PTZ camera's pan / tilt head to rotate horizontally. Horizontal rotation allows the camera to move left or right, changing its shooting angle and thus its shooting direction. This allows the reference marker to be moved back to the preset area in the center of the image after zooming adjustment. The reference marker can be a signal marker on the reference device that displays visual elements, such as indicator lights, electronic light-emitting elements, and visual signal devices.
[0037] Throughout each reference adjustment operation, the reference device remains stationary. The reference marker on the reference device serves as a standard target point for the target PTZ camera to align and adjust. Each reference adjustment operation aims to place the reference marker within a preset area centered on the target PTZ camera's image frame. This allows for continuous recording of the azimuth angle corresponding to the optical axis of the image frame and the azimuth angle corresponding to the PTZ horizontal angle relative to true north when the PTZ camera is aligned with the center of the image frame after each adjustment operation.
[0038] The azimuth angle corresponding to the optical axis of the imaging screen can be the horizontal angle between the optical axis and geographic north. In the geographic coordinate system, north is 0° (or 360°), east is 90°, south is 180°, and west is 270°. Once the azimuth angle of the optical axis is determined, the geographic direction it points to can be clearly identified. For example, the azimuth angle is the horizontal angle measured clockwise from the north line to the target direction line. The azimuth angle ranges from 0° to 360° and is a method of measuring direction. The central axis of the camera's imaging screen refers to the virtual central axis of the image, which divides the image in half both horizontally and vertically, serving as a reference line for the geometric center of the image.
[0039] The azimuth angle corresponding to the horizontal angle of the gimbal relative to true north can be defined as the horizontal angle between the direction of rotation of the gimbal around an axis perpendicular to the direction of gravity in the horizontal plane and the geographic true north. In the gimbal angle system, if true north is used as a reference, the horizontal angle of the gimbal at true north is usually defined as 0° (or 360°). This angle is determined based on the geographic coordinate system. The horizontal rotation axis of the gimbal is perpendicular to the direction of gravity. When the gimbal rotates horizontally until the zoom lens of the gimbal camera points to true north, from the perspective of angle measurement, the value measured by the angle sensor (such as a rotary encoder) should be 0° or 360°. It should be noted that the measurement of the horizontal angle of the gimbal is based on the geographic coordinate system, in which true north serves as an important reference direction. The geographic coordinate system provides a standard reference for directions on Earth, and true north is connected to the Earth's North Pole, forming the basis for determining other directions. In this coordinate system, the horizontal angle of the gimbal is rotated around an axis perpendicular to the direction of gravity. When the gimbal rotates so that its shooting direction is consistent with due north, according to the definition and measurement rules of angle, this angle is determined as 0° (it can also be represented as 360°, which is equivalent to 0° in direction, only the angle is different).
[0040] The preset area at the center of the image is a specific region pre-defined within the image, typically a region of a certain size determined based on the actual needs and the center of the image. For example, it could be a centerline area, a square, or a circle, and its size and shape may vary depending on the specific application scenario and accuracy requirements. In security monitoring, a more precise preset area may be required to ensure accurate capture of key targets; while in scenarios with relatively lower accuracy requirements, the preset area may be appropriately wider.
[0041] By combining zoom adjustment and gimbal rotation adjustment, the reference marker can be placed more precisely within a preset area centered on the image. Since the reference device remains in the same position during each adjustment operation, a stable reference standard is provided for the entire adjustment process. Each adjustment operation is based on the same reference point, making the adjustment results comparable.
[0042] As an optional but not limited implementation, controlling the target PTZ camera to perform each reference adjustment operation includes the following steps A1-A2:
[0043] Step A1: Control the reference device to fly and move to the reference position. The distance between the reference position and the target PTZ camera is greater than the preset distance. The reference device is an unmanned aerial vehicle with its own positioning function and carrying a reference marker.
[0044] Step A2: In the current reference adjustment operation, control the zoom lens of the target PTZ camera to perform zoom adjustment, and control the target PTZ camera to rotate the PTZ to adjust the PTZ angle until the reference mark on the reference device at the reference position is within the preset area of the center of the target PTZ camera's image. Keep the position of the reference device unchanged and control the target PTZ camera to perform the next reference adjustment operation.
[0045] After the PTZ camera is installed, you can use a dedicated orientation tool on the ground to walk along a north or south direction until the orientation tool is clearly visible in the PTZ camera's view. Then, precisely center the image on the personnel's location and mark that location as due north or due south. However, in scenarios like forest or grassland fire prevention, the installation environment is usually more complex. Ground conditions often don't allow personnel to easily move smoothly in a specific direction, and this method of determining orientation by personnel movement is difficult to guarantee in terms of accuracy.
[0046] Therefore, the reference device used in this solution can be an unmanned aerial vehicle (UAV) with its own positioning function and carrying a reference marker. It is controlled to fly and move to a specific reference position, which meets a preset distance requirement from the target PTZ camera's location; that is, the relative distance between the reference position and the target PTZ camera's location must be greater than the preset distance. The purpose of setting this reference position may be to simulate different distance scenarios that may occur between the target and the PTZ camera in actual applications, in order to more comprehensively test and calibrate the target PTZ camera's performance. For example, in security monitoring scenarios, it may be necessary to simulate a distant target object (represented by the reference device) entering the monitoring range. By placing the reference device at a relatively far location, the azimuth deviation that may occur when the camera zooms at different magnifications at different distances and when the PTZ rotates horizontally can be examined.
[0047] The reference device itself needs to have positioning capabilities. This ensures accurate location information throughout the reference adjustment process. This is crucial for calculating the azimuth angles corresponding to the optical axis of the target PTZ camera's image and the azimuth angles corresponding to the PTZ's horizontal angle relative to true north, which is essential for subsequent coordination with the target PTZ camera. The reference marker on the reference device serves as a standard for zooming and PTZ rotation adjustments to the target PTZ camera's zoom lens. This allows the camera to center the image using various operations, enabling the calculation of the azimuth angles corresponding to the optical axis of the image and the azimuth angles corresponding to the PTZ's horizontal angle relative to true north when the PTZ camera is aligned with the center of the image.
[0048] By controlling a reference device to fly to a more distant location (e.g., beyond a preset distance), the behavior of a target object at different distances in real-world applications can be simulated, such as tracking distant targets in field surveillance or photographing ground targets in aerial photography. This simulation allows for a more comprehensive test of the performance of the target PTZ camera at different distances and angles, including the zoom capability of the zoom lens, the rotation accuracy of the PTZ, and its response speed. For example, in security monitoring, it can verify whether the PTZ camera can clearly capture suspicious targets at a distance and accurately adjust its angle for tracking, improving the reliability and adaptability of the PTZ camera in practical applications.
[0049] For multiple reference adjustment operations performed on the target PTZ camera, in the current reference adjustment operation, the zoom lens of the target PTZ camera is operated. Zoom adjustment means adjusting the zoom lens of the target PTZ device according to the distance between the reference device and the camera, as well as the size and sharpness requirements of the reference mark in the image, changing the focal length of the lens to magnify or reduce the image. Then, the target PTZ camera is controlled to rotate and adjust the PTZ angle to change the shooting direction of the PTZ camera in the horizontal direction, so that the reference mark can enter the preset area within the center of the image. This process requires continuous fine-tuning until the reference mark on the reference device at the reference position meets the requirement of being within the preset area within the center of the image.
[0050] Throughout each reference adjustment operation, the position of the reference device remains unchanged to provide a stable reference standard. Each adjustment is based on the same reference device position, allowing for a more accurate evaluation of the adjustment effect and performance of the target PTZ camera. After completing the current adjustment, the target PTZ camera is controlled to perform the next reference adjustment operation. This allows for the detection of the azimuth angle corresponding to the optical axis of the target PTZ camera's zoom lens at different magnifications, and the azimuth angle corresponding to the horizontal angle of the PTZ camera relative to true north when the PTZ camera rotates horizontally at each magnification, while ensuring that the reference marker remains centered in the target PTZ camera's image frame.
[0051] As an optional but not limited implementation, controlling the target PTZ camera to rotate and adjust the PTZ angle includes the following steps B1-B2:
[0052] Step B1: Determine the relative position between the reference marker in the image of the target PTZ camera and the center of the image of the target PTZ camera.
[0053] Step B2: Based on the reference relative position, control the target PTZ camera to rotate and adjust the PTZ angle.
[0054] After the target PTZ camera captures an image containing the reference marker, it is necessary to analyze the relative positional relationship between the reference marker and the center of the image. For example, image recognition technology can be used to determine the coordinates of the reference marker within the target PTZ camera's image, and then the relative offset between it and the center of the image, including both horizontal and vertical offsets, can be calculated as the reference relative position. Optionally, this reference relative position can be represented by the pixel distance, angle, or other suitable metric between the reference marker and the center of the target PTZ camera's image, reflecting the degree and direction of the reference marker's deviation from the center of the image.
[0055] Based on the degree and direction of the reference marker's deviation from the center of the target pan-tilt camera's image, the target pan-tilt camera is controlled to rotate horizontally to adjust its horizontal angle. If the reference marker is to the left of the image center, the pan-tilt needs to rotate to the right; if it's to the right, it rotates to the left. The magnitude and speed of the rotation are determined by the relative position of the reference marker. For example, if the reference marker is far from the image center, the pan-tilt might rotate a larger angle at a faster speed; if the deviation is small, fine adjustments are made. Simultaneously, only the pan-tilt rotation is adjusted to bring the reference marker closer to the image center in the horizontal direction, without changing its vertical position (or the horizontal adjustment is performed separately after the vertical adjustment is completed).
[0056] By precisely determining the relative position of the reference marker to the center of the image and adjusting the pan-tilt-zoom accordingly, the reference marker can be moved to the center of the image more accurately. Especially in security monitoring, this means more precise monitoring of specific targets, reducing information loss or misjudgment caused by the target deviating from the center of the image. For example, when monitoring the entrance to an important location, it ensures that every person entering (the reference marker) is accurately centered in the image, allowing for clear capture of their facial features or actions, thus improving the effectiveness and accuracy of the monitoring. Regardless of how far the reference marker is from the center in the initial image, these two steps can effectively adjust it, enabling the system to adapt to different shooting scenarios and changes in target position, thus exhibiting greater adaptability.
[0057] As an optional but not limited implementation, controlling the target PTZ camera to rotate and adjust the PTZ angle includes the following steps C1-C2:
[0058] Step C1: Control the target PTZ camera to start the PTZ horizontal rotation function, and control the target PTZ camera to perform PTZ horizontal rotation according to whether the reference mark appears in the image of the target PTZ camera.
[0059] Step C2: If the reference marker appears in the image of the target PTZ camera, control the target PTZ camera to continue to rotate horizontally so that the reference marker is in the center of the image of the target PTZ camera.
[0060] A command is sent to the target PTZ camera to activate its horizontal rotation function. This function allows the PTZ camera's pan / tilt head to rotate horizontally, changing the camera's shooting angle. During this horizontal rotation, the camera's image is monitored in real time. Image analysis algorithms or related image processing techniques are used to determine if a reference marker appears in the image. If the reference marker is not yet visible, the PTZ camera continues to rotate horizontally at a preset direction and speed, continuously searching for areas where the reference marker might appear. For example, it might rotate slowly clockwise or counterclockwise to cover a wider horizontal field of view.
[0061] When a reference marker is detected in the image, the pan-tilt camera's horizontal rotation strategy is immediately adjusted. The target pan-tilt camera continues its horizontal rotation adjustment, with the goal of gradually moving the reference marker until it is centered in the image. Specifically, the direction and angle of rotation for the pan-tilt camera are calculated based on the relative position of the reference marker to the center of the image. For example, if the reference marker is located in the upper left corner of the image, the pan-tilt will slowly rotate to the lower right until the reference marker is centered. During this horizontal rotation, the image needs continuous analysis and feedback, with real-time adjustments to the pan-tilt rotation to ensure the reference marker is accurately centered.
[0062] Optionally, once the reference marker appears in the image, the pan-tilt unit (PTZ) should not only be rotated horizontally to center the marker, but the camera's zoom lens can also be automatically adjusted based on the marker's size and clarity. If the reference marker is too small, the focal length can be increased (zooming in) to display it more clearly; if the reference marker is too large and exceeds a preset reasonable range in the center of the image, the focal length can be decreased (zooming out). Simultaneously, the PTZ rotation is used to center the reference marker at a suitable size and proportion, further optimizing the imaging effect and improving target identifiability and monitoring quality.
[0063] Optionally, the process of horizontal rotation of the gimbal and centering of the reference marker can be divided into multiple stages, each using a different rotation speed and precision. In the initial search stage, the gimbal can rotate horizontally over a wide range at a relatively high speed to quickly locate the reference marker. Once the reference marker appears, a fine-tuning stage begins, reducing the rotation speed and increasing the adjustment precision to ensure the reference marker is accurately moved to the center of the image. For example, a coarse search can be performed initially at a speed of 10 degrees per second, and once the reference marker appears in the image, fine-tuning can be performed at a speed of 0.5 degrees per second.
[0064] Optionally, based on the movement trend and historical data of the reference marker, an intelligent prediction algorithm can be used to predict the rotation direction and angle of the pan-tilt unit in advance. For example, if in previous operations it was found that the reference marker usually appears from the right side of the screen and moves to the left, then in the next search, the pan-tilt unit can be rotated to the right by a certain angle in advance to capture the reference marker more quickly and reduce adjustment time. This intelligent prediction algorithm can improve the system's response speed and efficiency, especially when monitoring fast-moving targets or frequently changing scenes is required.
[0065] The above method, by controlling the horizontal rotation of the pan-tilt unit and dynamically adjusting it based on whether a reference marker appears in the image, allows for a faster search for the target reference marker. In large-area monitoring scenarios, such as large warehouses and plazas, traditional fixed-angle monitoring may miss many areas, while this dynamic search method can significantly improve the probability and speed of target detection. Once the reference marker appears in the frame, precisely controlling the horizontal rotation of the pan-tilt unit to center it in the image, combined with extended functions such as automatic zoom, can yield a clearer and more accurate image of the target.
[0066] For example, see Figure 3Set the latitude and longitude coordinates (Alog, Alat) of the PTZ camera's installation location. Activate the reference device with GPS positioning and a reference marker (e.g., a red indicator light). Control the reference device to fly to a reference position 500-1000 meters away from the PTZ camera. The reference position should not be too close to the PTZ camera, as this will affect calibration accuracy; nor should it be too far away, as the PTZ camera will not be able to find the reference device, and the reference marker will not be visible in the PTZ camera's image after the red indicator light is turned on. Control the PTZ camera to its minimum magnification of 1x and start rotating the PTZ. The PTZ camera will automatically locate the reference marker on the reference device based on the image. When the reference marker on the reference device is in the image, continue rotating the PTZ until the reference marker is centered in the image. Obtain the latitude and longitude coordinates (longitude Blog, latitude Blade) of the reference device. Based on the GPS coordinates of the reference device and the GPS coordinates of the PTZ camera, calculate the azimuth angle of the optical axis of the PTZ camera's image at a magnification of 1x. Calculate the horizontal angle of the PTZ camera corresponding to true north. Keeping the reference device stationary, continuously zoom in and out of the PTZ camera, calculating the offset of the optical axis of the image at each magnification. Calculate the azimuth angle corresponding to the optical axis of the image at any PTZ horizontal angle and any magnification.
[0067] S120. Determine the reference angle information after the target PTZ camera performs each reference adjustment operation. The reference angle information includes the azimuth angle corresponding to the optical axis of the imaging screen and the azimuth angle corresponding to the horizontal angle of the PTZ camera relative to true north when the target PTZ camera completes each reference adjustment operation.
[0068] After each reference adjustment operation is performed on the target PTZ camera, that is, after a series of reference adjustment operations (such as zoom adjustment and PTZ rotation adjustment) are performed to make the reference mark on the reference device within the preset area of the center of the image, the reference angle information is determined. At this time, the camera has reached a relatively stable and compliant position after adjustment, and the obtained angle information can accurately reflect the orientation of the camera in this state.
[0069] The optical axis of the imaging image is a virtual straight line perpendicular to the imaging plane, originating from the optical center of the pan-tilt camera. The azimuth angle corresponding to the optical axis is the angle formed by the optical axis on the horizontal plane and due north, which clearly indicates the camera's shooting direction in the horizontal direction. For example, when the optical axis azimuth angle is 0° (assuming due north is 0°), it means the camera is shooting directly in the due north direction; when the azimuth angle is 90°, it means it is shooting directly in the due east direction.
[0070] The horizontal angle of a gimbal refers to the angle by which it rotates around its vertical axis in a horizontal plane. The azimuth angle corresponding to this horizontal angle relative to true north establishes the relationship between the gimbal's horizontal rotation angle and geographic true north. For example, if the gimbal rotates horizontally by 30° towards due east (assuming clockwise is positive), then the azimuth angle corresponding to this horizontal angle relative to true north is 90° (because due east is 90° relative to true north). Recording this angle allows for precise determination of the gimbal's actual horizontal position.
[0071] As an optional but not limited implementation, the reference angle information of the target PTZ camera after each reference adjustment operation is determined, including the following steps D1-D2:
[0072] Step D1: Based on the reference position of the reference device, the position of the target PTZ camera, and the North Pole position, calculate the azimuth angle corresponding to the optical axis of the target PTZ camera's image when the target PTZ camera completes each reference adjustment operation.
[0073] Step D2: Based on the horizontal angle of the target PTZ camera's rotation relative to the starting point of the PTZ coordinates when the target PTZ camera completes each reference adjustment operation and the azimuth angle corresponding to the optical axis of the target PTZ camera's imaging screen, determine the azimuth angle corresponding to the horizontal angle of the target PTZ camera relative to due north at the corresponding magnification when the target PTZ camera completes each reference adjustment operation.
[0074] See Figure 4 The reference location of the reference device, the location of the target PTZ camera, and the North Pole form a geospatial network. Using the coordinates of these three locations, the orientation of the target PTZ camera relative to the North Pole (the geographic north reference) can be determined. When calculating the azimuth angle corresponding to the optical axis of the target PTZ camera's image, the relative angular relationships between these locations must be considered. For example, if the reference device is east of the target PTZ camera, and the North Pole is further north, the azimuth angle of the optical axis of the target PTZ camera's image may be biased eastward.
[0075] See Figure 4 Calculating the azimuth angle corresponding to the optical axis of the image involves mathematical methods such as geographic coordinate systems and triangulation. First, the coordinates of the reference device, the target pan-tilt camera, and the North Pole in the geographic coordinate system are determined. Then, the azimuth angle is determined by calculating the angle between the line connecting the two points and true north. For example, vector operations or angle calculation formulas can be used to calculate the azimuth angle corresponding to the optical axis of the image based on the angular relationship between the line connecting the target pan-tilt camera and the North Pole, and the line connecting the target pan-tilt camera and the reference device.
[0076] For example, such as Figure 4As shown, E, F, and N represent the positions of the gimbal camera, the drone, and the North Pole, respectively. Angle A represents the azimuth angle from E to F, which corresponds to the azimuth angle of the optical axis of the image. The corresponding angles can be calculated as follows: a = 90 - Elat, b = 90 - Elat, C = Flog - Elog. Using the cosine formula for the sides of a spherical triangle, the value of angle c can be calculated.
[0077] c=arc cos(cosa*cosb+sina*sinb*sinC)
[0078] The azimuth angle A is calculated using the sine formula of spherical trigonometry (the values of azimuth angle A are calculated as shown in Table 1 below):
[0079] A = arcsin(sina*sinC / (sinc))
[0080] Table 1
[0081]
[0082] See Figure 5 The starting point of the gimbal coordinates is usually a fixed reference point of the gimbal in its initial state, such as the initial horizontal position after the gimbal is installed or a specific position after calibration. The horizontal angle of rotation relative to the starting point of the gimbal coordinates refers to the angle of rotation of the gimbal in the horizontal direction from the starting point. This angle can be determined by the angle sensor or other measuring device inside the gimbal.
[0083] See Figure 5 Given the azimuth angle corresponding to the optical axis of the target pan-tilt camera's image, by considering the horizontal rotation angle of the pan-tilt camera relative to the starting point, the azimuth angle corresponding to the pan-tilt camera's horizontal angle relative to true north can be further determined. For example, if the optical axis azimuth angle is 45°, and the pan-tilt camera has rotated 30° clockwise from the starting point, then the azimuth angle corresponding to the pan-tilt camera's horizontal angle relative to true north might be 75° (45° + 30°). This process requires comprehensive consideration of the pan-tilt camera's rotation direction and angle, as well as the optical axis azimuth angle, to accurately determine the pan-tilt camera's horizontal angle in the geographic coordinate system.
[0084] For example, such as Figure 5 As shown, the horizontal angle P of the pan-tilt camera at this moment (the angle rotated relative to the 0 point of the pan-tilt coordinate system) is obtained. The value of P ranges from [0, 360°], and the value of P increases in the clockwise direction. Based on the azimuth angle A corresponding to the optical axis of the image at this moment, the horizontal angle P' of the pan-tilt camera corresponding to the relative north position is calculated as follows:
[0085] P' = (P + Q)%360°
[0086] Q = 360° - A
[0087] By accurately calculating the azimuth angles corresponding to the optical axis of the target pan-tilt camera's image and the horizontal angle of the pan-tilt unit, precise target positioning can be achieved. Accurate azimuth information is crucial for determining the target's location and tracking its movement. Especially in security monitoring, azimuth information can be used to quickly determine the position of people or objects, allowing for timely and appropriate measures to be taken.
[0088] S130. Based on the reference angle information after each reference adjustment operation of the target PTZ camera, determine the reference offset information of the target PTZ camera. This information is used to identify the azimuth angle of the target PTZ camera. The reference offset information is used to indicate the optical axis offset of the imaging image of the target PTZ camera's zoom lens at different magnifications and the horizontal angle deviation of the PTZ camera relative to due north when the PTZ camera performs horizontal rotation at each magnification.
[0089] After each reference adjustment operation, the target PTZ camera records a series of reference angle information. This information includes the azimuth angle corresponding to the optical axis of the image at the time of each adjustment operation, as well as the azimuth angle corresponding to the horizontal angle of the PTZ camera relative to true north. By analyzing and processing this angle data under different operations, the reference offset information of the target PTZ camera is determined.
[0090] When the magnification of a zoom lens changes, the optical axis of the image will shift. This shift is caused by changes in the way the lens's internal optical structure refracts and focuses light at different magnifications. By comparing the changes in the azimuth angle of the optical axis at different magnifications, and combining data from multiple reference adjustment operations, the degree and direction of this optical axis shift can be quantified. For example, if the azimuth angle of the optical axis rotates clockwise relative to its initial state when switching from a low to a high magnification, then it can be determined that there is a corresponding shift in the optical axis during this magnification change, and the angle and direction information of this shift can be recorded.
[0091] At each magnification level, when the target pan-tilt camera rotates horizontally, the horizontal angle of the pan-tilt head relative to true north may deviate. This deviation may be caused by factors such as the mechanical structure of the pan-tilt head, manufacturing precision, installation errors, and wear during use. By recording the difference between the actual horizontal angle of the pan-tilt head and the theoretically expected angle (relative to true north) when rotating horizontally at different magnification levels, the pan-tilt head horizontal angle deviation can be determined. For example, at a certain magnification level, when the pan-tilt head should rotate to true east (90° relative to true north), if the actual measured horizontal angle is 92°, then a 2° pan-tilt head horizontal angle deviation can be determined at this magnification and operation.
[0092] These defined reference offsets are primarily used to identify and correct the azimuth angle of the target PTZ camera. In practical applications, when the exact azimuth angle of the camera is needed, the initial angle data obtained from the measurements can be corrected based on the reference offset information. For example, if the zoom lens is known to be at a certain magnification and the measured optical axis azimuth angle of the image is 30°, but the reference offset information indicates a 5° clockwise offset of the optical axis at this magnification, then after correction, the actual optical axis azimuth angle of the image should be 25°. Similarly, for the horizontal angle deviation of the PTZ, when performing target positioning or working in conjunction with other equipment, the rotation angle of the PTZ can be compensated based on the deviation value to ensure the accuracy of the camera's shooting direction and position information.
[0093] By determining and applying accurate reference offset information, the azimuth accuracy of target PTZ cameras can be effectively improved. For example, in security monitoring, when tracking a moving target, the camera's shooting direction and the target's position can be determined more accurately, reducing target loss or inaccurate tracking due to azimuth errors and improving the reliability and effectiveness of the monitoring system.
[0094] Based on the above embodiments, optionally, after determining the reference offset information of the target PTZ camera based on the reference angle information after each reference adjustment operation is performed on the target PTZ camera, the following steps E1-E2 are also included:
[0095] Step E1: When controlling the zoom lens of the target PTZ camera to zoom from the first magnification to the second magnification, determine the azimuth angle corresponding to the optical axis of the target PTZ camera's imaging image at the first magnification.
[0096] Step E2: Based on the optical axis offset of the target PTZ camera's zoom lens at different magnifications indicated in the reference offset information of the target PTZ camera, and the azimuth angle corresponding to the optical axis of the target PTZ camera's image at the first magnification, determine the azimuth angle corresponding to the optical axis of the target PTZ camera's image at the second magnification.
[0097] When controlling the zoom lens of a target PTZ camera to change from one magnification (here referred to as the first magnification) to another (the second magnification), it is first necessary to determine the azimuth angle corresponding to the optical axis of the target PTZ camera's image at the initial first magnification. This azimuth angle is an important parameter describing the shooting direction of the PTZ camera, representing the angle between the optical axis of the image on the horizontal plane and geographic true north. The reference offset information of the target PTZ camera contains relevant data on the offset of the optical axis of the image at different magnifications. When adjusting the zoom from the first magnification to the second magnification, the azimuth angle corresponding to the optical axis of the image at the second magnification is calculated based on this offset information and the azimuth angle corresponding to the optical axis of the image at the first magnification.
[0098] Because the optical axis of the image may shift when the magnification of a zoom lens changes due to variations in the lens's internal optical structure, the shooting direction may change. Therefore, it cannot be simply assumed that the azimuth angle at the second magnification is the same as at the first magnification. By referring to the description of the optical axis shift in the offset information, the azimuth angle at the first magnification can be adjusted and compensated accordingly to obtain a more accurate azimuth angle corresponding to the optical axis of the image at the second magnification. For example, if the offset information indicates that the optical axis of the image will shift clockwise by 5° when changing from the first to the second magnification, then adding 5° to the azimuth angle at the first magnification will give the approximate azimuth angle at the second magnification. Of course, the actual calculation may be more complex and requires consideration of other factors, but the overall principle is to correct the initial azimuth angle based on the optical axis shift.
[0099] When the zoom lens of a PTZ camera is adjusted, accurately determining the azimuth angle corresponding to the optical axis of the image at different magnifications is crucial. For example, in security monitoring, when tracking a moving target, if the azimuth angle is not calculated accurately, the target may be lost or the monitored image may deviate from the target as the zoom lens magnification changes. By extending the above steps and solutions, the azimuth angle after zooming can be calculated more accurately, ensuring that the camera can always accurately aim at the target, achieving continuous and precise tracking and shooting, and improving the effectiveness of monitoring and image quality. Through real-time monitoring and dynamic adjustment of optical axis offset, combined with scene adaptive learning, the system can better cope with various complex environmental changes and working conditions. Whether it is temperature fluctuations, mechanical vibrations, or different shooting scenarios, the stability and accuracy of the optical axis azimuth angle of the image can be maintained, improving the reliability and adaptability of the system. During long-term use, if the optical axis offset when the zoom lens magnification changes is not effectively processed and compensated, errors may accumulate, ultimately affecting the performance and accuracy of the system. The measures in the above-mentioned extended solution can correct optical axis misalignment in a timely manner, reduce the accumulation of errors, and enable the system to maintain a good working condition during long-term operation, thereby reducing maintenance costs and adjustment complexity.
[0100] The technical solution of this invention involves placing a reference marker on the reference device within a preset area at the center of the target PTZ camera's image frame during each reference adjustment operation. This establishes a baseline for identifying the azimuth deviation of the PTZ camera. Simultaneously, this baseline is used to comprehensively record the reference angle information after each reference adjustment operation, including the azimuth angle corresponding to the optical axis of the image frame and the azimuth angle corresponding to the PTZ horizontal angle relative to true north. By recording and analyzing these azimuth angles after different reference adjustment operations, the azimuth angle variation patterns of the target PTZ camera under various magnifications and rotation states can be thoroughly investigated. This clarifies the offset of the optical axis of the target PTZ camera's zoom lens at different magnifications, as well as the PTZ horizontal angle deviation relative to true north when the PTZ camera rotates horizontally at each magnification. This facilitates more accurate azimuth angle adjustment and compensation, ensuring the camera's shooting direction meets the expected requirements.
[0101] Figure 6 This is a schematic diagram of the structure of a PTZ camera azimuth angle recognition device provided in an embodiment of the present invention. This embodiment is applicable to situations where the azimuth angle of a PTZ camera is precisely controlled when the zoom lens of the PTZ camera is zoomed and the PTZ is rotated horizontally. The PTZ camera azimuth angle recognition device can be implemented in hardware and / or software and can be configured in any electronic device with network communication function.
[0102] like Figure 6 As shown, the azimuth angle recognition device for the PTZ camera in this embodiment includes the following:
[0103] The control module 610 is used to control the target PTZ camera to perform each reference adjustment operation so that the reference mark on the reference device is within a preset area in the center of the imaging screen of the target PTZ camera. The reference adjustment operation is to perform a zoom adjustment on the PTZ camera and then perform a PTZ rotation adjustment on the PTZ camera. The reference device keeps its position unchanged during each reference adjustment operation.
[0104] The first determining module 620 is used to determine the reference angle information after the target PTZ camera performs each reference adjustment operation. The reference angle information includes the azimuth angle corresponding to the optical axis of the imaging screen and the azimuth angle corresponding to the horizontal angle of the PTZ camera relative to due north when the target PTZ camera completes each reference adjustment operation.
[0105] The second determining module 630 is used to determine the reference offset information of the target PTZ camera based on the reference angle information after each reference adjustment operation is performed by the target PTZ camera. The reference offset information is used to identify the azimuth angle of the target PTZ camera. The reference offset information is used to indicate the optical axis offset of the imaging image of the zoom lens of the target PTZ camera at different magnifications and the horizontal angle deviation of the PTZ camera relative to due north when the PTZ camera performs horizontal rotation at each magnification.
[0106] Based on the above embodiments, optionally, the control module is specifically used for:
[0107] The reference device is controlled to fly and move to a reference position. The distance between the reference position and the location of the target gimbal camera is greater than a preset distance. The reference device is an unmanned aerial vehicle with its own positioning function and carrying a reference marker.
[0108] In the current reference adjustment operation, the zoom lens of the target PTZ camera is controlled to perform zoom adjustment, and the PTZ camera is controlled to rotate and adjust the PTZ angle until the reference mark on the reference device at the reference position is within the preset area of the center of the image of the target PTZ camera. The position of the reference device is kept unchanged and the target PTZ camera is controlled to perform the next reference adjustment operation.
[0109] Based on the above embodiments, optionally, controlling the target PTZ camera to rotate and adjust the PTZ angle includes:
[0110] Determine the reference relative position between the reference marker in the image of the target pan-tilt camera and the center of the image of the target pan-tilt camera;
[0111] Based on the reference relative position, the target PTZ camera is controlled to rotate and adjust the PTZ angle.
[0112] Based on the above embodiments, optionally, controlling the target PTZ camera to rotate and adjust the PTZ angle includes:
[0113] Control the target PTZ camera to start the PTZ horizontal rotation function, and control the target PTZ camera to perform PTZ horizontal rotation according to whether the reference mark appears in the image of the target PTZ camera;
[0114] If the reference marker appears in the image of the target PTZ camera, then the target PTZ camera is controlled to continue to rotate horizontally so that the reference marker is in the center of the image of the target PTZ camera.
[0115] Based on the above embodiments, optionally, the reference angle information after the target PTZ camera performs each reference adjustment operation is determined, including:
[0116] Based on the reference position of the reference device, the position of the target PTZ camera, and the North Pole position, calculate the azimuth angle corresponding to the optical axis of the target PTZ camera's image when the target PTZ camera completes each reference adjustment operation;
[0117] Based on the horizontal angle of the target PTZ camera's rotation relative to the starting point of the PTZ coordinates when the target PTZ camera completes each reference adjustment operation and the azimuth angle corresponding to the optical axis of the target PTZ camera's imaging screen, determine the azimuth angle corresponding to the horizontal angle of the target PTZ camera relative to due north at the corresponding magnification when the target PTZ camera completes each reference adjustment operation.
[0118] Based on the above embodiments, optionally, after determining the reference offset information of the target PTZ camera based on the reference angle information after each reference adjustment operation of the target PTZ camera, the method further includes:
[0119] When controlling the zoom lens of the target PTZ camera to zoom from the first magnification to the second magnification, the azimuth angle corresponding to the optical axis of the imaging screen of the target PTZ camera at the first magnification is determined.
[0120] Based on the optical axis offset of the target PTZ camera's zoom lens at different magnifications indicated in the reference offset information of the target PTZ camera, and the azimuth angle corresponding to the optical axis of the target PTZ camera's image at the first magnification, the azimuth angle corresponding to the optical axis of the target PTZ camera's image at the second magnification is determined.
[0121] The technical solution of this invention involves placing a reference marker on the reference device within a preset area at the center of the target PTZ camera's image frame during each reference adjustment operation. This establishes a baseline for identifying the azimuth deviation of the PTZ camera. Simultaneously, this baseline is used to comprehensively record the reference angle information after each reference adjustment operation, including the azimuth angle corresponding to the optical axis of the image frame and the azimuth angle corresponding to the PTZ horizontal angle relative to true north. By recording and analyzing these azimuth angles after different reference adjustment operations, the azimuth angle variation patterns of the target PTZ camera under various magnifications and rotation states can be thoroughly investigated. This clarifies the offset of the optical axis of the target PTZ camera's zoom lens at different magnifications, as well as the PTZ horizontal angle deviation relative to true north when the PTZ camera rotates horizontally at each magnification. This facilitates more accurate azimuth angle adjustment and compensation, ensuring the camera's shooting direction meets the expected requirements.
[0122] The azimuth angle recognition device for PTZ cameras provided in this embodiment of the invention can execute the azimuth angle recognition method for PTZ cameras provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of executing the azimuth angle recognition method for PTZ cameras.
[0123] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the protection scope of the embodiments of the present invention.
[0124] Figure 7A schematic diagram of an electronic device that can be used to implement the azimuth angle recognition method of a PTZ camera according to embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, 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 processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0125] like Figure 7 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0126] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0127] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as the azimuth angle recognition method for a PTZ camera.
[0128] In some embodiments, the PTZ camera azimuth recognition method can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the PTZ camera azimuth recognition method described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform the PTZ camera azimuth recognition method by any other suitable means (e.g., by means of firmware).
[0129] Various embodiments 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-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0130] Computer programs used to implement 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, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0131] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0132] To provide interaction with a user, the systems and techniques described herein can 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 pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0133] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0134] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0135] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0136] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for azimuth angle recognition of a PTZ camera, characterized in that, The method includes: The target PTZ camera is controlled to perform each reference adjustment operation so that the reference mark on the reference device is within a preset area in the center of the image of the target PTZ camera. The reference adjustment operation is to perform a zoom adjustment on the PTZ camera and then perform a PTZ rotation adjustment on the PTZ camera. The reference device keeps its position unchanged during each reference adjustment operation. Determine the reference angle information after the target PTZ camera performs each reference adjustment operation. The reference angle information includes the azimuth angle corresponding to the optical axis of the imaging screen and the azimuth angle corresponding to the horizontal angle of the PTZ camera relative to true north when the target PTZ camera completes each reference adjustment operation. Based on the reference angle information after each reference adjustment operation performed by the target PTZ camera, the reference offset information of the target PTZ camera is determined. This information is used to identify the azimuth angle of the target PTZ camera. The reference offset information is used to indicate the optical axis offset of the imaging image of the target PTZ camera's zoom lens at different magnifications and the horizontal angle deviation of the PTZ camera relative to true north when the PTZ camera performs horizontal rotation at each magnification.
2. The method according to claim 1, characterized in that, Control the target PTZ camera to perform each reference adjustment operation, including: The reference device is controlled to fly and move to a reference position. The distance between the reference position and the location of the target gimbal camera is greater than a preset distance. The reference device is an unmanned aerial vehicle with its own positioning function and carrying a reference marker. In the current reference adjustment operation, the zoom lens of the target PTZ camera is controlled to perform zoom adjustment, and the PTZ camera is controlled to rotate and adjust the PTZ angle until the reference mark on the reference device at the reference position is within the preset area of the center of the image of the target PTZ camera. The position of the reference device is kept unchanged and the target PTZ camera is controlled to perform the next reference adjustment operation.
3. The method according to claim 2, characterized in that, Controlling the target PTZ camera to rotate and adjust the PTZ angle includes: Determine the reference relative position between the reference marker in the image of the target pan-tilt camera and the center of the image of the target pan-tilt camera; Based on the reference relative position, the target PTZ camera is controlled to rotate and adjust the PTZ angle.
4. The method according to claim 2 or 3, characterized in that, Controlling the target PTZ camera to rotate and adjust the PTZ angle includes: Control the target PTZ camera to start the PTZ horizontal rotation function, and control the target PTZ camera to perform PTZ horizontal rotation according to whether the reference mark appears in the image of the target PTZ camera; If the reference marker appears in the image of the target PTZ camera, then the target PTZ camera is controlled to continue to rotate horizontally so that the reference marker is in the center of the image of the target PTZ camera.
5. The method according to claim 1, characterized in that, Determine the reference angle information after each reference adjustment operation performed by the target PTZ camera, including: Based on the reference position of the reference device, the position of the target PTZ camera, and the North Pole position, calculate the azimuth angle corresponding to the optical axis of the target PTZ camera's image when the target PTZ camera completes each reference adjustment operation; Based on the horizontal angle of the target PTZ camera's rotation relative to the starting point of the PTZ coordinates when the target PTZ camera completes each reference adjustment operation and the azimuth angle corresponding to the optical axis of the target PTZ camera's imaging screen, determine the azimuth angle corresponding to the horizontal angle of the target PTZ camera relative to due north at the corresponding magnification when the target PTZ camera completes each reference adjustment operation.
6. The method according to claim 1, characterized in that, After determining the reference offset information of the target PTZ camera based on the reference angle information after each reference adjustment operation, the method further includes: When controlling the zoom lens of the target PTZ camera to zoom from the first magnification to the second magnification, the azimuth angle corresponding to the optical axis of the imaging screen of the target PTZ camera at the first magnification is determined. Based on the optical axis offset of the target PTZ camera's zoom lens at different magnifications indicated in the reference offset information of the target PTZ camera, and the azimuth angle corresponding to the optical axis of the target PTZ camera's image at the first magnification, the azimuth angle corresponding to the optical axis of the target PTZ camera's image at the second magnification is determined.
7. A PTZ camera azimuth angle recognition device, characterized in that, The device includes: The control module is used to control the target PTZ camera to perform each reference adjustment operation so that the reference mark on the reference device is within a preset area in the center of the imaging screen of the target PTZ camera. The reference adjustment operation is to perform a zoom adjustment on the PTZ camera and then perform a PTZ rotation adjustment on the PTZ camera. The reference device keeps its position unchanged during each reference adjustment operation. The first determining module is used to determine the reference angle information after the target PTZ camera performs each reference adjustment operation. The reference angle information includes the azimuth angle corresponding to the optical axis of the imaging screen and the azimuth angle corresponding to the horizontal angle of the PTZ camera relative to due north when the target PTZ camera completes each reference adjustment operation. The second determining module is used to determine the reference offset information of the target PTZ camera based on the reference angle information after each reference adjustment operation. It is used to identify the azimuth angle of the target PTZ camera. The reference offset information is used to indicate the optical axis offset of the imaging image of the zoom lens of the target PTZ camera at different magnifications and the horizontal angle deviation of the PTZ camera relative to due north when the PTZ camera performs horizontal rotation at each magnification.
8. The apparatus according to claim 7, characterized in that, The control module is specifically used for: The reference device is controlled to fly and move to a reference position. The distance between the reference position and the location of the target gimbal camera is greater than a preset distance. The reference device is an unmanned aerial vehicle with its own positioning function and carrying a reference marker. In the current reference adjustment operation, the zoom lens of the target PTZ camera is controlled to perform zoom adjustment, and the PTZ camera is controlled to rotate and adjust the PTZ angle until the reference mark on the reference device at the reference position is within the preset area of the center of the image of the target PTZ camera. The position of the reference device is kept unchanged and the target PTZ camera is controlled to perform the next reference adjustment operation.
9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the pan-tilt camera azimuth angle recognition method according to any one of claims 1-6.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that are used to cause a processor to execute the azimuth angle recognition method for a PTZ camera as described in any one of claims 1-6.