A high zoom ratio intelligent tracking camera and a control method thereof
By synchronously and collaboratively controlling the zoom stepper motor and the gimbal stepper motor, and combining zoned exposure and dynamic fill light technology, the problems of target deviation and overexposure in traditional high-magnification zoom cameras are solved, improving target tracking accuracy and image quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN HISTAR TECH CO LTD
- Filing Date
- 2026-02-03
- Publication Date
- 2026-06-02
Smart Images

Figure CN122138048A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent tracking camera technology, and in particular to a high-magnification zoom intelligent tracking camera and its control method. Background Technology
[0002] Intelligent tracking cameras are widely used in security monitoring, intelligent transportation, and other fields. Their core function is to clearly capture targets at both near and far distances through zoom lenses. Traditional high-magnification zoom cameras use an independent control strategy, with the zoom motor, pan-tilt motor, and exposure system working independently. This leads to problems such as target tracking failure and image quality degradation during zooming.
[0003] In existing technologies, changes in the focal length of a zoom lens cause a simultaneous reduction in the field of view. Targets originally located in the center of the image may shift or even disappear from the field of view due to this change. Existing technologies only reposition the target via gimbal adjustment after zooming is complete, resulting in significant control lag. Furthermore, high-magnification zooms cause locally magnified images, such as faces and license plates, to dominate the frame. Using global automatic exposure can lead to overexposure in these areas, resulting in loss of detail and affecting recognition accuracy. Summary of the Invention
[0004] This invention provides a high-magnification zoom intelligent tracking camera and its control method. This invention solves the problem of target deviation caused by adjusting the gimbal after zooming in traditional solutions, ensuring that the target remains in the center of the image throughout the entire zooming process.
[0005] In a first aspect, the present invention provides a control method for a high-magnification zoom intelligent tracking camera, the control method comprising: The target zoom factor and target focal length are calculated based on the video stream acquired during the current control cycle, and the pulse frequency sequence and target pixel offset are calculated based on the target focal length. The gimbal step count is calculated based on the target pixel offset. The total zoom duration is divided into multiple time slices. The pulse frequency sequence is synchronously output in each time slice to drive the zoom stepper motor and the gimbal stepper motor. The real-time zoom factor is calculated based on the real-time focal length. When the real-time zoom factor reaches the target zoom factor, the first exposure parameter is calculated. A fill light signal is generated based on the real-time zoom level and ambient illuminance, and a second exposure parameter is calculated based on the fill light signal.
[0006] In conjunction with the first aspect, in a first implementation of the first aspect of the present invention, calculating the target zoom factor and target focal length based on the video stream acquired in the current control cycle, and calculating the pulse frequency sequence and target pixel offset based on the target focal length, includes: Acquire the video stream captured by the camera during the current control cycle; Perform a difference operation on the i-th frame and the (i+1)-th frame in the video stream to obtain the grayscale difference. Extract the moving pixels whose grayscale difference is greater than a preset difference threshold, and calculate the target pixel coordinates and target pixel height based on the moving pixels. When the target pixel height is less than a first preset ratio of the screen height or greater than a second preset ratio of the screen height, the target zoom factor is calculated based on the target pixel height and the screen height, and the target focal length is calculated based on the target zoom factor and the reference focal length. The zoom step count is calculated based on the target focal length, the single-step focal length change, and the number of steps per revolution. A pulse frequency sequence is generated based on the zoom step number, and the target pixel offset is calculated based on the target focal length and the target pixel coordinates.
[0007] In conjunction with the first aspect, in a second implementation of the first aspect of the present invention, calculating the zoom step count based on the target focal length, the single-step focal length change, and the number of steps per circle includes: Obtain the real-time focal length of the camera, and perform a difference calculation between the target focal length and the real-time focal length to obtain the focal length difference. Divide the focal length difference by the single-step focal length change to obtain the number of motor rotations, and multiply the number of motor rotations by the number of single-step steps to obtain the zoom step count.
[0008] In conjunction with the first aspect, in a third implementation of the first aspect of the present invention, generating a pulse frequency sequence based on the zoom step number and calculating the target pixel offset based on the target focal length and the target pixel coordinates includes: The zoom step count is divided into acceleration phase step count, constant speed phase step count, and deceleration phase step count. The quadratic increasing frequency sequence corresponding to the acceleration phase step count, the constant frequency sequence corresponding to the constant speed phase step count, and the quadratic decreasing frequency sequence corresponding to the deceleration phase step count are calculated. A pulse frequency sequence is constructed based on the quadratic increasing frequency sequence, the constant frequency sequence, and the quadratic decreasing frequency sequence; The first field of view before zooming is calculated based on the real-time focal length, and the second field of view after zooming is calculated based on the target focal length. The target pixel offset is calculated based on the offset distance between the target pixel coordinates and the center of the image, the first field of view, and the second field of view.
[0009] In conjunction with the first aspect, in the fourth implementation of the first aspect of the present invention, the gimbal step count is calculated based on the target pixel offset, the total zoom duration is divided into multiple time slices, and the pulse frequency sequence is synchronously output in each time slice to drive the zoom stepper motor and the gimbal stepper motor, including: The horizontal pixel offset in the target pixel offset is calculated as a ratio to the screen width to obtain the horizontal ratio, and the vertical pixel offset in the target pixel offset is calculated as a ratio to the screen height to obtain the vertical ratio. Multiply the horizontal ratio by the second field of view to obtain the horizontal compensation angle, and multiply the vertical ratio by the second field of view to obtain the vertical compensation angle; Divide the horizontal compensation angle by the single-step angle accuracy of the gimbal stepper motor to obtain the horizontal axis step count, and divide the vertical compensation angle by the single-step angle accuracy of the gimbal stepper motor to obtain the vertical axis step count. Use the horizontal axis step count and the vertical axis step count as the gimbal step count. The total zoom duration is calculated based on the zoom step count, and the total zoom duration is divided into multiple time slices. Within each time slice, the pulse frequency sequence is synchronously output to drive the zoom stepper motor and the gimbal stepper motor.
[0010] In conjunction with the first aspect, in a fifth implementation of the first aspect of the present invention, the real-time zoom factor is calculated based on the real-time focal length, and when the real-time zoom factor reaches the target zoom factor, a first exposure parameter is calculated, including: Obtain the camera's real-time focal length; The real-time focal length is compared with the reference focal length to obtain the real-time zoom ratio. When the real-time zoom ratio reaches the target zoom ratio, the compensated target position is obtained. Divide the target area and the background area with the compensated target location as the center; Calculate the first average gray value of the target area and the second average gray value of the background area; When the first average gray value is greater than the overexposure threshold, a target exposure adjustment coefficient is calculated based on the first average gray value and the overexposure threshold. When the second average gray value is less than the underexposure threshold, a background adjustment coefficient is calculated based on the underexposure threshold and the second average gray value. A first exposure parameter is calculated based on the target exposure adjustment coefficient or the background adjustment coefficient.
[0011] In conjunction with the first aspect, in a sixth implementation of the first aspect of the present invention, generating a supplementary light signal based on the real-time zoom magnification and ambient illuminance, and calculating a second exposure parameter based on the supplementary light signal, includes: Obtain the third average grayscale value of the entire image in the camera, and calculate the ambient illuminance based on the third average grayscale value; The white light duty cycle and infrared duty cycle are calculated based on the real-time zoom ratio and the ambient illuminance, respectively, and the corresponding supplementary light signals are output to the white light LED and infrared LED based on the white light duty cycle and infrared duty cycle. The target area is divided into multiple pixel blocks of a preset size, and the fourth average gray value and the corresponding local gray standard deviation are calculated in each pixel block. When the local grayscale standard deviation is lower than the standard deviation threshold and the fourth average grayscale value is higher than the grayscale threshold, the second exposure parameter is calculated based on the fourth average grayscale value and the grayscale threshold.
[0012] In conjunction with the first aspect, in the seventh implementation of the first aspect of the present invention, the white light duty cycle and the infrared duty cycle are calculated based on the real-time zoom magnification and the ambient illuminance, respectively, and the corresponding supplementary lighting signals are output to the white light LED and the infrared LED based on the white light duty cycle and the infrared duty cycle, including: When the ambient illuminance is greater than or equal to the first illuminance threshold, the white light duty cycle is calculated based on the real-time zoom magnification and the white light reference duty cycle. When the ambient illuminance is less than the second illuminance threshold, the infrared duty cycle is calculated based on the real-time zoom magnification and the infrared reference duty cycle. When the ambient illuminance is between the second illuminance threshold and the first illuminance threshold, the white light duty cycle and the infrared duty cycle are calculated based on the real-time zoom magnification respectively. The corresponding supplementary light signal is output according to the white light duty cycle and the infrared duty cycle, and the supplementary light signal is output to the white light LED and the infrared LED.
[0013] In conjunction with the first aspect, in the eighth implementation of the first aspect of the present invention, the control method for the high-magnification zoom intelligent tracking camera further includes: Calculate the centering error between the compensated target position and the center of the image, and calculate the contrast of the target area; When the centering error exceeds the error threshold or the contrast is lower than the contrast threshold, a correction lookup table is established by recording the real-time zoom magnification, the actual deviation, and the target exposure adjustment coefficient. In the next control cycle, the correction coefficient is read from the correction lookup table according to the real-time zoom magnification of the next control cycle, and the gimbal compensation angle and target exposure adjustment coefficient are adjusted according to the correction coefficient.
[0014] Secondly, the present invention provides a high-magnification zoom intelligent tracking camera, the high-magnification zoom intelligent tracking camera comprising: The calculation module is used to calculate the target zoom factor and target focal length based on the video stream acquired in the current control cycle, and to calculate the pulse frequency sequence and target pixel offset based on the target focal length; The drive module is used to calculate the gimbal step count based on the target pixel offset, divide the total zoom duration into multiple time slices, and synchronously output the pulse frequency sequence in each time slice to drive the zoom stepper motor and the gimbal stepper motor. The exposure module is used to calculate the real-time zoom ratio based on the real-time focal length, and to calculate the first exposure parameter when the real-time zoom ratio reaches the target zoom ratio. The fill light module is used to generate a fill light signal based on the real-time zoom magnification and ambient illuminance, and to calculate the second exposure parameters based on the fill light signal.
[0015] The technical solution provided by this invention utilizes a time-slice synchronous collaborative control mechanism between the zoom stepper motor and the gimbal stepper motor. This mechanism divides the total zoom duration into multiple time slices and synchronously outputs zoom pulses and gimbal pulses within each time slice. This ensures that the field-of-view reduction caused by zooming is synchronized with the gimbal's compensating rotation, resolving the target deviation problem caused by adjusting the gimbal only after zooming in traditional solutions. This guarantees that the target remains centered throughout the zoom process. Furthermore, through a zoom-magnification-linked zone exposure optimization technology, when the zoom magnification reaches a preset threshold, the target area and background area are automatically divided, and differentiated exposure adjustment coefficients are calculated separately. This effectively suppresses overexposure in the target area while maintaining background visibility, preventing the loss of details in critical areas such as faces and license plates due to global automatic exposure. Simultaneously, the duty cycle of white light and infrared fill light is dynamically calculated based on the zoom magnification and ambient illuminance, causing the fill light intensity to increase linearly with the zoom magnification to compensate for light attenuation at long distances. The fill light mode is adaptively switched according to ambient illuminance, ensuring effective long-distance illumination at high zoom magnification while avoiding excessive fill light at low zoom magnification. Furthermore, by establishing a correction lookup table to record the centering error and exposure adjustment deviation at different zoom magnifications, the gimbal compensation angle and exposure parameters are adjusted according to the correction coefficient in the next control cycle, achieving adaptive optimization of system parameters and significantly improving the target tracking accuracy and image quality of the intelligent tracking high-magnification zoom camera.
[0016] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.
[0017] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0018] Figure 1 This is a schematic diagram of an embodiment of the control method for a high-magnification zoom intelligent tracking camera in the present invention; Figure 2 This is a schematic diagram of one embodiment of a high-magnification zoom intelligent tracking camera according to the present invention. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] The terms "comprising" and "having," and any variations thereof, used in the embodiments of this invention are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the steps or units listed, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.
[0021] To facilitate understanding of this embodiment, a control method for a high-magnification zoom intelligent tracking camera disclosed in this embodiment of the invention will first be described in detail. For example... Figure 1 As shown, this method includes the following steps: 101. Calculate the target zoom factor and target focal length based on the video stream acquired in the current control cycle, and calculate the pulse frequency sequence and target pixel offset based on the target focal length; 102. Calculate the gimbal step count based on the target pixel offset, divide the total zoom duration into multiple time slices, and synchronously output a pulse frequency sequence to drive the zoom stepper motor and the gimbal stepper motor in each time slice. 103. Calculate the real-time zoom ratio based on the real-time focal length. When the real-time zoom ratio reaches the target zoom ratio, calculate the first exposure parameter. 104. Generate a fill light signal based on the real-time zoom level and ambient illuminance, and calculate the second exposure parameters based on the fill light signal.
[0022] In one specific embodiment, the target zoom factor and target focal length are calculated based on the video stream acquired in the current control cycle, and the pulse frequency sequence and target pixel offset are calculated based on the target focal length, including: Acquire the video stream captured by the camera during the current control cycle; Perform a difference operation on the i-th frame and the (i+1)-th frame in the video stream to obtain the grayscale difference. Extract moving pixels whose grayscale difference is greater than a preset difference threshold, and calculate the target pixel coordinates and target pixel height based on the moving pixels. When the target pixel height is less than a first preset ratio of the screen height or greater than a second preset ratio of the screen height, the target zoom factor is calculated based on the target pixel height and the screen height, and the target focal length is calculated based on the target zoom factor and the reference focal length. The zoom steps are calculated based on the target focal length, the focal length change per step, and the number of steps per revolution. A pulse frequency sequence is generated based on the zoom step number, and the target pixel offset is calculated based on the target focal length and target pixel coordinates.
[0023] Specifically, within each current control cycle of the camera, the image sensor continuously acquires video stream data at a resolution of 2560×1440, and temporarily stores the acquired video stream in the video buffer of the controller. Subsequently, the controller sequentially reads the adjacent i-th frame image and i+1-th frame image from the video buffer, and performs pixel-by-pixel difference operation on the gray values at the same pixel coordinate position of the two frames. By calculating the absolute value of the difference between the gray value of the pixel in the i+1-th frame image and the corresponding pixel gray value in the i-th frame image, a gray-scale difference image is generated. When the absolute value of the gray-scale difference is greater than a preset difference threshold, such as 15, the corresponding pixel is determined to be a moving pixel, and all moving pixels that meet the condition are statistically processed and marked. The controller performs connected component analysis based on the set of moving pixels, merging spatially adjacent moving pixels into several connected regions. It then selects the connected region with the most pixels and the largest area as the target region, calculates the minimum bounding rectangle of the target region, and obtains the target pixel coordinates and target pixel height. The target pixel coordinates are determined by the position of the center point of the bounding rectangle in the 2560×1440 screen coordinate system, while the target pixel height is determined by the pixel size of the bounding rectangle in the vertical direction. The controller compares the target pixel height with the current screen height of 1440 pixels. When the target pixel height is less than 25% of the first preset ratio of the screen height (i.e., less than 360 pixels), the controller determines that the target is too small and triggers a zoom operation. When the target pixel height is greater than 60% of the second preset ratio of the screen height (i.e., greater than 864 pixels), the controller determines that the target occupies too large a proportion of the screen and triggers a zoom operation. Under either condition, the controller calculates the target zoom factor based on the ratio between the target pixel height and the screen height, so that the target pixel height approaches the ideal display ratio of 40% after zooming. Based on the product of the target zoom factor and the reference focal length of 4 mm, the corresponding target focal length value is obtained. Combining the lens structure parameters, the difference between the target focal length and the current focal length is calculated. Based on the parameters of 0.14 mm focal length change per step and 200 steps per revolution of the stepper motor, the total number of zoom steps required for the zoom stepper motor to move from the current focal length position to the target focal length position is calculated.The corresponding pulse frequency sequence is generated based on the zoom step number. The pulse frequency sequence adopts a segmented control strategy, in which the acceleration phase starts at a frequency of 500 Hz and reaches a maximum frequency of 2000 Hz. The transition is smoothed through a quadratic function to reduce the mechanical impact during the motor start-up and stop phases. Meanwhile, during the zoom control parameter generation phase, the controller calculates the change in field of view before and after zooming based on the relationship between the field of view before and after the target focal length change, combined with the effective dimensions of the image sensor in the horizontal direction of 7.1 mm and the vertical direction of 4.0 mm. Based on the positional relationship of the target pixel coordinates relative to the center point of the image (1280, 720), the controller predicts the target pixel offset caused by the reduction in field of view.
[0024] After calculating the zoom step count based on the target focal length, single-step focal length change, and single-cycle step count, and before calculating the gimbal step count based on the target pixel offset, the process includes: inputting the target pixel coordinates of the current frame and the target pixel coordinates of the historical M frames into a Kalman filter, calculating the predicted target pixel coordinates of the Nth frame in the future through the state prediction equation and the observation update equation; determining whether the target continues to approach or move away from the camera based on the predicted offset distance between the predicted target pixel coordinates and the center of the image; calculating the feedforward zoom magnification increment and the feedforward gimbal compensation angle increment when the rate of change of the predicted offset distance is greater than the distance change rate threshold; superimposing the feedforward zoom magnification increment onto the target zoom magnification to obtain the corrected target zoom magnification, and superimposing the feedforward gimbal compensation angle increment onto the gimbal compensation angle to obtain the corrected gimbal compensation angle, and starting the adjustment of the zoom stepper motor and the gimbal stepper motor in advance to reduce control delay.
[0025] In one specific embodiment, the zoom step count is calculated based on the target focal length, the focal length change per step, and the number of steps per revolution, including: Obtain the camera's real-time focal length, and perform a difference calculation between the target focal length and the real-time focal length to obtain the focal length difference. Divide the focal length difference by the single-step focal length change to get the number of motor rotations, and multiply the number of motor rotations by the number of steps per rotation to get the zoom step count.
[0026] Specifically, at the beginning of each zoom control cycle of the camera, the real-time focal length of the lens is obtained by the zoom position feedback mechanism inside the camera. The real-time focal length is obtained by means of the displacement encoder, Hall sensor or back-calculation based on the cumulative steps of the stepper motor, and is uniformly converted into a focal length value in millimeters. The difference between the real-time focal length and the previous target focal length is calculated. The focal length difference is obtained by subtracting the real-time focal length from the target focal length, which determines the amount of focal length change that the lens still needs to adjust during the current zoom process. The focal length difference is converted based on the lens's mechanical structure parameters. The focal length difference is divided by the single-step focal length change corresponding to the minimum stepper motor movement, yielding the equivalent number of rotations required for the stepper motor to axially drive the lens's optical components. The single-step focal length change is an inherent parameter of the lens structure. For example, each complete rotation of the stepper motor drives the lens assembly to produce a 0.14 mm axial displacement, corresponding to a 0.14 mm focal length change. Therefore, the single-step focal length change can be determined by the ratio between the single-rotation focal length change and the number of steps per rotation. The total number of zoom steps required to move from the current focal length position to the target focal length position is obtained by multiplying the number of motor rotations (200 steps) by the calculated number of rotations (whether integer or decimal). For example, if the calculated number of motor rotations is an integer or decimal, it can be multiplied by 200 steps to obtain the precise number of zoom steps.
[0027] In one specific embodiment, generating a pulse frequency sequence based on the zoom step count and calculating the target pixel offset based on the target focal length and target pixel coordinates includes: The zoom step count is divided into acceleration phase step count, constant speed phase step count, and deceleration phase step count. The quadratic increasing frequency sequence corresponding to the acceleration phase step count, the constant frequency sequence corresponding to the constant speed phase step count, and the quadratic decreasing frequency sequence corresponding to the deceleration phase step count are calculated. Construct a pulse frequency sequence based on a quadratic increasing frequency sequence, a constant frequency sequence, and a quadratic decreasing frequency sequence; The first field of view before zooming is calculated based on the real-time focal length, and the second field of view after zooming is calculated based on the target focal length. The target pixel offset is calculated based on the offset distance between the target pixel coordinates and the center of the image, the first field of view, and the second field of view.
[0028] Specifically, the zoom stepping number is divided into stages: acceleration, constant speed, and deceleration steps. For example, 30% of the zoom steps are allocated to acceleration, 40% to constant speed, and the remaining 30% to deceleration. For the acceleration steps, a quadratic increasing frequency sequence is constructed. Within the acceleration phase, the drive signal is output with a low initial pulse frequency, such as 500 Hz, and the pulse frequency is gradually increased according to the square of the step index within the acceleration range until a preset maximum frequency, such as 2000 Hz, is reached. This ensures that the zoom stepper motor's acceleration increases gradually rather than abruptly during startup, thus reducing mechanical shock and vibration. For the constant speed steps, a constant frequency sequence is generated, continuously outputting pulse signals at the highest frequency of 2000 Hz within this phase. This ensures that the zoom stepper motor maintains a stable speed within the main displacement range, improving overall zoom efficiency. A quadratic decreasing frequency sequence is constructed for the deceleration phase steps. Starting from 2000 Hz within the deceleration phase, the pulse frequency gradually decreases according to the square relationship of the step index, eventually returning to a level close to the initial frequency, achieving a smooth stop of the zoom action. The controller sequentially concatenates the quadratic increasing frequency sequence, the constant frequency sequence, and the quadratic decreasing frequency sequence to construct a pulse frequency sequence, which is then output as a drive signal to the zoom stepper motor drive circuit. Simultaneously, during the zoom control parameter generation stage, the controller calculates the first field of view before zooming based on the real-time focal length. This first field of view is determined based on the geometric relationship between the effective size of the image sensor and the real-time focal length; for example, in the horizontal direction, it can be calculated using the sensor width of 7.1 mm. The controller then calculates the second field of view after zooming based on the target focal length, which is also obtained based on the relationship between the target focal length and the sensor size. The analysis is based on the offset distance of the target pixel coordinates relative to the center point of the image. In an image with a resolution of 2560×1440, the pixel coordinates corresponding to the center point of the image are (1280, 720). The difference between the target pixel coordinates and the center point is the basic value of the pixel offset of the target before zooming. The controller combines the proportional relationship between the first field of view and the second field of view to perform proportional mapping calculation on the offset distance, and obtains the predicted offset of the target pixel caused by the shrinking or enlarging of the field of view.
[0029] The process of synchronously outputting pulse frequency sequences to drive the zoom stepper motor and gimbal stepper motor within each time slice also includes: at the beginning of each time slice, calculating the instantaneous change in lens focal length within that time slice based on the pulse frequency corresponding to that time slice, obtaining the instantaneous change rate of focal length by the ratio of the instantaneous change to the time slice duration, and calculating the instantaneous change rate of field of view based on the instantaneous change rate of focal length; when the instantaneous change rate of field of view is greater than a preset change rate threshold, calculating a compensation angle correction coefficient based on the difference between the instantaneous change rate of field of view and the preset change rate threshold, multiplying the compensation angle correction coefficient by the original gimbal compensation angle within that time slice to obtain the corrected gimbal compensation angle; recalculating the number of steps that the gimbal stepper motor needs to execute within that time slice based on the corrected gimbal compensation angle, so that the gimbal compensation speed is synchronously matched with the acceleration of the field of view change, solving the problem of instantaneous target deviation caused by non-uniform changes in field of view during acceleration and deceleration phases.
[0030] In one specific embodiment, the gimbal step count is calculated based on the target pixel offset, the total zoom duration is divided into multiple time slices, and a pulse frequency sequence is synchronously output in each time slice to drive the zoom stepper motor and the gimbal stepper motor, including: The horizontal pixel offset in the target pixel offset is calculated as the ratio of the horizontal pixel offset to the screen width to obtain the horizontal ratio, and the vertical pixel offset in the target pixel offset is calculated as the ratio of the vertical pixel offset to the screen height to obtain the vertical ratio. Multiply the horizontal ratio by the second field of view to obtain the horizontal compensation angle, and multiply the vertical ratio by the second field of view to obtain the vertical compensation angle. Divide the horizontal compensation angle by the single-step angle accuracy of the gimbal stepper motor to obtain the horizontal axis step count, and divide the vertical compensation angle by the single-step angle accuracy of the gimbal stepper motor to obtain the vertical axis step count. Use the horizontal axis step count and the vertical axis step count as the gimbal step count. The total zoom duration is calculated based on the zoom step count, and then divided into multiple time slices. Within each time slice, a pulse frequency sequence is synchronously output to drive the zoom stepper motor and the gimbal stepper motor.
[0031] Specifically, the target pixel offset is normalized. This involves calculating the ratio of the horizontal pixel offset to the width of the current video frame. For example, with a frame resolution of 2560×1440, the horizontal pixel offset is divided by the frame width of 2560 to obtain the horizontal ratio of the target relative to the overall frame. Simultaneously, the vertical pixel offset is calculated by dividing it by the frame height of 1440 to obtain the vertical ratio of the target relative to the overall frame. Angle compensation is then performed based on the second field of view calculated after zooming. The horizontal ratio is multiplied by the second field of view to obtain the horizontal compensation angle required for the target in the horizontal direction. Similarly, the vertical ratio is multiplied by the second field of view to obtain the vertical compensation angle required for the target in the vertical direction. The second field of view is determined by the target focal length and the effective size of the image sensor. This angle reflects the actual spatial angle range corresponding to the unit frame ratio after zooming. Therefore, by multiplying the ratio by the field of view, the target offset in pixel space is accurately mapped to the actual rotation angle required by the gimbal. The horizontal and vertical compensation angles are converted into the number of steps for the gimbal stepper motor. The horizontal compensation angle is divided by the single-step angle accuracy of the gimbal stepper motor after the reduction mechanism. For example, with a single-step angle accuracy of 0.028 degrees, the required number of steps for the horizontal axis is obtained through division. Similarly, the vertical compensation angle is divided by the same single-step angle accuracy to obtain the required number of steps for the vertical axis. The horizontal and vertical axis step counts are used as the number of gimbal steps to be executed in this gimbal compensation control, clarifying the amount of rotation that the gimbal needs to complete synchronously in the horizontal and vertical directions. The total zoom duration is calculated based on the zoom control parameters. The total zoom duration is determined by the number of zoom steps and the average pulse frequency of the zoom stepper motor. For example, the overall zoom execution time is estimated by dividing the number of zoom steps by the average frequency obtained from the acceleration, constant speed, and deceleration phases. The total zoom duration is divided into multiple time slices, such as twenty time slices, so that each time slice corresponds to a short and fixed time interval. Within each time slice, the controller synchronously outputs a pulse frequency sequence according to the time slice scheduling mechanism, driving the zoom stepper motor to complete the corresponding zoom stepping action according to the predetermined frequency sequence. At the same time, it drives the gimbal stepper motor to execute the corresponding gimbal stepping number on the horizontal and vertical axes respectively, so that the gimbal compensation action is synchronized with the zoom action in the time dimension.
[0032] Before dividing the zoom step count into acceleration, constant speed, and deceleration steps, the process includes: extracting the pixel height sequence of the target in the current frame and K consecutive historical frames; calculating the difference sequence of target pixel height between adjacent frames to obtain the size growth rate sequence; performing linear fitting on the size growth rate sequence to obtain the size growth rate trend line; extrapolating and predicting the future frame number corresponding to reaching the target proportion based on the size growth rate trend line and the target pixel height to the frame height target ratio coefficient; and obtaining the estimated arrival time by the ratio of the future frame number to the frame rate; when the estimated arrival time is less than the time required to complete zooming according to the original zoom step count, recalculating the deceleration step count ratio, increasing the deceleration step count ratio from the preset ratio to a higher ratio, and correspondingly reducing the constant speed step count ratio, so that the zoom stepper motor enters the deceleration braking stage in advance, avoiding the overshoot problem caused by the zoom motor continuing to enlarge even when the target size has reached the ideal proportion.
[0033] Before calculating the total zoom duration based on the zoom step count and dividing the total zoom duration into multiple time slices, the process includes: calculating the position change of the target pixel coordinates in N consecutive frames of images, dividing the position change by the time interval of the N consecutive frames to obtain the target motion speed; setting the number of time slices to a first value when the target motion speed is greater than a first speed threshold, setting the number of time slices to a second value when the target motion speed is between the first and second speed thresholds, and setting the number of time slices to a third value when the target motion speed is less than the second speed threshold, wherein the first value is greater than the second value and the second value is greater than the third value; and recalculating the ratio of the number of steps that the zoom stepper motor and the gimbal stepper motor need to execute in each time slice based on the adjusted number of time slices, so that a higher gimbal update frequency corresponds to a fast-moving target.
[0034] Before calculating the total zoom duration based on the zoom step count and dividing the total zoom duration into multiple time slices, the process includes: extracting the target pixel coordinate sequence from the current frame and N consecutive historical frames; performing trajectory fitting on the target pixel coordinate sequence to obtain the target motion trajectory curve; calculating the curvature and directional angle change rate of the target motion trajectory curve; determining that the target is in a non-linear motion mode when the curvature is greater than a curvature threshold or the directional angle change rate is greater than a directional change rate threshold; determining that the target is in a linear motion mode when the curvature is less than a curvature threshold and the directional angle change rate is less than a directional change rate threshold; and when the target is in a linear motion mode, extrapolating the target pixel coordinate sequence of the next M frames based on the slope of the target motion trajectory curve and the current target pixel coordinates, and calculating the target pixel coordinate sequence of the next M frames. The cumulative gimbal compensation angle corresponding to the pixel coordinate sequence is allocated to each time slice of the current zoom cycle, causing the gimbal compensation path to shift in advance along the target motion direction. When the target is in a non-linear motion mode, the actual compensation angle sequence executed by the gimbal in the historical N frames is calculated, and the number of direction reversals in the compensation angle sequence is counted to obtain the round-trip motion frequency. When the round-trip motion frequency is greater than the frequency threshold, the response gain coefficient of the gimbal compensation is reduced to reduce the gimbal compensation amplitude and avoid frequent round-trip adjustments. Based on the optimized gimbal compensation path, the number of horizontal axis steps and vertical axis steps in each time slice are recalculated to make the gimbal motion trajectory match the target motion trajectory in space, reducing the total rotation angle of the gimbal and the number of round-trip adjustments.
[0035] In one specific embodiment, the real-time zoom factor is calculated based on the real-time focal length. When the real-time zoom factor reaches the target zoom factor, the first exposure parameter is calculated, including: Obtain the camera's real-time focal length; The real-time zoom ratio is calculated by comparing the real-time focal length with the reference focal length. When the real-time zoom ratio reaches the target zoom ratio, the compensated target position is obtained. Divide the target area and background area using the compensated target location as the center; Calculate the first average gray value of the target area and the second average gray value of the background area; When the first average gray value is greater than the overexposure threshold, the target exposure adjustment coefficient is calculated based on the first average gray value and the overexposure threshold. When the second average gray value is less than the underexposure threshold, the background adjustment coefficient is calculated based on the underexposure threshold and the second average gray value. The first exposure parameter is calculated based on the target exposure adjustment coefficient or the background adjustment coefficient.
[0036] Specifically, in each zoom and tracking control cycle of the camera, the zoom position acquisition module inside the camera obtains the current real-time focal length of the lens. This real-time focal length is obtained through a displacement detection structure built into the lens, an encoded feedback structure, or by back-calculation based on the cumulative displacement of a stepper motor, and is uniformly converted into a focal length value in millimeters. The real-time focal length is then compared with a preset reference focal length. For example, with a reference focal length of 4 millimeters, the real-time zoom ratio is calculated using the ratio between the real-time focal length and 4 millimeters, reflecting the current magnification or reduction state of the lens. The controller continuously monitors the real-time zoom ratio. When the real-time zoom ratio reaches or approaches the target zoom ratio, it determines that the zoom process has been completed or is about to be completed, and at that moment, it acquires the target position after zoom and gimbal compensation. The compensated target position is located near the center of the image, for example, corresponding to pixel coordinates (1280, 720) in a 2560×1440 resolution image. Centered on the compensated target location, the current video frame is divided into a target region and a background region. The target region is defined by expanding the target pixel size obtained from previous target detection, for example, by expanding the target's bounding rectangle outwards by a certain proportion. The rest of the image outside the target region is uniformly defined as the background region. Statistical analysis is performed on the pixel grayscale values of the target and background regions respectively. The first average grayscale value of the target region is calculated by summing the grayscale values of all pixels in the target region and dividing by the total number of pixels in the target region. Similarly, the second average grayscale value of the background region is calculated by summing the grayscale values of all pixels in the background region and dividing by the total number of pixels in the background region. These values reflect the overall brightness level of the target subject and the ambient background, respectively. The first average gray value is compared with a preset overexposure threshold, for example, an overexposure threshold of 200. When the first average gray value is greater than 200, the target area is determined to be at risk of overexposure. A target exposure adjustment coefficient is calculated based on the difference between the first average gray value and the overexposure threshold. For example, the target exposure adjustment coefficient can be gradually reduced as the first average gray value increases using a linear or piecewise function, thereby reducing the exposure time or analog gain to suppress overexposure in the target area. Simultaneously, the second average gray value is compared with a preset underexposure threshold, for example, an underexposure threshold of 80. When the second average gray value is less than 80, the background area is determined to be underexposure, and a background adjustment coefficient is calculated based on the difference between the underexposure threshold and the second average gray value. First exposure parameters are calculated based on either the target exposure adjustment coefficient or the background adjustment coefficient. These first exposure parameters include new exposure time parameters and new analog gain parameters. Depending on whether a target-priority or background-compensation control strategy is used, the parameters are updated primarily based on either the target exposure adjustment coefficient or the background adjustment coefficient, thereby achieving a balance between suppressing overexposure in the target area and ensuring brightness in the background area after high-magnification zoom.
[0037] After calculating the first exposure parameter based on the target exposure adjustment factor or background adjustment factor, the method further includes: dividing the target area into a core sub-region, a middle sub-region, and an edge sub-region centered on the compensated target position. The core sub-region is a rectangular area centered on the compensated target position with a side length one-third of the side length of the target area. The edge sub-region is an annular area between the rectangular boundary of the target area and the target area after shrinking the boundary by a preset boundary width. The middle sub-region is the remaining area of the target area excluding the core and edge sub-regions. The average gray value of each sub-region (core, middle, and edge) is calculated. When the average gray value of the core sub-region is greater than the overexposure threshold, the core exposure adjustment factor is calculated. When the average gray value of the middle sub-region is greater than the overexposure threshold, the middle exposure adjustment factor is calculated. The coefficients are calculated as follows: the edge exposure adjustment coefficient is calculated when the average gray value of the edge sub-region is greater than the overexposure threshold; the core exposure adjustment coefficient is calculated based on the first difference between the average gray value of the core sub-region and the overexposure threshold; the middle exposure adjustment coefficient is calculated based on the second difference between the average gray value of the middle sub-region and the overexposure threshold, as well as the first gradient coefficient; and the edge exposure adjustment coefficient is calculated based on the third difference between the average gray value of the edge sub-region and the overexposure threshold, as well as the second gradient coefficient. The first gradient coefficient is less than the second gradient coefficient. The exposure time and analog gain of the core sub-region, middle sub-region, and edge sub-region are adjusted according to the core exposure adjustment coefficient, the middle exposure adjustment coefficient, and the edge exposure adjustment coefficient, respectively, so that the exposure suppression intensity of the target center region is greater than the exposure suppression intensity of the target edge region.
[0038] After dividing the target region and background region centered on the compensated target location, and before calculating the first average gray value of the target region, the process includes: extracting the gray value of each pixel on the rectangular boundary of the target region, calculating the gray value difference between adjacent pixels on the boundary to obtain the boundary gradient sequence, and calculating the proportion of pixels with gradient magnitudes greater than the gradient threshold in the boundary gradient sequence to the total number of pixels on the boundary to obtain the boundary intensity ratio; when the boundary intensity ratio is less than the first intensity threshold, it is determined that the target region contains too much background region, and the target region is re-divided by shrinking inward along the rectangular boundary by a preset first pixel distance; when the boundary intensity ratio is greater than the second intensity threshold, it is determined that the target region has missed the target edge, and the target region is re-divided by expanding outward along the rectangular boundary by a preset second pixel distance; the boundary gradient calculation and boundary intensity ratio determination process are repeated for the adjusted target region until the boundary intensity ratio is between the first intensity threshold and the second intensity threshold, so that the partition boundary fits the actual contour of the target to improve the accuracy of partition exposure adjustment.
[0039] In one specific embodiment, a supplementary light signal is generated based on the real-time zoom level and ambient illuminance, and a second exposure parameter is calculated based on the supplementary light signal, including: Obtain the third average grayscale value of the entire image from the camera, and calculate the ambient illuminance based on the third average grayscale value; The white light duty cycle and infrared duty cycle are calculated based on the real-time zoom magnification and ambient illuminance, respectively, and the corresponding supplementary light signals are output to the white light LED and infrared LED based on the white light duty cycle and infrared duty cycle. The target area is divided into multiple pixel blocks of a preset size, and the fourth average gray value and the corresponding local gray standard deviation are calculated in each pixel block. When the local grayscale standard deviation is lower than the standard deviation threshold and the fourth average grayscale value is higher than the grayscale threshold, the second exposure parameter is calculated based on the fourth average grayscale value and the grayscale threshold.
[0040] Specifically, after the camera completes zoom and gimbal compensation and enters a stable imaging state, the image processing module performs statistical processing on the grayscale values of all pixels in the current video frame. By summing the grayscale values of all pixels in the image and dividing by the total number of pixels in the image, the third average grayscale value of the entire image is calculated, which reflects the overall brightness level of the current imaging environment. Based on an empirical mapping relationship, the third average grayscale value is converted into an ambient illuminance value. For example, it is estimated according to the ratio that the ambient illuminance is equal to the third average grayscale value multiplied by 0.8. Without introducing an additional illuminance sensor, an approximate quantification of the brightness of the current environment is achieved. Based on ambient illuminance and the ratio between the current real-time focal length and the reference focal length, the real-time zoom ratio is calculated, and then the supplementary light intensity is linked to calculate the supplementary light intensity. When the ambient illuminance is in the daytime brightness range, the controller calculates the duty cycle of the white light supplementary light according to the real-time zoom ratio. For example, 40% is used as the reference duty cycle for 1x zoom, and an additional 10% duty cycle is added for each doubling of the real-time zoom ratio to compensate for the light attenuation caused by the increase in target distance. When the ambient illuminance is below the nighttime threshold, the white light supplementary light is turned off and the infrared supplementary light is enabled. 50% is used as the infrared duty cycle reference for 1x zoom, and an additional 15% infrared duty cycle is added for each doubling of the real-time zoom ratio to ensure sufficient infrared illumination intensity under high zoom conditions. When the ambient illuminance is in the day-night transition range, both white light and infrared supplementary light are enabled simultaneously, and the calculations are performed according to the duty cycle formula with a lower increase. After calculating the white light duty cycle and infrared duty cycle, the controller outputs the corresponding supplementary light signals in pulse-width modulation to the white light LED driver circuit and the infrared LED driver circuit respectively, enabling the supplementary light brightness to adaptively adjust in real time according to changes in zoom magnification and ambient brightness. After the supplementary light control is completed, a more refined local exposure optimization process is performed on the target area. The target area is divided into multiple small pixel blocks according to a preset pixel size, such as 8×8 pixel blocks, thereby performing fine-grained analysis of the target area in space. For each pixel block, the controller calculates the fourth average gray value within the pixel block and calculates the local gray standard deviation based on the deviation between the gray values of all pixels within the pixel block and the fourth average gray value, characterizing the brightness uniformity and texture contrast within the pixel block. The local grayscale standard deviation is compared with a preset standard deviation threshold. For example, when the local grayscale standard deviation is less than 15, it is determined that the grayscale variation inside the pixel block is small, showing the characteristic of uniform brightness. The fourth average grayscale value is compared with a preset grayscale threshold. For example, when the fourth average grayscale value is higher than 220, it is determined that the pixel block simultaneously meets the conditions of excessive brightness and insufficient contrast, thus identifying it as an area with high light reflection or local overexposure risk.Under the condition of satisfying the above two conditions, the second exposure parameter is calculated based on the difference between the fourth average gray value and the gray threshold. The second exposure parameter adjusts the exposure time, gain or gamma parameter through non-linear mapping, so that the bright areas in the pixel block are suppressed and the detail contrast is enhanced.
[0041] When the local grayscale standard deviation is lower than the standard deviation threshold and the fourth average grayscale value is higher than the grayscale threshold, after calculating the second exposure parameter based on the fourth average grayscale value and the grayscale threshold, the method further includes: performing face detection or license plate detection on pixel blocks where the local grayscale standard deviation is lower than the standard deviation threshold and the fourth average grayscale value is higher than the grayscale threshold; marking the pixel block as a ROI sub-region when a face feature point or license plate rectangle is detected; calculating the difference between the maximum grayscale value and the average grayscale value of the ROI sub-region to obtain the local overexposure degree; when the local overexposure degree is greater than the overexposure degree threshold, calculating the secondary gamma coefficient based on the local overexposure degree and the overexposure degree threshold; performing a secondary gamma nonlinear mapping based on the secondary gamma coefficient on each pixel in the ROI sub-region, and using the mapped pixel grayscale value as the third exposure parameter to further improve the grayscale contrast of facial features or license plate characters.
[0042] In one specific embodiment, the white light duty cycle and infrared duty cycle are calculated based on the real-time zoom magnification and ambient illuminance, respectively, and the corresponding supplementary lighting signals are output to the white light LED and infrared LED based on the white light duty cycle and infrared duty cycle, including: When the ambient illuminance is greater than or equal to the first illuminance threshold, the white light duty cycle is calculated based on the real-time zoom magnification and the white light reference duty cycle. When the ambient illuminance is less than the second illuminance threshold, the infrared duty cycle is calculated based on the real-time zoom magnification and the infrared reference duty cycle. When the ambient illuminance is between the second illuminance threshold and the first illuminance threshold, the white light duty cycle and the infrared duty cycle are calculated based on the real-time zoom magnification respectively. The corresponding supplementary light signals are output based on the white light duty cycle and the infrared duty cycle, and the supplementary light signals are output to the white light LED and the infrared LED.
[0043] Specifically, based on the ambient illuminance value, the current shooting environment's lighting range is determined. When the ambient illuminance is greater than or equal to the first illuminance threshold, for example, when the ambient illuminance is greater than or equal to 100 lux, the controller determines that it is currently in daylight or a high-brightness environment. In this state, there is no need to activate infrared supplementary lighting; instead, only white light supplementary lighting is adjusted. At this time, the real-time zoom ratio is calculated based on the ratio between the real-time focal length and the reference focal length, and the set white light reference duty cycle is used as the starting value. For example, 40% is used as the white light reference duty cycle under 1x zoom conditions. Based on this, the duty cycle is linearly increased according to the increase of the real-time zoom ratio. For example, for every doubling of the real-time zoom ratio, the white light duty cycle increases by 10%, thereby compensating for the insufficient brightness caused by the decrease in visible light illuminance with distance as the target distance increases. When the ambient illuminance is less than the second illuminance threshold, for example, when the ambient illuminance is less than 50 lux, the controller determines that it is currently in a nighttime or low-illuminance environment. In this state, white light supplementary lighting will interfere with the monitored target or is not suitable for use. Therefore, the controller turns off the white light supplementary lighting and switches to infrared supplementary lighting mode. It calculates the infrared duty cycle based on the real-time zoom magnification and the infrared reference duty cycle. For example, it uses 50% as the infrared reference duty cycle under the 1x zoom condition, and increases the infrared duty cycle by 15% for every doubling of the real-time zoom magnification to ensure that the infrared illumination intensity can still cover the target area under high zoom and long-distance monitoring conditions. When the ambient illuminance is between the second and first illuminance thresholds, for example, between 50 and 100 lux, the controller determines that the current state is a transitional period between day and night or an unstable lighting condition. In this state, a single supplementary lighting method is insufficient to balance image naturalness and target sharpness. Therefore, the controller simultaneously activates white light supplementary lighting and infrared supplementary lighting, calculating the corresponding white light duty cycle and infrared duty cycle based on the real-time zoom magnification. The white light duty cycle uses a lower base value and a smaller scaling factor with zoom, while the infrared duty cycle uses a medium base value and a medium scaling factor to achieve a comprehensive balance between overall image brightness and target visibility. The white light duty cycle and infrared duty cycle are converted into corresponding pulse width modulation control signals and output to the white light LED driver circuit and infrared LED driver circuit respectively through the supplementary lighting control interface. This allows the white light LED and infrared LED to adjust their luminous intensity according to the calculated duty cycle, thus enabling the supplementary lighting brightness to adaptively adjust with changes in ambient illuminance and real-time zoom magnification throughout the zoom and tracking process.
[0044] In one specific embodiment, the control method for a high-magnification zoom intelligent tracking camera further includes: Calculate the centering error between the compensated target position and the center of the image, and calculate the contrast of the target area; When the centering error exceeds the error threshold or the contrast is lower than the contrast threshold, record the real-time zoom magnification, the actual deviation, and the target exposure adjustment coefficient to establish a correction lookup table. In the next control cycle, the correction coefficient is read from the correction lookup table according to the real-time zoom magnification of the next control cycle, and the gimbal compensation angle and target exposure adjustment coefficient are adjusted according to the correction coefficient.
[0045] Specifically, the centering error of the target is calculated by comparing the compensated target position with the current center position of the image. With an image resolution of 2560×1440, the pixel coordinates corresponding to the center position are (1280, 720). The controller calculates the difference between the compensated target pixel coordinates and the center coordinates of the image in the horizontal and vertical directions, and normalizes the difference. For example, the Euclidean distance between the target position and the center position is divided by the image width of 2560 to obtain a dimensionless centering error value, reflecting whether the target still has a significant deviation from the image center within the current control cycle. Simultaneously, image quality assessment processing is performed on the target area. By statistically analyzing the pixel grayscale values within the target area, the average grayscale value and grayscale standard deviation of the target area are calculated. The ratio of the grayscale standard deviation to the average grayscale value is then used to obtain a contrast index characterizing the degree of brightness variation in the target area, reflecting whether the details and textures within the target area are clear and whether there are problems of overexposure suppression or insufficient brightness. The centering error is compared with a preset error threshold. For example, if the centering error is greater than 0.05, it means that the target position deviates from the center of the image by more than 5% of the image width, indicating that the current gimbal compensation is insufficient or has a systematic deviation. Simultaneously, the target area contrast is compared with a preset contrast threshold. For example, if the target area contrast is lower than 0.08, it indicates that the current exposure adjustment is suppressing target details too much, resulting in insufficient target texture information. If any of the above conditions are met, the controller considers the current control parameters needing correction. It records the real-time zoom magnification, the actual deviation of the target from the image center, and the currently used target exposure adjustment coefficient within the current control cycle. These parameters are then written into a correction lookup table using the zoom magnification as the index key, establishing a mapping relationship between the zoom magnification, compensation error, and exposure correction. The correction lookup table is stored in the form of an array, key-value pairs, or piecewise functions, and is gradually supplemented and improved as the control cycle continues to execute. Upon entering the next control cycle, the current real-time zoom magnification is reacquired, and a corresponding correction record is searched in the correction lookup table based on the real-time zoom magnification. If a matching or approximately matching zoom magnification range exists, the corresponding correction coefficient is read from the correction lookup table and applied to the calculation of the gimbal compensation angle and the target exposure adjustment coefficient. For example, when calculating the gimbal compensation angle, the original horizontal and vertical compensation angles are multiplied by an angle correction coefficient greater than 1 to increase the gimbal compensation amplitude, thereby more fully offsetting the target offset caused by the change in field of view during the next zoom and compensation process. At the same time, the original target exposure adjustment coefficient is appropriately increased in the exposure control to reduce the impact of overexposure suppression on the contrast of the target area.By continuously calculating the centering error and target area contrast in each control cycle, recording key parameters and establishing a correction lookup table under abnormal conditions, and automatically reading and applying correction coefficients based on the real-time zoom magnification in the next control cycle, the camera can gradually correct the gimbal compensation accuracy and exposure control strategy under different zoom magnifications and shooting scenarios, effectively reducing the impact of inherent system errors on tracking performance, and achieving parameter adaptive convergence after multiple control cycles.
[0046] The control method of the high-magnification zoom intelligent tracking camera in the embodiments of the present invention has been described above. The high-magnification zoom intelligent tracking camera in the embodiments of the present invention will be described below. Please refer to [link / reference]. Figure 2 One embodiment of the high-magnification zoom intelligent tracking camera in this invention includes: The calculation module 201 is used to calculate the target zoom factor and target focal length based on the video stream acquired in the current control cycle, and to calculate the pulse frequency sequence and target pixel offset based on the target focal length; The drive module 202 is used to calculate the gimbal step number based on the target pixel offset, divide the total zoom duration into multiple time slices, and synchronously output a pulse frequency sequence to drive the zoom stepper motor and the gimbal stepper motor in each time slice. Exposure module 203 is used to calculate the real-time zoom ratio based on the real-time focal length, and to calculate the first exposure parameter when the real-time zoom ratio reaches the target zoom ratio; The fill light module 204 is used to generate a fill light signal based on the real-time zoom magnification and ambient illuminance, and to calculate the second exposure parameters based on the fill light signal.
[0047] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0048] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0049] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A control method for a high-magnification zoom intelligent tracking camera, characterized in that, include: The target zoom factor and target focal length are calculated based on the video stream acquired during the current control cycle, and the pulse frequency sequence and target pixel offset are calculated based on the target focal length. The gimbal step count is calculated based on the target pixel offset. The total zoom duration is divided into multiple time slices. The pulse frequency sequence is synchronously output in each time slice to drive the zoom stepper motor and the gimbal stepper motor. The real-time zoom factor is calculated based on the real-time focal length. When the real-time zoom factor reaches the target zoom factor, the first exposure parameter is calculated. A fill light signal is generated based on the real-time zoom level and ambient illuminance, and a second exposure parameter is calculated based on the fill light signal.
2. The control method for a high-magnification zoom intelligent tracking camera according to claim 1, characterized in that, The target zoom factor and target focal length are calculated based on the video stream acquired during the current control cycle, and the pulse frequency sequence and target pixel offset are calculated based on the target focal length, including: Acquire the video stream captured by the camera during the current control cycle; Perform a difference operation on the i-th frame and the (i+1)-th frame in the video stream to obtain the grayscale difference. Extract the moving pixels whose grayscale difference is greater than a preset difference threshold, and calculate the target pixel coordinates and target pixel height based on the moving pixels. When the target pixel height is less than a first preset ratio of the screen height or greater than a second preset ratio of the screen height, the target zoom factor is calculated based on the target pixel height and the screen height, and the target focal length is calculated based on the target zoom factor and the reference focal length. The zoom step count is calculated based on the target focal length, the single-step focal length change, and the number of steps per revolution. A pulse frequency sequence is generated based on the zoom step number, and the target pixel offset is calculated based on the target focal length and the target pixel coordinates.
3. The control method for a high-magnification zoom intelligent tracking camera according to claim 2, characterized in that, The zoom step count is calculated based on the target focal length, the focal length change per step, and the number of steps per revolution, including: Obtain the real-time focal length of the camera, and perform a difference calculation between the target focal length and the real-time focal length to obtain the focal length difference. Divide the focal length difference by the single-step focal length change to obtain the number of motor rotations, and multiply the number of motor rotations by the number of single-step steps to obtain the zoom step count.
4. The control method for a high-magnification zoom intelligent tracking camera according to claim 3, characterized in that, Generate a pulse frequency sequence based on the zoom step number, and calculate the target pixel offset based on the target focal length and the target pixel coordinates, including: The zoom step count is divided into acceleration phase step count, constant speed phase step count, and deceleration phase step count. The quadratic increasing frequency sequence corresponding to the acceleration phase step count, the constant frequency sequence corresponding to the constant speed phase step count, and the quadratic decreasing frequency sequence corresponding to the deceleration phase step count are calculated. A pulse frequency sequence is constructed based on the quadratic increasing frequency sequence, the constant frequency sequence, and the quadratic decreasing frequency sequence; The first field of view before zooming is calculated based on the real-time focal length, and the second field of view after zooming is calculated based on the target focal length. The target pixel offset is calculated based on the offset distance between the target pixel coordinates and the center of the image, the first field of view, and the second field of view.
5. The control method for a high-magnification zoom intelligent tracking camera according to claim 4, characterized in that, The gimbal step count is calculated based on the target pixel offset. The total zoom duration is divided into multiple time slices. Within each time slice, the pulse frequency sequence is synchronously output to drive the zoom stepper motor and the gimbal stepper motor, including: The horizontal pixel offset in the target pixel offset is calculated as a ratio to the screen width to obtain the horizontal ratio, and the vertical pixel offset in the target pixel offset is calculated as a ratio to the screen height to obtain the vertical ratio. Multiply the horizontal ratio by the second field of view to obtain the horizontal compensation angle, and multiply the vertical ratio by the second field of view to obtain the vertical compensation angle; Divide the horizontal compensation angle by the single-step angle accuracy of the gimbal stepper motor to obtain the horizontal axis step count, and divide the vertical compensation angle by the single-step angle accuracy of the gimbal stepper motor to obtain the vertical axis step count. Use the horizontal axis step count and the vertical axis step count as the gimbal step count. The total zoom duration is calculated based on the zoom step count, and the total zoom duration is divided into multiple time slices. Within each time slice, the pulse frequency sequence is synchronously output to drive the zoom stepper motor and the gimbal stepper motor.
6. The control method for a high-magnification zoom intelligent tracking camera according to claim 1, characterized in that, The real-time zoom ratio is calculated based on the real-time focal length. When the real-time zoom ratio reaches the target zoom ratio, the first exposure parameters are calculated, including: Obtain the camera's real-time focal length; The real-time focal length is compared with the reference focal length to obtain the real-time zoom ratio. When the real-time zoom ratio reaches the target zoom ratio, the compensated target position is obtained. Divide the target area and the background area with the compensated target location as the center; Calculate the first average gray value of the target area and the second average gray value of the background area; When the first average gray value is greater than the overexposure threshold, a target exposure adjustment coefficient is calculated based on the first average gray value and the overexposure threshold. When the second average gray value is less than the underexposure threshold, a background adjustment coefficient is calculated based on the underexposure threshold and the second average gray value. A first exposure parameter is calculated based on the target exposure adjustment coefficient or the background adjustment coefficient.
7. The control method for a high-magnification zoom intelligent tracking camera according to claim 6, characterized in that, A supplementary light signal is generated based on the real-time zoom level and ambient illuminance, and a second exposure parameter is calculated based on the supplementary light signal, including: Obtain the third average grayscale value of the entire image in the camera, and calculate the ambient illuminance based on the third average grayscale value; The white light duty cycle and infrared duty cycle are calculated based on the real-time zoom ratio and the ambient illuminance, respectively, and the corresponding supplementary light signals are output to the white light LED and infrared LED based on the white light duty cycle and infrared duty cycle. The target area is divided into multiple pixel blocks of a preset size, and the fourth average gray value and the corresponding local gray standard deviation are calculated in each pixel block. When the local grayscale standard deviation is lower than the standard deviation threshold and the fourth average grayscale value is higher than the grayscale threshold, the second exposure parameter is calculated based on the fourth average grayscale value and the grayscale threshold.
8. The control method for a high-magnification zoom intelligent tracking camera according to claim 7, characterized in that, The white light duty cycle and infrared duty cycle are calculated based on the real-time zoom magnification and the ambient illuminance, respectively, and the corresponding supplementary lighting signals are output to the white light LED and infrared LED based on the white light duty cycle and infrared duty cycle, including: When the ambient illuminance is greater than or equal to the first illuminance threshold, the white light duty cycle is calculated based on the real-time zoom magnification and the white light reference duty cycle. When the ambient illuminance is less than the second illuminance threshold, the infrared duty cycle is calculated based on the real-time zoom magnification and the infrared reference duty cycle. When the ambient illuminance is between the second illuminance threshold and the first illuminance threshold, the white light duty cycle and the infrared duty cycle are calculated based on the real-time zoom magnification respectively. The corresponding supplementary light signal is output according to the white light duty cycle and the infrared duty cycle, and the supplementary light signal is output to the white light LED and the infrared LED.
9. The control method for a high-magnification zoom intelligent tracking camera according to claim 8, characterized in that, The control method for the high-magnification zoom intelligent tracking camera also includes: Calculate the centering error between the compensated target position and the center of the image, and calculate the contrast of the target area; When the centering error exceeds the error threshold or the contrast is lower than the contrast threshold, a correction lookup table is established by recording the real-time zoom magnification, the actual deviation, and the target exposure adjustment coefficient. In the next control cycle, the correction coefficient is read from the correction lookup table according to the real-time zoom magnification of the next control cycle, and the gimbal compensation angle and target exposure adjustment coefficient are adjusted according to the correction coefficient.
10. A high-magnification zoom intelligent tracking camera, characterized in that, A control method for performing the high-magnification zoom intelligent tracking camera as described in any one of claims 1-9, comprising: The calculation module is used to calculate the target zoom factor and target focal length based on the video stream acquired in the current control cycle, and to calculate the pulse frequency sequence and target pixel offset based on the target focal length; The drive module is used to calculate the gimbal step count based on the target pixel offset, divide the total zoom duration into multiple time slices, and synchronously output the pulse frequency sequence in each time slice to drive the zoom stepper motor and the gimbal stepper motor. The exposure module is used to calculate the real-time zoom ratio based on the real-time focal length, and to calculate the first exposure parameter when the real-time zoom ratio reaches the target zoom ratio. The supplementary lighting module is used to generate a supplementary lighting signal based on the real-time zoom level and ambient illuminance, and to calculate the second exposure parameters based on the supplementary lighting signal.