Summary of the invention
This application provides a kind of template reconstructing devices and method based on two-dimensional linear transformation, to solve location algorithm mould
When plate is modified, the too big problem of system data treating capacity.
In a first aspect, this application provides a kind of template reconstructing device based on two-dimensional linear transformation, which includes:
Unit is modified, modifies for the first template to location algorithm, obtains the second template;Training data is executed
Second template exports two-dimensional linear transformation matrix corresponding with the second template;
Notification unit rebuilds instruction to reconstruction unit for sending when the first template of the location algorithm is modified;
Reconstruction unit, for being converted according to the two-dimensional linear corresponding with the second template when receiving reconstruction instruction
Matrix rebuilds the template of the vision algorithm based on two-dimensional linear transformation.
With reference to first aspect, in a first possible implementation of that first aspect, the reconstruction unit includes:
Subelement is obtained, the initial search area of the current template for obtaining the vision algorithm based on two-dimensional linear transformation
Domain;
Subelement is rebuild, for converting according to the initial search region and the two-dimensional linear corresponding with the second template
Matrix rebuilds the template of the vision algorithm based on two-dimensional linear transformation.
With reference to first aspect or first aspect the first possible implementation, in second of first aspect possible realization
In mode, the reconstruction subelement, the two-dimensional linear corresponding with the second template specifically for obtaining modification unit output is converted
Matrix calculates the inverse matrix of the two-dimensional linear transformation matrix corresponding with the second template;
According to the inverse matrix and the initial search region, the vision algorithm based on two-dimensional linear transformation is rebuild
Template.
With reference to first aspect, in first aspect in the third possible implementation, the acquiring unit includes:
Subelement is executed, for executing first template to training data, exports two-dimensional line corresponding with the first template
Property transformation matrix;
Determine subelement, for obtaining the two-dimensional linear transformation matrix corresponding with the first template for executing subelement output,
According to the corresponding two-dimensional linear transformation matrix of first template and it is described based on two-dimensional linear transformation vision algorithm it is current
Template determines initial search region.
With reference to first aspect or second of first aspect possible implementation, in the 4th kind of possible realization of first aspect
In mode, the reconstruction subelement is specifically used for, according to the inverse matrix and the initial search region according to matrix multiplication weight
Build the template of the vision algorithm based on two-dimensional linear transformation.
Second aspect, the application provide a kind of template method for reconstructing based on two-dimensional linear transformation, this method comprises:
When the first template of location algorithm is modified, modified the second obtained template is obtained;
Second template is executed to training data, obtains two-dimensional linear transformation matrix corresponding with the second template;
According to the two-dimensional linear transformation matrix corresponding with the second template, the view based on two-dimensional linear transformation is rebuild
Feel the template of algorithm.
In conjunction with second aspect, in second aspect in the first possible implementation, two-dimensional line is based on described in the reconstruction
Property transformation vision algorithm template, comprising:
Obtain the initial search region of the current template of the vision algorithm converted based on two-dimensional linear;
According to the initial search region and the two-dimensional linear transformation matrix corresponding with the second template, the base is rebuild
In the template of the vision algorithm of two-dimensional linear transformation.
In conjunction with second of second aspect possible implementation, in second aspect in the third possible implementation, institute
It states according to initial search region and the two-dimensional linear transformation matrix corresponding with the second template, rebuilds described based on two-dimensional linear
The template of the vision algorithm of transformation, comprising:
Calculate the inverse matrix of the two-dimensional linear transformation matrix corresponding with the second template;
According to the inverse matrix and the initial search region, the vision algorithm based on two-dimensional linear transformation is rebuild
Template.
In conjunction with second aspect, in the 4th kind of possible implementation of second aspect, described obtain is become based on two-dimensional linear
The initial search region of the current template of the vision algorithm changed, comprising:
First template is executed to training data, exports two-dimensional linear transformation matrix corresponding with the first template;
It is calculated according to the corresponding two-dimensional linear transformation matrix of first template and the vision based on two-dimensional linear transformation
The current template of method determines initial search region.
The third possible implementation in conjunction with second aspect, in the 4th kind of possible implementation of second aspect, root
The vision algorithm based on two-dimensional linear transformation is rebuild according to matrix multiplication according to the inverse matrix and the initial search region
Template.
From the above technical scheme, it is provided by the embodiments of the present application based on two-dimensional linear transformation template reconstructing device and
Method obtains the second template firstly, modification unit modifies to the first template of location algorithm;Institute is executed to training data
The second template is stated, two-dimensional linear transformation matrix corresponding with the second template is exported;Secondly, notification unit is when the location algorithm
When first template is modified, sends and rebuild instruction to reconstruction unit;Then, when reconstruction unit receives reconstruction instruction, according to
The two-dimensional linear transformation matrix corresponding with the second template rebuilds the mould of the vision algorithm based on two-dimensional linear transformation
Plate.
Using the application device and method, when the template of location algorithm is modified, based on its of two-dimensional linear transformation
The template of his vision algorithm is passively modified according to the template of modified location algorithm, to reduce software in system
Programming quantity and data processing amount reduce system maintenance cost.Meanwhile for distribution and the vision software that can individually debug, keep away
Exempt from only to have modified location algorithm and other unmodified corresponding vision algorithms lead to abnormal situation occur when use next time.
Specific embodiment
Technical solution in order to enable those skilled in the art to better understand the present invention, below in conjunction with of the invention real
The attached drawing in example is applied, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described implementation
Example is only a part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, this field is common
Technical staff's every other embodiment obtained without making creative work, all should belong to protection of the present invention
Range.
The embodiment of the present application provides a kind of template reconstructing device based on two-dimensional linear transformation, built-in or be attached to vision figure
As detection system, refering to fig. 1, which includes:
Unit U100 is modified, modifies for the first template to location algorithm, obtains the second template;To training data
Second template is executed, two-dimensional linear transformation matrix corresponding with the second template is exported;
Notification unit U200 rebuilds instruction to reconstruction for sending when the first template of the location algorithm is modified
Unit;
Reconstruction unit U300, for when receive rebuild instruction when, according to the two-dimensional linear corresponding with the second template
Transformation matrix rebuilds the template of the vision algorithm based on two-dimensional linear transformation.
In the present embodiment, modification unit U100 according to demand to the first template of location algorithm, that is, current template, into
Row modification, modified template are the second template.Meanwhile modifying unit U100 and second template is executed to training data, it is defeated
Two-dimensional linear transformation matrix corresponding with the second template out.For example, modification unit U100 repairs the first template Ms of location algorithm
It is changed to the second template Ms1;Algorithm of once location is executed again, exports two-dimensional linear transformation matrix C2 corresponding with the second template Ms1.
Notification unit U200 is generated when the first template of location algorithm is modified and is rebuild instruction, and be sent to reconstruction
Unit U300, so that when the template of location algorithm is modified, by reconstruction unit automatically to being converted based on two-dimensional linear
Other vision algorithms make modification, so that modified second template with location algorithm matches.As reconstruction unit U300
When receiving reconstruction instruction, according to two-dimensional linear transformation matrix corresponding with the second template, rebuilds the two-dimensional linear that is based on and become
The template of the vision algorithm changed.
For example, reconstruction unit U300 receives the reconstruction instruction of notification unit U200 transmission, it is described based on two not executing
Dimensional linear transformation vision algorithm in the case where, the template of these algorithms (such as looking for round algorithm) is rebuild automatically, make its with
Second template Ms1 matching.
Referring to Fig.2, in some preferred embodiments of the application, reconstruction unit U300 includes:
Subelement U310 is obtained, the initial search of the current template for obtaining the vision algorithm based on two-dimensional linear transformation
Region;
Subelement U320 is rebuild, for according to the initial search region and the two-dimensional linear corresponding with the second template
Transformation matrix rebuilds the template of the vision algorithm based on two-dimensional linear transformation.
In the present embodiment, modification is made to the template of location algorithm in modification unit U100, and pass through notification unit U200
Notify that acquisition subelement U310 obtains the current template of the vision algorithm converted based on two-dimensional linear to after reconstruction unit U300
Initial search region.Subelement U320 is rebuild according to the initial search region of acquisition and described corresponding with the second template two
Dimensional linear transformation matrix rebuilds the template of the vision algorithm based on two-dimensional linear transformation.
For example, obtaining the two-dimensional linear transformation matrix C2 corresponding with the second template Ms1 of modification unit output;It is single to rebuild son
First U330 can determine the new template Mf1 for looking for round algorithm according to two-dimensional linear transformation matrix C2 and initial search region D.
Wherein, initial search region D is not it is to be understood that location algorithm and based on other views of two-dimensional linear transformation
When feeling that the template of algorithm makes modification, the corresponding initial search region of the current template of vision algorithm.For example, the of location algorithm
One template is Ms, executes the first template Ms, exports two-dimensional linear transformation matrix C, looks for round algorithm to obtain based on two-dimensional linear transformation
Take two-dimensional linear transformation matrix C, and according to two-dimensional linear transformation matrix C and current template Mf determine region of search D, D be with
The corresponding initial search region of the current template for looking for round algorithm based on two-dimensional linear transformation.
Based on this, in some preferred embodiments of the application, obtaining subelement U310 includes:
Subelement U311 is executed, for executing first template, output corresponding with the first template two to training data
Dimensional linear transformation matrix;
Subelement U312 is determined, for obtaining two-dimensional linear corresponding with the first template transformation square for executing subelement output
Battle array is worked as according to first template corresponding two-dimensional linear transformation matrix and the vision algorithm based on two-dimensional linear transformation
Front template determines initial search region.
The first template Ms is executed to training data for example, executing subelement U311, is exported and the first template Ms corresponding two
Dimensional linear transformation matrix C;Determine that subelement U312 obtains two-dimensional linear transformation matrix C, according to two-dimensional linear transformation matrix C and base
In the current template Mf of the vision algorithm of two-dimensional linear transformation, initial search region D, D=Mf × C are determined.
In the application further preferred embodiment, subelement U320 is rebuild especially by following step, rebuilds institute
State the template of the vision algorithm based on two-dimensional linear transformation:
Firstly, obtaining two-dimensional linear transformation matrix corresponding with the second template, described corresponding with the second template two are calculated
The inverse matrix of dimensional linear transformation matrix;
For example, obtaining two-dimensional linear transformation matrix C2 corresponding with the second template Ms1, and calculating matrix C2's is inverse;
Secondly, rebuilding the vision based on two-dimensional linear transformation according to the inverse matrix and the initial search region
The template of algorithm.
Preferably, subelement U320 is rebuild to be rebuild with the initial search region according to matrix multiplication according to the inverse matrix
The template of the vision algorithm based on two-dimensional linear transformation.For example, looking for round algorithm based on two-dimensional linear transformation after rebuilding
Template Mf1=initial search region D × two-dimensional linear transformation matrix C2 it is inverse.
As can be seen from the above embodiments, the template reconstructing device provided by the present application based on two-dimensional linear transformation, firstly, modification
Unit modifies to the first template of location algorithm, obtains the second template;Second template, output are executed to training data
Two-dimensional linear transformation matrix corresponding with the second template;Secondly, notification unit is modified when the first template of the location algorithm
When, it sends and rebuilds instruction to reconstruction unit;Then, when reconstruction unit receives reconstruction instruction, according to described and the second template
Corresponding two-dimensional linear transformation matrix rebuilds the template of the vision algorithm based on two-dimensional linear transformation.
Using the application device and method, when the template of location algorithm is modified, based on its of two-dimensional linear transformation
The template of his vision algorithm is passively modified according to the template of modified location algorithm, to reduce software in system
Programming quantity and data processing amount reduce system maintenance cost.Meanwhile for distribution and the vision software that can individually debug, keep away
Exempt from only to have modified location algorithm and other unmodified corresponding vision algorithms lead to abnormal situation occur when use next time.
According to a kind of above-mentioned template reconstructing device based on two-dimensional linear transformation, the present embodiment provides one kind to be based on two-dimensional line
Property transformation template method for reconstructing, refering to Fig. 3, this method comprises:
Step S110 obtains modified the second obtained template when the first template of location algorithm is modified;
Step S120 executes second template to training data, obtains two-dimensional linear transformation corresponding with the second template
Matrix;
Step S130 is rebuild described based on two-dimensional line according to the two-dimensional linear transformation matrix corresponding with the second template
Property transformation vision algorithm template.
Preferably, the step S130, according to the two-dimensional linear transformation matrix corresponding with the second template, described in reconstruction
The template of vision algorithm based on two-dimensional linear transformation, comprising:
Firstly, obtaining the initial search region of the current template of the vision algorithm converted based on two-dimensional linear;
Secondly, being rebuild according to the initial search region and the two-dimensional linear transformation matrix corresponding with the second template
The template of the vision algorithm based on two-dimensional linear transformation.
Preferably, described according to the initial search region and corresponding with the second template two-dimensional linear converts square
Battle array rebuilds the template of the vision algorithm based on two-dimensional linear transformation, comprising:
Firstly, calculating the inverse matrix of the two-dimensional linear transformation matrix corresponding with the second template;
Secondly, rebuilding the vision based on two-dimensional linear transformation according to the inverse matrix and the initial search region
The template of algorithm.
Preferably, it is rebuild according to the inverse matrix and the initial search region according to matrix multiplication described based on two-dimensional line
Property transformation vision algorithm template.
Preferably, the initial search region of the current template for obtaining the vision algorithm converted based on two-dimensional linear, packet
It includes:
Firstly, executing first template to training data, two-dimensional linear transformation matrix corresponding with the first template is exported;
Secondly, according to the corresponding two-dimensional linear transformation matrix of first template and the view based on two-dimensional linear transformation
The current template for feeling algorithm, determines initial search region.
As can be seen from the above embodiments, the template reconstructing device and side provided by the embodiments of the present application based on two-dimensional linear transformation
Method obtains the second template firstly, modification unit modifies to the first template of location algorithm;To described in training data execution
Second template exports two-dimensional linear transformation matrix corresponding with the second template;Secondly, notification unit is when the of the location algorithm
When one template is modified, sends and rebuild instruction to reconstruction unit;Then, when reconstruction unit receives reconstruction instruction, according to institute
Two-dimensional linear transformation matrix corresponding with the second template is stated, the template of the vision algorithm based on two-dimensional linear transformation is rebuild.
Using the application device and method, when the template of location algorithm is modified, based on its of two-dimensional linear transformation
The template of his vision algorithm is passively modified according to the template of modified location algorithm, to reduce software in system
Programming quantity and data processing amount reduce system maintenance cost.Meanwhile for distribution and the vision software that can individually debug, keep away
Exempt from only to have modified location algorithm and other unmodified corresponding vision algorithms lead to abnormal situation occur when use next time.
In the specific implementation, the present invention also provides a kind of computer storage mediums, wherein the computer storage medium can store
There is program, which may include step some or all of in each embodiment of method for reconstructing provided by the invention when executing.Institute
The storage medium stated can for magnetic disk, CD, read-only memory (English: read-only memory, referred to as: ROM) or with
Machine storage memory (English: random access memory, referred to as: RAM) etc..
It is required that those skilled in the art can be understood that the technology in the embodiment of the present invention can add by software
The mode of general hardware platform realize.Based on this understanding, the technical solution in the embodiment of the present invention substantially or
Say that the part that contributes to existing technology can be embodied in the form of software products, which can deposit
Storage is in storage medium, such as ROM/RAM, magnetic disk, CD, including some instructions are used so that computer equipment (can be with
It is personal computer, server or the network equipment etc.) execute certain part institutes of each embodiment of the present invention or embodiment
The method stated.
Same and similar part may refer to each other between each embodiment in this specification.Implement especially for device
For example, since it is substantially similar to the method embodiment, so being described relatively simple, related place is referring in embodiment of the method
Explanation.
Invention described above embodiment is not intended to limit the scope of the present invention..