CN110349183B - Tracking method and device based on KCF, electronic equipment and storage medium - Google Patents

Tracking method and device based on KCF, electronic equipment and storage medium Download PDF

Info

Publication number
CN110349183B
CN110349183B CN201910465360.1A CN201910465360A CN110349183B CN 110349183 B CN110349183 B CN 110349183B CN 201910465360 A CN201910465360 A CN 201910465360A CN 110349183 B CN110349183 B CN 110349183B
Authority
CN
China
Prior art keywords
feature block
noise ratio
obtaining
peak signal
score value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910465360.1A
Other languages
Chinese (zh)
Other versions
CN110349183A (en
Inventor
邵晓鹏
赵小明
李翠
张佳欢
高苗
白杨
宗靖国
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xidian University
Original Assignee
Xidian University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xidian University filed Critical Xidian University
Priority to CN201910465360.1A priority Critical patent/CN110349183B/en
Publication of CN110349183A publication Critical patent/CN110349183A/en
Application granted granted Critical
Publication of CN110349183B publication Critical patent/CN110349183B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • G06T7/246Analysis of motion using feature-based methods, e.g. the tracking of corners or segments
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning

Abstract

The invention discloses a KCF-based tracking method, which comprises the following steps: carrying out blocking processing on the target image to obtain a plurality of characteristic blocks; obtaining score values of the feature blocks according to pixel points on the diagonal lines of the feature blocks; obtaining a score value mean value according to the score value of each feature block; obtaining a strong feature block according to the score value and the score value mean value; and obtaining the final tracking position of the target image according to the peak signal-to-noise ratio of each strong feature block. According to the tracking method, each feature block of the target image is processed, so that weak feature blocks influencing a tracking result are discarded, only the reserved strong feature blocks are tracked, and the tracking speed and the accuracy of the tracking result are effectively improved.

Description

KCF-based tracking method and device, electronic equipment and storage medium
Technical Field
The invention belongs to the technical field of target tracking, and particularly relates to a tracking method and device based on KCF, electronic equipment and a storage medium.
Background
In the field of computer vision, object Tracking (Object Tracking) generally refers to Tracking a single Object, namely: the state of the target is given in the first frame image, generally the bounding box information of the target, and then the state of the target in each frame image after prediction is carried out, and the corresponding bounding box information of the target is also given. The KCF algorithm (target tracking algorithm) is widely applied to the related filtering tracking direction as a discriminant tracking algorithm due to its high processing speed and good tracking effect.
The KCF algorithm mainly comprises three parts of training, detecting and updating, wherein a filter is trained by extracting HOG (Histogram of Oriented Gradient) features of a first frame of target, a plurality of samples to be detected are obtained in a current frame in a cyclic shift mode, convolution operation is carried out on the samples to be detected and the filter to obtain a response graph, the sample position corresponding to the maximum response value is taken as a final tracking result, the final tracking result is the target position of the current frame, and finally the filter and a template image are updated. In the whole tracking process, the robustness of the filter determines whether the tracking result is reliable or not, and the feature selection of the target has important influence on the training of the filter.
However, the feature blocks in the tracked target include strong feature blocks and weak feature blocks, and the robustness of the filter obtained by training using the weak feature blocks is weak, which inevitably receives the influence of background information in the tracking process, causes unreliable tracking results, influences fusion results, and causes the position of the target to be tracked to be inaccurate.
Disclosure of Invention
In order to solve the above problems in the prior art, the present invention provides a KCF-based tracking method, apparatus, electronic device, and storage medium. The technical problem to be solved by the invention is realized by the following technical scheme:
a KCF-based tracking method, comprising:
carrying out blocking processing on the target image to obtain a plurality of characteristic blocks;
obtaining score values of the feature blocks according to pixel points on the diagonal lines of the feature blocks;
obtaining a score value mean value according to the score value of each feature block;
obtaining a strong feature block according to the score value and the score value mean value;
and obtaining the final tracking position of the target image according to the peak signal-to-noise ratio of each strong feature block.
In an embodiment of the present invention, obtaining the score value of the feature block according to the pixel point on the diagonal of the feature block includes:
acquiring pixel points on the diagonal line of the feature block;
calculating the absolute value of the gray value difference value of each pixel point on the diagonal line of the feature block and the pixel point at the center point of the feature block;
and calculating the sum of all the absolute values of each feature block to obtain the score value of the feature block.
In one embodiment of the present invention, obtaining a score value mean value according to the score value of each feature block includes:
and calculating the average value of the score values of all the feature blocks to obtain the score value average value.
In an embodiment of the present invention, obtaining the strong feature block according to the score value and the score value mean includes:
judging the score value and the score value mean value of each feature block, if the score value of the feature block is smaller than the score value mean value, the feature block is a weak feature block, discarding the weak feature block, and if the score value of the feature block is larger than the score value mean value, the feature block is a strong feature block, and reserving the strong feature block.
In an embodiment of the present invention, obtaining a final position of a tracking target according to a peak signal-to-noise ratio of each strong feature block includes:
obtaining the peak signal-to-noise ratio of each strong feature block according to the current response graph and the template response graph;
obtaining an average peak signal-to-noise ratio according to the peak signal-to-noise ratio of the strong feature block;
obtaining a feature block to be tracked according to the peak signal-to-noise ratio of the strong feature block and the average peak signal-to-noise ratio;
obtaining the weight of the characteristic block to be tracked according to the peak signal-to-noise ratio of the strong characteristic block;
and obtaining the final tracking position of the target image according to the weight of the characteristic block to be tracked and the final tracking position of the characteristic block to be tracked.
In an embodiment of the present invention, obtaining an average peak snr according to the peak snr of the strong feature block includes:
acquiring the peak signal-to-noise ratio of the current frame in the forward continuous t frames;
and obtaining the average peak signal-to-noise ratio according to the peak signal-to-noise ratio of the current frame in the previous continuous t frames.
In an embodiment of the present invention, obtaining a to-be-tracked feature block according to the peak signal-to-noise ratio of the strong feature block and the average peak signal-to-noise ratio includes:
judging the peak signal-to-noise ratio of the strong feature block and the average peak signal-to-noise ratio, if the peak signal-to-noise ratio of the strong feature block is smaller than the average peak signal-to-noise ratio, discarding the feature block to be tracked, and if the peak signal-to-noise ratio of the strong feature block is larger than the average peak signal-to-noise ratio, taking the strong feature block as the feature block to be tracked and reserving the feature block to be tracked.
An embodiment of the present invention further provides a KCF-based tracking apparatus, including:
the blocking module is used for carrying out blocking processing on the target image to obtain a plurality of characteristic blocks;
the score value calculation module is used for obtaining the score value of the feature block according to the pixel points on the diagonal line of the feature block;
the score value mean value calculation module is used for obtaining a score value mean value according to the score value of each feature block;
the strong feature block processing module is used for obtaining a strong feature block according to the score value and the score value mean value;
and the fusion module is used for obtaining the current target center position according to the peak signal-to-noise ratio of each strong feature block.
An embodiment of the present invention further provides an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface, and the memory complete mutual communication through the communication bus;
a memory for storing a computer program;
a processor for implementing any of the above-described tracking method steps when executing the computer program.
An embodiment of the invention further provides a computer-readable storage medium having stored therein a computer program which, when executed by a processor, carries out the steps of the tracking method of any one of the preceding claims.
The invention has the beneficial effects that:
according to the tracking method, each feature block of the target image is processed, so that weak feature blocks influencing a tracking result are discarded, only the reserved strong feature blocks are tracked, and the tracking speed and the accuracy of the tracking result are effectively improved.
The present invention will be described in further detail with reference to the accompanying drawings and examples.
Drawings
FIG. 1 is a flow chart of a KCF-based tracking method provided by an embodiment of the present invention;
FIG. 2 is a block diagram of a prior art partitioning method;
FIG. 3 is a flowchart illustrating a method for calculating score values of feature blocks according to an embodiment of the present invention;
FIG. 4 is a block diagram of a blocking method according to an embodiment of the present invention;
FIG. 5 is a schematic flow chart illustrating a method for determining a final position of a tracking target according to an embodiment of the present invention;
FIG. 6 is a schematic structural diagram of a KCF-based tracking apparatus provided in an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to specific examples, but the embodiments of the present invention are not limited thereto.
Example one
Referring to fig. 1, fig. 1 is a flowchart illustrating a KCF-based tracking method according to an embodiment of the present invention. The embodiment provides a KCF-based tracking method, which includes:
step 1, carrying out blocking processing on the target image to obtain a plurality of characteristic blocks;
step 2, obtaining score values of the feature blocks according to pixel points on the diagonal lines of the feature blocks;
step 3, obtaining a score value mean value according to the score value of each feature block;
step 4, obtaining a strong feature block according to the score value and the score value mean value;
and 5, obtaining the center position of the current target according to the peak signal-to-noise ratio of each strong feature block.
Before specifically describing the tracking method of the embodiment, a blocking method in the existing KCF algorithm needs to be described, the KCF algorithm obtains a plurality of feature blocks by uniformly blocking a target frame, and respectively extracts the HOG features of each feature block, the HOG features are used for training a plurality of filters and tracking the filters by using the filters, so as to obtain a plurality of target candidate frames, and finally the target candidate frames are fused to determine a final target position, so that stable tracking of a target is realized. The specific process is as follows: referring to fig. 2, a tracking target is selected from a current frame image frame, and if the size of the target frame is m × n, the target frame is uniformly divided into a × b feature blocks with the same size, for example, fig. 2 divides the target image of the tracking target into 4 feature blocks, i.e., feature block 1, feature block 2, feature block 3, and feature block 4, and then tracks each feature block, and then fuses the tracking results of each feature block to determine the position of the final tracking target, and if the target image of the frame selected tracking target is uniformly divided into four small blocks, p is assumed as shown in fig. 2 i (i =1,2,3,4) represents the final tracking position of the i-th feature block, which is the final tracking result of the feature block, and then the final tracking position p of the target image is determined according to the final tracking positions of the four feature blocks, and the final tracking position p is taken as the final tracking result, and the calculation formula of the final tracking position p of the target image is shown as formula (1):
Figure BDA0002079262200000061
in the above tracking method, a strong feature block and a weak feature block may exist in a target image at the same time, the strong feature block is a feature block containing more tracking target information, the weak feature block is a feature block containing less tracking target information, and the robustness of a filter obtained through training of the weak feature block is weak, so that the filter is inevitably affected by background information in a tracking process, so that a tracking result is unreliable, a fusion result is affected by proximity, and a finally tracked target position is inaccurate.
In this embodiment, a tracking target of a current frame is selected as a target image, the target image is divided into a plurality of feature blocks with equal size by a uniform blocking processing method, the size of the target image is recorded as m × n, the number of the feature blocks is recorded as a × b, then pixel points on a diagonal line of each feature block are selected, a score value of each feature block is obtained through gray values of the pixel points, for example, an absolute value of a gray value difference between a pixel point on the diagonal line of the feature block and a pixel point on a certain position of the feature block is calculated, for example, a pixel point on a certain position of the feature block may be a pixel point on a central position or an adjacent pixel point on a pixel point on the central position, when an absolute value of a gray value difference between gray values of all pixel points on the diagonal line of the feature block and a pixel point on a certain position of the feature block is calculated, then all absolute values obtained by the feature block are summed, a final value obtained by the summation is a score value of the feature block, a mean value of all pixel points divided by the feature blocks is obtained, a weak-to-noise ratio of all the feature blocks divided by the target image, and a final score value of the target image is determined, and a robust feature block is determined according to which a strong score of the target block, and a strong target image is obtained by using a weak-to which a target image, and a target image.
The tracking method of the embodiment uniformly divides the target image into feature blocks with equal size, compares the pixel point on the diagonal line in each feature block with the gray value of the central pixel point, judges whether the feature block is a strong feature block, if the feature block is the strong feature block, the feature block is reserved as the strong feature block to continue tracking, and otherwise, the feature block is discarded. Therefore, the retained strong feature blocks can always obtain reliable results, and the accuracy of obtaining the final tracking target position can be ensured by evaluating the quality of the response graph of the tracking result of each retained strong feature block, so that the continuous and stable tracking of the target image is realized.
Example two
On the basis of the foregoing embodiments, the present embodiment specifically describes the tracking method in the first embodiment.
Referring to fig. 3, fig. 3 is a flowchart illustrating a method for calculating score values of feature blocks according to an embodiment of the present invention. The step 2 in the first embodiment may specifically include:
step 201, obtaining pixel points on the diagonal line of the feature block;
step 202, calculating the absolute value of the gray value difference value of each pixel point on the diagonal line of the feature block and the pixel point of the center point of the feature block;
and 203, calculating the sum of all the absolute values of each feature block to obtain the score value of the feature block.
Each feature block obtained in step 1 of example one is processed as follows: firstly, acquiring pixel points on a diagonal line in each feature block, acquiring pixel points at a central position in the feature block, traversing each pixel point on the diagonal line of the feature block, namely performing difference processing on a gray value of each pixel point on the diagonal line of the feature block and a gray value of the pixel point at the central position of the feature block, summing absolute values of all difference processing results, recording the sum processing result as a score value of the feature block, and recording the score value as s i (i =1, …, a × b). In this embodiment, the absolute value of the difference between the gray value of the pixel point of the feature block on the diagonal and the gray value of the pixel point at the center position is calculated, so as to obtain the score of the feature block, which feature blocks are strong can be more accurately determined by this wayAnd in the feature blocks, which feature blocks are weak feature blocks, so that strong feature blocks can be kept more favorably, and a tracking result is more reliable.
For example, referring to fig. 4, in this embodiment, the target image is divided into 4 feature blocks, and the first feature block located at the upper left corner is taken as an example for illustration, where a gray portion is a pixel point located on a diagonal line on the first feature block, the gray portion is a pixel point located at the center position on the first feature block, an absolute value of a difference between a gray value of the pixel point corresponding to each gray portion and a gray value of the pixel point corresponding to the black portion is calculated, and a sum of all absolute values of the feature blocks is calculated, and a sum result is a score value of the first feature block.
Based on the foregoing embodiment, this embodiment specifically describes step 3 in the first embodiment, where step 3 may specifically include:
step 301, calculating an average value of the score values of each feature block to obtain the score value average value.
In this embodiment, an average value of score values of all feature blocks in the target image is calculated, where the average result is a score value average value, and a calculation formula of the score value average value is shown in formula (2):
Figure BDA0002079262200000091
wherein s is the mean value of the score values, s i And taking the value of i from 1 to a x b as the score value of the ith feature block.
Based on the foregoing embodiment, this embodiment specifically describes step 4 in the first embodiment, where step 4 specifically includes:
step 401, judging the score value and the score value mean value of each feature block, if the score value of a feature block is smaller than the score value mean value, the feature block is a weak feature block, discarding the weak feature block, and if the score value of the feature block is larger than the score value mean value, the feature block is a strong feature block, and reserving the strong feature block.
In this embodiment, by comparing the score value of each feature block with the average value of the score values, which feature blocks are strong feature blocks and which feature blocks are determined, when the score value of a certain feature block is greater than the score value average value, it is indicated that the feature block contains less background information and more information of a tracking target, the feature block can be retained and used as a strong feature block for subsequent tracking, and the strong feature block is retained for continuous tracking, which can improve the accuracy of a tracking result, and when the score value of a certain feature block is less than the score value average value, it is indicated that the feature block contains more background information and less information of a tracking target, and if the feature block is retained for subsequent tracking, the accuracy of the tracking result is affected, and the final tracking result is affected.
Referring to fig. 5, fig. 5 is a flowchart illustrating a method for determining a final position of a tracking target according to an embodiment of the present invention. Based on the foregoing embodiment, this embodiment specifically describes step 5 in the first embodiment, where step 5 specifically includes:
step 501, obtaining a peak signal-to-noise ratio of each strong feature block according to a current response graph and a template response graph;
step 502, obtaining an average peak signal-to-noise ratio according to the peak signal-to-noise ratio of the strong feature block;
step 503, obtaining a feature block to be tracked according to the peak signal-to-noise ratio and the average peak signal-to-noise ratio of the strong feature block;
step 504, obtaining the weight of the feature block to be tracked according to the peak signal-to-noise ratio of the strong feature block;
and 505, obtaining the current target center position according to the weight of the characteristic block to be tracked and the target center of the characteristic block to be tracked.
In this embodiment, the peak signal-to-noise ratio of each reserved strong feature block is obtained through the current response graph and the template response graph, and the peak signal-to-noise ratio of the strong feature block may be specifically used to evaluate the reliability of the final tracking result, so as to further improve the accuracy of the tracking result of the tracking method of this embodiment, generally, the larger the value of the peak signal-to-noise ratio, the better the quality of the response graph of the current tracking is, and the more reliable the obtained tracking result is, for example, the peak signal-to-noise ratio of each feature block may be obtained through a peak signal-to-noise ratio calculation formula, where the peak signal-to-noise ratio calculation formula is shown in formula (3):
Figure BDA0002079262200000101
the PSNR is a peak signal-to-noise ratio, the MAX is a peak value of the current response image, and the MSE represents a mean square error of response values of the current response image and the template response image.
Specifically, the calculation formula of MSE is shown in formula (4):
Figure BDA0002079262200000111
wherein, I (I, j) is the response value of the current response map I at the position (I, j), and K (I, j) is the response value of the template response map K at the position (I, j).
After the peak signal-to-noise ratio of the strong feature block is obtained, the average peak signal-to-noise ratio of the strong feature block may be correspondingly calculated through the obtained peak signal-to-noise ratio, where the average peak signal-to-noise ratio may be an average value of the peak signal-to-noise ratios of the feature blocks corresponding to the strong feature block in a previous continuous multiple frames, for example, the peak signal-to-noise ratio of the strong feature block in a current frame to a previous continuous t frame relative to the current frame may be obtained, and then the average value of the peak signal-to-noise ratios of the strong feature block in the current frame to the previous continuous t frame relative to the current frame is obtained, where the average value is an average peak signal-to-noise ratio of the strong feature block, and a calculation formula of a specific average peak signal-to-noise ratio is shown in formula (5):
Figure BDA0002079262200000112
wherein PSNR mean The peak signal-to-noise ratio of the strong feature block from the current frame to the previous continuous T frames relative to the current frame, wherein T is the frame number of the current frame, PSNR k Is a strong characteristicThe peak signal-to-noise ratio of the target image at the k frame is blocked.
After the average peak signal-to-noise ratio of the strong feature block is determined, whether the strong feature block is a feature block to be tracked or not can be determined through the relation between the average peak signal-to-noise ratio and the peak signal-to-noise ratio of the strong feature block, the feature block to be tracked is a feature block for continuous tracking, further, when the peak signal-to-noise ratio of the strong feature block is greater than the average peak signal-to-noise ratio, the strong feature block is the feature block to be tracked, the quality of a tracking result response graph of the strong feature block is better, the strong feature block can be tracked continuously, so that a more reliable tracking result can be obtained, and if the strong feature block cannot be used as the feature block to be tracked, the feature block needs to be discarded, so that the accuracy of a final result is not affected.
In order to further improve the accuracy of the tracking result, after determining which strong feature blocks are to-be-tracked feature blocks, different weights may be given to the to-be-tracked feature blocks according to peak signal-to-noise ratios of the to-be-tracked feature blocks, so as to determine a final tracking result, where a calculation formula of the weights is shown in formula (6):
Figure BDA0002079262200000121
wherein, ω is i PSNR, the weight of the ith feature block i And the peak signal-to-noise ratio of the ith characteristic block is the characteristic block to be tracked.
After determining the weight of each feature block to be tracked, the tracking results of all the feature blocks to be tracked can be fused, and the final fusion result is shown in formula (7):
Figure BDA0002079262200000122
wherein p is the final tracking position of the target image, i.e. p is the final tracking result, p i For the final tracking position of the ith feature block, w i Is the weight of the ith feature block.
At present, the feature blocks obtained by uniformly dividing the target image include not only strong feature blocks but also weak feature blocks, and the existence of the weak feature blocks makes the final tracking result easily interfered by background information, so that the reliability of the final tracking result obtained by fusion is affected, and the accuracy of the target position obtained by final calculation is reduced. In the embodiment, the target image is uniformly divided into feature blocks with the same size, pixel points on the diagonal line are extracted from each feature block, the absolute values of the gray value difference values of the pixel points and the central pixel point are respectively calculated, and the score values of the feature blocks are calculated according to the obtained absolute values, so that which feature blocks are strong feature blocks are determined, weak feature blocks are discarded, and the reserved strong feature blocks can always obtain reliable results. And finally, performing weighted summation on each result to obtain a final tracking target position, thereby realizing continuous and stable tracking of the target image.
In addition, the tracking method of this embodiment may further determine whether the target image needs to be re-partitioned according to the finally determined number of the feature blocks to be tracked, because when the number of the finally obtained feature blocks to be tracked is large and the number of the finally obtained feature blocks to be tracked is small, the accuracy of the final tracking result may be affected, therefore, when the number of the obtained feature blocks to be tracked affects the accuracy of the final tracking result, re-tracking may be performed in a re-partitioning manner, for example, the target image is partitioned into 4 feature blocks in this embodiment, when the number of the finally determined feature blocks to be tracked is less than 3, re-partitioning and tracking may be performed on the target image, whether re-partitioning may be set according to the actual needs of the user, which is not specifically limited in this embodiment.
EXAMPLE III
Referring to fig. 6, fig. 6 is a schematic structural diagram of a KCF-based tracking apparatus according to an embodiment of the present invention. The tracking device includes:
the blocking module is used for carrying out blocking processing on the target image to obtain a plurality of characteristic blocks;
the score value calculation module is used for obtaining the score value of the feature block according to the pixel points on the diagonal line of the feature block;
the score value mean value calculation module is used for obtaining a score value mean value according to the score value of each feature block;
the strong characteristic block processing module is used for obtaining a strong characteristic block according to the score value and the score value mean value;
and the fusion module is used for obtaining the final tracking position of the target image according to the peak signal-to-noise ratio of each strong feature block.
In an embodiment of the present invention, the score calculating module is specifically configured to obtain pixel points on a diagonal line of the feature block; calculating the absolute value of the gray value difference value of each pixel point on the diagonal line of the feature block and the pixel point of the center point of the feature block; and calculating the sum of all the absolute values of each feature block to obtain the score value of the feature block.
In an embodiment of the present invention, the score mean calculation module is specifically configured to calculate a mean of the score values of all the feature blocks, so as to obtain the score mean.
In an embodiment of the present invention, the strong feature block processing module is specifically configured to determine the score value and the score value mean of each feature block, if the score value of the feature block is smaller than the score value mean, the feature block is a weak feature block, the weak feature block is discarded, and if the score value of the feature block is larger than the score value mean, the feature block is a strong feature block, and the strong feature block is retained.
In an embodiment of the present invention, the fusion module is specifically configured to obtain a peak signal-to-noise ratio of each strong feature block according to the current response map and the template response map; obtaining an average peak signal-to-noise ratio according to the peak signal-to-noise ratio of the strong feature block; obtaining a characteristic block to be tracked according to the peak signal-to-noise ratio of the strong characteristic block and the average peak signal-to-noise ratio; obtaining the weight of the characteristic block to be tracked according to the peak signal-to-noise ratio of the strong characteristic block; and obtaining the final tracking position of the target image according to the weight of the characteristic block to be tracked and the final tracking position of the characteristic block to be tracked.
In an embodiment of the present invention, the fusion module is further configured to obtain a peak signal-to-noise ratio of the current frame in a previous continuous t frame; and obtaining the average peak signal-to-noise ratio according to the peak signal-to-noise ratio of the current frame in the previous continuous t frames.
In an embodiment of the present invention, the fusion module is further configured to determine peak signal-to-noise ratios of the strong feature blocks and sizes of the average peak signal-to-noise ratio, discard the feature block to be tracked if the peak signal-to-noise ratio of the strong feature blocks is smaller than the average peak signal-to-noise ratio, and reserve the feature block to be tracked if the peak signal-to-noise ratio of the strong feature blocks is larger than the average peak signal-to-noise ratio.
The tracking apparatus provided in the embodiment of the present invention may implement the method embodiments described above, and the implementation principle and technical effects are similar, which are not described herein again.
Example four
Referring to fig. 7, fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. As shown in fig. 7, the electronic device 1100 includes: the system comprises a processor 1101, a communication interface 1102, a memory 1103 and a communication bus 1104, wherein the processor 1101, the communication interface 1102 and the memory 1103 are communicated with each other through the communication bus 1104;
a memory 1103 for storing a computer program;
the processor 1101 is configured to implement the above-mentioned method steps when executing the computer program.
The processor 1101, when executing the computer program, implements the steps of: carrying out blocking processing on the target image to obtain a plurality of characteristic blocks; obtaining score values of the feature blocks according to pixel points on the diagonal lines of the feature blocks; obtaining a score value mean value according to the score value of each feature block; obtaining a strong feature block according to the score value and the score value mean value; and obtaining the final tracking position of the target image according to the peak signal-to-noise ratio of each strong feature block.
The electronic device provided by the embodiment of the present invention can execute the above method embodiments, and the implementation principle and technical effect are similar, which are not described herein again.
EXAMPLE five
Yet another embodiment of the present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
carrying out blocking processing on the target image to obtain a plurality of characteristic blocks;
obtaining score values of the feature blocks according to pixel points on the diagonal lines of the feature blocks;
obtaining a score value mean value according to the score value of each feature block;
obtaining a strong feature block according to the score value and the score value mean value;
and obtaining the final tracking position of the target image according to the peak signal-to-noise ratio of each strong feature block.
The computer-readable storage medium provided by the embodiment of the present invention may implement the above method embodiments, and the implementation principle and technical effect are similar, which are not described herein again.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, apparatus (device), or computer program product. Accordingly, this application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects that may all generally be referred to herein as a "module" or "system. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein. A computer program stored/distributed on a suitable medium supplied together with or as part of other hardware, may also take other distributed forms, such as via the Internet or other wired or wireless telecommunication systems.
In the description of the present invention, the terms "first" and "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present invention, "a plurality" means two or more unless specifically defined otherwise.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples described in this specification can be combined and combined by those skilled in the art.
The foregoing is a more detailed description of the invention in connection with specific preferred embodiments and it is not intended that the invention be limited to these specific details. For those skilled in the art to which the invention pertains, several simple deductions or substitutions can be made without departing from the spirit of the invention, and all shall be considered as belonging to the protection scope of the invention.

Claims (10)

1. A KCF-based tracking method is characterized by comprising the following steps:
carrying out blocking processing on the target image to obtain a plurality of characteristic blocks;
obtaining score values of the feature blocks according to pixel points on the diagonal lines of the feature blocks;
obtaining a score value mean value according to the score value of each feature block;
obtaining a strong feature block according to the score value and the score value mean value;
and obtaining the final tracking position of the target image according to the peak signal-to-noise ratio of each strong feature block.
2. The tracking method according to claim 1, wherein obtaining the score value of the feature block according to the pixel points on the diagonal of the feature block comprises:
acquiring pixel points on the diagonal line of the feature block;
calculating the absolute value of the gray value difference value of each pixel point on the diagonal line of the feature block and the pixel point at the center point of the feature block;
and calculating the sum of all the absolute values of each feature block to obtain the score value of the feature block.
3. The tracking method according to claim 1, wherein obtaining a score value mean according to the score value of each feature block comprises:
and calculating the average value of the score values of all the feature blocks to obtain the score value average value.
4. The tracking method according to claim 1, wherein obtaining a strong feature block according to the score value and the score value mean comprises:
judging the score value and the score value mean value of each feature block, if the score value of the feature block is smaller than the score value mean value, the feature block is a weak feature block, discarding the weak feature block, and if the score value of the feature block is larger than the score value mean value, the feature block is a strong feature block, and reserving the strong feature block.
5. The tracking method according to claim 1, wherein obtaining the final position of the tracking target according to the peak signal-to-noise ratio of each strong feature block comprises:
obtaining the peak signal-to-noise ratio of each strong feature block according to the current response graph and the template response graph;
obtaining an average peak signal-to-noise ratio according to the peak signal-to-noise ratio of the strong feature block;
obtaining a characteristic block to be tracked according to the peak signal-to-noise ratio of the strong characteristic block and the average peak signal-to-noise ratio;
obtaining the weight of the characteristic block to be tracked according to the peak signal-to-noise ratio of the strong characteristic block;
and obtaining the final tracking position of the target image according to the weight of the characteristic block to be tracked and the final tracking position of the characteristic block to be tracked.
6. The tracking method according to claim 5, wherein obtaining an average peak signal-to-noise ratio from the peak signal-to-noise ratios of the strong feature blocks comprises:
acquiring the peak signal-to-noise ratio of the current frame in the forward continuous t frames;
and obtaining the average peak signal-to-noise ratio according to the peak signal-to-noise ratio of the current frame in the previous continuous t frames.
7. The tracking method according to claim 5, wherein obtaining the feature block to be tracked according to the peak signal-to-noise ratio of the strong feature block and the average peak signal-to-noise ratio comprises:
judging the peak signal-to-noise ratio of the strong feature block and the average peak signal-to-noise ratio, if the peak signal-to-noise ratio of the strong feature block is smaller than the average peak signal-to-noise ratio, discarding the feature block to be tracked, and if the peak signal-to-noise ratio of the strong feature block is larger than the average peak signal-to-noise ratio, taking the strong feature block as the feature block to be tracked and reserving the feature block to be tracked.
8. A KCF-based tracking device, comprising:
the blocking module is used for carrying out blocking processing on the target image to obtain a plurality of characteristic blocks;
the score value calculation module is used for obtaining the score value of the feature block according to the pixel points on the diagonal line of the feature block;
the score value mean value calculation module is used for obtaining a score value mean value according to the score value of each feature block;
the strong feature block processing module is used for obtaining a strong feature block according to the score value and the score value mean value;
and the fusion module is used for obtaining the final tracking position of the target image according to the peak signal-to-noise ratio of each strong feature block.
9. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 7.
CN201910465360.1A 2019-05-30 2019-05-30 Tracking method and device based on KCF, electronic equipment and storage medium Active CN110349183B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910465360.1A CN110349183B (en) 2019-05-30 2019-05-30 Tracking method and device based on KCF, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910465360.1A CN110349183B (en) 2019-05-30 2019-05-30 Tracking method and device based on KCF, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110349183A CN110349183A (en) 2019-10-18
CN110349183B true CN110349183B (en) 2022-12-09

Family

ID=68174480

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910465360.1A Active CN110349183B (en) 2019-05-30 2019-05-30 Tracking method and device based on KCF, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110349183B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105279772A (en) * 2015-10-23 2016-01-27 中国运载火箭技术研究院 Trackability distinguishing method of infrared sequence image
WO2018121286A1 (en) * 2016-12-30 2018-07-05 纳恩博(北京)科技有限公司 Target tracking method and device
CN109064491A (en) * 2018-04-12 2018-12-21 江苏省基础地理信息中心 A kind of nuclear phase pass filter tracking method of adaptive piecemeal

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105279772A (en) * 2015-10-23 2016-01-27 中国运载火箭技术研究院 Trackability distinguishing method of infrared sequence image
WO2018121286A1 (en) * 2016-12-30 2018-07-05 纳恩博(北京)科技有限公司 Target tracking method and device
CN109064491A (en) * 2018-04-12 2018-12-21 江苏省基础地理信息中心 A kind of nuclear phase pass filter tracking method of adaptive piecemeal

Also Published As

Publication number Publication date
CN110349183A (en) 2019-10-18

Similar Documents

Publication Publication Date Title
CN110858394B (en) Image quality evaluation method and device, electronic equipment and computer readable storage medium
CN107424171B (en) Block-based anti-occlusion target tracking method
CN112883819A (en) Multi-target tracking method, device, system and computer readable storage medium
CN111340749B (en) Image quality detection method, device, equipment and storage medium
CN110310305B (en) Target tracking method and device based on BSSD detection and Kalman filtering
CN115546705B (en) Target identification method, terminal device and storage medium
CN113643365A (en) Camera pose estimation method, device, equipment and readable storage medium
KR101991307B1 (en) Electronic device capable of feature vector assignment to a tracklet for multi-object tracking and operating method thereof
CN114283089B (en) Jump acceleration based depth recovery method, electronic device, and storage medium
CN111784658A (en) Quality analysis method and system for face image
CN109544584B (en) Method and system for realizing inspection image stabilization precision measurement
CN110717910B (en) CT image target detection method based on convolutional neural network and CT scanner
CN110349183B (en) Tracking method and device based on KCF, electronic equipment and storage medium
US10776932B2 (en) Determining whether ground is to be re-detected
CN109978916B (en) Vibe moving target detection method based on gray level image feature matching
CN114283081B (en) Depth recovery method based on pyramid acceleration, electronic device and storage medium
CN111738085B (en) System construction method and device for realizing automatic driving simultaneous positioning and mapping
CN115471671A (en) Network model training method, target recognition method and related equipment
CN110751163A (en) Target positioning method and device, computer readable storage medium and electronic equipment
CN114399532A (en) Camera position and posture determining method and device
CN113554685A (en) Method and device for detecting moving target of remote sensing satellite, electronic equipment and storage medium
CN114004876A (en) Dimension calibration method, dimension calibration device and computer readable storage medium
CN112614154A (en) Target tracking track obtaining method and device and computer equipment
CN112802108A (en) Target object positioning method and device, electronic equipment and readable storage medium
CN111951254A (en) Source camera identification method and system based on edge-guided weighted average

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant