Video monitoring target tracking method and device, computer equipment and storage medium

By acquiring video frame images, extracting image coordinate points and using feature tracking algorithms to calculate the direction of movement and dynamically adjusting the camera angle, the problem of tracking moving targets in the video surveillance system is solved and high-precision and real-time monitoring effects are achieved.

CN118784984APending Publication Date: 2024-10-15SHENZHEN JULONG CHUANGSHI TECH CO LTD
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202411079545.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-07
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

Existing video surveillance systems are difficult to effectively track moving targets, resulting in surveillance failure.

Method used

By acquiring video frame images, extract image coordinate points, use feature tracking algorithms for matching, calculate the moving direction of the target object, and dynamically adjust the camera angle to keep the target within the monitoring field of view.

Benefits of technology

It achieves accurate tracking of moving targets, improves the intelligence level and reliability of the monitoring system, reduces false alarms and false negatives, ensures that the target is always within the monitoring range, and adapts to complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118784984A_ABST
    Figure CN118784984A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of video monitoring. The invention relates to a video monitoring target tracking method and device, computer equipment and a storage medium, and the method comprises the steps: obtaining a video frame image, extracting image coordinate points in the video frame image according to a tracking target set by a user, and carrying out the feature matching of the image coordinate points through a feature tracking algorithm, and obtaining a first to-be-tracked target image coordinate point and a second to-be-tracked target image coordinate point, comparing the first to-be-tracked target image coordinate point with the second to-be-tracked target image coordinate point to obtain the moving direction of the target object, and adjusting the moving angle of the camera according to the moving direction of the target object. The application has the effects of tracking the monitoring target and improving the intelligent level of the monitoring system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of video surveillance, and in particular to a video surveillance target tracking method, device, computer equipment and storage medium. Background Art

[0002] With the continuous development of security technology, video surveillance has been widely used in various fields. In the existing technology, the monitoring system usually uses a fixed-angle camera to shoot. When the target moves, it may move out of the camera's shooting range, resulting in monitoring failure. Therefore, how to track moving targets has become an urgent problem to be solved. Summary of the invention

[0003] In order to achieve the tracking of monitoring targets and improve the intelligence level of the monitoring system, the present application provides a video monitoring target tracking method, device, computer equipment and storage medium.

[0004] The above-mentioned invention objective of the present application is achieved through the following technical solutions: A video surveillance target tracking method, the video surveillance target tracking method comprising: Get video frame image; Extracting image coordinate points in the video frame image according to the tracking target set by the user; Performing feature matching on the image coordinate points through a feature tracking algorithm to obtain a first target image coordinate point to be tracked and a second target image coordinate point to be tracked, and comparing the first target image coordinate point to be tracked with the second target image coordinate point to be tracked to obtain a moving direction of the target object; The moving angle of the camera is adjusted according to the moving direction of the target object.

[0005] By adopting the above technical solution, the system can accurately identify and locate the position of the target object by acquiring the video frame image and extracting the image coordinate points. The feature tracking algorithm can effectively match and compare the image coordinate points to ensure that the position change of the target object in the image is accurately captured and analyzed. The system can analyze the video frame in real time and respond quickly to the movement of the target object. By calculating the moving direction of the target object, the camera can adjust the angle instantly to ensure that the target object is always within the monitoring field of view.

[0006] In a preferred example, the present application may be further configured as follows: extracting the image coordinate points in the video frame image according to the tracking target set by the user specifically includes: According to the tracking target set by the user, setting the target detection model parameters; The video frame image is input into the target detection model to obtain a target image region, and the image coordinate points are extracted from the target image region.

[0007] By adopting the above technical solution, according to the tracking target set by the user, the system can adaptively adjust the parameters of the target detection model and accurately extract the image coordinate points of the target object. The system improves the recognition accuracy and efficiency of different types of targets. By inputting the video frame image into the target detection model, the system can accurately locate the target image area and extract accurate image coordinate points from it. The system can process the video frame image in real time and extract the coordinate points of the target object, ensuring timely response and adjustment when the target object moves.

[0008] In a preferred example, the present application may be further configured as follows: performing feature matching on the image coordinate points by a feature tracking algorithm to obtain a first target image coordinate point to be tracked and a second target image coordinate point to be tracked, and comparing the first target image coordinate point to be tracked with the second target image coordinate point to be tracked to obtain a moving direction of the target object, specifically including: Matching the feature points of the current frame with the feature points of the previous frame according to the feature tracking algorithm to obtain a feature point pair, and obtaining the first to-be-tracked target image coordinate point and the second to-be-tracked target image coordinate point from the feature point pair; The first to-be-tracked target image coordinate point is compared with the second to-be-tracked target image coordinate point to obtain the moving direction of the target object.

[0009] By adopting the above technical solutions, the feature point matching algorithm can accurately determine the position change of the target object in consecutive frames, thereby achieving high-precision target tracking. High-precision tracking can significantly reduce false positives and false negatives, and improve the reliability and accuracy of the monitoring system. The feature point matching algorithm can quickly process video frames and achieve real-time tracking. The real-time response capability enables the system to quickly detect and track moving targets and respond to emergencies in a timely manner. The system can dynamically adjust the camera's moving angle according to the moving direction of the target object to ensure that the target is always within the monitoring range.

[0010] In a preferred example, the present application may be further configured as follows: comparing the first to-be-tracked target image coordinate point with the second to-be-tracked target image coordinate point to obtain the moving direction of the target object specifically includes: If the first target image coordinate point to be tracked is the same as the second target image coordinate point to be tracked, the target is determined to be stationary; if the first target image coordinate point to be tracked is different from the second target image coordinate point to be tracked, the target is determined to be moving, and the horizontal distance and vertical distance between the coordinate points before and after the target movement are calculated, and the angle is calculated using the inverse tangent function to determine the moving direction of the target object.

[0011] By adopting the above technical solution, through accurate coordinate point comparison, it is possible to reliably determine whether the target is stationary or moving, thereby enhancing the accuracy of the monitoring system. The comparison and calculation of coordinate points can be completed quickly, realizing real-time monitoring and real-time response. The movement of the target object can be tracked in time and responded quickly. By calculating the horizontal and vertical distances, the system can accurately determine the movement trajectory of the target object. Based on the real-time information of the target's moving direction, the system can dynamically adjust the angle of the camera to ensure that the target is always within the monitoring range, thereby improving the coverage and flexibility of the monitoring system and adapting to a variety of complex environments.

[0012] In a preferred example, the present application may be further configured as follows: if the first target image coordinate point to be tracked is different from the second target image coordinate point to be tracked, the target movement is determined, and the horizontal distance and vertical distance between the coordinate points before and after the target movement are calculated, and the angle is calculated using the inverse tangent function to determine the moving direction of the target object, specifically including: calculating the horizontal distance ΔX=X2-X1 and the vertical distance ΔY=Y2-Y1 between the first target image coordinate point to be tracked (x1, y1) and the second target image coordinate point to be tracked (x2, y2); By the inverse tangent function Wherein θ refers to the moving direction angle of the target object. According to the signs of Δx and Δy, the moving direction angle θ of the target object is adjusted. If Δx>0 and Δy>0, θ is in the first quadrant. If Δx<0 and Δy>0, θ is in the second quadrant and π needs to be added to θ. If Δx<0 and Δy<0, θ is in the third quadrant and π needs to be added to θ. If Δx>0 and Δy<0, θ is in the fourth quadrant and 2π needs to be added to θ. If Δx≠0 or Δy≠0, it is determined that the target moves.

[0013] By adopting the above technical solution, the specific direction and position of the target movement can be accurately obtained by calculating the horizontal and vertical distances, providing high-precision monitoring data. It reduces misjudgments and missed judgments, ensuring the reliability and accuracy of the monitoring results. The real-time calculation of the target movement direction angle enables the system to quickly respond to the target movement and adjust the camera position in time to ensure that the target is always within the monitoring range. The system's response speed is improved and it can quickly adapt to environmental changes.

[0014] In a preferred example, the present application can be further configured as follows: the video surveillance target tracking method further includes: For tracking of multiple target points, multiple targets are converted into multiple coordinate points, scattered coordinate points and coordinate points at the edge of the camera's view are removed, and the coordinate points are calculated using the formula. Where i is the i-th point, n is the total number of valid points, and the processed center point coordinates (x, y) are obtained.

[0015] By adopting the above technical solution, the movement of multiple targets can be processed simultaneously, and the accurate tracking of multiple targets can be achieved by independently calculating the movement direction and position of each target, thereby improving the processing capacity of the system and enhancing its adaptability in complex environments.

[0016] In a preferred example, the present application may be further configured as follows: adjusting the moving angle of the camera according to the moving direction of the target object specifically includes: By adjusting the horizontal angle formula, Where X is the horizontal coordinate of the moving direction of the target object, W is the width of the video frame image, FOV h is the horizontal field of view of the camera, tan(FOV h / 2) represents the half field of view angle of the camera in the horizontal direction; By adjusting the vertical angle formula, Where Y is the vertical coordinate of the moving direction of the target object, H is the height of the video frame image, FOV v is the vertical field of view of the camera, tan(FOV v / 2) represents the half field of view angle of the camera in the vertical direction.

[0017] By adopting the above technical solution, the target object's horizontal and vertical coordinates in the video frame image are calculated, and the angle is adjusted by using the camera's field of view. The target tracking accuracy is improved to ensure that the target object is always within the monitoring range. The coordinates of the target object are calculated in real time and the camera angle is adjusted dynamically, so that the system can respond quickly to the target's movement changes and provide continuous and uninterrupted monitoring. The response speed and real-time performance of the system are improved, and the ability to respond to emergencies is enhanced. Through the horizontal and vertical angle adjustment formulas, all-round coverage of the target object is achieved, and the system can accurately track the target in any direction. The monitoring coverage is expanded, the monitoring blind spots are reduced, and the comprehensiveness of the monitoring is improved.

[0018] The second object of the invention is achieved by the following technical solutions: A video surveillance target tracking device, the video surveillance target tracking device comprising: An image acquisition module, used for acquiring video frame images; A coordinate point extraction module is used to extract image coordinate points in the video frame image according to the tracking target set by the user; a target object movement module is used to perform feature matching on the image coordinate points through a feature tracking algorithm to obtain a first target image coordinate point to be tracked and a second target image coordinate point to be tracked, and compare the first target image coordinate point to be tracked with the second target image coordinate point to be tracked to obtain a moving direction of the target object; The angle adjustment module is used to adjust the moving angle of the camera according to the moving direction of the target object.

[0019] By adopting the above technical solution, the system can accurately identify and locate the position of the target object by acquiring the video frame image and extracting the image coordinate points. The feature tracking algorithm can effectively match and compare the image coordinate points to ensure that the position change of the target object in the image is accurately captured and analyzed. The system can analyze the video frame in real time and respond quickly to the movement of the target object. By calculating the moving direction of the target object, the camera can adjust the angle instantly to ensure that the target object is always within the monitoring field of view.

[0020] The third objective of the present application is achieved through the following technical solutions: A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above-mentioned video surveillance target tracking method are implemented.

[0021] The fourth objective of the present application is achieved through the following technical solutions: A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the above-mentioned video surveillance target tracking method.

[0022] In summary, the present application includes at least one of the following beneficial technical effects: 1. By acquiring video frame images and extracting image coordinate points, the system can accurately identify and locate the position of the target object. The feature tracking algorithm can effectively match and compare image coordinate points to ensure that the position changes of the target object in the image are accurately captured and analyzed. The system can analyze video frames in real time and quickly respond to the movement of the target object. By calculating the moving direction of the target object, the camera can adjust the angle instantly to ensure that the target object is always within the monitoring field of view; 2. It can process the movement of multiple targets at the same time, and realize accurate tracking of multiple targets by independently calculating the movement direction and position of each target. It improves the processing capacity of the system and enhances its adaptability in complex environments; 3. By calculating the horizontal and vertical coordinates of the target object in the video frame image and adjusting the angle using the camera's field of view, the target object's moving trajectory can be accurately tracked. The accuracy of target tracking is improved to ensure that the target object is always within the monitoring range. The coordinates of the target object are calculated in real time and the camera angle is adjusted dynamically, so that the system can quickly respond to the target's movement changes and provide continuous and uninterrupted monitoring. The system's response speed and real-time performance are improved, and the ability to respond to emergencies is enhanced. Through the horizontal and vertical angle adjustment formulas, all-round coverage of the target object is achieved, and the system can accurately track the target in any direction. The monitoring coverage is expanded, the monitoring blind spots are reduced, and the comprehensiveness of monitoring is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 is a flow chart of a video surveillance target tracking method in one embodiment of the present application; Figure 2 This is a flowchart of the implementation of step S20 of the video surveillance target tracking method in one embodiment of the present application; Figure 3 This is a flowchart of the implementation of step S30 of the video surveillance target tracking method in one embodiment of the present application; Figure 4 This is a flowchart of the implementation of step S32 of the video surveillance target tracking method in one embodiment of the present application; Figure 5 This is a flowchart of the implementation of step S322 of the video surveillance target tracking method in one embodiment of the present application; Figure 6 This is a flowchart of the implementation of the video surveillance target tracking method after step S32 in one embodiment of the present application; Figure 7 This is a flowchart of the implementation of step S40 of the video surveillance target tracking method in one embodiment of the present application; Figure 8 This is a principle block diagram of a video surveillance target tracking method in one embodiment of the present application; Fig. 9 It is a schematic diagram of a device in an embodiment of the present application. DETAILED DESCRIPTION

[0024] The present application is further described in detail below in conjunction with the accompanying drawings.

[0025] In one embodiment, if Figure 1 As shown, the present application discloses a video surveillance target tracking method, which specifically includes the following steps: S10: Acquire a video frame image.

[0026] In this embodiment, the video frame image refers to a single image frame extracted from a video stream.

[0027] Specifically, the OpenCV library is used to initialize the video source, and image frames are read from the video stream frame by frame by opening the surveillance camera or loading the video file as the input source. Each time, the image frame read is the image frame of the current time point. The read image frames are preprocessed, such as adjusting the image size and converting the color space, for subsequent image processing and analysis, and each frame of the video stream is captured and processed in real time.

[0028] S20: extracting image coordinate points in the video frame image according to the tracking target set by the user.

[0029] In this embodiment, the tracking target set by the user refers to a specific object or subject specified by the user through the system interface or configuration file, such as a human body, a vehicle, a flame, etc. The image coordinate point refers to a point in the video frame image that represents the position of the target object, which is expressed in the form of two-dimensional coordinates, corresponding to the horizontal position (x coordinate) and the vertical position (y coordinate) of the image.

[0030] Specifically, according to the tracking target set by the user, the target detection model is loaded, the image frames are read frame by frame from the video stream, and each frame of the image read is input into the target detection model to detect the target object in the image. The target detection model outputs the bounding box of each detected target object, which contains the position and size information of the target object in the image. The image coordinate point is extracted from the bounding box of the detected target object. The format of the image coordinate point is (x, y), where x is the horizontal position of the target object in the image and y is the vertical position.

[0031] S30: Perform feature matching on the image coordinate points through a feature tracking algorithm to obtain a first target image coordinate point to be tracked and a second target image coordinate point to be tracked, and compare the first target image coordinate point to be tracked and the second target image coordinate point to be tracked to obtain a moving direction of the target object.

[0032] In this embodiment, the feature tracking algorithm refers to an algorithm for matching and tracking the target object between video frames. The first target image coordinate point to be tracked refers to the image coordinate point of the target object detected in the current frame. The second target image coordinate point to be tracked refers to the image coordinate point of the target object detected in the previous frame. The moving direction of the target object refers to the moving direction of the target object in the image calculated by comparing the image coordinate points of the target object in two consecutive frames (the current frame and the previous frame).

[0033] Specifically, the feature tracking algorithm is used to match the feature points of the current frame with those of the previous frame to obtain a pair of successfully matched feature points. Among these feature point pairs, the feature point of the current frame is the first target image coordinate point to be tracked (x1, y1), and the feature point of the previous frame is the second target image coordinate point to be tracked (x2, y2). By calculating the horizontal distance Δx and the vertical distance Δy between these two coordinate points, and using the inverse tangent function to calculate the moving angle θ of the target object, θ is adjusted according to the signs of Δx and Δy to determine the moving direction of the target object, and finally it is determined whether the target object moves, and its moving direction information is obtained.

[0034] S40: adjusting the moving angle of the camera according to the moving direction of the target object.

[0035] Specifically, according to the coordinate points of the first target image to be tracked and the coordinate points of the second target image to be tracked, the horizontal offset and vertical offset of the target object relative to the center of the image are calculated, the offset angle is calculated using the inverse tangent function, and the actual moving direction of the target object is determined according to the offset angle. Finally, the horizontal and vertical offset angles of the target object in the camera's field of view are calculated, and the horizontal and vertical rotation angles of the camera are adjusted.

[0036] In one embodiment, if Figure 2 As shown, in step S20, the image coordinate points in the video frame image are extracted according to the tracking target set by the user, which specifically includes: S21: Setting target detection model parameters according to the tracking target set by the user.

[0037] Specifically, select a model based on the target category set by the user, such as human, vehicle, flame, etc. Use the YOLO model to detect human and vehicle. Use the Inception model to detect flame. Adjust the input size of the model according to the application scenario. Set the detection threshold to control the confidence threshold of the model output. Set the NMS threshold to control the box suppression threshold during multi-target detection. Load the pre-trained YOLO model and Inception model through the deep learning framework to obtain the target detection model.

[0038] S22: Input the video frame image into the target detection model to obtain the target image area, and extract the image coordinate points from the target image area.

[0039] Specifically, the video frame image is read and resized to match the input size of the target detection model. The image is normalized and the pixel values ​​are scaled to the range [0,1]. Then, the preprocessed image is input into the target detection model for forward propagation to obtain the detection results, including bounding box coordinates, confidence scores, and category labels. Low-confidence detection results are filtered out according to the set confidence threshold, and the non-maximum suppression (NMS) algorithm is used to remove overlapping bounding boxes, retaining the detection results with the highest confidence. The center point coordinates of the bounding box are extracted from the processed detection results as image coordinate points for subsequent feature tracking and target tracking.

[0040] In one embodiment, if Figure 3 As shown, in step S30, feature matching is performed on the image coordinate points through a feature tracking algorithm to obtain a first target image coordinate point to be tracked and a second target image coordinate point to be tracked, and the first target image coordinate point to be tracked and the second target image coordinate point to be tracked are compared to obtain the moving direction of the target object, specifically including: S31: matching the feature points of the current frame with the feature points of the previous frame according to the feature tracking algorithm to obtain a feature point pair, and obtaining the first target image coordinate point to be tracked and the second target image coordinate point to be tracked from the feature point pair.

[0041] Specifically, feature point detection is performed on the images of the current frame and the previous frame. The SIFT algorithm can be used to extract feature points and descriptors in the image. The descriptor of each feature point is calculated. The descriptor is a vector used to describe the local area of ​​the feature point to facilitate the matching of the feature points. The feature point matching algorithm FLANN is used to match the feature point descriptor of the current frame with the feature point descriptor of the previous frame. By calculating the distance between the descriptors, the optimal matching point of each feature point is found to obtain the matched feature point pair. The wrong matching points are filtered out by applying the RANSAC algorithm. RANSAC removes abnormal matches by iteratively selecting matching point pairs and calculating the transformation matrix between them to find the transformation matrix with the most internal points. From the matching point pairs filtered by RANSAC, the corresponding feature point coordinates in the current frame and the previous frame are extracted. The coordinates of the matched feature points in the current frame are used as the first target image coordinate point to be tracked, and the coordinates of the matched feature points in the previous frame are used as the second target image coordinate point to be tracked.

[0042] S32: Compare the first to-be-tracked target image coordinate point with the second to-be-tracked target image coordinate point to obtain the target object's moving direction.

[0043] Specifically, by comparing the first target image coordinate point (x1, y1) to be tracked and the second target image coordinate point (x2, y2) to be tracked, the horizontal distance Δx and the vertical distance Δy of the target object between the two frames are calculated, the inverse tangent function (arctan) is used to calculate the moving direction angle θ, and θ is adjusted according to the signs of Δx and Δy to determine the moving direction of the target object.

[0044] In one embodiment, if Figure 4 As shown, in step S32, the first to-be-tracked target image coordinate point and the second to-be-tracked target image coordinate point are compared to obtain the moving direction of the target object, which specifically includes: S321: If the first to-be-tracked target image coordinate point is the same as the second to-be-tracked target image coordinate point, it is determined that the target is stationary.

[0045] Specifically, the first to-be-tracked target image coordinate point (x1, y1) and the second to-be-tracked target image coordinate point (x2, y2) are compared to see if they are the same: if (x1=x2) and (y1=y2), it is determined that the target object is stationary.

[0046] S322: If the coordinate point of the first target image to be tracked is different from the coordinate point of the second target image to be tracked, the target movement is determined, and the moving direction of the target object is determined by calculating the horizontal distance and vertical distance between the coordinate points before and after the target movement and using the inverse tangent function to calculate the angle.

[0047] Specifically, compare whether the first target image coordinate point (x1, y1) to be tracked and the second target image coordinate point (x2, y2) to be tracked are the same: if (x1≠x2) or (y1≠y2), it is determined that the target object moves. Calculate the horizontal distance Δx and vertical distance Δy of the target object between the two frames, use the inverse tangent function (arctan) to calculate the moving direction angle θ, and adjust θ according to the signs of Δx and Δy to determine the moving direction of the target object.

[0048] In one embodiment, if Figure 5 As shown, in step S322, if the first target image coordinate point to be tracked is different from the second target image coordinate point to be tracked, the target is determined to be moving, and the horizontal distance and vertical distance between the coordinate points before and after the target movement are calculated, and the angle is calculated using the inverse tangent function to determine the moving direction of the target object, specifically including: S3221: Calculate the horizontal distance ΔX=X2-X1 and the vertical distance ΔY=Y2-Y1 between the first target image coordinate point to be tracked (x1, y1) and the second target image coordinate point to be tracked (x2, y2).

[0049] Specifically, the first target image coordinate point (x1, y1) and the second target image coordinate point (x2, y2) are obtained. The horizontal distance Δx and the vertical distance Δy are calculated by the difference between the coordinate points of the current frame and the previous frame.

[0050] S3222: Through the inverse tangent function Wherein θ refers to the moving direction angle of the target object. According to the signs of Δx and Δy, the moving direction angle θ of the target object is adjusted. If Δx>0 and Δy>0, θ is in the first quadrant. If Δx<0 and Δy>0, θ is in the second quadrant and θ needs to be increased by π. If Δx<0 and Δy<0, θ is in the third quadrant and θ needs to be increased by π. If Δx>0 and Δy<0, θ is in the fourth quadrant and θ needs to be increased by 2π.

[0051] Specifically, the first target image coordinate point to be tracked (x1, y1) and the second target image coordinate point to be tracked (x2, y2) are obtained. The horizontal distance Δx and the vertical distance Δy are calculated using the inverse tangent function Calculate the initial angle θ. Adjust θ to the correct quadrant based on the signs of Δx and Δy. Output the adjusted angle, making sure the angle value is in the correct range.

[0052] S3223: If Δx≠0 or Δy≠0, determine that the target moves.

[0053] Specifically, if Δx≠0 or Δy≠0, it is determined that the target moves.

[0054] In one embodiment, if Figure 6 As shown, after step S32, the video surveillance target tracking method further includes: S33: For tracking of multiple target points, multiple targets are converted into multiple coordinate points, scattered coordinate points and coordinate points at the edge of the camera's viewing angle are removed, and the coordinate points are calculated using the formula. Where i is the i-th point, n is the total number of valid points, and the processed center point coordinates (x, y) are obtained.

[0055] Specifically, the coordinate points of multiple targets are extracted from the video frame image to form a list of coordinate points. The distance between each coordinate point and all other points is calculated, and the scattered coordinate points with a large distance from other points are removed. A distance threshold D can be set. If the average distance between a point and other points is greater than D, the point is considered to be scattered. According to the viewing angle of the camera, the coordinate points in the edge area are removed. An edge threshold E is set. If the x or y coordinate of a point is less than E from the edge of the image, the point is considered to be in the edge area. The remaining valid coordinate points are averaged to calculate the coordinates of the center point (x, y).

[0056] In one embodiment, if Figure 7As shown, in step S40, the moving angle of the camera is adjusted according to the moving direction of the target object, which specifically includes: S41: Adjust the formula by horizontal angle, Where X is the horizontal coordinate of the target object's moving direction, W is the width of the video frame image, and FOV h is the horizontal field of view of the camera, tan(FOV h / 2) represents the half field of view angle of the camera in the horizontal direction.

[0057] Specifically, by obtaining parameters, X is the horizontal coordinate of the target object's moving direction, W is the width of the video frame image, and FOVh is the horizontal field of view of the camera, and the half field of view angle of the camera in the horizontal direction is calculated, tan(FOVh / 2). The horizontal offset of the target object relative to the center of the image is XW / 2. The horizontal angle adjustment value αH is calculated by the formula, which represents the horizontal angle that the camera needs to adjust.

[0058] S42: Adjust the formula by vertical angle, Where Y is the vertical coordinate of the target object's moving direction, H is the height of the video frame image, and FOV v is the vertical field of view of the camera, tan(FOV v / 2) represents the half field of view angle of the camera in the vertical direction.

[0059] Specifically, by obtaining parameters, Y is the vertical coordinate of the target object's moving direction, H is the height of the video frame image, and FOV v is the vertical field of view of the camera, tan(FOV v / 2) represents the half-viewing angle of the camera in the vertical direction. The horizontal offset of the target object relative to the center of the image is YH / 2. The horizontal angle adjustment value αV is calculated by the formula, which represents the vertical angle that the camera needs to adjust.

[0060] Optionally, the coordinate point extraction module includes: The parameter confirmation submodule is used to set the target detection model parameters according to the tracking target set by the user; The coordinate point submodule is used to input the video frame image into the target detection model, obtain the target image area, and extract the image coordinate points from the target image area.

[0061] Optionally, the target object moving module includes: A matching submodule, used for matching the feature points of the current frame with the feature points of the previous frame according to the feature tracking algorithm to obtain a feature point pair, and obtaining the first to-be-tracked target image coordinate point and the second to-be-tracked target image coordinate point from the feature point pair; The moving direction submodule is used to compare the first to-be-tracked target image coordinate point with the second to-be-tracked target image coordinate point to obtain the moving direction of the target object.

[0062] Optionally, the moving direction submodule includes: A stationary unit, configured to determine that the target is stationary if the first image coordinate point of the target to be tracked is the same as the second image coordinate point of the target to be tracked; The moving unit is used to determine the target movement if the coordinate point of the first target image to be tracked is different from the coordinate point of the second target image to be tracked, and to determine the moving direction of the target object by calculating the horizontal distance and vertical distance between the coordinate points before and after the target movement and using the inverse tangent function to calculate the angle.

[0063] Optionally, the mobile unit comprises: A calculation subunit, used for calculating a horizontal distance ΔX=X2-X1 and a vertical distance ΔY=Y2-Y1 between a first target image coordinate point to be tracked (x1, y1) and a second target image coordinate point to be tracked (x2, y2); The determination subunit is used to pass the inverse tangent function Where θ refers to the moving direction angle of the target object. According to the signs of Δx and Δy, the moving direction angle θ of the target object is adjusted. If Δx>0 and Δy>0, θ is in the first quadrant. If Δx<0 and Δy>0, θ is in the second quadrant and π needs to be added to θ. If Δx<0 and Δy<0, θ is in the third quadrant and π needs to be added to θ. If Δx>0 and Δy<0, θ is in the fourth quadrant and 2π needs to be added to θ. The moving subunit is used to determine whether the target moves if Δx≠0 or Δy≠0.

[0064] Optionally, the mobile unit also includes: The multi-target tracking unit is used to track multiple target points, convert multiple targets into multiple coordinate points, remove the scattered coordinate points and the coordinate points at the edge of the camera's view, and calculate the coordinate points through the formula. Where i is the i-th point, n is the total number of valid points, and the processed center point coordinates (x, y) are obtained.

[0065] Optionally, the angle adjustment module includes: The horizontal adjustment submodule is used to adjust the formula through the horizontal angle. Where X is the horizontal coordinate of the target object's moving direction, W is the width of the video frame image, and FOV h is the horizontal field of view of the camera, tan(FOV h / 2) represents the half field of view angle of the camera in the horizontal direction; The vertical adjustment submodule is used to adjust the formula by vertical angle, Where Y is the vertical coordinate of the target object's moving direction, H is the height of the video frame image, and FOV v is the vertical field of view of the camera, tan(FOV v / 2) represents the half field of view angle of the camera in the vertical direction.

[0066] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0067] In one embodiment, a video surveillance target tracking device is provided, and the video surveillance target tracking device corresponds to the video surveillance target tracking method in the above embodiment. Figure 8 As shown, the video surveillance target tracking device includes an image acquisition module, a coordinate point extraction module, a target object movement module and an angle adjustment module. The detailed description of each functional module is as follows: an image acquisition module, used to acquire a video frame image; A coordinate point extraction module is used to extract image coordinate points in the video frame image according to the tracking target set by the user; A target object moving module is used to perform feature matching on image coordinate points through a feature tracking algorithm to obtain a first target image coordinate point to be tracked and a second target image coordinate point to be tracked, and compare the first target image coordinate point to be tracked with the second target image coordinate point to be tracked to obtain a moving direction of the target object; The angle adjustment module is used to adjust the moving angle of the camera according to the moving direction of the target object.

[0068] For the specific definition of the video surveillance target tracking device, please refer to the definition of the video surveillance target tracking method above, which will not be repeated here. Each module in the above-mentioned video surveillance target tracking device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0069] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig. 9As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used for the OpenCV library. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a video surveillance target tracking method is implemented.

[0070] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: Get video frame image; According to the tracking target set by the user, the image coordinate points in the video frame image are extracted; Perform feature matching on the image coordinate points through a feature tracking algorithm to obtain a first target image coordinate point to be tracked and a second target image coordinate point to be tracked, and compare the first target image coordinate point to be tracked with the second target image coordinate point to obtain a moving direction of the target object; Adjust the camera's movement angle according to the target object's moving direction.

[0071] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: Get video frame image; According to the tracking target set by the user, the image coordinate points in the video frame image are extracted; Perform feature matching on the image coordinate points through a feature tracking algorithm to obtain a first target image coordinate point to be tracked and a second target image coordinate point to be tracked, and compare the first target image coordinate point to be tracked with the second target image coordinate point to obtain a moving direction of the target object; Adjust the camera's movement angle according to the target object's moving direction.

[0072] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0073] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0074] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A video surveillance target tracking method, characterized in that: The video surveillance target tracking method comprises: Get video frame image; Extracting image coordinate points in the video frame image according to the tracking target set by the user; Performing feature matching on the image coordinate points through a feature tracking algorithm to obtain a first target image coordinate point to be tracked and a second target image coordinate point to be tracked, and comparing the first target image coordinate point to be tracked with the second target image coordinate point to be tracked to obtain a moving direction of the target object; The moving angle of the camera is adjusted according to the moving direction of the target object.

2. The video surveillance target tracking method according to claim 1, characterized in that: The step of extracting the image coordinate points in the video frame image according to the tracking target set by the user specifically includes: According to the tracking target set by the user, setting the target detection model parameters; The video frame image is input into the target detection model to obtain a target image region, and the image coordinate points are extracted from the target image region.

3. The video surveillance target tracking method according to claim 1, characterized in that: The method of performing feature matching on the image coordinate points by using a feature tracking algorithm to obtain a first target image coordinate point to be tracked and a second target image coordinate point to be tracked, and comparing the first target image coordinate point to be tracked with the second target image coordinate point to be tracked to obtain a moving direction of the target object specifically includes: Matching the feature points of the current frame with the feature points of the previous frame according to the feature tracking algorithm to obtain a feature point pair, and obtaining the first to-be-tracked target image coordinate point and the second to-be-tracked target image coordinate point from the feature point pair; The first to-be-tracked target image coordinate point is compared with the second to-be-tracked target image coordinate point to obtain the moving direction of the target object.

4. The video surveillance target tracking method according to claim 3, characterized in that: The step of comparing the first to-be-tracked target image coordinate point with the second to-be-tracked target image coordinate point to obtain the moving direction of the target object specifically includes: If the first target image coordinate point to be tracked is the same as the second target image coordinate point to be tracked, the target is determined to be stationary; if the first target image coordinate point to be tracked is different from the second target image coordinate point to be tracked, the target is determined to be moving, and the horizontal distance and vertical distance between the coordinate points before and after the target movement are calculated, and the angle is calculated using the inverse tangent function to determine the moving direction of the target object.

5. The video surveillance target tracking method according to claim 4, characterized in that: If the first to-be-tracked target image coordinate point and the second to-be-tracked target image coordinate point are not the same, the target is determined to have moved, and the moving direction of the target object is determined by calculating the horizontal distance and the vertical distance between the coordinate points before and after the target moves and using the inverse tangent function to calculate the angle, which specifically includes: By calculating the horizontal distance ΔX=X2-X1 and the vertical distance ΔY=Y2-Y1 between the first target image coordinate point to be tracked (x1, y1) and the second target image coordinate point to be tracked (x2, y2); By the inverse tangent function Wherein θ refers to the moving direction angle of the target object. According to the signs of Δx and Δy, the moving direction angle θ of the target object is adjusted. If Δx>0 and Δy>0, θ is in the first quadrant. If Δx<0 and Δy>0, θ is in the second quadrant and π needs to be added to θ. If Δx<0 and Δy<0, θ is in the third quadrant and π needs to be added to θ. If Δx>0 and Δy<0, θ is in the fourth quadrant and 2π needs to be added to θ. If Δx≠0 or Δy≠0, it is determined that the target moves.

6. The video surveillance target tracking method according to claim 5, characterized in that: The video surveillance target tracking method also includes: For tracking of multiple target points, multiple targets are converted into multiple coordinate points, scattered coordinate points and coordinate points at the edge of the camera's view are removed, and the coordinate points are calculated using the formula. Where i is the i-th point, n is the total number of valid points, and the processed center point coordinates (x, y) are obtained.

7. The video surveillance target tracking method according to claim 1, characterized in that: The adjusting the moving angle of the camera according to the moving direction of the target object specifically includes: By adjusting the horizontal angle formula, Where X is the horizontal coordinate of the moving direction of the target object, W is the width of the video frame image, FOV h is the horizontal field of view of the camera, tan(FOV h / 2) represents the half field of view angle of the camera in the horizontal direction; By adjusting the vertical angle formula, Where Y is the vertical coordinate of the moving direction of the target object, H is the height of the video frame image, FOV v is the vertical field of view of the camera, tan(FOV v / 2) represents the half field of view angle of the camera in the vertical direction.

8. A video surveillance target tracking device, characterized in that: The video surveillance target tracking device comprises: An image acquisition module, used for acquiring video frame images; A coordinate point extraction module, used to extract image coordinate points in the video frame image according to a tracking target set by a user; A target object moving module is used to perform feature matching on the image coordinate points through a feature tracking algorithm to obtain a first target image coordinate point to be tracked and a second target image coordinate point to be tracked, and compare the first target image coordinate point to be tracked with the second target image coordinate point to be tracked to obtain a moving direction of the target object; The angle adjustment module is used to adjust the moving angle of the camera according to the moving direction of the target object.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the video surveillance target tracking method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the video surveillance target tracking method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Camera monitoring method and device, storage medium and computer program product

    CN119402742A

  • Target tracking and positioning system based on video analysis

    CN119540875A

  • A target tracking and positioning system based on video analysis

    CN119540875B

  • Flying dust source positioning and video tracking integrated device and method for thermal power plant

    CN119643396A

  • Video-based method and device for tracking contraband in parcel, equipment and medium

    CN122244105A