Improved target tracking algorithm based on template matching
By automatically detecting the target center point in the template matching algorithm and creating a fixed-size template, combining scale factors and normalized cross-correlation operations, the existing template matching algorithm has solved the problem of tracking speed and accuracy in complex environments, and achieved efficient and low-computation target tracking effect, which is suitable for embedded platforms.
Patent Information
- Application Number
- CN202411790878.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2044-12-06
AI Technical Summary
Existing template matching algorithms are difficult to take into account both tracking speed and accuracy in complex environments, and are large in calculations and unstable in time. The demand for suitable for embedded platforms is not high.
By automatically detecting the target center point, creating a fixed-size template, and introducing scale factors into each frame of the image, normalized cross-correlation operations are performed to achieve target tracking.
It improves the applicability of the template matching algorithm, takes into account tracking speed and accuracy, reduces the calculation amount, has low requirements for embedded platforms, and has good application prospects.
Smart Images

Figure CN119887836A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an improved target tracking algorithm implementation method based on template matching, in particular to a typical fixed target tracking method for uncooled infrared images and visible light images, belonging to image processing technology in the field of computer vision. Background Art
[0002] In the field of computer vision, typical target tracking based on uncooled infrared images or visible light images is a key technology with broad application prospects. With the rapid development of video surveillance systems, intelligent transportation, human-computer interaction and other fields, the demand for efficient and accurate target tracking algorithms is growing.
[0003] For buildings such as bridges, warehouses, and buildings, it is difficult to separate the target from the background in a complex natural background environment. In this case, a region-based template matching algorithm is usually used to track the target. The template matching algorithm is based on the grayscale features of the target area, contains some background information, has low requirements on image quality, has strong environmental adaptability and anti-interference ability, and is particularly suitable for target tracking technology in complex scenes.
[0004] The common template matching algorithms currently available include the mean absolute difference (MAD), the normalized product correlation (NCC) and the maximum neighbor distance (MCD) algorithm. It is difficult for these algorithms to achieve ideal matching accuracy and correctness. Currently, these traditional matching methods are greatly limited, especially in terms of adaptive scale and processing time. Some more advanced tracking algorithms based on multi-feature fusion, correlation filtering, deep learning, etc., have relatively high requirements on the processing capabilities of embedded hardware platforms, which also increases R&D costs. Summary of the invention
[0005] The purpose of the present invention is to overcome the above-mentioned defects and propose an improved target tracking algorithm implementation method based on template matching. The target size is automatically detected by the target center point and a fixed-size template is created to ensure that the time consumption of each frame image in the entire tracking process is consistent. The present invention improves the applicability of the traditional template matching algorithm and takes into account the tracking speed and accuracy. At the same time, the algorithm has a small and fixed amount of calculation, low requirements on the embedded platform, and has good application prospects.
[0006] The present invention adopts the following technical solution:
[0007] An improved target tracking method based on template matching, comprising:
[0008] The target center point position in the t-th frame image is recorded as P t , the scale factor is denoted as Scale t , t is an integer greater than or equal to 1;
[0009] When t=1, according to the target center point position P in the first frame image 1 Detect the target size Rect in the first frame image 1 ; Set the target size Rect 1 Compare with the template fixed size MaskSize to determine the initial scale factor Scale 1 , scale the image 1 Multiply and create a template Mask;
[0010] When t>1, each frame of the image executes the following steps S1 to S5 cyclically:
[0011] S1. Scale the tth frame image t times, within the fixed search range SearchArea, according to the point selection method of creating the template, take out the area block with the same size as the template Mask at every other point, perform normalized cross-correlation operation, and obtain N predicted positions P t n ;
[0012] S2, using the N predicted positions P t n As the center point, take out the area blocks with the same size as the template Mask point by point in the surrounding area, perform normalized cross-correlation operation, and get the first matching position P t and the first confidence R t ;
[0013] S3, determine the scale factor Scale according to the scale change of the target in two adjacent frames of images t ', scale the tth frame image t ' times, within the fixed search range SearchArea, according to the point selection method of creating the template, take out the area block with the same size as the template Mask at every other point, perform normalized cross-correlation operation, and obtain N predicted positions P t ' n ;
[0014] S4, using the N predicted positions P t ' n As the center point, take out the area blocks with the same size as the template Mask point by point in the surrounding area, perform normalized cross-correlation operation, and obtain the second matching position P t ' and the second confidence R t '.
[0015] S5. According to the first matching confidence R t and the second confidence R t 'Determine whether the scale factor needs to be updated. If so, update the current scale factor and output the matching position as Pt '; Otherwise the scale factor remains unchanged and the output matching position is P t .
[0016] In the above improved target tracking method based on template matching, according to the target center point position P in the first frame image, 1 Determine the target size Rect in the first frame image 1 and the initial scale factor Scale 1 methods, including:
[0017] Take the target center point position P in the first frame image 1 As the center, perform local segmentation on the target area to obtain the target contour points;
[0018] Get the minimum bounding rectangle of the target according to the target contour points, expand the minimum bounding rectangle by 3 to 5 pixels, and get the target box Rect 1 ;
[0019] If Rect 1 If it is smaller than the fixed size of the template MaskSize, then Scale 1 Initialized to 1.0, otherwise Scale 1 Initialized as Rect 1 / MaskSize ratio.
[0020] In the above improved target tracking method based on template matching, the target center point position P in the first frame image is 1 The method of locally segmenting the target area range to obtain the target contour point includes: taking the target center point position P 1 The surrounding area is evenly divided into multiple directions, with P 1 Determine whether the gradient of pixels in each direction is greater than a preset threshold for the starting point. When the gradient of a pixel is greater than the preset threshold and the gradient of the previous pixel is less than or equal to the preset threshold, the pixel is used as the target contour point.
[0021] In the above improved template matching-based target tracking method, the target center point position P 1 The surrounding area is evenly divided into 4 to 8 directions; the preset threshold value is 20.
[0022] In the above improved target tracking method based on template matching, when t=1, the method of creating the template Mask includes:
[0023] The template Mask is gridded, the template step size of the central area is 1, the template step size of the surrounding area is m, and m>1 is satisfied. 1 Centered by the scale factor Scale 1After scaling, the image data of the corresponding points are read sequentially to complete the template creation.
[0024] In the above improved template matching-based target tracking method, according to the scale factor Scale t The image is scaled and the processing method is open bilinear interpolation.
[0025] In the above improved target tracking method based on template matching, the first matching position P is obtained. t and the first confidence R t methods, including:
[0026] In the fixed search range SearchArea, obtain the area blocks with the same size as the template Mask at every other point, perform normalized correlation operation with the template Mask, and obtain the correlation coefficient matrix;
[0027] The pixel points corresponding to the largest N correlation coefficients in the correlation coefficient matrix are taken as P t n ;
[0028] With N predicted positions P t n Take the center point as the center point, obtain the area blocks with the same size as the template Mask point by point in the surrounding area, perform normalized cross-correlation operation with the template Mask, and obtain the correlation coefficient matrix. The largest corresponding point in the correlation coefficient matrix is taken as the first matching position P t and confidence R t .
[0029] In the above improved template matching-based target tracking method, the value of N is 5; the surrounding area is 3*3 pixels.
[0030] In the above improved template matching-based target tracking method, in step S3, the scale factor Scale is predicted according to the scale change of the target in two adjacent frames of images. t ', the scale change of the target in two adjacent frames is in the range of 1.02 to 1.07, and the predicted scale factor Scale t 'By the current scale factor Scale t Multiply by the scale change to obtain.
[0031] In the above improved target tracking method based on template matching, the second matching position P is obtained. t ' and the second confidence R t ' methods, including:
[0032] Scale the image t' times, within the fixed search range SearchArea, obtain the area block with the same size as the template Mask at every other point, perform normalized correlation operation with the template Mask, and obtain the correlation coefficient matrix;
[0033] The pixel points corresponding to the largest N correlation coefficients in the correlation coefficient matrix are taken as P t ' n ;
[0034] With N predicted positions P t ' n Take the center point as the center point, obtain the area blocks with the same size as the template Mask point by point in the surrounding area, perform normalized cross-correlation operation with the template Mask, and obtain the correlation coefficient matrix. The largest corresponding point in the correlation coefficient matrix is used as the second matching position P t ' and the second confidence R t '.
[0035] In the above improved template matching-based target tracking method, in step S5, according to the first matching confidence R t and the second confidence R t 'Judge whether the scale factor needs to be updated. If R t 0.95 times of ' is still greater than R t , and P t and P t 'If the position is less than 3 pixels, update the current scale factor and output the matching position as P t '; Otherwise the scale factor remains unchanged and the output matching position is P t .
[0036] A computer program product comprises a computer program, which implements the steps of the above method when executed by a processor.
[0037] Compared with the prior art, the present invention has at least the following beneficial effects:
[0038] (1) The embodiment of the present invention improves the strategy of creating templates and reads the original image data to create templates, thereby solving the problems in the traditional template matching algorithm that the template is too large or too small, which leads to the inability to balance tracking robustness and accuracy, time-consuming instability, and interference from similar targets around. When searching for each subsequent frame, the scale factor is introduced to match the current scale image and the predicted scale image respectively. Within the search range, a region block with the same size as the template is taken out with each pixel point as the center, and the normalized correlation operation with the template is performed to obtain the position of the target point in the current scale and the predicted next scale image. The current latest scale factor is obtained by judging the confidence, thereby solving the problem of tracking drift in the traditional template matching algorithm when the target size exceeds the template in the final stage of tracking due to the fixed template size. The present invention improves the applicability of the traditional template matching algorithm, balances tracking speed and accuracy, and at the same time, the algorithm has a small and fixed amount of calculation, low requirements on the embedded platform, and has good application prospects.
[0039] (2) The embodiment of the present invention adopts an automatic contour detection method for the target area in the first frame image, which can effectively hit the target area, simplify the actual operation process, avoid the subjectivity of manual selection, and make the algorithm more objective; the automatic contour detection method combined with manual adjustment can further improve the accuracy of locking the target;
[0040] (3) In the embodiment of the present invention, when creating a template, a gridding process is preferably used. The central area of the template is the target position, and a fine processing is used to ensure the tracking accuracy of the template matching process. The area around the template is the background position, and a large step length is used to sample data to obtain a larger background range, which can ensure the robustness and stability of the template matching process and solve the problem of tracking jumps caused by fast movement or similar targets in the background.
[0041] (4) The embodiment of the present invention introduces a scale factor in the matching process, thereby solving the problem of tracking drift in the traditional template matching algorithm when the target size exceeds the template at the end of tracking due to the fixed template size.
[0042] (5) In the entire template matching and tracking process, the data types of the embodiments of the present invention are all integers, the amount of calculation is small and fixed, and both tracking speed and accuracy are taken into account. The requirements for the embedded platform are low, and the embodiment of the present invention can be used for terminal target tracking of image-guided weapons, and has good application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 A flow chart of a method for implementing an improved template matching algorithm according to an embodiment of the present invention;
[0044] Figure 2 This is a schematic diagram of target frame detection in the first frame image according to an embodiment of the present invention;
[0045] Figure 3Schematic diagram of template creation in the first frame image of an embodiment of the present invention, wherein (a) is a schematic diagram of the template point selection sequence, and (b) is a schematic diagram of the template;
[0046] Figure 4 Schematic diagram of the tracking effect obtained by using the infrared target tracking implementation method of the present invention; wherein (a) is a schematic diagram of the 1st frame image, (b) is a schematic diagram of the 300th frame image, (c) is a schematic diagram of the 450th frame image, and (d) is a schematic diagram of the 650th frame image. DETAILED DESCRIPTION
[0047] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments:
[0048] like Figure 1 As shown, an improved target tracking algorithm implementation method based on template matching provided by an embodiment of the present invention is an infrared target tracking algorithm implementation method based on feature and grayscale fusion, which specifically includes the following steps:
[0049] 1. The target center point position in the t-th frame image is recorded as P t , the scale factor is denoted as Scale t , t is an integer greater than or equal to 1;
[0050] According to the target center pixel P of the first frame image 1 (x, y) Determine the target area to be tracked, perform local segmentation on the target area, find the target edge, and then use morphological methods to calculate the minimum outer bounding rectangle of the target. Based on the minimum outer bounding rectangle, expand it by 3 to 5 pixels to determine the target box Rect 1 Size; set the target size to Rect 1 Compare with the template fixed size MaskSize to determine the initial scale factor Scale 1 ;
[0051] The specific method is: take the target center pixel P 1 The (x, y) position is the center of the circle, and the grayscale distribution around it is calculated. The 360-degree direction angle is divided into 4 to 8 directions with a unit interval of 45 degrees. 1 Determine whether the gradient of pixels in each direction is greater than the preset threshold as the starting point. When the gradient of a pixel is greater than the preset threshold and the gradient of the previous pixel is less than or equal to the preset threshold, the pixel is taken as the target contour point. An initial contour is obtained by determining the points where the gradient of each direction is greater than the threshold (the threshold is set to 20 in the embodiment of the present invention), and the minimum bounding rectangle of the target is calculated to obtain the size of the target frame. If the length and width of the target frame are both smaller than the fixed size of the template, the initial scale factor Scale 1 Initialized to 1.0, otherwise the initial scale factor Scale 1Initialized as Rect 1 / MaskSize ratio.
[0052] 2. According to the target position P 1 and the initial scale factor Scale 1 Create a template Mask. The method to create a template is:
[0053] The template Mask is gridded, the template step size of the central area is 1, and the template step size of the surrounding area is m (m>1). 1 Centered by the scale factor Scale 1 After scaling, the image data of the corresponding points are read in a certain order to complete the template creation. t Bilinear interpolation is used when scaling the original image.
[0054] 3. For non-first frame images, first search for alternate points within a certain search range. Taking each point as the center, take out a region block of the same size as the template according to the point selection method when creating the template, and perform normalized correlation operation with the template to obtain a correlation coefficient matrix. The points corresponding to the largest N (5 in this implementation) correlation coefficients in the matrix are used as the preliminary predicted target point position P in the frame image. t n ; Then use N predicted positions P t n As the center point, in the surrounding area (3*3 in this embodiment), the above area blocks are obtained point by point, and the normalized cross-correlation operation is performed with the template Mask to obtain the correlation coefficient matrix. The largest corresponding point in the correlation coefficient matrix is confirmed as the accurate first matching position P t and the first confidence R t .
[0055] Fourth, predict the scale factor Scale based on the scale change of the target in two adjacent frames t ', in this embodiment, the scale change rate is in the range of 1.02 to 1.07, which is adjusted according to the actual application scenario, and the predicted scale factor Scale t 'By the current scale factor Scale t Multiply the scale change of the target in two adjacent frames to get the image scale. t ' times, within the search range, the above area block is also obtained and the template Mask is correlated to obtain the accurate second matching position P t ' and the second confidence R t '.
[0056] 5. According to the first matching confidence R t and the second confidence Rt 'Judge whether the scale factor needs to be updated. If R t 0.95 times of ' is still greater than R t , and P t and P t 'The position is close (in this embodiment, P t and P t ' position is less than 3 pixels), then update the current scale factor and output the matching position as P t '; Otherwise the scale factor remains unchanged and the output matching position is P t .
[0057] The present invention also provides a computer program product, comprising a computer program, which implements the steps of the above method when executed by a processor.
[0058] Example 1
[0059] like Figure 1 As shown, the specific steps of this embodiment are as follows:
[0060] Step 1: First, according to the pixel position P of the target center point in the first frame image 1 (x, y) position determines the target area to be tracked and the initial scale factor Scale 1 ; 1 (x, y) is the center, the target area is locally segmented, the target edge is found, the target contour points are extracted, the target minimum outer bounding rectangle is calculated, and the target box Rect is determined by expanding the minimum outer bounding rectangle by 4 pixels. 1 Size, such as Figure 2 As shown. If the target box Rect 1 If both the length and width are smaller than the template fixed size MaskSize, then Scale 1 Initialized to 1.0, otherwise Scale 1 Initialized to min(Rect 1 .width,Rect 1 .height) / MaskSize.
[0061] Step 2: According to the target position P 1 and the initial scale factor Scale 1 Create a template Mask. The method of creating a template is: grid the template Mask, the template step size of the center area is 1, the template step size of the surrounding area is 2, and the image is scaled according to the scale factor 1 After scaling using bilinear interpolation, the target position P 1 (x, y) is the center, and the image data of the corresponding points are read in a certain order, such as Figure 3As shown in (a), each small grid in the figure represents a pixel. The red and black colors are the read image data. The pixels are arranged smoothly to complete the template creation. The template effect is as follows Figure 3 (b) as shown.
[0062] Step 3: For non-first frame images, record them as t-th frame images, t>1, in the t-th frame image, the target position P of the previous frame is t (x, y) is the center, and every other point is searched within a certain search range. That is, with each pixel as the center point, a region block with the same size as the template Mask and the same point selection method as the template creation is taken. The taken region block is normalized and correlated with the template Mask to obtain a correlation coefficient matrix; the pixel points corresponding to the largest 5 correlation coefficients in the correlation coefficient matrix are taken as P t n . Then take 5 predicted positions P t n As the center point, in the surrounding area (take 3*3), obtain the above area blocks point by point, perform normalized cross-correlation operation with the template Mask, and obtain the correlation coefficient matrix. The largest corresponding point in the correlation coefficient matrix is confirmed as the accurate matching position P t and confidence R t .
[0063] The basic principle of the normalized correlation tracking algorithm is as follows: In a certain search area of the image (or the entire image), take each point I (i, j) as the center and take a block of the same size as the template to perform a normalized correlation operation with the template to obtain a correlation coefficient matrix. The point corresponding to the maximum correlation coefficient in the matrix is used as the position of the target point in the image. The normalized correlation coefficient calculation formula is as follows:
[0064]
[0065] Where:
[0066] r(s,t): normalized correlation coefficient at the search point (s,t);
[0067] M, N: template size is M×N;
[0068] T(i,j) is the gray value at the template midpoint (i,j), is the template grayscale mean;
[0069] I(i,j) is the gray value at point (i,j) in the area block centered at point (s,t) in the image. is the grayscale mean of the block in this area;
[0070] Step 4: Predict the scale factor based on the scale change rate t', the general scale change rate is in the range of 1.02 to 1.07, which is adjusted according to the actual application scenario. In this embodiment, the value is 1.04, and the prediction scale factor Scale t 'By the current scale factor Scale t Multiply the scale change rate to get the image according to the predicted scale factor Scale t The bilinear interpolation method is used for scaling to obtain new image data to be matched.
[0071] Step 5: Based on the scaled new image data to be matched, similar to the method in step 3, within the fixed search range, take each search point as the center, take the area block with the same size as the template Mask according to the point selection method of creating the template, perform normalized cross-correlation operation, and obtain N predicted positions P t ' n ; Then use N predicted positions P t ' n Take the center point as the center point, and take out the area blocks with the same size as the template Mask point by point in the surrounding 3*3 area, perform normalized cross-correlation operation, and get the accurate matching position P t ' and confidence R t '.
[0072] Step 6: Match the confidence R based on the two scales t and R t 'Judgement, if R t 0.95 times of ' is still greater than R t , and P t and P t 'If the position is less than 3 pixels, update the current scale factor and output the matching position as P t '; Otherwise the scale factor remains unchanged and the output matching position is P t .
[0073] According to the above steps, the improved template matching tracking algorithm was completed and a simulation test was carried out to verify the effect. Figure 4 As shown, (a) is a schematic diagram of the 1st frame image, (b) is a schematic diagram of the 300th frame image, (c) is a schematic diagram of the 450th frame image, and (d) is a schematic diagram of the 650th frame image. The white box is the template matching result. It can be seen that the target of the present invention obtains stable and accurate tracking effects at different scales.
[0074] The above description is only the best specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.
[0075] The contents not described in detail in the specification of the present invention belong to the common knowledge of the professionals in this field.
Claims
1. An improved target tracking method based on template matching, characterized in that: include: The target center point position in the t-th frame image is recorded as P t , the scale factor is denoted as Scale t , t is an integer greater than or equal to 1; When t=1, the target size Rect1 in the first frame image is detected according to the target center point position P1 in the first frame image; the target size Rect1 is compared with the template fixed size MaskSize, the initial scale factor Scale1 is determined, the image is scaled by Scale1 and a template Mask is created; When t>1, each frame of the image executes the following steps S1 to S5 cyclically: S1. Scale the tth frame image t times, within the fixed search range SearchArea, according to the point selection method of creating the template, take out the area block with the same size as the template Mask at every other point, perform normalized cross-correlation operation, and obtain N predicted positions P t n ; S2, using the N predicted positions P t n As the center point, take out the area blocks with the same size as the template Mask point by point in the surrounding area, perform normalized cross-correlation operation, and get the first matching position P t and the first confidence R t ; S3, determine the scale factor Scale according to the scale change of the target in two adjacent frames of images t ', scale the tth frame image t ' times, within the fixed search range SearchArea, according to the point selection method of creating the template, take out the area block with the same size as the template Mask at every other point, perform normalized cross-correlation operation, and obtain N predicted positions P t ' n ; S4, using the N predicted positions P t ' n As the center point, take out the area blocks with the same size as the template Mask point by point in the surrounding area, perform normalized cross-correlation operation, and obtain the second matching position P t ' and the second confidence R t '. S5. According to the first matching confidence R t and the second confidence R t 'Determine whether the scale factor needs to be updated. If so, update the current scale factor and output the matching position as P t '; Otherwise, the scale factor remains unchanged and the output matching position is P t .
2. The improved template matching-based target tracking method according to claim 1, characterized in that: The method for determining the target size Rect1 and the initial scale factor Scale1 in the first frame image according to the target center point position P1 in the first frame image includes: Taking the target center point position P1 in the first frame image as the center, perform local segmentation on the target area to obtain the target contour points; The minimum outer bounding rectangle of the target is obtained according to the target contour points, and the minimum outer bounding rectangle is expanded by 3 to 5 pixels to obtain the target frame Rect1; If Rect1 is smaller than the template fixed size MaskSize, Scale1 is initialized to 1.0, otherwise Scale1 is initialized to the ratio of Rect1 / MaskSize.
3. The improved template matching-based target tracking method according to claim 2, characterized in that: The method of locally segmenting the target region range with the target center point position P1 in the first frame image as the center to obtain the target contour points includes: The area around the target center point position P1 is evenly divided into multiple directions, and P1 is used as the starting point to determine whether the gradient of the pixels in each direction is greater than the preset threshold. When the gradient of a pixel is greater than the preset threshold and the gradient of the previous pixel is less than or equal to the preset threshold, the pixel is taken as the target contour point.
4. The improved template matching-based target tracking method according to claim 3, characterized in that: The area around the target center point position P1 is evenly divided into 4 to 8 directions; the preset threshold value is 20.
5. The improved template matching-based target tracking method according to claim 1, characterized in that: When t=1, the method of creating the template Mask includes: The template Mask is gridded, the template step size of the central area is 1, and the template step size of the surrounding area is m, satisfying m>1. Taking the target center point position P1 as the center, the image is scaled according to the scale factor Scale1, and the image data of the corresponding points are read in sequence to complete the template creation.
6. The improved template matching-based target tracking method according to claim 1, characterized in that: According to the scale factor Scale t The image is scaled and the processing method is open bilinear interpolation.
7. The improved template matching-based target tracking method according to claim 1, characterized in that: Get the first matching position P t and the first confidence R t methods, including: In the fixed search range SearchArea, obtain the area block with the same size as the template Mask at every other point, perform normalized correlation operation with the template Mask, and obtain the correlation coefficient matrix; The pixel points corresponding to the largest N correlation coefficients in the correlation coefficient matrix are taken as With N predicted positions Take the center point as the center point, obtain the area blocks with the same size as the template Mask point by point in the surrounding area, perform normalized cross-correlation operation with the template Mask, and obtain the correlation coefficient matrix. The largest corresponding point in the correlation coefficient matrix is taken as the first matching position P t and confidence R t .
8. The improved template matching-based target tracking method according to claim 7, characterized in that: The value of N is 5; the surrounding area is 3*3 pixels.
9. The improved template matching-based target tracking method according to claim 1, characterized in that: In step S3, the scale factor Scale is predicted according to the scale change of the target in two adjacent frames of images. t ', the scale change of the target in two adjacent frames is in the range of 1.02 to 1.07, and the predicted scale factor Scale t 'By the current scale factor Scale t Multiply by the scale change to obtain.
10. The improved template matching-based target tracking method according to claim 1, characterized in that: Get the second matching position P t ' and the second confidence R t ' methods, including: Scale the image t ' times, within the fixed search range SearchArea, obtain the area block with the same size as the template Mask at every other point, perform normalized correlation operation with the template Mask, and obtain the correlation coefficient matrix; The pixel points corresponding to the largest N correlation coefficients in the correlation coefficient matrix are taken as P t ' n ; With N predicted positions P t ' n Take the center point as the center point, obtain the area blocks with the same size as the template Mask point by point in the surrounding area, perform normalized cross-correlation operation with the template Mask, and obtain the correlation coefficient matrix. The largest corresponding point in the correlation coefficient matrix is used as the second matching position P t ' and the second confidence R t '.
11. The improved template matching-based target tracking method according to claim 1, characterized in that: In step S5, according to the first matching confidence R t and the second confidence R t 'Judge whether the scale factor needs to be updated. If R t 0.95 times of ' is still greater than R t , and P t and P t 'If the position is less than 3 pixels, update the current scale factor and output the matching position as P t '; Otherwise, the scale factor remains unchanged and the output matching position is P t .
12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to claim 1 are implemented.
Citation Information
Patent Citations
Target tracking algorithm based on scale adaptive correlation filtering and feature point matching
CN106815859A
A target detection and tracking method based on a DSP
CN109685827A
A target scale adaptive tracking method based on OpenCV
CN109949340A
Robustness long-time tracking method based on correlation filtering
CN113327272A
Urban overhead small unmanned aerial vehicle target tracking method and system
CN118447055A