Target tracking method, device, medium and electronic equipment for pan-tilt camera

By determining and controlling the position and size of the rectangular frame in the gimbal camera, high-precision target tracking is achieved in multi-moving target scenarios, solving the problems of low accuracy and high cost in existing technologies.

CN114764817BActive Publication Date: 2025-09-19ZHEJIANG UNIVIEW TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011643265.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-30
Publication Date
2025-09-19
Estimated Expiration
2040-12-30

AI Technical Summary

Technical Problem

Existing target tracking methods for gimbal cameras have low accuracy in multi-moving target scenarios and rely on deep algorithms, which increases costs.

Method used

By determining the rectangular frame position of the object in the current frame image, selecting the tracking object according to the preset rules, and controlling the gimbal camera to move the center of the picture to the center position of the rectangular frame, combined with the rectangular frame size restriction conditions, the target of the tracking frame image is determined and controlled.

Benefits of technology

Without relying on algorithms, the accuracy and effect of target tracking are improved and the cost is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114764817B_ABST
    Figure CN114764817B_ABST
Patent Text Reader

Abstract

The embodiments of the present application disclose a target tracking method, device, medium, and electronic device for a pan-tilt camera. The method comprises determining the rectangular frame position of an object detected in a current frame image, and determining the tracking object in the current frame image according to preset rules; controlling the pan-tilt camera to move the center position of the image to the center position of the rectangular frame of the tracking object; determining the rectangular frame position of the object to be identified detected in the tracking frame image, and determining the tracking object of the tracking frame image based on the rectangular frame position and rectangular frame size constraints; and controlling the pan-tilt camera based on the rectangular frame center position of the tracking object in the tracking frame image. By adopting this solution, target tracking can be completed in a multi-target situation without the aid of an algorithm, and the tracking accuracy and effect can be improved at the lowest cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of image processing technology, and in particular to a target tracking method, device, medium, and electronic device for a pan-tilt camera. Background Art

[0002] A PTZ camera is a type of camera used in video surveillance that can capture images from multiple angles. In real-world surveillance scenarios, it can be used to track moving objects.

[0003] Existing target tracking methods utilize depth algorithms, transmitting images captured by a gimbal camera to the algorithm, which then identifies target features and provides unified target coordinates. However, due to cost constraints, this over-reliance on algorithms increases investment. Other methods use target size for data processing and zoom tracking, but this method fails to track a unified target. In scenarios with multiple moving targets, this leads to tracking confusion and reduced target tracking accuracy. Summary of the Invention

[0004] The embodiments of the present application provide a target tracking method, device, medium and electronic equipment for a pan-tilt camera to achieve accurate target tracking.

[0005] In a first aspect, an embodiment of the present application provides a target tracking method for a pan-tilt camera, the method comprising:

[0006] Determine the position of the rectangular frame of the object detected in the current frame image, and determine the tracking object in the current frame image according to a preset rule;

[0007] Control the gimbal camera to move the center of the image to the center of the rectangular frame of the tracked object;

[0008] Determining a position of a rectangular frame of an object to be identified detected in a tracking frame image, and determining a tracking object of the tracking frame image according to the position of the rectangular frame and a rectangular frame size restriction condition;

[0009] The gimbal camera is controlled according to the center position of the rectangular frame of the tracking object in the tracking frame image.

[0010] In a second aspect, an embodiment of the present application provides a target tracking device for a pan-tilt camera, the device comprising:

[0011] a first tracking object determination module, configured to determine a position of a rectangular frame of an object detected in a current frame image, and determine the tracking object in the current frame image according to a preset rule;

[0012] The center position determination module is used to control the PTZ camera to move the center position of the image to the center position of the rectangular frame of the tracked object;

[0013] A second tracking object determination module is used to determine the position of a rectangular frame of the object to be identified detected in the tracking frame image, and determine the tracking object of the tracking frame image according to the position of the rectangular frame and the rectangular frame size restriction condition;

[0014] The pan-tilt camera control module is used to control the pan-tilt camera according to the center position of the rectangular frame of the tracking object in the tracking frame image.

[0015] In a third aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the target tracking method for a pan-tilt camera as described in an embodiment of the present application.

[0016] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the target tracking method for a gimbal camera as described in the embodiment of the present application is implemented.

[0017] The technical solution provided by the embodiments of the present application determines the position of the rectangular frame of the object detected in the current frame image and determines the tracking object in the current frame image according to preset rules; controls the gimbal camera to move the center position of the image to the center position of the rectangular frame of the tracking object; determines the position of the rectangular frame of the object to be identified detected in the tracking frame image, and determines the tracking object in the tracking frame image based on the rectangular frame position and rectangular frame size constraints; and controls the gimbal camera based on the center position of the rectangular frame of the tracking object in the tracking frame image. The technical solution provided by the present application can complete target tracking in a multi-target situation without the aid of an algorithm, improving the tracking accuracy and effect at the lowest cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1A This is a flow chart of the target tracking method for a pan-tilt camera provided in Example 1 of the present application;

[0019] Figure 1B is a schematic diagram of an object in a current frame image provided by Example 1 of the present application;

[0020] Figure 1C is a schematic diagram of a tracking object in a current frame image provided by the first embodiment of the present application;

[0021] Figure 2 This is a flow chart of the target tracking method for a pan-tilt camera provided in Example 2 of the present application;

[0022] Figure 3A This is a flow chart of the target tracking method for a pan-tilt camera provided in Example 3 of the present application;

[0023] Figure 3B is a schematic diagram of an object to be identified in a tracking frame image provided in Example 3 of the present application;

[0024] Figure 4 This is a schematic diagram of the structure of the target tracking device for a pan-tilt camera provided in Example 4 of the present application;

[0025] Figure 5 This is a structural diagram of an electronic device provided in Example 5 of the present application. DETAILED DESCRIPTION

[0026] The present application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are intended only to illustrate the present application and are not intended to limit the present application. It should also be noted that, for ease of description, the accompanying drawings only illustrate portions of the present application, not all of the structures.

[0027] Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the steps as sequential processes, many of the steps can be implemented in parallel, concurrently, or simultaneously. In addition, the order of the steps can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0028] Example 1

[0029] Figure 1A This is a flowchart of the target tracking method of the pan-tilt camera provided in Example 1 of the present application. This embodiment is applicable to the situation of tracking multiple moving targets. The method can be executed by the target tracking device of the pan-tilt camera provided in the embodiment of the present application. The device can be implemented by software and / or hardware and can be integrated into an electronic device.

[0030] like Figure 1A As shown, the method may specifically include:

[0031] S110 : Determine the position of the rectangular frame of the object detected in the current frame image, and determine the tracking object in the current frame image according to a preset rule.

[0032] The current frame image is the processed frame image of a certain frame image in the video captured by the gimbal camera; the object can be a target pedestrian, target vehicle, etc. in the current frame image; and the rectangular frame position refers to the position of the object in the current frame image, including the coordinates of the upper left corner and lower right corner of the rectangular frame, or the coordinates of the center point position and the length and width of the rectangular frame. In this embodiment, image recognition technology can be used to identify an object that is different from the background based on physical characteristics such as color and shape, and the position of the object is calibrated as the rectangular frame position of the object detected in the current frame image.

[0033] The preset rule refers to a rule for determining the tracking object according to certain rules; the tracking object can be one or more, for example, the vehicle causing the accident or the suspect in the video.

[0034] In this embodiment, an object that frequently appears in an image in a video over a certain period of time can be used as a tracking object, and the rectangular frame position of the object can be detected in the video frame image. If the tracking object is detected in the current frame image, the tracking object is used as the tracking object in the current frame image.

[0035] In this embodiment, if at least two objects' rectangular frames are detected, the object whose center is closest to the center of the current frame is selected as the object to be tracked in the current frame. The method for determining the object to be tracked is not limited to the distance from the center of the current frame, such as the largest or smallest distance, but can also be based on the size of the rectangular frames themselves, such as the largest or smallest.

[0036] The center position of the current frame image is the center position of the image in the gimbal's current gimbal camera. Specifically, if the rectangular frame positions of at least two objects are detected, for each object, the Euclidean distance between the center position of the rectangular frame of the object and the center position of the current frame image is calculated; the distances between the center positions of the at least two object rectangular frames and the center position data of the current frame image are compared, and the object corresponding to the smallest distance is selected as the tracking object in the current frame image.

[0037] It should be noted that the coordinates of the center position of the object are obtained based on the coordinates of the upper left corner and the lower right corner of the rectangular frame of the object.

[0038] See also Figure 1B, it gives the rectangular box positions of the objects in the current frame image and the position of the pan-tilt camera. There are three target objects in the current frame image, namely Target 1, Target 2 and Target 3; the coordinates of the rectangular boxes corresponding to these three targets are (x111, y111), (x112, y112); (x121, y121), (x122, y122); (x131, y131), (x132, y132). The central position coordinates, that is, the position coordinates of the center point of the pan-tilt camera, are O(x, y). Further, the distances L11, L12, L13 from these three targets to the center point are respectively:

[0039] The distance from Target 1 to the center point

[0040] The distance from Target 2 to the center point

[0041] The distance from Target 3 to the center point

[0042] Assume L12 < L11 < L13, then Target 2 is taken as the tracking object in the current frame image.

[0043] S120, control the pan-tilt camera to move the center position of the screen to the center position of the rectangular box of the tracking object.

[0044] In this embodiment, control the pan-tilt camera to move the center position of the screen to the center position of the rectangular box of the tracking object, see Figure 1C , which shows a schematic diagram of the tracking object in the current frame image. p2(xp, yp) is the center point position coordinates of Target 2, that is, the center position coordinates of the rectangular box of the tracking object. It is calculated through the above S110 that Target 2 is the tracking target in the current frame image, then move the center position of the screen to the center position of the rectangular box of the tracking object, that is, the center point O(x, y) becomes p2(xp, yp).

[0045] S130, determine the rectangular box position of the to-be-recognized object detected in the tracking frame image, and determine the tracking object of the tracking frame image according to the rectangular box position and the rectangular box size limit condition.

[0046] Among them, the tracking frame image refers to the image frame after the current frame image in the video frame, for example, it can be the second frame image, the third frame image or the image frames with a set number of intervals, etc. The to-be-recognized object can be one or more, used to determine whether it is the tracking object in the current frame image.

[0047] In this embodiment, the position of the rectangular frame of the object to be identified detected in the tracking frame image is determined according to the method described in S110, and then the tracking object of the tracking frame image is determined based on the rectangular frame position and the rectangular frame size restriction. Alternatively, the size of the rectangular frame to be identified is determined for each object to be identified based on the rectangular frame position of the object to be identified, and the size of the rectangular frame to be identified is compared with the size of the rectangular frame of the tracking object in the current frame image. If the two sizes are equal, the object to be identified is determined to be the tracking object of the tracking frame image.

[0048] S140 , controlling the pan / tilt camera according to the center position of the rectangular frame of the tracking object in the tracking frame image.

[0049] In this embodiment, according to the center position of the rectangular frame of the tracking object in the tracking frame image, the pan / tilt camera is controlled to move the center position of the image to the center position of the rectangular frame of the tracking object according to the step described in S120, thereby achieving tracking of the tracking object.

[0050] The technical solution provided by the embodiments of the present application determines the position of the rectangular frame of the object detected in the current frame image and determines the tracking object in the current frame image according to preset rules; controls the gimbal camera to move the center position of the image to the center position of the rectangular frame of the tracking object; determines the position of the rectangular frame of the object to be identified detected in the tracking frame image, and determines the tracking object of the tracking frame image based on the position of the rectangular frame and the size restriction of the rectangular frame; and controls the gimbal camera based on the center position of the rectangular frame of the tracking object in the tracking frame image. The technical solution provided by the present application can complete target tracking in a multi-target situation without the aid of an algorithm, and improve the tracking accuracy and effect at the lowest cost.

[0051] Example 2

[0052] Figure 2 This is a flow chart of the target tracking method of the PTZ camera provided in the second embodiment of the present application; based on the above technical solutions, the method of "controlling the PTZ camera to move the center of the image to the center of the rectangular frame of the tracking object" is optimized. Figure 2 As shown, the method may specifically include:

[0053] S210 : Determine the position of the rectangular frame of the object detected in the current frame image, and determine the tracking object in the current frame image according to a preset rule.

[0054] S220 , calculating the horizontal coordinate difference between the horizontal coordinate of the center position of the rectangular frame of the tracking object and the horizontal coordinate of the center position of the picture.

[0055] In this embodiment, first, the horizontal coordinates of the center position of the rectangular frame of the tracked object are calculated based on the horizontal coordinates of the upper left corner and the horizontal coordinates of the lower right corner of the rectangular frame of the tracked object. For example, the horizontal coordinates of the upper left corner and the horizontal coordinates of the lower right corner can be added and averaged to obtain the horizontal coordinates of the center position of the rectangular frame of the tracked object. For another example, the horizontal coordinates of the center position of the rectangular frame of the tracked object can be obtained by adding half of the absolute value of the difference between the horizontal coordinates of the upper left corner and the horizontal coordinates of the lower right corner to the horizontal coordinates of the upper left corner. For another example, the horizontal coordinates of the center position of the rectangular frame of the tracked object can be obtained by subtracting half of the absolute value of the difference between the horizontal coordinates of the upper left corner and the horizontal coordinates of the lower right corner from the horizontal coordinates of the lower right corner to obtain the horizontal coordinates of the center position of the rectangular frame of the tracked object. Then, the horizontal coordinate difference between the horizontal coordinates of the center position of the rectangular frame of the tracked object and the horizontal coordinates of the center position of the picture can be calculated.

[0056] S230: Determine a horizontal adjustment angle according to the horizontal coordinate difference and the horizontal coefficient.

[0057] The horizontal coefficient can be estimated by a skilled artisan based on site survey requirements. Specifically, since the image captured by a gimbal camera is fan-shaped, assume that the two boundary points in the current gimbal camera image are B and C, and the midpoint O of line segment BC corresponds to the gimbal camera's center A. From boundary point B to C, the image is divided into 10,000, 6,000, or 8,000 parts, based on a ratio of 10,000. When an object in the center of the image spreads x parts from center O toward the edge, the angle changes by c degrees. If the angle continues to change by c degrees in the same direction after the change, the number of parts corresponding to line segment BC will be greater than x. This is because the further the gimbal camera spreads toward the edge, the greater the distance between the point on line segment BC corresponding to the gimbal camera's center and the point on line segment BC corresponding to the previous gimbal camera center increases with each rotation. This means that the number of parts corresponding to the gimbal camera increases. Therefore, for the same ratio of 10,000, the larger the angle required for the gimbal camera in the center of the image, the larger the horizontal coefficient should be.

[0058] In this embodiment, the product of the horizontal coordinate difference and the horizontal coefficient is used as the horizontal adjustment angle.

[0059] S240: Calculate the vertical coordinate difference between the vertical coordinate of the center position of the rectangular frame of the tracked object and the vertical coordinate of the center position of the picture.

[0060] In this embodiment, first, the vertical coordinates of the center position of the rectangular frame of the tracked object are calculated based on the vertical coordinates of the upper left corner and the vertical coordinates of the lower right corner of the rectangular frame of the tracked object. For example, the vertical coordinates of the upper left corner and the lower right corner can be added and averaged to obtain the vertical coordinates of the center position of the rectangular frame of the tracked object. For another example, the vertical coordinates of the center position of the rectangular frame of the tracked object can be obtained by adding half of the absolute value of the difference between the vertical coordinates of the upper left corner and the vertical coordinates of the lower right corner to the vertical coordinates of the upper left corner. For another example, the vertical coordinates of the center position of the rectangular frame of the tracked object can be obtained by subtracting half of the absolute value of the difference between the vertical coordinates of the upper left corner and the vertical coordinates of the lower right corner from the vertical coordinates of the lower right corner to obtain the vertical coordinates of the center position of the rectangular frame of the tracked object. Then, the vertical coordinate difference between the vertical coordinates of the center position of the rectangular frame of the tracked object and the vertical coordinates of the center position of the image is calculated.

[0061] S250: Determine a vertical adjustment angle according to the vertical coordinate difference and the vertical coefficient.

[0062] In this embodiment, the vertical coefficient may be determined according to the method described in S230 , and the product of the vertical coordinate difference and the vertical coefficient is used as the vertical adjustment angle.

[0063] It should be noted that there is no particular order between S220-S230 and S240-S250.

[0064] S260, adjust the angle of the gimbal camera according to the horizontal adjustment angle and vertical adjustment angle.

[0065] In this embodiment, the pan-tilt camera is controlled to perform corresponding horizontal and vertical angle adjustments according to the horizontal adjustment angle and the vertical adjustment angle, so that the center position of the pan-tilt camera corresponds to the center position of the tracked object.

[0066] Furthermore, to prevent frequent shaking of the gimbal camera, if the horizontal adjustment angle is less than a first threshold, the gimbal camera will not adjust the horizontal angle; if the vertical adjustment angle is less than a second threshold, the gimbal camera will not adjust the vertical angle. The first and second thresholds are set based on the experience of those skilled in the art. For example, the first threshold is set to 5 degrees, and the second threshold is set to 2.5 degrees.

[0067] S270 , determining a position of a rectangular frame of an object to be identified detected in the tracking frame image, and determining a tracking object of the tracking frame image according to the position of the rectangular frame and a restriction condition of the rectangular frame size.

[0068] S280 , controlling the pan / tilt camera according to the center position of the rectangular frame of the tracking object in the tracking frame image.

[0069] The technical solution provided in the embodiment of the present application introduces a horizontal coefficient and a vertical coefficient. Through the process of determining the specific horizontal adjustment angle and the vertical adjustment angle, the angle of the gimbal camera is adjusted, making the adjustment of the gimbal camera more accurate, so as to facilitate accurate tracking of the object.

[0070] Example 3

[0071] Figure 3A This is a flow chart of the target tracking method for a pan-tilt camera provided in the third embodiment of the present application; based on the above embodiment, further optimization is made to "determine the position of the rectangular frame of the object to be identified detected in the tracking frame image, and determine the tracking object of the tracking frame image according to the position of the rectangular frame and the rectangular frame size restriction conditions." Figure 3A As shown, the method may specifically include:

[0072] S310: Determine the position of the rectangular frame of the object detected in the current frame image, and determine the tracking object in the current frame image according to a preset rule.

[0073] S320: Control the pan / tilt camera to move the center of the image to the center of the rectangular frame of the tracking object.

[0074] S330. Determine the distance between the center position of the rectangular frame of the object to be identified and the center position of the rectangular frame of the tracking object in the current frame image, and in ascending order of the distances, use the rectangular frame size restriction condition as a verification condition, and determine the object to be identified whose rectangular frame size meets the verification condition as the tracking object in the tracking frame image.

[0075] Among them, the rectangular frame size restriction condition is a restriction condition with a maximum threshold value and a minimum threshold value as boundary values; among them, the maximum threshold value and the minimum threshold value are determined based on the rectangular frame size of the tracked object in the current frame image and the position change in the current frame image and the tracking frame image.

[0076] Optionally, the maximum threshold is determined using the following formula:

[0077] S2max=(|x121–x122|+|L2n–L12|)*(|y121–y122|+|L2n–L12|);

[0078] Wherein, S2max is the maximum threshold value, x121 is the horizontal coordinate of the upper left corner of the rectangular frame of the tracked object in the current frame image, x122 is the horizontal coordinate of the lower right corner of the rectangular frame of the tracked object in the current frame image, y121 is the vertical coordinate of the upper left corner of the rectangular frame of the tracked object in the current frame image, y122 is the vertical coordinate of the lower right corner of the rectangular frame of the tracked object in the current frame image, L12 is the center position of the current frame image and the center position of the rectangular frame of the tracked object, L2n is the center position of the tracking frame image and the center position of the rectangular frame of the nth object to be identified in the tracking frame image, and n is greater than or equal to 1;

[0079] Optionally, the minimum threshold is determined using the following formula:

[0080] S2min=(|x121–x122|-|L2n–L12|)*(|y121–y122|-|L2n–L12|);

[0081] Among them, S2min is the minimum threshold value, x121 is the horizontal coordinate of the upper left corner of the rectangular box of the tracked object in the current frame image, x122 is the horizontal coordinate of the lower right corner of the rectangular box of the tracked object in the current frame image, y121 is the vertical coordinate of the upper left corner of the rectangular box of the tracked object in the current frame image, y122 is the vertical coordinate of the lower right corner of the rectangular box of the tracked object in the current frame image, L12 is the center position of the current frame image and the center position of the rectangular box of the tracked object, L2n is the center position of the tracking frame image and the center position of the rectangular box of the nth object to be identified in the tracking frame image, and n is greater than or equal to 1.

[0082] Optionally, when the value of |x121–x122|-|L2n–L12| or |y121–y122|-|L2n–L12| is less than 0, the minimum threshold is determined to be 0.

[0083] In this embodiment, combined with Figure 1B , see Figure 3B , a schematic diagram of the target object in the current frame image and the target object in the tracking frame image when the tracking frame is the second frame image is given. The dotted rectangular boxes represent the target objects in the current frame image, which are respectively recorded as original target 1, original target 2, and original target 3; the realized rectangular boxes represent the objects to be identified in the tracking frame image, which are respectively recorded as target 1, target 2, and target 3; the center point O(x, y) is the center position of original target 2. First, the center position of the rectangular box of the object to be identified and the center position of the rectangular box of the tracking object in the current frame image can be determined according to the method described in S310, respectively:

[0084] The distance from target 1 to the last detected target

[0085] The distance from target 2 to the last detected target

[0086] The distance from target 3 to the last detected target

[0087] Then, the distance between the center position of the rectangular frame of the object to be identified and the center position of the rectangular frame of the tracking object in the current frame image is calculated in ascending order, using the rectangular frame size restriction as a verification condition, and the object to be identified whose rectangular frame size meets the verification condition is determined as the tracking object in the tracking frame image. Specifically, the size of the rectangular frame of each sorted object to be identified is calculated in ascending order based on the distance between the center position of the rectangular frame of the object to be identified and the center position of the rectangular frame of the tracking object in the current frame image, and it is determined whether the size of the rectangular frame of the object to be identified meets the rectangular frame size restriction. If so, the object to be identified is determined to be the tracking object in the tracking frame image.

[0088] Specifically, after arranging in order from small to large, the size of the rectangular frame of the object to be identified with the smallest distance can be verified first. If the verification is successful, it can be determined that the object to be identified is the object that is actually wanted to be tracked, that is, the tracking object in the current frame determined previously. If the verification fails, it is determined that the object to be identified is not the object that is actually wanted to be tracked, and it is necessary to verify the size of the rectangular frame of the object to be identified with the second smallest distance. This process is repeated until the verification is successful. The tracking object in the tracking frame image can be determined, and the rotation of the gimbal camera can be further controlled. This solution analyzes the size of the rectangular frame of each object in the tracking frame image in combination with the law of motion to obtain the tracking object in the tracking frame image. It can achieve automatic locking of the tracking target and complete the adaptive tracking control of the gimbal camera.

[0089] S340: Control the pan / tilt camera according to the center position of the rectangular frame of the tracking object in the tracking frame image.

[0090] The technical solution provided by the embodiment of the present application introduces a rectangular frame size restriction condition. By determining the rectangular frame position of the object detected in the current frame image and determining the tracking object in the current frame image according to a preset rule, the pan-tilt camera is controlled to move the center position of the image to the center position of the rectangular frame of the tracking object. Then, the distance between the center position of the rectangular frame of the object to be identified and the center position of the rectangular frame of the tracking object in the current frame image is determined. In ascending order of this distance, the rectangular frame size restriction condition is used as a verification condition. The object to be identified whose rectangular frame size meets the verification condition is determined as the tracking object in the tracking frame image. The pan-tilt camera is controlled according to the center position of the rectangular frame of the tracking object in the tracking frame image. Through the above technical solution, the target object can be tracked more accurately.

[0091] Example 4

[0092] Figure 4 This is a structural diagram of the target tracking device of the pan-tilt camera provided in an embodiment of the present application. This embodiment is applicable to the situation of tracking multiple moving targets. The device can be implemented by software and / or hardware and can be integrated into electronic equipment.

[0093] like Figure 4 As shown, the apparatus may include a first tracking object determination module 410, a center position determination module 420, a second tracking object determination module 430 and a pan / tilt camera control module 440, wherein:

[0094] A first tracking object determination module 410 is configured to determine a position of a rectangular frame of an object detected in a current frame image, and determine the tracking object in the current frame image according to a preset rule;

[0095] The center position determination module 420 is used to control the PTZ camera to move the center position of the image to the center position of the rectangular frame of the tracked object;

[0096] The second tracking object determination module 430 is used to determine the position of the rectangular frame of the object to be identified detected in the tracking frame image, and determine the tracking object of the tracking frame image according to the position of the rectangular frame and the rectangular frame size restriction condition;

[0097] The pan-tilt camera control module 440 is used to control the pan-tilt camera according to the center position of the rectangular frame of the tracking object in the tracking frame image.

[0098] The technical solution provided by the embodiments of the present application determines the position of the rectangular frame of the object detected in the current frame image and determines the tracking object in the current frame image according to preset rules; controls the gimbal camera to move the center position of the image to the center position of the rectangular frame of the tracking object; determines the position of the rectangular frame of the object to be identified detected in the tracking frame image, and determines the tracking object of the tracking frame image based on the position of the rectangular frame and the size restriction of the rectangular frame; and controls the gimbal camera based on the center position of the rectangular frame of the tracking object in the tracking frame image. The technical solution provided by the present application can complete target tracking in a multi-target situation without the aid of an algorithm, and improve the tracking accuracy and effect at the lowest cost.

[0099] Furthermore, the first tracking object determination module 410 is specifically configured to, if at least two objects' rectangular frame positions are detected, use the rectangular frame center position of the at least two objects closest to the center position of the current frame image as the tracking object in the current frame image.

[0100] Furthermore, the center position determination module 420 includes, among others, a first difference determination unit, a first adjustment angle determination unit, a second difference determination unit, a second adjustment angle determination unit, and an angle adjustment unit, wherein,

[0101] a first difference determination unit, configured to calculate a horizontal coordinate difference between a horizontal coordinate of a center position of a rectangular frame of a tracked object and a horizontal coordinate of a center position of a picture;

[0102] A first adjustment angle determining unit, configured to determine a horizontal adjustment angle according to a horizontal coordinate difference and a horizontal coefficient;

[0103] The second difference determination unit is further used to calculate the vertical coordinate difference between the vertical coordinate of the center position of the rectangular frame of the tracked object and the vertical coordinate of the center position of the picture;

[0104] The second adjustment angle determination unit is further configured to determine the vertical adjustment angle according to the vertical coordinate difference and the vertical coefficient;

[0105] The angle adjustment unit is used to adjust the angle of the gimbal camera according to the horizontal adjustment angle and the vertical adjustment angle.

[0106] Furthermore, if the horizontal adjustment angle is less than the first threshold, the gimbal camera does not perform horizontal angle adjustment;

[0107] If the vertical adjustment angle is less than the second threshold, the gimbal camera does not perform vertical angle adjustment.

[0108] Furthermore, the second tracking object determination module 430 is specifically used to determine the distance between the center position of the rectangular frame of the object to be identified and the center position of the rectangular frame of the tracking object in the current frame image, and in order of the distance from small to large, using the rectangular frame size restriction condition as the verification condition, the object to be identified whose rectangular frame size meets the verification condition is determined as the tracking object in the tracking frame image.

[0109] Furthermore, the rectangular frame size restriction condition is a restriction condition with a maximum threshold value and a minimum threshold value as boundary values; wherein the maximum threshold value and the minimum threshold value are determined based on the rectangular frame size of the tracked object in the current frame image and the position change in the current frame image and the tracking frame image.

[0110] Furthermore, the maximum threshold is determined using the following formula:

[0111] S2max=(|x121–x122|+|L2n–L12|)*(|y121–y122|+|L2n–L12|);

[0112] Wherein, S2max is the maximum threshold value, x121 is the horizontal coordinate of the upper left corner of the rectangular frame of the tracked object in the current frame image, x122 is the horizontal coordinate of the lower right corner of the rectangular frame of the tracked object in the current frame image, y121 is the vertical coordinate of the upper left corner of the rectangular frame of the tracked object in the current frame image, y122 is the vertical coordinate of the lower right corner of the rectangular frame of the tracked object in the current frame image, L12 is the center position of the current frame image and the center position of the rectangular frame of the tracked object, L2n is the center position of the tracking frame image and the center position of the rectangular frame of the nth object to be identified in the tracking frame image, and n is greater than or equal to 1;

[0113] The minimum threshold is determined using the following formula:

[0114] S2min=(|x121–x122|-|L2n–L12|)*(|y121–y122|-|L2n–L12|);

[0115] Among them, S2min is the minimum threshold value, x121 is the horizontal coordinate of the upper left corner of the rectangular box of the tracked object in the current frame image, x122 is the horizontal coordinate of the lower right corner of the rectangular box of the tracked object in the current frame image, y121 is the vertical coordinate of the upper left corner of the rectangular box of the tracked object in the current frame image, y122 is the vertical coordinate of the lower right corner of the rectangular box of the tracked object in the current frame image, L12 is the center position of the current frame image and the center position of the rectangular box of the tracked object, L2n is the center position of the tracking frame image and the center position of the rectangular box of the nth object to be identified in the tracking frame image, and n is greater than or equal to 1.

[0116] The target tracking device for a pan-tilt camera provided in an embodiment of the present application can execute the target tracking method for a pan-tilt camera provided in any embodiment of the present application, and has the corresponding functional modules and beneficial effects for executing the method.

[0117] Example 5

[0118] Embodiment 5 of the present application also provides an electronic device, in which the target tracking device of the pan-tilt camera provided in the embodiment of the present application can be integrated. The electronic device can be configured within the system, or it can be a device that performs some or all of the functions within the system. Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5 As shown, this embodiment provides an electronic device 500, which includes: one or more processors 520; a storage device 510 for storing one or more programs. When the one or more programs are executed by the one or more processors 520, the one or more processors 520 implement the target tracking method for a pan-tilt camera provided in an embodiment of the present application. The method includes:

[0119] Determine the position of the rectangular frame of the object detected in the current frame image, and determine the tracking object in the current frame image according to a preset rule;

[0120] Control the gimbal camera to move the center of the image to the center of the rectangular frame of the tracked object;

[0121] Determining a position of a rectangular frame of an object to be identified detected in a tracking frame image, and determining a tracking object of the tracking frame image according to the position of the rectangular frame and a rectangular frame size restriction condition;

[0122] The gimbal camera is controlled according to the center position of the rectangular frame of the tracking object in the tracking frame image.

[0123] Of course, those skilled in the art will appreciate that the processor 520 also implements the technical solution of the target tracking method for the pan-tilt camera provided in any embodiment of the present application.

[0124] Figure 5 The electronic device 500 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.

[0125] like Figure 5 As shown, the electronic device 500 includes a processor 520, a storage device 510, an input device 530, and an output device 540; the number of processors 520 in the electronic device can be one or more. Figure 5 In the figure, a processor 520 is used as an example; the processor 520, the storage device 510, the input device 530 and the output device 540 in the electronic device can be connected via a bus or other means. Figure 5 The connection via bus 550 is taken as an example.

[0126] The storage device 510 is a computer-readable storage medium that can be used to store software programs, computer executable programs, and module units, such as program instructions corresponding to the target tracking method of the pan-tilt camera in the embodiment of the present application.

[0127] The storage device 510 may primarily include a program storage area and a data storage area. The program storage area may store an operating system and at least one application required for a function; the data storage area may store data created based on the use of the terminal, etc. Furthermore, the storage device 510 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state memory device. In some instances, the storage device 510 may further include a memory remotely located relative to the processor 520, and these remote memories may be connected via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0128] The input device 530 may be used to receive input numbers, character information or voice information, and generate key signal input related to user settings and function control of the electronic device. The output device 540 may include electronic devices such as a display screen and a speaker.

[0129] Example 6

[0130] Embodiment 6 of the present application further provides a storage medium containing computer-executable instructions. When the computer-executable instructions are executed by a computer processor, the computer-executable instructions are used to perform a target tracking method for a pan-tilt camera. The method includes:

[0131] Determine the position of the rectangular frame of the object detected in the current frame image, and determine the tracking object in the current frame image according to a preset rule;

[0132] Control the gimbal camera to move the center of the image to the center of the rectangular frame of the tracked object;

[0133] Determining a position of a rectangular frame of an object to be identified detected in a tracking frame image, and determining a tracking object of the tracking frame image according to the position of the rectangular frame and a rectangular frame size restriction condition;

[0134] The gimbal camera is controlled according to the center position of the rectangular frame of the tracking object in the tracking frame image.

[0135] Storage media refers to any of various types of memory electronic devices or storage electronic devices. The term "storage medium" is intended to include: installation media, such as CD-ROMs, floppy disks, or tape devices; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (such as hard disks or optical storage); registers or other similar types of memory elements, etc. Storage media may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the computer system in which the program is executed, or it may be located in a different second computer system that is connected to the computer system via a network (such as the Internet). The second computer system may provide program instructions to the computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations (e.g., in different computer systems connected via a network). The storage medium may store program instructions (e.g., embodied as a computer program) that can be executed by one or more processors.

[0136] Of course, the storage medium containing computer-executable instructions provided in an embodiment of the present application, whose computer-executable instructions are not limited to the operations of the target tracking method of the gimbal camera described above, can also execute related operations in the target tracking method of the gimbal camera provided in any embodiment of the present application.

[0137] The target tracking device, medium, and electronic device for a pan-tilt camera provided in the above embodiments can execute the target tracking method for a pan-tilt camera provided in any embodiment of the present application, and have the corresponding functional modules and beneficial effects of executing the method. For technical details not fully described in the above embodiments, please refer to the target tracking method for a pan-tilt camera provided in any embodiment of the present application.

[0138] Note that the above are only preferred embodiments of the present application and the technical principles employed. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application has been described in more detail through the above embodiments, the present application is not limited to the above embodiments and may include many other equivalent embodiments without departing from the scope of the present application. The scope of the present application is determined by the scope of the appended claims.

Claims

1. A target tracking method for a pan-tilt camera, characterized in that: The method comprises: Determine the position of the rectangular frame of the object detected in the current frame image, and determine the tracking object in the current frame image according to a preset rule; Control the gimbal camera to move the center of the image to the center of the rectangular frame of the tracked object; Determining a position of a rectangular frame of an object to be identified detected in a tracking frame image, and determining a tracking object of the tracking frame image according to the position of the rectangular frame and a rectangular frame size restriction condition; Control the PTZ camera according to the center position of the rectangular frame of the tracking object in the tracking frame image; The step of determining the position of a rectangular frame of the object to be identified detected in the tracking frame image and determining the tracking object of the tracking frame image according to the position of the rectangular frame and the rectangular frame size restriction condition includes: Determine the distance between the center position of the rectangular frame of the object to be identified and the center position of the rectangular frame of the tracking object in the current frame image, use the rectangular frame size restriction condition as a verification condition, and determine the object to be identified whose rectangular frame size meets the verification condition as the tracking object in the tracking frame image; the rectangular frame size restriction condition is a restriction condition using a maximum threshold value and a minimum threshold value as boundary values; the maximum threshold value and the minimum threshold value are determined based on the rectangular frame size of the tracking object in the current frame image and the position change in the current frame image and the tracking frame image.

2. The method according to claim 1, characterized in that Determining the position of the rectangular frame of the object detected in the current frame image, and determining the tracking object in the current frame image according to a preset rule, including: If the rectangular frame positions of at least two objects are detected, the object whose rectangular frame center positions of the at least two objects are closest to the center position of the current frame image is used as the tracking object in the current frame image.

3. The method according to claim 1, characterized in that Control the gimbal camera to move the center of the image to the center of the rectangular frame of the tracked object, including: Calculate the horizontal coordinate difference between the horizontal coordinate of the center position of the rectangular frame of the tracked object and the horizontal coordinate of the center position of the picture; determining a horizontal adjustment angle according to the horizontal coordinate difference and the horizontal coefficient; as well as, Calculate the vertical coordinate difference between the vertical coordinate of the center position of the rectangular frame of the tracked object and the vertical coordinate of the center position of the picture; Determining a vertical adjustment angle according to the vertical coordinate difference and the vertical coefficient; The angle of the pan-tilt camera is adjusted according to the horizontal adjustment angle and the vertical adjustment angle.

4. The method according to claim 1, wherein Determining the position of a rectangular frame of the object to be identified detected in the tracking frame image, and determining the tracking object of the tracking frame image according to the position of the rectangular frame and the rectangular frame size restriction condition, further comprising: The size of the rectangular frame of the object to be identified is verified in ascending order of the distance between the center position of the rectangular frame of the object to be identified and the center position of the rectangular frame of the tracking object in the current frame image.

5. The method according to claim 1, characterized in that The maximum threshold is determined using the following formula: S2max=(|x121–x122|+|L2n–L12|)*(|y121–y122|+|L2n–L12|); Among them, S2max is the maximum threshold value, x121 is the horizontal coordinate of the upper left corner of the rectangular box of the tracked object in the current frame image, x122 is the horizontal coordinate of the lower right corner of the rectangular box of the tracked object in the current frame image, y121 is the vertical coordinate of the upper left corner of the rectangular box of the tracked object in the current frame image, y122 is the vertical coordinate of the lower right corner of the rectangular box of the tracked object in the current frame image, L12 is the center position of the current frame image and the center position of the rectangular box of the tracked object, L2n is the center position of the tracking frame image and the center position of the rectangular box of the nth object to be identified in the tracking frame image, and n is greater than or equal to 1.

6. The method according to claim 1, characterized in that The minimum threshold is determined using the following formula: S2min=(|x121–x122|-|L2n–L12|)*(|y121–y122|-|L2n–L12|); Among them, S2min is the minimum threshold value, x121 is the horizontal coordinate of the upper left corner of the rectangular box of the tracked object in the current frame image, x122 is the horizontal coordinate of the lower right corner of the rectangular box of the tracked object in the current frame image, y121 is the vertical coordinate of the upper left corner of the rectangular box of the tracked object in the current frame image, y122 is the vertical coordinate of the lower right corner of the rectangular box of the tracked object in the current frame image, L12 is the center position of the current frame image and the center position of the rectangular box of the tracked object, L2n is the center position of the tracking frame image and the center position of the rectangular box of the nth object to be identified in the tracking frame image, and n is greater than or equal to 1.

7. A target tracking device for a pan-tilt camera, characterized in that: The device comprises: a first tracking object determination module, configured to determine a position of a rectangular frame of an object detected in a current frame image, and determine the tracking object in the current frame image according to a preset rule; The center position determination module is used to control the PTZ camera to move the center position of the image to the center position of the rectangular frame of the tracked object; A second tracking object determination module is used to determine the position of a rectangular frame of the object to be identified detected in the tracking frame image, and determine the tracking object of the tracking frame image according to the position of the rectangular frame and the rectangular frame size restriction condition; The PTZ camera control module is used to control the PTZ camera according to the center position of the rectangular frame of the tracking object in the tracking frame image; The second tracking object determination module is specifically used to determine the distance between the center position of the rectangular frame of the object to be identified and the center position of the rectangular frame of the tracking object in the current frame image, using the rectangular frame size restriction condition as a verification condition, and determining the object to be identified whose rectangular frame size meets the verification condition as the tracking object in the tracking frame image; the rectangular frame size restriction condition is a restriction condition using a maximum threshold value and a minimum threshold value as boundary values; the maximum threshold value and the minimum threshold value are determined based on the rectangular frame size of the tracking object in the current frame image and the position change in the current frame image and the tracking frame image.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the target tracking method for a pan-tilt camera according to any one of claims 1 to 6 is implemented.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein: When the processor executes the computer program, the target tracking method for a pan-tilt camera according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Target monitoring method and device

    CN111093050A

  • Target tracking method and device, electronic equipment and computer readable storage medium

    CN111640140A