Summary of the invention
In order to solve the above-mentioned technical problem or it at least is partially solved above-mentioned technical problem, the embodiment of the invention provides
Target loses the method and device examined again in a kind of target following.
In view of this, in a first aspect, the embodiment of the present invention, which provides target in a kind of target following, loses the method examined, packet again
It includes:
After tracking target loss, search bit of multiple pixels as the target is randomly selected on current frame image
It sets a little;
According to the position of the corresponding search box of searching position point, from the corresponding search box of the multiple searching position point
One search box of middle selection is as similarity frame;
The computer capacity for expanding the similarity frame obtains region of search;
The position of the target is determined according to the position of the corresponding search box of pixel each in described search region.
Optionally, it according to the position of the corresponding search box of searching position point, is respectively corresponded to from the multiple searching position point
Search box in choose a search box as similarity frame, comprising:
Calculate separately the corresponding search box of the multiple searching position point in previous frame image target frame it is similar
Degree;
The similarity being calculated is compared;
The corresponding search box of maximum similarity is as similarity frame in the similarity being calculated described in selection.
Optionally, the computer capacity for expanding the similarity frame obtains region of search, comprising:
Using padding technology by the carry out interpolation up and down to the similarity frame, expand described similar search
The computer capacity of rope frame is to threshold value;
Using the computer capacity of the similarity frame after padding as region of search.
Optionally, the position of the target is determined according to the position of each pixel in described search region, comprising:
Calculate the similarity of target frame in the corresponding search box of each pixel and previous frame image in described search region;
The similarity being calculated is compared;
Described in position in the similarity being calculated described in selection where the corresponding search box of maximum similarity is used as
The position of target.
Optionally, the similarity by for Euclidean distance, manhatton distance, Minkowski distance or pass through
Twin network obtains.
Second aspect, the embodiment of the present invention provide target in a kind of target following and lose the device examined again, comprising:
Stochastical sampling module, for randomly selecting searching position of multiple pixels as target on current frame image
Point;
Rough search module, for the position according to the corresponding search box of searching position point, from the multiple searching position
A search box is chosen in the corresponding search box of point as similarity frame;
Region of search determining module, the computer capacity for expanding the similarity frame obtain region of search;
Target position determining module, for being determined according to the position of the corresponding search box of pixel each in described search region
The position of target.
Optionally, the rough search module includes:
First similarity calculation module, for calculating separately the corresponding search box of the multiple searching position point with before
The similarity of target frame in one frame image;
First comparison module, for being compared to the similarity being calculated;
First chooses module, makees for choosing the corresponding search box of maximum similarity in the similarity being calculated
For similarity frame.
Optionally, described search determining module uses up and down progress of the padding technology to the similarity frame
Interpolation expands the computer capacity of the similarity frame to threshold value, and by the calculating model of the similarity frame after padding
It encloses as region of search.
Optionally, the target position determining module includes:
Second computing module, for calculating in the corresponding search box of each pixel in described search region and previous frame image
The similarity of target frame;
Second comparison module, for being compared to the similarity being calculated;
Second chooses module, for choosing the corresponding search box institute of maximum similarity in the similarity being calculated
Position of the position as target.
The third aspect, the embodiment of the present invention provide a kind of mobile terminal, comprising:
Processor, memory, communication interface and bus;
The processor, memory, communication interface complete mutual communication by the bus;
The communication interface is for the information transmission between external equipment;
The processor is used to call the program instruction in the memory, to execute the step of first aspect the method
Suddenly.
Fourth aspect, the embodiment of the present invention also propose a kind of non-transient computer readable storage medium, the non-transient meter
Calculation machine readable storage medium storing program for executing stores computer instruction, and the computer instruction makes the computer execute side as described in relation to the first aspect
The step of method.
Compared with prior art, target loses the method examined again in a kind of target following that the embodiment of the present invention proposes, passes through
The stochastical sampling of pixel is carried out to current frame image, so that it is determined that similarity frame, reduces search range, then to similarity
Frame carries out computer capacity expansion, target search region is obtained, according to the position of the search box of pixel each in target search region
The accurate position for determining target.It is multiple to reduce the time that target is examined again by reducing search range for technical solution provided by the present application
The problem of miscellaneous degree, efficiently target is lost during processing target tracking, thus make tracker to the robustness of moving object more
It is good.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is
A part of the embodiments of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people
Member's every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
Fig. 1 is that target loses the method flow diagram examined again in a kind of target following provided in an embodiment of the present invention, comprising: thick
Slightly search and fine search;
Rough search includes the steps that S1-S2 as described below:
S1. after tracking target loss, multiple pixels searching as the target is randomly selected on current frame image
Rope location point;
Specifically, in the embodiment of the present application, the current frame image is target with the target tracker acquisition after losing
First frame image, target is not with losing in previous frame image.
S2. it according to the position of the corresponding search box of searching position point, is searched from the multiple searching position point is corresponding
A search box is chosen in rope frame as similarity frame;
Specifically, in the embodiment of the present application, according to the position of the corresponding search box of searching position point, from multiple search bits
It sets and chooses a search box in a little corresponding search box as similarity frame, comprising:
Each searching position point corresponding one, using the position of described search location point as the search box of center position, is searched for
Size target tracking algorism used by target following of frame determines.
Calculate separately the similarity of target frame in the corresponding search box of multiple searching position points and previous frame image, mesh
Marking frame is exactly the search box put centered on the position where target, specifically, in the embodiment of the present application, similarity can lead to
It crosses calculating Euclidean distance, manhatton distance, Minkowski distance or is obtained with twin network etc.;
The similarity being calculated is compared;
The corresponding search box of maximum similarity is as similarity frame in the similarity being calculated described in selection, due to
These searching position points all randomly select, as long as so some searching position point is located near the position where target,
Then the similarity of target frame will be greater than other searching position points in the corresponding search box of searching position point and previous frame image
The similarity of corresponding search box and target frame can thus navigate to position near target position, i.e., similar to search
In rope frame.
Rough search bring time complexity is only related with the number of the searching position of selection point.
Fine search includes the steps that S3-S4 as described below:
S3. the computer capacity for expanding the similarity frame obtains region of search;
Specifically, in the embodiment of the present application, region of search is obtained by carrying out padding to similarity frame,
Padding is the more commonly used gimmick of target tracking domain, right exactly on the basis of the similarity frame being presently processing
The carry out interpolation up and down of similarity frame expands the range of calculating.
S4. the position of the target is determined according to the position of the corresponding search box of pixel each in described search region;
Specifically, in the embodiment of the present application, determining the target according to the position of each pixel in described search region
Position, comprising:
Calculate the similarity of target frame in the corresponding search box of each pixel and previous frame image in described search region, tool
Body, in the embodiment of the present application, similarity can by calculate Euclidean distance, manhatton distance, Minkowski away from
It is obtained from or with twin network etc.;
The similarity being calculated is compared;
Described in position in the similarity being calculated described in selection where the corresponding search box of maximum similarity is used as
The position of target, the position where search box are the position of search box central point.
The complexity of fine search is directly proportional to the region of search size after padding.
Compared with prior art, the invention has the following advantages that 1. efficiently processing target tracking in due to being moved through
The problem of target caused by the reasons such as fast is lost, to keep tracker more preferable to the robustness of moving object.2. time complexity
It is low, only directly proportional with the selection counted at random the time required to rough search, square rank time complexity that the method for exhaustion is searched for
Drop to linear rank.3. fine search ensure that the accuracy rate of search significantly, to improve tracking effect.
Based on inventive concept identical with target loss weight detecting method in above-mentioned target following, the embodiment of the present invention is also provided
Target loses the device examined again in a kind of target following, as shown in Fig. 2, target loses the device examined again in the target following,
Include:
Stochastical sampling module, for randomly selecting searching position of multiple pixels as target on current frame image
Point;
Rough search module, for the position according to the corresponding search box of searching position point, from the multiple searching position
A search box is chosen in the corresponding search box of point as similarity frame;
Region of search determining module, the computer capacity for expanding the similarity frame obtain region of search;
Target position determining module, for being determined according to the position of the corresponding search box of pixel each in described search region
The position of target.
The rough search module may include:
First similarity calculation module, for calculating separately the corresponding search box of the multiple searching position point with before
The similarity of target frame in one frame image;
First comparison module, for being compared to the similarity being calculated;
First chooses module, makees for choosing the corresponding search box of maximum similarity in the similarity being calculated
For similarity frame.
Described search determining module can using padding technology to the similarity frame carry out up and down it is slotting
Value expands the computer capacity of the similarity frame to threshold value, and by the computer capacity of the similarity frame after padding
As region of search.
The target position determining module may include:
Second computing module, for calculating in the corresponding search box of each pixel in described search region and previous frame image
The similarity of target frame;
Second comparison module, for being compared to the similarity being calculated;
Second chooses module, for choosing the corresponding search box institute of maximum similarity in the similarity being calculated
Position of the position as target.
One specific example:
After obtaining the signal of BREAK TRACK, it is meant that target region of search not current in tracker, at this moment mesh
Mark tracker can change region of search, carry out redefinition to the target search region of track algorithm.In order to be efficiently obtained
Re-detection process can be carried out in two steps by target search region --- rough search and fine search.Pass through the first step first
Rough search obtains the approximate location where target;Then precise search is carried out to the position, obtains the accurate position where target
It sets, to solve the problems, such as that target caused by as moving too fast wait is lost.
1. carrying out rough search with the method for stochastical sampling
Several searching position points are generated at random on present frame picture first, as direction possible where target.Such as Fig. 3
Shown, white dot is the searching position point generated at random in figure, and the dot of black is target point;
Then to previous frame image target frame generated (as shown in figure 4, the frame centered on black dot is target
Frame) and present frame each searching position point where search box (as shown in figure 4, the frame centered on white dot is search
Frame) similarity calculation is done, since these searching position points randomly select, as long as so some searching position point is located at mesh
Near position where marking, the similarity of target frame will be greater than in the corresponding search box of searching position point and previous frame image
The similarity of other searching position point corresponding search boxes and target frame, can thus navigate near target position
Position, i.e., the position where search box as shown in Figure 4, here it is the results of rough search.And the rough search bring time
Complexity is only related with the number of the random point of selection.
2. carrying out fine search with the method for padding
Since the position that rough search obtains also is position near target place, and it is in place to be not necessarily target institute
It sets, so also needing to continue to be accurately positioned target, that is, padding is carried out to the search box that rough search obtains,
Then the area the region after padding as target search region, in the dotted line frame as shown in Figure 5 of region after padding
Search box where each pixel in target search region is carried out similarity meter with the target frame of former frame respectively by domain
It calculates, the position where that maximum pixel of similarity is obtained, as the position of target, to realize precise search.Finely
The complexity of search is directly proportional to the area size after padding.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row
His property includes, so that the process, method, article or the device that include a series of elements not only include those elements, and
And further include other elements that are not explicitly listed, or further include for this process, method, article or device institute it is intrinsic
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do
There is also other identical elements in the process, method of element, article or device.
It should be noted that, in this document, the relational terms of such as " first " and " second " or the like are used merely to one
A entity or operation with another entity or operate distinguish, without necessarily requiring or implying these entities or operation it
Between there are any actual relationship or orders.
Through the above description of the embodiments, those skilled in the art can be understood that each reality of the present invention
Applying method described in example can realize by means of software and necessary general hardware platform, naturally it is also possible to by hardware,
But the former is more preferably embodiment in many cases.Based on this understanding, technical solution of the present invention is substantially in other words
The part that contributes to existing technology can be embodied in the form of software products, which is stored in one
In a storage medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal device (can be hand
Machine, computer, server, air conditioner or network equipment etc.) execute method or implementation described in each embodiment of the present invention
Method described in certain parts of example.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair
Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills
Art field, is included within the scope of the present invention.