High-precision target tracking method

By combining the YOLO detection algorithm with the center of gravity detection algorithm, high-precision and high-real-time target detection is achieved, solving the problems of high detection complexity and poor real-time performance in existing technologies. It is suitable for rapid and accurate positioning of infrared flying targets.

CN121746432APending Publication Date: 2026-03-27CHINESE PEOPLES LIBERATION ARMY UNIT 63801 +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-17
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing real-time target detection algorithms are complex, have poor real-time performance, and low measurement accuracy, making it particularly difficult to meet the detection requirements of high frame rate image detectors, especially for the rapid and accurate localization of infrared flying targets.

Method used

By combining the YOLO detection algorithm with the centroid detection algorithm, the YOLO model is used for global target capture, and the centroid detection algorithm is used for local high-precision target detection, thus achieving high-accuracy, high-precision, and high-real-time fusion target detection.

Benefits of technology

It enables rapid and accurate positioning of infrared flying targets, improves detection accuracy and real-time performance, has strong adaptability, and can meet the detection requirements of high frame rate image detectors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121746432A_ABST
    Figure CN121746432A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of high-precision target tracking, and particularly relates to a high-precision target tracking method. The method comprises the steps of S1, reading a first frame of image, judging a target state based on a current frame of image, if the target state meets a first judgment condition, executing a step S2, and otherwise, executing a step S3; s2, global target capturing is carried out based on a YOLO model, if the number of captured targets is larger than or equal to 1, the step S3 is executed, and otherwise, the step S5 is executed; s3, acquiring a capture area of each target, and correspondingly setting a to-be-selected area of each target based on the capture area of each target; s4, performing real-time high-precision target detection on the to-be-selected area of each target based on a gravity center detection algorithm to obtain a target detection result; and S5, judging whether the target detection is finished or not, if so, finishing the target detection, otherwise, replacing the first frame of image with the next frame of image, and repeating the step S1. According to the invention, high-accuracy, high-precision and high-real-time fusion target detection can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of high-precision target tracking, and particularly relates to a high-precision target tracking method. BACKGROUND

[0002] The existing methods for real-time target detection are generally divided into two categories: one is a traditional real-time detection algorithm, and the other is a real-time detection algorithm based on deep learning. There are many types of traditional real-time detection algorithms, and typical ones include a gravity center detection algorithm, a gravity center detection algorithm, an edge detection algorithm and derivative algorithms thereof. The most commonly used one is the gravity center detection algorithm. The basic principle of the traditional real-time detection algorithm is to perform threshold calculation and target segmentation based on the spatial gray value statistics of a target, and the feature recognition ability and adaptability of the target are poor, so the target is easily affected by interference targets, causing target false detection. The most representative real-time detection algorithm based on deep learning is a target detection algorithm based on a YOLO model and derivative algorithms thereof. The real-time detection algorithm based on deep learning has the advantages of strong target feature recognition ability and strong robustness, and the disadvantages of large calculation amount, poor real-time performance and low detection precision (generally pixel level) compared with the traditional detection algorithm. Especially for typical infrared flying targets, since the vital parts are often not in the geometric center of the target and the target moves at a high speed, the deep learning method represented by the YOLO model often fails to achieve fast and accurate positioning of the infrared flying target. The real-time detection algorithm based on deep learning is based on the real-time detection algorithm of deep learning to complete target detection. The complexity of this kind of algorithm is high, and the real-time performance is poor. Even though the YOLO algorithm has excellent real-time performance in the field of deep learning, its real-time performance is still quite different from that of the traditional real-time detection algorithm, and it is difficult to meet the target detection requirements of high frame frequency (frame frequency >= 100 Hz) image detectors. Moreover, for most deep learning algorithms, the detection precision often depends on the calibration results of the data set, and it is difficult to achieve sub-pixel level high-precision detection. With the rapid development of science and technology and the continuous improvement of measurement requirements, on the one hand, the accuracy of algorithm recognition is required to be higher and higher, and on the other hand, the real-time performance and measurement precision of the algorithm are also required to be improved. SUMMARY

[0003] Therefore, the present application aims to provide a high-precision target tracking method to solve the problems of high complexity, poor real-time performance and low measurement precision of the real-time target detection algorithm in the prior art. The present application combines the YOLO detection algorithm with the gravity center detection algorithm to achieve high-accuracy, high-precision and high-real-time fusion target detection.

[0004] To achieve the above-mentioned purpose, the technical solution of the present application is as follows: A high-precision target tracking method, specifically comprising the following steps: S1: acquire a video sequence, read a first frame image, and judge a target state based on the current frame image, if the target state satisfies a first judging condition, execute step S2, otherwise execute step S3; S2: perform global target capture based on a YOLO model, if the number of captured targets is greater than or equal to 1, execute step S3, otherwise execute step S5; S3: record the capture region of each target as , , where i is the target number, 0 is the capture region, and the capture region of each target is correspondingly set as the candidate region of each target , where N is the candidate region; S4: perform real-time high-precision target detection on the candidate region of each target based on a gravity center detection algorithm to obtain a target detection result; S5: judge whether the target detection is finished, if yes, end the target detection, otherwise replace the first frame image with a next frame image and repeat step S1.

[0005] Further, in step S1, the first judging condition includes target loss, target jump and target first detection; the target state satisfies one of target loss, target jump and target first detection, that is, the first judging condition is satisfied.

[0006] Further, in step S3, the capture region is a rectangular region.

[0007] Further, in step S3, assuming that the image frame frequency of the video sequence is f, the time interval t of adjacent two frame images is 1 / f, and the projection displacement of the target in the current frame image is calculated by the following formula : ; wherein, is the projection value of the moving speed of the target in the current frame image; The capture region and the candidate region of the same target in the current frame image are concentric rectangles, and the half of the difference dD between the side length of the candidate region and the corresponding side length of the capture region is greater than the projection displacement .

[0008] Further, step S4 specifically includes the following steps: S41: perform image preprocessing on the candidate region of each target, and convert the candidate region of each target into a unified image format; S42: calculate the threshold value T for distinguishing the target and the background based on a selected threshold calculation method; S43: based on the threshold value T, perform threshold segmentation on each candidate region after image preprocessing to obtain a threshold segmentation image; S44: Calculate the target gravity center position of each target based on a gravity center calculation formula, the gravity center calculation formula is: ; ; ; Wherein, M is the image width of the threshold segmentation image of the current target, N is the image height of the threshold segmentation image of the current target, x c The horizontal coordinate of the gravity center position, the range is [0, w-1]; y c The vertical coordinate of the gravity center position, the range is [0, h-1], V(i) is the column projection of the threshold segmentation image corresponding to the current target in the frame image, H(i) is the row projection of the threshold segmentation image corresponding to the current target in the frame image, The position of the pixel point of the threshold segmentation image (i, j); S45: Determine the horizontal direction interval and the vertical direction interval of each target region, and determine all target regions based on the horizontal direction interval and the vertical direction interval of each target.

[0009] Further, in step S43, for each candidate region whose brightness of the target is higher than the background, a first threshold segmentation expression is used to perform threshold segmentation on each candidate region after image preprocessing, to obtain a threshold segmentation image corresponding to each candidate region: ; For each candidate region whose brightness of the target is lower than the background, a second threshold segmentation expression is used to perform threshold segmentation on each candidate region after image preprocessing, to obtain a threshold segmentation image corresponding to each candidate region: ; Wherein, g(i, j) is the candidate region, L is the maximum gray level of the image space, the position of the pixel point (i, j), and f(i, j) is the threshold segmentation image.

[0010] Further, in step S43, for each candidate region whose brightness of the target is higher than the background, a first threshold segmentation expression is used to perform threshold segmentation on each candidate region after image preprocessing, to obtain a threshold segmentation image corresponding to each candidate region: ; For each candidate region whose brightness of the target is lower than the background, a second threshold segmentation expression is used to perform threshold segmentation on each candidate region after image preprocessing, to obtain a threshold segmentation image corresponding to each candidate region: ; Wherein, g(i, j) is a to be selected area, L is the maximum gray level of the image space, (i, j) is the position of the pixel point, f(i, j) is the threshold value segmented image.

[0011] Further, the step S45 specifically comprises the following steps: S451: for the determination of the horizontal direction interval: taking x c As the starting point, in the threshold value segmented image where the current target is located, sequentially find the minimum value x1 which makes the column projection V(x) greater than 0 to the left; then taking x c As the starting point, in the threshold value segmented image where the current target is located, sequentially find the maximum value x2 which makes the column projection V(x) greater than 0 to the right; For the determination of the vertical direction interval: taking y c As the starting point, in the threshold value segmented image where the current target is located, sequentially find the minimum value y1 which makes the row projection H(x) greater than 0 to the up; then taking y c As the starting point, in the threshold value segmented image where the current target is located, sequentially find the maximum value y2 which makes the row projection H(x) greater than 0 to the down; In the threshold value segmented image where the current target is located, obtain the target region with (x1, y1) as the upper left corner and (x2, y2) as the lower right corner, and the target region is a rectangle; S452: replace the threshold value segmented image where the current target is located with the threshold value segmented image where the next target is located, repeat the step S451, determine the horizontal direction interval and the vertical direction interval of the target region of each target, and determine all target regions based on the horizontal direction interval and the vertical direction interval of each target.

[0012] Compared with the prior art, the present application can achieve the following beneficial effects: (1) The high-precision target tracking method of the present application is a full-view multi-target capture method based on YOLO model design, which realizes local target position detection by using gravity center detection. Compared with the traditional real-time detection algorithm (i.e. the method based on image gray feature statistics), the present application uses YOLO model for full-view multi-target capture, has stronger feature recognition ability, and has better adaptability to the attitude change detection and brightness feature change detection of the target in the field of view.

[0013] (2) Compared with the real-time detection algorithm related to deep learning, the high-precision target tracking method of the present application automatically uses the gravity center detection algorithm for high-precision target detection in the local area after completing the full-view target capture, has better real-time performance and higher target detection accuracy. BRIEF DESCRIPTION OF DRAWINGS

[0014] The accompanying drawings, which form a part of this application, are included to provide a further understanding of the application and are incorporated in and constitute a part of this application. The drawings illustrate embodiments of the application and, together with the description, serve to explain the application. In the drawings: Figure 1 A flowchart of a high-precision target tracking method according to an embodiment of the application; Figure 2 An image division structure diagram of a YOLO model according to an embodiment of the application; Figure 3 A model parameter training process diagram of a YOLO model according to an embodiment of the application; Figure 4 A target prediction process diagram according to an embodiment of the application; Figure 5 A position relationship diagram of a target and a camera according to an embodiment of the application; A position relationship diagram of a target and a camera according to an embodiment of the application; A position relationship diagram of a target and a camera according to an embodiment of the application; Figure 6 A center of gravity calculation schematic diagram according to an embodiment of the application. DETAILED DESCRIPTION

[0015] In order to make the objects, technical solutions and advantages of the application clearer, the application will be further described in detail below with reference to the drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the application, and do not constitute a limitation on the application.

[0016] It should be noted that the embodiments in the application and the features in the embodiments can be combined with each other without conflict.

[0017] In the description of the application, it should be understood that the terms "center", "longitudinal", "transverse", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer" and the like indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, and are only used to facilitate the description of the application and simplify the description, and therefore cannot be understood as indicating or implying that the device or element referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as a limitation on the application. In addition, the terms "first", "second" and the like are only used for description purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features limited by "first", "second" and the like can explicitly or implicitly include one or more features. In the description of the application, unless otherwise specified, the meaning of "a plurality of" is two or more.

[0018] In the description of the present application, it should be noted that unless otherwise explicitly specified and limited, the terms "mounting", "connection", "connecting" should be understood in a broad sense, for example, it can be fixed connection, or detachable connection, or integrally connected; it can be mechanical connection, or electrical connection; it can be directly connected, or indirectly connected through an intermediate medium, or the communication inside two elements. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.

[0019] The present application will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.

[0020] As Figure 1 shown, the present application provides a high-precision target tracking method, specifically comprising the following steps: S1: acquiring a video sequence, reading a first frame image, and judging the target state based on the current frame image, if the target state meets the first judgment condition, executing step S2, otherwise executing step S3; S2: performing global target capture based on a YOLO model, if the number of captured targets is greater than or equal to 1, executing step S3, otherwise executing step S5; S3: recording the capture region of each target as , , where i is the target number, 0 is the capture region, and the capture region of each target is corresponding to the selected region of each target , and N is the selected region; S4: performing real-time high-precision target detection on the selected region of each target based on a barycenter detection algorithm to obtain a target detection result; S5: judging whether the target detection is finished, if yes, ending the target detection, otherwise replacing the first frame image with the next frame image and repeating step S1.

[0021] It should be noted that the present application proposes a fusion target detection method combining YOLO detection algorithm and barycenter detection algorithm, the basic idea is: in the initial stage of target detection or when the target detection state changes (such as target loss, target tracking position changes), calling the YOLO detection algorithm (the YOLO model can be selected according to actual needs) with strong target feature recognition capability to capture multiple targets in the whole field of view, after capturing the target, continuously calling the barycenter detection algorithm in each capture region to complete real-time high-precision local detection update of the target. If the target detection state changes during the barycenter detection process of the next frame image, the YOLO detection algorithm is called again to capture the target in the whole field of view, and after the capture is completed, the barycenter detection algorithm is called again to complete the local target detection. In addition, the video sequence of step S1 can be pre-acquired or composed of real-time acquired images.

[0022] Further, the principle of the YOLO model for target detection is as follows: the target detection method based on deep learning is an important branch developed in the field of target detection in the past two decades. A typical representative of this kind of algorithm is the R-CNN algorithm model proposed by Girshick, but the R-CNN algorithm model has the following problems: multi-stage training steps are tedious, feature retrieval is time-consuming, and feature storage occupies a large amount of resources. In view of the above problems, many scholars have successively proposed the SPP-net model supporting arbitrary image size input, the Fast-RCNN model combining the separated feature extraction, target classification and position regression steps, the Faster-RCNN model introducing shared calculation and the TridentNet target detection framework suitable for multi-scale. Although the R-CNN algorithm has been optimized in many aspects, it still has the problems of large amount of calculation and difficulty in realizing real-time detection.

[0023] Compared with the problem of poor real-time performance of the R-CNN algorithm, the YOLO (You Only Look Once) algorithm adopts the One-Stage detection method, which can directly complete the positioning and classification of the target in one neural network, has a faster operation speed, and plays an increasingly important role in real-time detection.

[0024] The basic idea of the YOLO algorithm is to divide the image to be detected into S×S image grids (as shown in FIG. 1), and then perform boundary box prediction centered on each grid subgraph. Finally, the whole image outputs a one-dimensional vector containing S×S×(B×5+C) parameters, that is, each subgraph corresponds to (B×5+C) prediction parameters. Figure 2

[0025] Among them, B is the number of prediction boxes of each grid subgraph specified by the YOLO model (in YOLOv1: B=2), and 5 is the representation parameter of each prediction box, that is: prediction box center x coordinate, prediction box center y coordinate, prediction box width w, prediction box height h, and confidence c of the typical target contained in the prediction box. C is the number of target classifications contained in the model data set.

[0026] After obtaining the prediction result of the YOLO algorithm, the YOLO model parameters can be trained or target prediction can be performed according to the processing needs.

[0027] The training process of the model parameters is to input the labeled picture as an input image into the YOLO model. The prediction result of the YOLO model and the labeled true value are calculated by the loss function, and then the network parameters of the YOLO model are repeatedly adjusted through back propagation, so as to finally achieve the purpose of model parameter training. The training process is as shown in FIG. 2. Figure 3

[0028] ​​In step S2 of the present application, the YOLO model mentioned is a trained model. The process of target prediction is to input the picture to be detected as an input image into the trained YOLO model, obtain prediction parameters (the prediction results include the detected target position information, target confidence and target classification information), and use a non-maximum suppression algorithm or other screening algorithm to remove targets with low confidence or repeatedly extracted targets, and finally output the prediction results. The target prediction process is as shown in Figure 4

[0029] In some embodiments, in step S1, the first judgment condition includes target loss, target jump and target first detection; and the target state satisfies one of target loss, target jump and target first detection, that is, the first judgment condition is satisfied.

[0030] YOLO model target detection principle: the target detection method based on deep learning is an important branch developed in the field of target detection in the past two decades. A typical representative of this kind of algorithm is the R-CNN algorithm model proposed by Girshick. However, the R-CNN algorithm model has the following disadvantages: multi-stage training steps are tedious, feature retrieval is time-consuming, and feature storage occupies a lot of resources. In view of the above problems, many scholars have successively proposed the SPP-net model supporting arbitrary image size input, the Fast-RCNN model combining separate feature extraction, target classification and position regression steps, the Faster-RCNN model introducing shared calculation, and the TridentNet suitable for multi-scale target detection framework. Although there are many adaptive optimizations, the R-CNN algorithm still has the problems of large amount of calculation and difficulty in realizing real-time detection.

[0031] Compared with the poor real-time performance of the R-CNN algorithm, the YOLO (You Only Look Once) algorithm adopts a One-Stage detection method, which can directly complete the positioning and classification of targets in a neural network, has a faster operation speed, and plays an increasingly important role in real-time detection.

[0032] The basic idea of the YOLO algorithm is to divide the image to be detected into S×S image grids (as shown in Figure 3 Then, the boundary box is predicted with each grid subgraph as the center. Finally, the whole image outputs a one-dimensional vector containing S×S×(B×5+C) parameters, that is, each subgraph corresponds to (B×5+C) prediction parameters.

[0033] ​Wherein, B is the number of prediction boxes of each grid map specified by the model (B=2 in YOLOV1). 5 is the representation parameter of each prediction box, that is: the prediction box center x coordinate, the prediction box center y coordinate, the prediction box width w, the prediction box height h, and the confidence c of the typical target contained in the prediction box. C is the number of target classifications contained in the model data set.

[0034] After obtaining the prediction result of YOLO, the training of the YOLO model parameter or the target prediction can be carried out according to the processing requirement.

[0035] The training process of the model parameter is to input the labeled picture as an image into the YOLO network model. The prediction result of YOLO and the labeled true value are calculated by a loss function, and then the network parameters of YOLO are repeatedly adjusted through back propagation, so that the purpose of model parameter training is finally achieved. The training process is as shown in Figure 4

[0036] The application can replace the YOLO model with other deep learning models with better real-time detection to realize full-view multi-target capture.

[0037] In some embodiments, in step S1, the first judgment condition includes target loss, target jump and target first detection; and the target state satisfies one of target loss, target jump and target first detection, that is, the first judgment condition is satisfied.

[0038] It should be noted that the target first detection refers to the first entering of the target detection program, and the full-view target capture detection has not been performed; the target loss refers to the change of the target quantity caused by the target loss in the local target detection process; and the target jump refers to the great jump of the current target detection position or target size compared with the previous frame detection result in the local target detection process.

[0039] In some embodiments, in step S3, the capture region is a rectangular region.

[0040] In some embodiments, in step S3, the image frame frequency of the video sequence is f, the time interval t of adjacent two frames of images is 1 / f, and the projection displacement of the target in the current frame of images is calculated by the following formula : ; Wherein, is the projection value of the moving speed of the target in the current frame of images; The capture region and the candidate region of the same target in the current frame of images are concentric rectangles, and the half dD of the difference value between the side length of the candidate region and the corresponding side length of the capture region is greater than the projection displacement . ​

[0041] Considering the real-time displacement of the moving target between image frames in the image sequence, in order to detect the position of the target in the current frame image in real time, Generally, the target region is a large rectangular area concentric with The position relationship is shown in the figure Figure 5 .

[0042] Where dD is The half width of the side length difference, in pixels, which depends on the projection value of the target's moving speed in the image , assuming the image frame frequency is f, then the time interval t between adjacent two frames is 1 / f. Then, the value of dD should not be less than the projection displacement s of the target within the frame interval t. The calculation formula of the target projection displacement s is: ; ; That is, the value of dD should not be less than s.

[0043] In some embodiments, step S4 specifically comprises the following steps: S41: image pre-processing is performed on the candidate regions of each target, and the candidate regions of each target are converted into a unified image format; S42: calculating the threshold value T for distinguishing the target from the background based on the selected threshold calculation method; S43: based on the threshold value T, threshold segmentation is performed on each candidate region after image pre-processing to obtain a threshold segmentation image; S44: calculating the target barycenter position of each target based on the barycenter calculation formula: ; ; ; Where M is the image width of the threshold segmentation image of the current target, N is the image height of the threshold segmentation image of the current target, x c The horizontal coordinate of the barycenter position, ranging from 0 to w-1; y c The vertical coordinate of the barycenter position, ranging from 0 to h-1, V(i) is the column projection of the threshold segmentation image corresponding to the current target in the frame image, H(i) is the row projection of the threshold segmentation image corresponding to the current target in the frame image, is the threshold segmentation image, and the position of the pixel point (i, j); S45: determining the horizontal direction interval and the vertical direction interval of each target region, and determining all target regions based on the horizontal direction interval and the vertical direction interval of each target.

[0044] In some embodiments, in step S43, for each candidate region whose brightness of the target is higher than that of the background, a first threshold segmentation expression is used to perform threshold segmentation on the image pre-processed candidate region, to obtain a threshold segmentation image corresponding to the candidate region: ; For each candidate region whose brightness of the target is lower than that of the background, a second threshold segmentation expression is used to perform threshold segmentation on the image pre-processed candidate region, to obtain a threshold segmentation image corresponding to the candidate region: ; Wherein g(i, j) is the candidate region, L is the maximum gray level of the image space, (i, j) is the position of the pixel point, and f(i, j) is the threshold segmentation image.

[0045] In some embodiments, step S45 specifically comprises the following steps: S451: For determination of the horizontal direction interval: taking x c as the starting point, sequentially searching to the left in the threshold segmentation image where the current target is located to find the minimum value x1 that makes the column projection V(x) greater than 0; then taking x c as the starting point, sequentially searching to the right in the threshold segmentation image where the current target is located to find the maximum value x2 that makes the column projection V(x) greater than 0; For determination of the vertical direction interval: taking y c as the starting point, sequentially searching upwards in the threshold segmentation image where the current target is located to find the minimum value y1 that makes the row projection H(x) greater than 0; then taking y c as the starting point, sequentially searching downwards in the threshold segmentation image where the current target is located to find the maximum value y2 that makes the row projection H(x) greater than 0; In the threshold segmentation image where the current target is located, the target region with (x1, y1) as the upper left corner and (x2, y2) as the lower right corner is obtained, and the target region is a rectangle; S452: replacing the threshold segmentation image where the current target is located with the threshold segmentation image where the next target is located, repeating step S451 to determine the horizontal direction interval and the vertical direction interval of the target region of each target, and determining all target regions based on the horizontal direction interval and the vertical direction interval of each target.

[0046] It should be noted that, as shown in Figure 6 , the barycenter detection is a process of calculating the center position of the gray scale of the target and the covered region according to the covered position information of the target region.

[0047] It should be noted that the barycenter detection step is: (1) Image pre-processing: The purpose of image pre-processing is to preliminarily remove the interference factors (such as interference noise, image edge, and other invalid regions of the target) in the image that are not conducive to target detection by a series of pre-processing means, and to convert them into a unified image format (such as unifying the image channel number to a single channel image, and unifying the image bit number to an 8-bit image) that meets the threshold calculation.

[0048] (2) Threshold calculation: The threshold calculation is to calculate the threshold T that can distinguish the target from the background according to a certain selected threshold calculation method (such as the maximum inter-class variance threshold segmentation method).

[0049] (3) Threshold segmentation: According to the calculated threshold T, the pre-processed image is subjected to threshold segmentation processing.

[0050] For the case of bright target and dark background, the threshold segmentation processing expression is: ; For the case of dark target and bright background, the threshold segmentation processing expression is: ; Where g(i, j) is the pixel gray scale of the position (i, j) in the selected region; L is the maximum gray scale of the image space (for example, L takes the value of , f(i, j) is the threshold segmentation image.

[0051] (4) Calculation of the center of gravity position of the target: After completing the threshold segmentation of the image, the center of gravity calculation formula can be called to calculate the center of gravity position of the target. The calculation expression is as follows: ; Where M is the image width, in pixels; N is the image height, in pixels; is the horizontal coordinate calculation result of the center of gravity position of the target, in pixels, ranging from 0 to M-1; is the vertical coordinate calculation result of the center of gravity position of the target, in pixels, ranging from 0 to N-1; V(i) is the projection in the vertical direction of the image (i.e., column projection), and its calculation formula is: ; H(i) is the projection in the horizontal direction of the image (i.e., row projection), and its calculation formula is: ; (5) Target region calculation: Determination of the horizontal direction range of the target region: first, take as the starting point, and then find the minimum value x1 that makes the column projection V(x) greater than 0 to the left; then take as the starting point, and then find the minimum value y1 that makes the row projection H(y) greater than 0 to the top.As a starting point, find the maximum value x2 of the column projection V(x) greater than 0 in turn to the right.

[0052] Determination of the vertical range of the target region: Firstly, take As a starting point, find the minimum value y1 of the row projection H(x) greater than 0 in turn upwards; and then take As a starting point, find the maximum value y2 of the row projection H(x) greater than 0 in turn downwards.

[0053] Thus, the position of the target rectangular region with (x1, y1) as the upper left corner and (x2, y2) as the lower right corner can be obtained.

[0054] The present application can replace the barycenter detection algorithm with other real-time detection algorithms such as the edge detection algorithm to realize the local region target detection.

[0055] It should be understood that the various forms of flow shown above can be used to reorder, add or delete steps. For example, the steps described in the present disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions of the present disclosure can be achieved, which is not limited herein.

[0056] The above detailed description does not constitute a limitation on the protection scope of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A high-precision target tracking method, characterized in that: Specifically, the steps include the following: S1: Obtain the video sequence, read the first frame image, and judge the target state based on the current frame image. If the target state meets the first judgment condition, execute step S2; otherwise, execute step S3. S2: Perform global target capture based on the YOLO model. If the number of captured targets is ≥1, proceed to step S3; otherwise, proceed to step S5. S3: Record the capture area of ​​each target as , The target number is 0, and the capture area is 0, based on the capture area of ​​each target. Set the candidate areas for each target accordingly. N is the region to be selected; S4: Real-time high-precision target detection is performed on the candidate region of each target based on the centroid detection algorithm to obtain the target detection results; S5: Determine whether the object detection has ended. If yes, end the object detection; otherwise, replace the first frame with the next frame and repeat step S1.

2. The high-precision target tracking method according to claim 1, characterized in that: In step S1, the first judgment condition includes target loss, target change, and target first detection; the target state satisfies one of the three conditions: target loss, target change, and target first detection, which means that the first judgment condition is met.

3. The high-precision target tracking method according to claim 1, characterized in that: In step S3, the captured area is a rectangular area.

4. The high-precision target tracking method according to claim 1, characterized in that: In step S3, let the frame rate of the video sequence be f, then the time interval between two adjacent frames is t = 1 / f. The projection displacement of the target in the current frame is calculated using the following formula. : ; in, The projection of the target's movement speed onto the current frame image; The capture region and the candidate region of the same target in the current frame image are represented as concentric rectangles, and half of the difference dD between the side length of the candidate region and the corresponding side length of the capture region is greater than the projected displacement. .

5. The high-precision target tracking method according to claim 1, characterized in that: Step S4 specifically includes the following steps: S41: Perform image preprocessing on the candidate regions of each target and convert the candidate regions of each target into a unified image format; S42: Calculate the threshold T for distinguishing between the target and the background based on the selected threshold calculation method; S43: Based on the threshold T, perform threshold segmentation on each candidate region after image preprocessing to obtain a threshold segmentation image; S44: Calculate the target's center of gravity position for each target based on the center of gravity calculation formula. The center of gravity calculation formula is: ; ; ; Where M is the image width of the thresholded segmentation image of the current target, N is the image height of the thresholded segmentation image of the current target, and x c Let y be the horizontal coordinate of the target's centroid, ranging from [0, w-1]; c Let H(i) be the vertical coordinate of the target's centroid, ranging from [0, h-1]. Let V(i) be the column projection of the thresholded segmentation image corresponding to the current target onto the frame image, and let H(i) be the row projection of the thresholded segmentation image corresponding to the current target onto the frame image. For threshold segmentation of the image, the position of the pixel at (i, j); S45: Determine the horizontal and vertical ranges of the target area for each target, and determine all target areas based on the horizontal and vertical ranges of each target.

6. The high-precision target tracking method according to claim 5, characterized in that: In step S43, for each candidate region where the brightness of the target is higher than that of the background, the first threshold segmentation expression is used to perform threshold segmentation on each candidate region after image preprocessing, to obtain a threshold segmentation image corresponding to each candidate region: ; For each candidate region where the target brightness is lower than the background, the second threshold segmentation expression is used to perform threshold segmentation on each candidate region after image preprocessing, obtaining a threshold segmentation image corresponding to each candidate region: ; Where g(i,j) is the region to be selected, L is the maximum gray level in the image space, (i,j) is the position of the pixel, and f(i,j) is the threshold segmentation image.

7. The high-precision target tracking method according to claim 5, characterized in that: Step S45 specifically includes the following steps: S451: Determining the horizontal interval: using x c Starting from the current target, search leftwards in the thresholded segmentation image to find the minimum value x1 that makes the column projection V(x) greater than 0; then, using x... c Starting from the current target, search to the right in the threshold segmentation image to find the maximum value x2 that makes the column projection V(x) greater than 0; For determining the vertical interval: using y c Starting from the current target, search upwards in the thresholded segmentation image to find the minimum value y1 that makes the row projection H(x) greater than 0; then, using y c Starting from the current target, search downwards in the threshold segmentation image to find the maximum value y2 that makes the row projection H(x) greater than 0; In the threshold segmentation image where the current target is located, a target region with (x1, y1) as the upper left corner and (x2, y2) as the lower right corner is obtained, and the target region is a rectangle; S452: Replace the current target's threshold segmentation image with the threshold segmentation image of the next target, repeat step S451, determine the horizontal and vertical ranges of the target region for each target, and determine all target regions based on the horizontal and vertical ranges of each target.