A method and system for tracking a moving target

CN118297983BActive Publication Date: 2026-10-16NAVAL AVIATION UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410508178.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-25
Publication Date
2026-10-16
Estimated Expiration
2044-04-25

AI Technical Summary

Technical Problem

但是这种设定滑动步长的方法降低了匹配的精度,影响跟踪性能

Benefits of technology

[0067] 1. The method proposed in this invention performs coarse matching first and then fine matching when determining the matching sub-image. During coarse matching, the coarse matching sliding point is determined based on the number of coarse matching sliding intervals. The template image is then slid along the coarse matching sliding point on the matching region. This sliding method helps to increase the sliding interval. After coarse matching, z reference sub-images are obtained. During fine matching, the fine matching sliding point is obtained based on the z reference sub-images, and then sliding is performed on the fine matching sliding point. This helps to reduce the amount of computation while improving the matching accuracy and tracking performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118297983B_ABST
    Figure CN118297983B_ABST
Patent Text Reader

Abstract

The present application belongs to the field of target tracking, and particularly relates to a moving target tracking method and system, which can both: select a moving target to be tracked in a current frame of real-time images, and create a template image; set a matching area around the moving target in a next frame of real-time images; set a KxK reference point array on the matching area, each element of the reference point array being a reference point; set a coarse matching sliding interval number, obtain coarse matching sliding points in the reference points based on the coarse matching sliding interval number, and obtain z reference subgraphs based on the coarse matching sliding points; obtain fine matching sliding points based on the z reference subgraphs, and obtain a fine matching subgraph based on the fine matching sliding points; determine a target matching subgraph in the fine matching subgraph; and update the template image by using a weighted merging method of the matching subgraph and the template image. The present application is used for improving tracking performance, suppressing template drift, and improving tracking effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of target tracking, specifically relating to a method and system for tracking moving targets. Background Technology

[0002] Moving target tracking technology is an emerging research direction in recent years. For example, it is a key technology in photoelectric detection equipment. Its purpose is to locate the target in each frame of a video sequence and achieve tracking of moving targets.

[0003] Currently, template matching is a commonly used method for tracking moving targets. Its basic idea is to create a template image based on the target to be tracked, set a matching region around the target, and then search within the matching region to find the sub-image with the highest similarity, i.e., the matching sub-image. The new target is then determined based on the matching sub-image. After determining the matching sub-image, the template image is updated for target tracking in the next frame.

[0004] When the aforementioned tracking method searches within the matching region, the template image slides according to a set sliding step size. After each slide, it is calculated with the sub-image it covers. In high-speed airborne environments, to reduce computational load and track high-speed moving targets, a larger sliding step size is generally set. However, this method of setting the sliding step size reduces matching accuracy and affects tracking performance. Furthermore, when environmental factors (such as fog) or noise cause target deformation or partial occlusion, multiple sub-images with the highest similarity may exist. When updating the template, a sub-image with the highest similarity to the template image is usually randomly selected as the new template image for subsequent tracking. This method often leads to error accumulation after multiple frames, which can easily cause template drift, making the updated template image no longer accurately represent the original target and affecting tracking performance. Summary of the Invention

[0005] To address at least one of the above-mentioned problems, this invention provides a moving target tracking method and system to improve tracking performance, suppress template drift, and enhance tracking effectiveness.

[0006] In a first aspect, the present invention provides a method for tracking a moving target, comprising the steps of:

[0007] S1: Select the moving target to be tracked in the current frame of the real-time image and create a template image; the template image is an M×N image, where M is the width of the template image in pixels and N is the height of the template image in pixels, and both M and N are even numbers;

[0008] S2: In the next frame of the real-time image, a matching region is set around the moving target;

[0009] S3: A region remaining after removing N / 2 rows of pixels on each of both sides in the height direction and M / 2 rows of pixels on each of both sides in the width direction of the matching region is defined as a target region; a K×K reference point array is set on the matching region, each element on the reference point array is a reference point, four vertexes of the reference point array are four vertexes of the target region, a column spacing of the rectangular array is defined as x pixels, a row spacing of the rectangular array is defined as y pixels, and x is less than M / 2 and y is less than N / 2;

[0010] S4: Based on a preset coarse matching sliding interval number, reference points for coarse matching sliding are determined on the reference point array and are recorded as coarse matching sliding points, the template image slides on the matching region along each coarse matching sliding point, that is, coarse matching sliding is performed, each time of sliding, the similarity between the template image and the subgraph covered by the template image is analyzed respectively, after the coarse matching sliding is completed, z subgraphs with the maximum similarity to the template image are obtained, and centers of the z subgraphs correspond to z reference points; the value of z is less than the number of subgraphs covered by the coarse matching sliding of the template image on the matching region; the coarse matching sliding interval number is the number of reference points spaced in each sliding of the coarse matching sliding; the z subgraphs are z reference subgraphs;

[0011] S5: Reference points contained in a preset neighborhood of the center of each subgraph in the z reference subgraphs are acquired, a group of fine matching sliding points are obtained by summarization, the template image slides on the matching region along each fine matching sliding point, that is, fine matching sliding is performed, each time of sliding, the similarity between the template image and the subgraph covered by the template image is analyzed and the z reference subgraphs are updated once, after the sliding is completed, the latest z reference subgraphs are obtained, the latest z reference subgraphs are the z subgraphs with the maximum similarity to the template image covered in the coarse matching sliding and the fine matching sliding of the template image, which are recorded as z fine matching subgraphs;

[0012] S6: One subgraph that best matches the template image is found from the z fine matching subgraphs and determined as a target matching subgraph;

[0013] S7: The position where the target matching subgraph is located is the position of the tracked moving target in the next frame of image;

[0014] S8: The template image is updated by adopting a method of weighted merging of the target matching subgraph and the template image, then, by using the updated template image and the current position of the moving target, the process returns to step S2 to continue executing target tracking of the next frame until the tracking is finished.

[0015] Further, the expression of the matching region in step S2 is as follows:

[0016]

[0017]

[0018] Where F represents the matching region, R represents the moving target to be tracked, and x F and y F To match the x and y coordinates of the center of region F, x R and y R The x and y coordinates of the center point of the region where the moving target R is located are represented, V is the full field of view image corresponding to the next frame image, and W is the center point of the region where the moving target R is located. V W F W R These represent the widths of V, F, and R, respectively; H V H F H R These represent the heights of V, F, and R, respectively.

[0019] Furthermore, the similarity between the template image and each sub-image of its sliding overlay is represented by a nearest neighbor distance, which is calculated using the following formula:

[0020]

[0021]

[0022]

[0023] Where D(T,S) is the nearest neighbor distance, T is the template image, S is the sub-image covered by the template image, and i and j are the pixel coordinates of the relatively opposite pixels in the template image and its covered sub-image. When the pixel coordinates of the relatively opposite pixels in the template image and its covered sub-image are (i,j), w i,j The weights for the corresponding center weighting are given, where C is a constant greater than 1;

[0024] T i,j S represents the grayscale value of pixel (i,j) in the template image. i,j Let |T| be the gray value of pixel (i,j) on the subimage covered by the template image. i,j -S i,j | represents the absolute difference in grayscale between pixel (i,j) on the template image and pixel (i,j) on the subimage it covers; H is the similarity threshold; M is the width of the template image in pixels; and N is the height of the template image in pixels.

[0025] R(T i,j ,S i,j ) is an intermediate value.

[0026] Further, step S4 includes:

[0027] Set the coarse matching sliding interval number, which includes the row interval number a and the column interval number b. The row interval number a is a positive integer and satisfies that the horizontal sliding distance does not exceed M each time, and the column interval number b is a positive integer and satisfies that the vertical sliding distance does not exceed N.

[0028] The reference point at the top left corner of the reference point array is designated as the coarse matching sliding point. In the first row of reference points, each reference point corresponding to an interval of row interval 'a' is designated as a coarse matching sliding point. When the last sliding interval of the first row is less than an interval of row interval 'a', the last reference point of the first row is designated as a coarse matching sliding point. In the column corresponding to each coarse matching sliding point in the first row, each reference point corresponding to an interval of column interval 'b' is designated as a coarse matching sliding point. When the last sliding interval of each column is less than an interval of column interval 'b', the last reference point of each column is designated as a coarse matching sliding point. Thus, all coarse matching sliding points used for coarse matching sliding on the reference point array are obtained.

[0029] Pre-set the sum threshold value L.

[0030] The z mentioned above is preset;

[0031] Slide the center of the template image to the position of the coarse matching sliding point at the top left corner of the reference point array to obtain the sub-image covered by the template image, and calculate and record the nearest neighbor distance between the template image and the sub-image it covers.

[0032] Let the template image slide along the coarse matching sliding point. After each slide, the center of the template image is placed at the coarse matching sliding point. Before the template image slides z times, a sub-image covered by the template image is obtained after each slide. The nearest neighbor distance between the template image and the sub-image it covers is calculated and recorded. After the template image slides z times, z sub-images covered by the template image and their corresponding nearest neighbor distances are obtained. The z sub-images covered by the template image are recorded as z reference sub-images.

[0033] After obtaining z reference subgraphs, the value of the cumulative threshold L is updated to the largest nearest neighbor distance among the nearest neighbor distances of the z reference subgraphs.

[0034] When the number of slides of the template image is greater than z, each slide yields a sub-image covered by the template image. The nearest neighbor distance between the template image and its covered sub-image is calculated, and the calculated nearest neighbor distance is compared with the current value of the cumulative threshold L. If the nearest neighbor distance is less than the cumulative threshold L, the nearest neighbor distance is recorded, and the reference sub-image with the largest nearest neighbor distance in the original reference sub-image is replaced with the sub-image covered by the current template image. The value of the cumulative threshold L is updated to the largest nearest neighbor distance among all the current reference sub-images. This process continues until the slide is complete, at which point the coarse matching ends, and z reference sub-images and their corresponding nearest neighbor distances are obtained.

[0035] Further, step S5 includes:

[0036] Taking the reference point corresponding to the center of each reference subgraph as the center, obtain all reference points within the 3×3 neighborhood of the reference point corresponding to the center of each reference subgraph, and summarize them to obtain a set of fine matching sliding points;

[0037] The template image is slid one by one at the fine-matching sliding point. Each time it slides, the center of the template image is placed at the position of the fine-matching sliding point. Each slide results in a sub-image covered by the template image. The nearest neighbor distance between the template image and the sub-image it covers is calculated and compared with the current value of the cumulative threshold L. If the nearest neighbor distance is less than the cumulative threshold L, the nearest neighbor distance is recorded, and the reference sub-image with the largest corresponding nearest neighbor distance in the original reference sub-image is replaced with the sub-image covered by the current template image. Then, the value of the cumulative threshold L is updated to the largest nearest neighbor distance among all the current reference sub-images. This process continues until the sliding is complete. At this point, the fine-matching ends, and z latest reference sub-images and their corresponding nearest neighbor distances are obtained. The z latest reference sub-images are denoted as the z fine-matching sub-images.

[0038] Furthermore, in steps S4 and S5, during each calculation of the nearest neighbor distance between the template image and its covered sub-images, the sum of the intermediate values ​​is calculated and compared with the latest value of the sum threshold L. Once the sum is greater than the sum threshold L, it is determined that the sub-image at the corresponding position does not match, the calculation of the current nearest neighbor distance is terminated, and the template image is controlled to slide for the next time.

[0039] Further, step S6 includes:

[0040] The reference point corresponding to the center of the subgraph with the smallest nearest neighbor distance among the z finely matched subgraphs is recorded as the candidate matching point;

[0041] When the number of candidate matching points is unique, the candidate matching point is the target matching point, and the fine matching subgraph corresponding to the target matching point is the target matching subgraph.

[0042] When the number of candidate matching points is not unique, the average Hausdorff distance between the fine matching sub-image and the template image corresponding to each candidate matching point is calculated. The candidate matching point corresponding to the smallest calculated average Hausdorff distance is the target matching point, and the corresponding fine matching sub-image is the target matching sub-image.

[0043] Furthermore, the method for updating the template image in step S8 is as follows:

[0044] Image T' is obtained using the following formula:

[0045] T'=p×S m +(1-p)×T,

[0046] Among them, S m Let T be the target matching submap, p be the template image, and p be the pre-set target matching submap S. m The weights;

[0047] Update template image T using image T'.

[0048] Furthermore, in step S8, after each update of the template image, the similarity threshold H is updated accordingly;

[0049] In step S8, the method for updating the similarity threshold H each time includes:

[0050] The pre-defined similarity threshold H ranges from [H... min H max ];

[0051] H” is obtained using the following formula:

[0052] G = 1.0 - D min / D max ,

[0053]

[0054]

[0055] Where G is the template image T and the target matching sub-image S. m Match confidence, D min For template image T, match the target sub-image S m The nearest neighbor distance between them, where N is the number of candidate matching points;

[0056] Update the similarity threshold H using H”.

[0057] In a second aspect, the present invention provides a motion target tracking system configured to perform the aforementioned motion target tracking method, the system comprising:

[0058] A first module, configured to select a moving target to be tracked in a current frame of a real-time image, and create a template image; the template image is an M×N image, where M is the number of width pixels of the template image, N is the number of height pixels of the template image, and both M and N are even numbers;

[0059] A second module, configured to set a matching region around the moving target in the next frame of the real-time image;

[0060] A third module, configured to record a remaining region obtained by removing N / 2 rows of pixels on each of two sides in the height direction and M / 2 rows of pixels on each of two sides in the width direction of the matching region as a target region; set a K×K reference point array on the matching region, each element on the reference point array is a reference point, four vertices of the reference point array are four vertices of the target region, a column spacing of the rectangular array is recorded as x pixels, a row spacing of the rectangular array is recorded as y pixels, and x is less than M / 2 and y is less than N / 2;

[0061] A fourth module, configured to determine reference points for coarse matching sliding on the reference point array based on a preset number of coarse matching sliding intervals, and record the reference points as coarse matching sliding points; slide the template image on the matching region along each coarse matching sliding point, that is, perform coarse matching sliding; after each sliding, analyze the similarity between the template image and the subgraph covered by the template image respectively; after the coarse matching sliding is completed, obtain z subgraphs with the highest similarity to the template image, and centers of the z subgraphs correspond to z reference points; the value of z is less than the number of subgraphs covered by the template image through coarse matching sliding on the matching region; the number of coarse matching sliding intervals is the number of reference points of the sliding interval for each coarse matching sliding; the z subgraphs are z reference subgraphs;

[0062] A fifth module, configured to obtain reference points contained in a preset neighborhood of the center of each of the z reference subgraphs, and collect the reference points to obtain a set of fine matching sliding points; slide the template image on the matching region along each fine matching sliding point, that is, perform fine matching sliding; after each sliding, analyze the similarity between the template image and the subgraph covered by the template image respectively and update the z reference subgraphs once; after the sliding is completed, obtain z latest reference subgraphs, where the z latest reference subgraphs are the z subgraphs with the highest similarity to the template image covered by the template image in the coarse matching sliding and the fine matching sliding, and are recorded as z fine matching subgraphs;

[0063] A sixth module, configured to find a subgraph that best matches the template image from the z fine matching subgraphs, and determine the subgraph as a target matching subgraph;

[0064] A seventh module, configured to determine that the position where the target matching subgraph is located is the position of the moving target tracked in the next frame;

[0065] The eighth module is used to update the template image by weighted merging of the target matching sub-image and the template image. Then, using the updated template image and the current position of the moving target, it proceeds to step S2 to continue target tracking in the next frame until the tracking ends.

[0066] The beneficial effects of this invention are as follows:

[0067] 1. The method proposed in this invention performs coarse matching first and then fine matching when determining the matching sub-image. During coarse matching, the coarse matching sliding point is determined based on the number of coarse matching sliding intervals. The template image is then slid along the coarse matching sliding point on the matching region. This sliding method helps to increase the sliding interval. After coarse matching, z reference sub-images are obtained. During fine matching, the fine matching sliding point is obtained based on the z reference sub-images, and then sliding is performed on the fine matching sliding point. This helps to reduce the amount of computation while improving the matching accuracy and tracking performance.

[0068] 2. The method proposed in this invention updates the template image by weighted merging of the matching sub-image and the template image, instead of directly using the matching sub-image as the new template image. This improves the robustness of the template image, helps to avoid error accumulation after multiple frames, suppresses template drift, and improves the tracking effect.

[0069] Therefore, it is evident that the present invention has outstanding substantive features and significant progress compared with the prior art, and the beneficial effects of its implementation are also obvious. Attached Figure Description

[0070] Figure 1 This is a flowchart illustrating an image tracking method provided by the present invention.

[0071] Figure 2 This is a schematic diagram of the structure of an image tracking system provided by the present invention.

[0072] Figure 3 This is a schematic diagram showing the relative positional relationship between the full field of view image, the matching region, and the moving target.

[0073] Figure 4 This is a diagram illustrating the correlation comparison between the center-weighted template and the general template.

[0074] Figure 5 This is a schematic diagram illustrating a reference point array in one embodiment of the present invention.

[0075] Figure 6 This is a schematic diagram illustrating the distribution of coarse matching sliding points on a reference point array in one embodiment of the present invention.

[0076] Figure 7is a schematic diagram of reference points in a 3×3 neighborhood of the reference point corresponding to the center of a reference subgraph illustrated in an embodiment of the present invention.

[0077] Figure 8 is a schematic diagram of reference points in a 3×3 neighborhood of the reference point corresponding to the center of a reference subgraph illustrated in an embodiment of the present invention. Detailed Description of the Embodiments

[0078] To make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0079] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which the present invention belongs. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments, and are not intended to limit the present invention.

[0080] Figure 1 The present invention provides a moving object tracking method, which includes steps S1 to S8.

[0081] Step S1: Select the moving object to be tracked in the current frame of the real-time image, and create a template image; the template image is an M×N image, M is the number of width pixels of the template image, N is the number of height pixels of the template image, and both M and N are even numbers.

[0082] Step S2: In the next frame of the real-time image, set a matching area around the moving object.

[0083] Step S3: The remaining area after removing N / 2 rows of pixels on each side in the height direction and M / 2 rows of pixels on each side in the width direction on the matching area is defined as the target area; a K×K reference point array is set on the matching area, each element on the reference point array is a reference point, the four vertices of the reference point array are the four vertices of the target area, the column spacing of the rectangular array is x pixels, the row spacing is y pixels, x < M / 2 and y < N / 2.

[0084] Step S4: Based on the pre-set coarse matching sliding interval, determine the reference points for coarse matching sliding on the reference point array, denoted as coarse matching sliding points. Slide the template image along each coarse matching sliding point on the matching region, which is coarse matching sliding. After each slide, analyze the similarity between the template image and the sub-images it covers. After the coarse matching sliding is completed, obtain z sub-images with the highest similarity to the template image. The center of the z sub-images corresponds to z reference points. The value of z is less than the number of sub-images covered by the coarse matching sliding of the template image on the matching region. The coarse matching sliding interval is the number of reference points in each sliding interval of the coarse matching sliding. The z sub-images are z reference sub-images.

[0085] Step S5: Obtain the reference points contained in the preset neighborhood of the center of each of the z reference sub-images, and summarize them to obtain a set of fine matching sliding points. Slide the template image along each fine matching sliding point on the matching region, which is to perform fine matching sliding. Analyze the similarity between the template image and the sub-images it covers and update the z reference sub-images once after each slide. After the sliding is completed, obtain the z latest reference sub-images. These z latest reference sub-images are the z sub-images that have the greatest similarity to the template image covered by the template image in the coarse matching sliding and fine matching sliding, and are denoted as the z fine matching sub-images.

[0086] Step S6: Find the sub-image that best matches the template image among the z fine-matching sub-images and determine it as the target matching sub-image.

[0087] Step S7: The location of the target matching sub-image is the location of the tracked moving target in the next frame image.

[0088] Step S8: Update the template image by weighted merging of the target matching sub-image and the template image. Then, using the updated template image and the current position of the moving target, proceed to step S2 to continue target tracking in the next frame until the tracking ends.

[0089] It is understandable that after selecting the moving target to be tracked in step S1, the position of the moving target in the current frame is recorded at the same time. In step S2, a matching region is set around the moving target, that is, a matching region is set around the position of the moving target selected in step S1.

[0090] It should be noted that in step S3, using the four vertices of the target region as the four vertices of the reference point array ensures that when the template image slides to the reference point at the edge of the reference point array, it can cover the matching area outside the target region without exceeding the range of the matching area.

[0091] It should be noted that the template image is a rectangular image.

[0092] There are several ways to create a template image. For example, Method 1: Set the selection box size in advance, click on the moving target to be tracked, and select the template image based on the clicked position. Method 2: Draw a rectangle directly on the moving target to be tracked, and the image inside the rectangle is the template image.

[0093] When determining the matching sub-images, reference points for coarse matching sliding are first determined on the reference point array based on the number of coarse matching sliding intervals, denoted as coarse matching sliding points. The template image is then coarsely matched and slid along these sliding points across the matching region. After matching, z reference sub-images are obtained. This sliding method helps increase the sliding interval and reduce computational load, thus aiding in tracking high-speed moving targets. Fine matching sliding points are then obtained based on these z reference sub-images. The template image is then slid along each fine matching sliding point across the matching region. After sliding, a fine matching sub-image is obtained. This method expands the search range based on the z reference sub-images obtained from coarse matching, and then fine matching is performed, which helps improve matching accuracy and tracking performance.

[0094] When updating the template image, a weighted merging method of the matching subimage and the template image is adopted instead of directly using the matching subimage as the new template image. This improves the robustness of the template image, helps to avoid error accumulation after multiple frames, and slows down template drift.

[0095] Preferably, the expression for the matching region in step S2 is as follows:

[0096]

[0097]

[0098] Where F represents the matching region, R represents the moving target to be tracked, and x F and y F To match the x and y coordinates of the center of region F, x R and y R The x and y coordinates of the center point of the region where the moving target R is located are represented, V is the full field of view image corresponding to the next frame image, and W is the center point of the region where the moving target R is located. V W F W R These represent the widths of V, F, and R, respectively; H V H F H R These represent the heights of V, F, and R, respectively.

[0099] It should be noted that the matching area is a rectangular area.

[0100] like Figure 3This diagram illustrates the relative positional relationship between the full-field-of-view image, the matching region, and the moving target as described in this embodiment. In the diagram, V represents the full-field-of-view image, F represents the matching region, and R represents the moving target. Figure 3 As can be seen, the selected matching region F is not centered on the center of the moving target R, but rather includes the moving target R, but is biased towards the center point Vc of the field of view. This method of selecting the matching region combines the characteristics of the servo control system. In actual tracking, the servo system will "pull" the matching sub-map towards the center of the field of view; the farther the sub-map is from the center, the greater the pulling force. Based on this characteristic, the matching region selection method of this application actually maximizes the effective range of the matching search under limited computing power, thereby allowing for faster servo control speed.

[0101] Preferably, the similarity between the template image and each sub-image of its sliding overlay is represented by a nearest neighbor distance, which is calculated using the following formula:

[0102]

[0103]

[0104]

[0105] Where D(T,S) is the nearest neighbor distance, T is the template image, S is the sub-image covered by the template image, and i and j are the pixel coordinates of the relatively opposite pixels in the template image and its covered sub-image. When the pixel coordinates of the relatively opposite pixels in the template image and its covered sub-image are (i,j), w i,j The weights for the corresponding center weighting are given, where C is a constant greater than 1.

[0106] T i,j S represents the grayscale value of pixel (i,j) in the template image. i,j Let |T| be the gray value of pixel (i,j) on the subimage covered by the template image. i,j -S i,j | represents the absolute difference in grayscale between pixel (i,j) on the template image and pixel (i,j) on the subimage it covers; H is the similarity threshold; M is the width of the template image in pixels; and N is the height of the template image in pixels.

[0107] R(T i,j ,S i,j ) is an intermediate value.

[0108] It is understandable that when the absolute difference in grayscale between pixel (i,j) on the template image and pixel (i,j) on the subimage it covers is greater than the similarity threshold H, R(T) i,j ,S i,j ) for w i,jOtherwise R(T) i,j ,S i,j If ) is 0, then R(T) is set to 0 for all pixels in the template image and all corresponding pixels in the sub-image it covers. i,j ,S i,j The sum D(T,S) obtained by accumulating is the nearest neighbor distance.

[0109] It should be noted that the similarity analysis of the template image and its covered sub-image in steps S4 and S5 is expressed as the nearest neighbor distance between the template image and its covered sub-image.

[0110] The nearest neighbor distance between the template image and its covered subimages is simply referred to as the nearest neighbor distance of the corresponding subimage.

[0111] It should be noted that the greater the nearest neighbor distance between the template image and its covered subimages, the smaller the similarity between the template image and its covered subimages.

[0112] In this embodiment, the coordinate system corresponding to the pixel coordinates of the template image is established with the center of the template image as the origin, and the coordinate system corresponding to the pixel coordinates of each sub-image is established with the center of each sub-image as the origin.

[0113] The center of the template image changes very little between frames. Therefore, center-weighted processing of the template ensures that the contribution rate of template pixels in the calculation decreases from the center to the edge, thus improving the ability to resist target deformation and local occlusion. A larger value of C indicates a greater proportion of pixels closer to the template center. However, the value of C cannot be too large; otherwise, the contribution rate of pixels far from the template center in the matching process will be negligible. For example, for a 28×28 pixel template, the value of C is generally between 1.1 and 1.5. Center-weighted processing can improve the steepness of the correlation peak, better handling situations such as small-scale target distortion and partial occlusion of target edges. Figure 4 This is a correlation matching comparison between a center-weighted template and a general template for a certain scenario. As can be seen from the figure, using a center-weighted template can improve the steepness of the correlation peak.

[0114] Preferably, step S4 includes:

[0115] Set the coarse matching sliding interval number, which includes the row interval number a and the column interval number b. The row interval number a is a positive integer and satisfies that the horizontal sliding distance does not exceed M each time, and the column interval number b is a positive integer and satisfies that the vertical sliding distance does not exceed N.

[0116] The reference point at the top left corner of the reference point array is designated as the coarse matching sliding point. In the first row of reference points, each reference point corresponding to an interval of row interval 'a' is designated as a coarse matching sliding point. When the last sliding interval of the first row is less than an interval of row interval 'a', the last reference point of the first row is designated as a coarse matching sliding point. In the column corresponding to each coarse matching sliding point in the first row, each reference point corresponding to an interval of column interval 'b' is designated as a coarse matching sliding point. When the last sliding interval of each column is less than an interval of column interval 'b', the last reference point of each column is designated as a coarse matching sliding point. Thus, all coarse matching sliding points used for coarse matching sliding on the reference point array are obtained.

[0117] Pre-set the sum threshold value L.

[0118] The z mentioned above is preset.

[0119] Slide the center of the template image to the position of the coarse matching sliding point at the top left corner of the reference point array to obtain the sub-image covered by the template image, and calculate and record the nearest neighbor distance between the template image and the sub-image it covers.

[0120] Let the template image slide along the coarse matching sliding point. After each slide, the center of the template image is placed at the coarse matching sliding point. Before the template image slides z times, a sub-image covered by the template image is obtained after each slide. The nearest neighbor distance between the template image and the sub-image it covers is calculated and recorded. After the template image slides z times, z sub-images covered by the template image and their corresponding nearest neighbor distances are obtained. The z sub-images covered by the template image are recorded as z reference sub-images.

[0121] After obtaining z reference subgraphs, the cumulative threshold value L is updated to the largest nearest neighbor distance among the nearest neighbor distances corresponding to the z reference subgraphs.

[0122] When the number of slides of the template image is greater than z, each slide yields a sub-image covered by the template image. The nearest neighbor distance between the template image and its covered sub-image is calculated, and the calculated nearest neighbor distance is compared with the current value of the cumulative threshold L. If the nearest neighbor distance is less than the cumulative threshold L, the nearest neighbor distance is recorded, and the reference sub-image with the largest nearest neighbor distance in the original reference sub-image is replaced with the sub-image covered by the current template image. The value of the cumulative threshold L is updated to the largest nearest neighbor distance among all the current reference sub-images. This process continues until the slide is complete, at which point the coarse matching ends, and z reference sub-images and their corresponding nearest neighbor distances are obtained.

[0123] Figure 5 This is a schematic diagram of a 20×20 reference point array, i.e., the array... Figure 5 Each dot shown represents a reference point. Figure 5 When the row interval a = 1 and the column interval b = 1, the coarse matching sliding points obtained by the reference point array are as follows: Figure 6 As shown by the square dot.

[0124] It should be noted that the set accumulation and threshold values... Let M be the initial value of the summation threshold, where M is the width of the template image in pixels and N is the height of the template image in pixels. When the pixel coordinates of a pixel in the template image are (i,j), w i,j The weights are assigned to the corresponding center for weighted processing.

[0125] In practice, those skilled in the art can set the value of z based on the values ​​of M, N, a, and b and the size of the matching region. The value of z should not be too small. Based on experience, the number of coarse matching sliding points obtained based on the values ​​of M, N, a, and b and the size of the matching region is much greater than 15. In this case, z can be set to 15.

[0126] As a preferred embodiment of the present invention, step S5 includes:

[0127] Taking the reference point corresponding to the center of each reference subgraph as the center, obtain all reference points within the 3×3 neighborhood of the reference point corresponding to the center of each reference subgraph, and summarize them to obtain a set of fine-matching sliding points.

[0128] The template image is slid one by one at the fine-matching sliding point. Each time it slides, the center of the template image is placed at the position of the fine-matching sliding point. Each slide results in a sub-image covered by the template image. The nearest neighbor distance between the template image and the sub-image it covers is calculated and compared with the current value of the cumulative threshold L. If the nearest neighbor distance is less than the cumulative threshold L, the nearest neighbor distance is recorded, and the reference sub-image with the largest corresponding nearest neighbor distance in the original reference sub-image is replaced with the sub-image covered by the current template image. Then, the value of the cumulative threshold L is updated to the largest nearest neighbor distance among all the current reference sub-images. This process continues until the sliding is complete. At this point, the fine-matching ends, and z latest reference sub-images and their corresponding nearest neighbor distances are obtained. The z latest reference sub-images are denoted as the z fine-matching sub-images.

[0129] Understandably, for example, if the sub-image after the current replacement is the first reference sub-image, the second reference sub-image, the third reference sub-image, ..., the z-th reference sub-image, and the nearest neighbor distances between each sub-image and the template image are the first nearest neighbor distance, the second nearest neighbor distance, the third nearest neighbor distance, ..., the z-th nearest neighbor distance, the cumulative sum and threshold value L are updated to the largest nearest neighbor distance among all the nearest neighbor distances corresponding to the current reference sub-images, that is, the cumulative sum and threshold value L are updated to the largest nearest neighbor distance among the first nearest neighbor distance, the second nearest neighbor distance, the third nearest neighbor distance, ..., the z-th nearest neighbor distance.

[0130] It can be understood that the 3×3 neighborhood of the reference point corresponding to the center of each reference subgraph is the 3×3 neighborhood of the reference point corresponding to the center of each reference subgraph on the reference point array. When the reference point corresponding to the center of the reference subgraph is located at a vertex of the reference point array, there are 3 reference points in the 3×3 neighborhood; when the reference point corresponding to the center of the reference subgraph is located at other positions on the edge of the reference point array, there are 5 reference points in the 3×3 neighborhood; and when the reference point corresponding to the center of the reference subgraph is located at other positions in the reference point array, there are 8 reference points in the 3×3 neighborhood.

[0131] by Figure 7 For example, when the reference point corresponding to the center of the reference subgraph is located at the top left corner of the reference point array, there are 3 reference points in its 3×3 neighborhood, that is... Figure 7 The triangular point shown.

[0132] by Figure 8 For example, when the reference point corresponding to the center of the reference subgraph is located at another position in the reference point array, that is, inside the reference array, for example... Figure 8 The reference point enclosed by all triangle points has 8 reference points in its 3×3 neighborhood, i.e. Figure 8 The triangular point shown.

[0133] It should be noted that, in order to avoid the problem of repeated calculations at a reference point when sliding on the fine-matching sliding point, a check flag is set for each reference point, with an initial value of 0. Once the nearest neighbor distance of the corresponding subgraph has been calculated at the reference point, the check flag is set to 1. When sliding on the fine-matching sliding point, if a reference point with a check flag of 1 is encountered, it is skipped. This ensures that the calculation is performed at most once at each reference point.

[0134] Preferably, in steps S4 and S5, during each calculation of the nearest neighbor distance between the template image and its covered sub-images, the sum of the intermediate values ​​is calculated and compared with the latest value of the sum threshold L. Once the sum is greater than the sum threshold L, it is determined that the sub-image at the corresponding position does not match, the calculation of the current nearest neighbor distance is terminated, and the template image is controlled to slide for the next time.

[0135] For example, in a certain calculation, the cumulative sum threshold value L is taken as L1, based on the formula. For the intermediate value R(T) i,j ,S i,j When accumulating, if i has reached M and j has not reached N, and the sum of the intermediate values ​​is already greater than L1, then the calculation of the current nearest neighbor distance is terminated.

[0136] When adjusting the sum threshold L, the sum threshold L decreases monotonically, so that the accumulation process is terminated early when calculating the nearest neighbor distance at most non-matching points. It is not necessary to calculate all pixels in the template image and the sub-image it covers, which helps to further reduce the amount of computation.

[0137] Preferably, step S6 includes:

[0138] The reference point corresponding to the center of the subgraph with the smallest nearest neighbor distance among the z finely matched subgraphs is recorded as the candidate matching point.

[0139] When the number of candidate matching points is unique, the candidate matching point becomes the target matching point, and the fine matching subgraph corresponding to the target matching point becomes the target matching subgraph.

[0140] When the number of candidate matching points is not unique, the average Hausdorff distance between the fine matching sub-image and the template image corresponding to each candidate matching point is calculated. The candidate matching point corresponding to the smallest calculated average Hausdorff distance is the target matching point, and the corresponding fine matching sub-image is the target matching sub-image.

[0141] The average Hausdorff distance is a floating-point number, so it is almost impossible for multiple target matching points to remain in the final selection. Furthermore, since the number of candidate matching points is very small, using the average Hausdorff distance does not significantly increase the computational load. The method for determining matching subgraphs in this invention avoids random selection from multiple subgraphs with the highest similarity, further avoiding error accumulation when updating the template image and further mitigating template drift.

[0142] In a preferred embodiment of the present invention, the method for updating the template image in step S8 is as follows:

[0143] Image T' is obtained using the following formula:

[0144] T'=p×S m +(1-p)×T,

[0145] Among them, S m Let T be the target matching submap, p be the template image, and p be the pre-set target matching submap S. m The weight.

[0146] Update template image T using image T'.

[0147] Preferably, in step S8, after each update of the template image, the similarity threshold H is updated accordingly.

[0148] In step S8, the method for updating the similarity threshold H each time includes:

[0149] The pre-defined similarity threshold H ranges from [H... min H max ].

[0150] H” is obtained using the following formula:

[0151] G = 1.0 - D min / D max ,

[0152]

[0153]

[0154] Where G is the template image T and the target matching sub-image S. m Match confidence, D min For template image T, match the target sub-image S m The nearest neighbor distance between them, where N is the number of candidate matching points.

[0155] Update the similarity threshold H using H”.

[0156] It should be noted that p is an empirical value and can also be set according to the actual situation. For example, first calculate the matching confidence G between the template image and the matching sub-image, and then set different weights p according to the size of the matching confidence G. The larger the value of G, the larger p is.

[0157] In practice, a piecewise function can be set to match the confidence level G with the corresponding weight p. When the confidence level G changes, the weight p is automatically adjusted according to the piecewise function.

[0158] When adjusting the similarity threshold, if the number of candidate matching points N is not unique, the similarity threshold is quickly decreased to make the matching in the next frame more accurate. When the candidate matching point is unique, the similarity threshold is gradually increased to improve the tolerance to target deformation and lighting changes.

[0159] If the current matching confidence G < 0.8, it is likely due to drastic changes in the image. In this case, the similarity threshold should be set to a larger or maximum value. By dynamically adjusting the similarity threshold, the template drift problem is further mitigated, enabling more stable tracking over a longer period.

[0160] Figure 2 provides a moving target tracking system configured to execute the moving target tracking method, the system comprising:

[0161] First module: configured to select a moving target to be tracked in the current frame of a real-time image, and create a template image; the template image is an M×N image, M is the number of width pixels of the template image, N is the number of height pixels of the template image, and both M and N are even numbers.

[0162] Second module: configured to set a matching area around the moving target in the next frame of the real-time image.

[0163] Third module: configured to define a remaining area as a target area after removing N / 2 rows of pixels on each of both sides in the height direction and M / 2 rows of pixels on each of both sides in the width direction from the matching area; arrange a K×K reference point array on the matching area, each element on the reference point array is a reference point, four vertices of the reference point array are four vertices of the target area, the column spacing of the rectangular array is x pixels, the row spacing is y pixels, x<M / 2 and y<N / 2.

[0164] Fourth module: configured to determine reference points for coarse matching sliding on the reference point array based on a preset number of coarse matching sliding intervals, which are referred to as coarse matching sliding points, slide the template image on the matching area along each coarse matching sliding point to perform coarse matching sliding, analyze the similarity between the template image and the subgraph it covers after each sliding, and obtain z subgraphs with the highest similarity to the template image after the coarse matching sliding is completed, the centers of the z subgraphs correspond to z reference points; the value of z is less than the number of subgraphs covered by the template image through coarse matching sliding on the matching area; the number of coarse matching sliding intervals is the number of reference points of each sliding interval in the coarse matching sliding; the z subgraphs are z reference subgraphs.

[0165] Fifth module: configured to acquire reference points contained in a preset neighborhood of the center of each of the z reference subgraphs, collect them to obtain a set of fine matching sliding points, slide the template image on the matching area along each fine matching sliding point to perform fine matching sliding, analyze the similarity between the template image and the subgraph it covers and update the z reference subgraphs once after each sliding, obtain z latest reference subgraphs after the sliding is completed, the z latest reference subgraphs are the z subgraphs with the highest similarity to the template image among the subgraphs covered by the template image in the coarse matching sliding and the fine matching sliding, which are referred to as z fine matching subgraphs.

[0166] Sixth module: configured to find a subgraph that best matches the template image from the z fine matching subgraphs, and determine it as a target matching subgraph.

[0167] Module 7: The location of the target matching sub-image is the location of the tracked moving target in the next frame image.

[0168] The eighth module is used to update the template image by weighted merging of the target matching sub-image and the template image. Then, using the updated template image and the current position of the moving target, it proceeds to step S2 to continue target tracking in the next frame until the tracking ends.

[0169] The moving target tracking system proposed in this invention corresponds to the moving target tracking method described above, and can improve tracking performance, suppress template drift, and improve tracking effect.

[0170] The above-disclosed embodiments are merely preferred embodiments of the present invention, but the present invention is not limited thereto. Any non-creative variations that can be conceived by those skilled in the art, as well as any improvements and modifications made without departing from the principles of the present invention, should fall within the protection scope of the present invention.

Claims

1. A method for tracking moving targets, characterized in that, The method includes the steps: S1: Select a moving target to be tracked in the current frame of the real-time image, and create a template image; the template image is an M×N image, M is the number of width pixels of the template image, N is the number of height pixels of the template image, and both M and N are even numbers; S2: In the next frame of the real-time image, set a matching area around the moving target; Let the remaining area after removing N / 2 rows of pixels on each side in the height direction and M / 2 rows of pixels on each side in the width direction of the matching area be the target area; set a K×K reference point array on the matching area, each element on the reference point array is a reference point, the four vertices of the reference point array are the four vertices of the target area, let the column spacing of the rectangular array be x pixels, and the row spacing be y pixels, where x < M / 2 and y < N / 2; Based on the preset coarse matching sliding interval number, determine the reference points for coarse matching sliding on the reference point array, which are recorded as coarse matching sliding points, slide the template image on the matching area along each coarse matching sliding point, that is, perform coarse matching sliding, and analyze the similarity between the template image and the subgraph it covers for each slide; after the coarse matching sliding is completed, z subgraphs with the maximum similarity to the template image are obtained, and the centers of the z subgraphs correspond to z reference points; the value of z is less than the number of subgraphs covered by the coarse matching sliding of the template image on the matching area; the coarse matching sliding interval number is the number of reference points spaced per slide during the coarse matching sliding; the z subgraphs are z reference subgraphs; Obtain the reference points contained in the preset neighborhood of the center of each of the z reference subgraphs, collect them to obtain a set of fine matching sliding points, slide the template image on the matching area along each fine matching sliding point, that is, perform fine matching sliding, analyze the similarity between the template image and the subgraph it covers and update the z reference subgraphs once for each slide; after the sliding is completed, z latest reference subgraphs are obtained, which are the z subgraphs with the maximum similarity to the template image covered by the template image during the coarse matching sliding and the fine matching sliding, and are recorded as z fine matching subgraphs; Find a subgraph that best matches the template image among the z fine matching subgraphs, and determine it as the target matching subgraph; The position where the target matching subgraph is located is the position of the moving target tracked in the next frame image; Update the template image by using the weighted merging method of the target matching subgraph and the template image, then use the updated template image and the current position of the moving target, go to step S2 to continue performing target tracking for the next frame until the tracking ends.

2. The moving target tracking method according to claim 1, characterized in that, The expression of the matching area in step S2 is as follows: Where F represents the matching region, R represents the moving target to be tracked, and x F and y F To match the x and y coordinates of the center of region F, x R and y R The x and y coordinates of the center point of the region where the moving target R is located are represented, V is the full field of view image corresponding to the next frame image, and W is the center point of the region where the moving target R is located. V W F W R These represent the widths of V, F, and R, respectively; H V H F H R These represent the heights of V, F, and R, respectively.

3. The moving target tracking method according to claim 1, characterized in that, The similarity between the template image and each subgraph covered by its sliding is represented as a nearest neighbor distance, and the calculation formula of the nearest neighbor distance is as follows: Where D(T,S) is the nearest neighbor distance, T is the template image, S is the sub-image covered by the template image, and i and j are the pixel coordinates of the relatively opposite pixels in the template image and its covered sub-image. When the pixel coordinates of the relatively opposite pixels in the template image and its covered sub-image are (i,j), w i,j The weights for the corresponding center weighting are given, where C is a constant greater than 1; T i,j S represents the grayscale value of pixel (i,j) in the template image. i,j Let |T| be the gray value of pixel (i,j) on the subimage covered by the template image. i,j -S i,j | represents the absolute difference in grayscale between pixel (i,j) on the template image and pixel (i,j) on the subimage it covers; H is the similarity threshold; M is the width of the template image in pixels; and N is the height of the template image in pixels. R(T i,j ,S i,j ) is an intermediate value.

4. The moving target tracking method according to claim 3, characterized in that, Step S4 includes: Set the coarse matching sliding interval number, where the coarse matching sliding interval number includes a row interval number a and a column interval number b, the row interval number a is a positive integer and satisfies that the horizontal sliding distance per slide does not exceed M, and the column interval number b is a positive integer and satisfies that the longitudinal sliding distance per slide does not exceed N; The reference point at the top left corner of the reference point array is designated as the coarse matching sliding point. In the first row of reference points, each reference point corresponding to an interval of row interval 'a' is designated as a coarse matching sliding point. When the last sliding interval of the first row is less than an interval of row interval 'a', the last reference point of the first row is designated as a coarse matching sliding point. In the column corresponding to each coarse matching sliding point in the first row, each reference point corresponding to an interval of column interval 'b' is designated as a coarse matching sliding point. When the last sliding interval of each column is less than an interval of column interval 'b', the last reference point of each column is designated as a coarse matching sliding point. Thus, all coarse matching sliding points used for coarse matching sliding on the reference point array are obtained. Pre-set the sum threshold value L. The z mentioned above is preset; Slide the center of the template image to the position of the coarse matching sliding point at the top left corner of the reference point array to obtain the sub-image covered by the template image, and calculate and record the nearest neighbor distance between the template image and the sub-image it covers. Let the template image slide along the coarse matching sliding point. After each slide, the center of the template image is placed at the coarse matching sliding point. Before the template image slides z times, a sub-image covered by the template image is obtained after each slide. The nearest neighbor distance between the template image and the sub-image it covers is calculated and recorded. After the template image slides z times, z sub-images covered by the template image and their corresponding nearest neighbor distances are obtained. The z sub-images covered by the template image are recorded as z reference sub-images. After obtaining z reference subgraphs, the value of the cumulative threshold L is updated to the largest nearest neighbor distance among the nearest neighbor distances of the z reference subgraphs. When the number of slides of the template image is greater than z, each slide yields a sub-image covered by the template image. The nearest neighbor distance between the template image and its covered sub-image is calculated, and the calculated nearest neighbor distance is compared with the current value of the cumulative threshold L. If the nearest neighbor distance is less than the cumulative threshold L, the nearest neighbor distance is recorded, and the reference sub-image with the largest nearest neighbor distance in the original reference sub-image is replaced with the sub-image covered by the current template image. The value of the cumulative threshold L is updated to the largest nearest neighbor distance among all the current reference sub-images. This process continues until the slide is complete, at which point the coarse matching ends, and z reference sub-images and their corresponding nearest neighbor distances are obtained.

5. The moving target tracking method according to claim 4, characterized in that, Step S5 includes: Taking the reference point corresponding to the center of each reference subgraph as the center, obtain all reference points within the 3×3 neighborhood of the reference point corresponding to the center of each reference subgraph, and summarize them to obtain a set of fine matching sliding points; The template image is slid one by one on the fine matching sliding points. For each slide, the center of the template image is placed at the position of the slid fine matching sliding point, and a sub-image covered by the template image is obtained after each slide. The nearest neighbor distance between the template image and the covered sub-image is calculated, and the calculated nearest neighbor distance is compared with the current value of the cumulative sum threshold L. If the nearest neighbor distance is less than the cumulative sum threshold L, the nearest neighbor distance is recorded, the sub-image covered by the current template image is used to replace the reference sub-image with the largest corresponding nearest neighbor distance in the original reference sub-images, then the value of the cumulative sum threshold L is updated to the maximum nearest neighbor distance among the nearest neighbor distances corresponding to all current reference sub-images, until the sliding is completed. At this time, the fine matching is ended, and z latest reference sub-images and their corresponding nearest neighbor distances are obtained, and the z latest reference sub-images are denoted as z fine matching sub-images.

6. The moving target tracking method according to claim 5, characterized in that, In step S4 and step S5, during each process of calculating the nearest neighbor distance between the template image and the covered sub-image, every time the cumulative sum of the intermediate values is calculated, the cumulative sum is compared with the latest value of the cumulative sum threshold L. Once the cumulative sum is greater than the cumulative sum threshold L, it is determined that the sub-image at the corresponding position does not match, the calculation of the current nearest neighbor distance is terminated, and the template image is controlled to perform the next slide.

7. The moving target tracking method according to claim 6, characterized in that, Step S6 includes: The reference point corresponding to the center of the sub-image with the smallest nearest neighbor distance among the z fine matching sub-images is recorded as a candidate matching point; When the number of candidate matching points is unique, the candidate matching point is the target matching point, and the fine matching sub-image corresponding to the target matching point is the target matching sub-image; When the number of candidate matching points is not unique, the average Hausdorff distance between the fine matching sub-image corresponding to each candidate matching point and the template image is calculated, wherein the candidate matching point corresponding to the calculated minimum average Hausdorff distance is the target matching point, and the corresponding fine matching sub-image is the target matching sub-image.

8. The moving target tracking method according to claim 7, characterized in that, The method for updating the template image in step S8 is: The following calculation formula is used to obtain the image T': T'=p×S m +(1-p)×T, Among them, S m Let T be the target matching submap, p be the template image, and p be the pre-set target matching submap S. m The weights; The template image T is updated using the image T'.

9. The moving target tracking method according to claim 7, characterized in that, In step S8, after each update of the template image, the similarity threshold H is updated correspondingly; In step S8, the method for updating the similarity threshold H each time includes: The pre-defined similarity threshold H ranges from [H... min H max ]; The following calculation formula is used to obtain H'': G=1.0-D min / D max , Where G is the template image T and the target matching sub-image S. m Match confidence, D min For template image T, match the target sub-image S m The nearest neighbor distance between them, where N is the number of candidate matching points; The similarity threshold H is updated using H''.

10. A moving target tracking system configured to perform the moving target tracking method according to any one of claims 1-9, characterized in that, The system includes: First module: configured to select the moving target to be tracked in the current frame of the real-time image, and create a template image; the template image is an M×N image, M is the number of width pixels of the template image, N is the number of height pixels of the template image, and both M and N are even numbers; Second module: configured to set a matching area around the moving target in the next frame of the real-time image; Third module: configured to denote the remaining area after removing N / 2 rows of pixels on each side in the height direction and M / 2 rows of pixels on each side in the width direction of the matching area as the target area; a K×K reference point array is set on the matching area, each element on the reference point array is a reference point, four vertices of the reference point array are the four vertices of the target area, the column spacing of the rectangular array is denoted as x pixels, the row spacing is denoted as y pixels, and x<M / 2 and y<N / 2; The fourth module is used to determine reference points for coarse matching sliding on the reference point array based on a pre-set number of coarse matching sliding intervals. These reference points are denoted as coarse matching sliding points. The template image is then slid along each coarse matching sliding point in the matching region. This constitutes coarse matching sliding. After each slide, the similarity between the template image and the sub-images it covers is analyzed. After the coarse matching sliding is completed, z sub-images with the highest similarity to the template image are obtained. The centers of these z sub-images correspond to z reference points. The value of z is less than the number of sub-images covered by the coarse matching sliding of the template image in the matching region. The number of coarse matching sliding intervals is the number of reference points in each sliding interval of the coarse matching sliding. The z sub-images are z reference sub-images. The fifth module is used to obtain the reference points contained in the preset neighborhood of the center of each of the z reference sub-images, and summarize them to obtain a set of fine matching sliding points. The template image is slid along each fine matching sliding point on the matching region, which is to perform fine matching sliding. Each time it slides, the similarity between the template image and the sub-image it covers is analyzed and the z reference sub-images are updated. After the sliding is completed, the z latest reference sub-images are obtained. These z latest reference sub-images are the z sub-images that are most similar to the template image covered by the template image in the coarse matching sliding and fine matching sliding, and are denoted as z fine matching sub-images. Module 6: Used to find the sub-image that best matches the template image among z fine-matching sub-images, and determine it as the target matching sub-image; Module 7: The location of the target matching sub-image is the location of the tracked moving target in the next frame image; The eighth module is used to update the template image by weighted merging of the target matching sub-image and the template image. Then, using the updated template image and the current position of the moving target, it proceeds to step S2 to continue target tracking in the next frame until the tracking ends.

Citation Information

Patent Citations

  • Device and method for PTZ (planning, tilting and zooming) single-target automatic tracking

    CN102215377A

  • Television image moving target-based automatic tracking method

    CN103281476A