A kind of presetting bit method and control system
Technical field
The present invention relates to video camera and field of video monitoring, specifically refer to a kind of presetting bit method and control system.
Background technology
Need monitored key area is linked together with the operation conditions of ball machine in protection and monitor field, need
Multiple specifically monitored regional locations are arranged and are stored in back-end controller, when needing to be monitored these regions, controller
By by sending commands to call above-mentioned certain presetting bit for setting.And this presetting bit setting and method of calling, it usually needs
Store ball machine directional information, Zoom when presetting bit is arranged simultaneously(Amplification)And Focus(Aggregation), and when calling only
Have under these specific Zoom, could fast and accurately carry out presetting bit and call, the data storage so when presetting bit is arranged
Amount is big, but information is less, when presetting bit is called, needs specific Z oom just be accurately positioned.
The content of the invention
It is an object of the invention to provide a kind of presetting bit method and control system, solve ball machine any direction difference Zoom
The problem of accurate presetting bit can accurately be carried out down.
The purpose of the present invention is realized by following technical methods:
A kind of presetting bit method, comprises the following steps:Presetting bit setting steps and presetting bit invocation step,
Presetting bit setting steps are comprised the steps of:
(A1)After system initialization, camera review center alignment is specified into target,
(A2)Ball machine directional information and the amplification Zoom value under given range are sent to all-in-one, directional information includes
Ball machine level angle and ball machine vertical angle,
(A3)All-in-one under the Zoom values, using auto-focusing makes image object clearly and obtains current Focus values,
(A4)Using current Zoom values and Focus values, according to being calculated by linear interpolation method in online number storehouse
To the wire size of current preset point, wire size includes corresponding Zoom values and Focus values under current directional information,
(A5)Current directional information and wire size are stored,
(A6)According to the number in preset site, repeat(A1)Step is extremely(A5)Step, stores all presetting bit set-points pair
The directional information answered and calculated wire size form presetting bit information table;
Presetting bit invocation step is comprised the steps of:
(B1)After system initialization, camera review center alignment is specified into target,
(B2)Ball machine directional information is sent with arbitrary amplification Zoom value to all-in-one,
(B3)Directional information and wire size that inquiry presetting bit is stored when arranging, if there is current correspondence direction information,
(B4)If(B3)Corresponding directional information can be inquired, then directly finds out current wire size,
(B5)If(B3)Corresponding directional information can not be inquired, is then made a look up and is calculated by the method for interpolation calculation
Wire size,
(B6)Pass through(B4)Or(B5)After the wire size for obtaining, according to wire size and(B1)In amplification Zoom value calculating
Corresponding Focus values, so as to be quickly obtained picture rich in detail,
(B7)Number is called according to specified presetting bit, is repeated(B1)Step is extremely(B6)Step.
Presetting bit is arranged:According to amplification Zoom in ball machine directional information and given range, current wire size is set.
Presetting bit is called:The ball machine directional information received according to all-in-one and current arbitrary amplification, according to correlation
Method searches current corresponding wire size.
Specifically:When camera review center alignment specifies target, obtained to ball machine according to ball machine control device
Directional information, and the Zoom values under given range, directional information include ball machine level angle and vertical angle.All-in-one machine
Core under the Zoom values, using auto-focusing makes image object clearly and obtains current Focus values, then using current Zoom
Value and Focus values are calculated the wire size of current preset point according to data base.Wire size now is for present level angle and vertically
Zoom values and Focus values under angle, due to the different corresponding Focus values of Zoom values it is also different, therefore the wire size information pair
Answer and multiple map corresponding Zoom values and Focus values one by one.
The presetting bit arrange need to store the corresponding ball machine level angle in all presetting bit set-points, vertical angle and
Calculated wire size.
The presetting bit is called and is included in given ball machine level, vertical angle and Zoom values, is arranged according to the presetting bit
When the ball machine angle information that stores and wire size relation obtain current wire size, and according to Zoom values and the wire size for finding calculating
Corresponding Focus values, enable all-in-one to be clearly directed at presetting bit point of invocation.Therefore the present invention need not store Focus values,
And Zoom values when calling can also be any Zoom values.
From the aforegoing it can be seen that the present invention draws wire size using Zoom values and Focus value curve linear relationships, using storage wire size
Mode changes the mode of conventional store Zoom value and Focus values, so only needs to call reality by wire size and arbitrary Zoom values
Existing image is clearly called, therefore amplification of amplification of presetting bit when calling when being arranged with presetting bit is not appointed
What relation, when not arranged by presetting bit, amplification is constrained, and can be arbitrarily enlarged multiple.
When the presetting bit is called, differ in storage table and surely find all of ball machine angle information, accordingly, it would be desirable to adopt
Wire size is made a look up and is calculated with the method for interpolation calculation, and interpolation method is using the ball machine direction level angle and vertical angle
In immediate wire size, more accurate wire size now is calculated by the method for linear interpolation.
It is described(A2)In Zoom value scopes be。
Presetting bit information table includes wire size data and ball machine level angle data and ball machine vertical angle data.
(B5)In formula that wire size adopts is made a look up and calculated by the method for interpolation calculation for:
;
Wherein,WithIt is horizontal and vertical interpolation coefficient respectively,It is basisArriveWithThe distance between
Determine,It is basisArriveWithThe distance between determining, it is specific as follows:
;;(B2)In ball machine directional information be:Level angle, vertical angle
Degree,、It is and level angleAdjacent level angle,、It is and vertical angleNeighboring vertical angle
Degree, x,yExpression makes a look up and calculates wire size by the method for interpolation calculation, i,jRepresent level angle, vertical angle
The wire size of composition, i+1,jRepresent level angle, vertical angleThe wire size of composition, i,j+1Represent level angle, hang down
SquarenessThe wire size of composition, i+1,j+1Represent level angle, vertical angleThe wire size of composition,
The computing formula realized all by fixed-point processing inside processor,WithAll it is to be normalized to 128
Or 256,、、Level angle is represented,、、Vertical angle is represented。
The directional information that one ball machine level angle data is constituted with a ball machine vertical angle data is corresponding one
Wire size, a wire size correspond to multiple amplification Zoom values and the Focus values under correspondence amplification Zoom value.
It is to go to calculate current Focus values according to directional information and amplification Zoom value to obtain current Focus values, its
Computational methods are under the Zoom values of given range, make target image clear, record Focus values now.
According to the control system that the presetting bit method is generated,
Including the ball machine control device that order can be sent to ball machine,
Including the command analysis module of energy resolve command head,
Including the Focus computing modules that can calculate Focus values,
Including the presetting bit that can calculate wire size, wire size computing module is set,
Including the preset information memory module that can store level angle, vertical angle, wire size,
Wire size module is called including the presetting bit that can call wire size,
Including the presetting bit that Focus values can be calculated according to wire size and amplification Zoom value call Focus computing modules,
Including the locating module that can be positioned according to Focus values and Zoom values,
Also include the motor control module that action is carried out according to Focus values and Zoom values,
The command format that ball machine control device sends is defined as follows:
Including 2 byte command heads, the amplification Zoom value of 2 bytes, the ball machine level angle and 1 byte of 2 bytes are hung down
Squareness, it is that presetting bit setting or presetting bit are called that command header determines.
Command analysis module is analyzed presetting bit setting or presetting bit according to the command header of preset order of the bit and is called.
When command analysis module according to command header come analyze be presetting bit arrange when, mentioned order be transferred to Focus calculating
In module, Focus computing modules go to calculate according to the level angle and vertical angle and amplification Zoom value in order works as
Data [Zoom, Focus], after drawing Focus values, are sent to presetting bit by Focus computing modules and arrange wire size by front Focus values
Computing module, presetting bit arrange wire size computing module and pass through linear according in the online number storehouse of current data [Zoom, Focus]
Interpolation method is calculated current wire size, finally, present level angle, vertical angle and wire size is stored in preset information storage
Module;
When command analysis module is that presetting bit call to analyze according to command header, mentioned order is transferred to presetting bit and calls
Wire size module, presetting bit call wire size module to be inquired and present level angle according to the level angle and vertical angle in order
The wire size corresponding with vertical angle, calls Focus computing modules just be calculated according to wire size and Zoom values by presetting bit
Current Focus values are obtained, motor control module are controlled by Camera Positioning module using Zoom values and Focus values,
When command analysis module is that presetting bit call to analyze according to command header, mentioned order is transferred to presetting bit and calls
Wire size module, presetting bit call wire size module according to the level angle in order and vertical angle inquiry less than with present level angle
The degree wire size corresponding with vertical angle, then made a look up by the method for interpolation calculation and calculate current wire size, by preset
Position call Focus computing modules just be calculated current Focus values according to wire size and Zoom values, using Zoom values with
Focus values control motor control module by Camera Positioning module,
Amplification Zoom value when presetting bit is arranged, it is necessary to meet the amplification in given range, when presetting bit is called
Multiple Zoom values can be arbitrarily enlarged multiple.
Due to present invention employs presetting bit method as described above, presetting bit precision and efficiency are greatly improved.Therefore,
Compared with background technology method, the invention has the advantages that:
1st, can preset bigger quantity of information, the presetting bit under any multiple under the ball machine angle can be called;
2nd, Zoom values when Zoom values when presetting bit is called are arranged with presetting bit are unrelated, can be any Zoom values;
3rd, it is easy to from motion tracking, is capable of achieving from motion tracking when Zoom values are given;
4th, according to special scenes, angle presetting bit setting and tracking are carried out, during angle change, by controller by the change of ball machine
Change information is sent to all-in-one, provides angle and Zoom value predictive values, the speed of presetting bit tracking can be greatly improved and smooths
Property.
Description of the drawings
Fig. 1 is a kind of structured flowchart of presetting bit method provided in an embodiment of the present invention;
Fig. 2 is a kind of particular flow sheet of presetting bit method provided in an embodiment of the present invention;
Fig. 3 is the schematic diagram of interpolation lookup wire size in a kind of presetting bit method provided in an embodiment of the present invention;
Fig. 4 is a kind of structural representation of presetting bit system provided in an embodiment of the present invention.
Specific embodiment
With reference to embodiment, the present invention is described in further detail, but embodiments of the present invention not limited to this.
Embodiment 1:
Such as Fig. 1,
Fig. 1 gives the structured flowchart of the embodiment of presetting bit method of the present invention, specifically include presetting bit arrange and
Presetting bit is called, and presetting bit arranges mainly according to the current directional information of ball machine and amplification to determine current wire size, and will
Directional information is stored with wire size, and it is searching wire size, and according to ball according to the current directional information of ball machine that presetting bit is called
Machine is sent to the amplification determination of video camera and works as front focal length, calls so as to carry out quickly and accurately presetting bit.
Such as Fig. 2,
A kind of presetting bit method, comprises the following steps:Presetting bit setting steps and presetting bit invocation step,
The flow process of a-quadrant in such as Fig. 2, presetting bit setting steps are comprised the steps of:
(A1)After system initialization, camera review center alignment is specified into target,
(A2)Ball machine directional information and the amplification Zoom value under given range are sent to all-in-one, directional information includes
Ball machine level angle and ball machine vertical angle,
(A3)All-in-one under the Zoom values, using auto-focusing makes image object clearly and obtains current Focus values,
(A4)Using current Zoom values and Focus values, according to being calculated by linear interpolation method in online number storehouse
To the wire size of current preset point, wire size includes corresponding Zoom values and Focus values under current directional information,
(A5)Current directional information and wire size are stored,
(A6)According to the number in preset site, repeat(A1)Step is extremely(A5)Step, stores all presetting bit set-points pair
The directional information answered and calculated wire size form presetting bit information table;So assume there is N number of preset site, then, will
A length can be stored for N, and have ball machine level angle and ball machine vertical angle, wire size these three element data presetting bit information
Table.
The flow process in B regions in such as Fig. 2, presetting bit invocation step are comprised the steps of:
(B1)After system initialization, camera review center alignment is specified into target,
(B2)Ball machine directional information is sent with arbitrary amplification Zoom value to all-in-one,
(B3)Directional information and wire size that inquiry presetting bit is stored when arranging, if there is current correspondence direction information,
(B4)If(B3)Corresponding directional information can be inquired, then directly finds out current wire size,
(B5)If(B3)Corresponding directional information can not be inquired, is then made a look up and is calculated by the method for interpolation calculation
Wire size,
(B6)Pass through(B4)Or(B5)After the wire size for obtaining, according to wire size and(B1)In amplification Zoom value calculating
Corresponding Focus values, so as to be quickly obtained picture rich in detail,
(B7)Number is called according to specified presetting bit, is repeated(B1)Step is extremely(B6)Step.
Presetting bit is arranged:According to amplification Zoom in ball machine directional information and given range, current wire size is set.
Presetting bit is called:The ball machine directional information received according to all-in-one and current arbitrary amplification, according to correlation
Method searches current corresponding wire size.
Specifically:When camera review center alignment specifies target, obtained to ball machine according to ball machine control device
Directional information, and the Zoom values under given range, directional information include ball machine level angle and vertical angle.All-in-one machine
Core under the Zoom values, using auto-focusing makes image object clearly and obtains current Focus values, then using current Zoom
Value and Focus values are calculated the wire size of current preset point according to data base.Wire size now is for present level angle and vertically
Zoom values and Focus values under angle, due to the different corresponding Focus values of Zoom values it is also different, therefore the wire size information pair
Answer and multiple map corresponding Zoom values and Focus values one by one.
The presetting bit arrange need to store the corresponding ball machine level angle in all presetting bit set-points, vertical angle and
Calculated wire size.
The presetting bit is called and is included in given ball machine level, vertical angle and Zoom values, is arranged according to the presetting bit
When the ball machine angle information that stores and wire size relation obtain current wire size, and according to Zoom values and the wire size for finding calculating
Corresponding Focus values, enable all-in-one to be clearly directed at presetting bit point of invocation.Therefore the present invention need not store Focus values,
And Zoom values when calling can also be any Zoom values.
From the aforegoing it can be seen that the present invention draws wire size using Zoom values and Focus value curve linear relationships, using storage wire size
Mode changes the mode of conventional store Zoom value and Focus values, so only needs to call reality by wire size and arbitrary Zoom values
Existing image is clearly called, therefore amplification of amplification of presetting bit when calling when being arranged with presetting bit is not appointed
What relation, when not arranged by presetting bit, amplification is constrained, and can be arbitrarily enlarged multiple.
When the presetting bit is called, differ in storage table and surely find all of ball machine angle information, accordingly, it would be desirable to adopt
Wire size is made a look up and is calculated with the method for interpolation calculation, and interpolation method is using the ball machine direction level angle and vertical angle
In immediate wire size, more accurate wire size now is calculated by the method for linear interpolation.
It is described(A2)In Zoom value scopes be。
Presetting bit information table includes wire size data and ball machine level angle data and ball machine vertical angle data.
Such as Fig. 3,(B5)In formula that wire size adopts is made a look up and calculated by the method for interpolation calculation for:
;
Wherein,WithIt is horizontal and vertical interpolation coefficient respectively,It is basisArriveWithThe distance between
Determine,It is basisArriveWithThe distance between determining, it is specific as follows:
;;(B2)In ball machine directional information be:Level angle, vertical angle
Degree,、It is and level angleAdjacent level angle,、It is and vertical angleNeighboring vertical angle
Degree, x,yExpression makes a look up and calculates wire size by the method for interpolation calculation, i,jRepresent level angle, vertical angle
The wire size of composition, i+1,jRepresent level angle, vertical angleThe wire size of composition, i,j+1Represent level angle, hang down
SquarenessThe wire size of composition, i+1,j+1Represent level angle, vertical angleThe wire size of composition,
The computing formula realized all by fixed-point processing inside processor,WithAll it is to be normalized to 128
Or 256,、、Level angle is represented,、、Vertical angle is represented。
The directional information that one ball machine level angle data is constituted with a ball machine vertical angle data is corresponding one
Wire size, a wire size correspond to multiple amplification Zoom values and the Focus values under correspondence amplification Zoom value.
It is to go to calculate current Focus values according to directional information and amplification Zoom value to obtain current Focus values, its
Computational methods are under the Zoom values of given range, make target image clear, record Focus values now.
Embodiment 2
Such as Fig. 4, according to the control system that the presetting bit method is generated,
Including the ball machine control device that order can be sent to ball machine,
Including the command analysis module of energy resolve command head,
Including the Focus computing modules that can calculate Focus values,
Including the presetting bit that can calculate wire size, wire size computing module is set,
Including the preset information memory module that can store level angle, vertical angle, wire size,
Wire size module is called including the presetting bit that can call wire size,
Including the presetting bit that Focus values can be calculated according to wire size and amplification Zoom value call Focus computing modules,
Including the locating module that can be positioned according to Focus values and Zoom values,
Also include the motor control module that action is carried out according to Focus values and Zoom values,
The command format that ball machine control device sends is defined as follows:
Including 2 byte command heads, the amplification Zoom value of 2 bytes, the ball machine level angle of 2 bytes and 1 byte vertical angle
Degree, it is that presetting bit setting or presetting bit are called that command header determines.For example:Preset order of the bit:。
Command analysis module is analyzed presetting bit setting or presetting bit according to the command header of preset order of the bit and is called.
When command analysis module according to command header come analyze be presetting bit arrange when, mentioned order be transferred to Focus calculating
In module, Focus computing modules go to calculate according to the level angle and vertical angle and amplification Zoom value in order works as
Data [Zoom, Focus], after drawing Focus values, are sent to presetting bit by Focus computing modules and arrange wire size by front Focus values
Computing module, presetting bit arrange wire size computing module and pass through linear according in the online number storehouse of current data [Zoom, Focus]
Interpolation method is calculated current wire size, finally, present level angle, vertical angle and wire size is stored in preset information storage
Module;
When command analysis module is that presetting bit call to analyze according to command header, mentioned order is transferred to presetting bit and calls
Wire size module, presetting bit call wire size module to be inquired and present level angle according to the level angle and vertical angle in order
The wire size corresponding with vertical angle, calls Focus computing modules just be calculated according to wire size and Zoom values by presetting bit
Current Focus values are obtained, motor control module are controlled by Camera Positioning module using Zoom values and Focus values,
When command analysis module is that presetting bit call to analyze according to command header, mentioned order is transferred to presetting bit and calls
Wire size module, presetting bit call wire size module according to the level angle in order and vertical angle inquiry less than with present level angle
The degree wire size corresponding with vertical angle, then made a look up by the method for interpolation calculation and calculate current wire size, by preset
Position call Focus computing modules just be calculated current Focus values according to wire size and Zoom values, using Zoom values with
Focus values control motor control module by Camera Positioning module,
Amplification Zoom value when presetting bit is arranged, it is necessary to meet the amplification in given range, when presetting bit is called
Multiple Zoom values can be arbitrarily enlarged multiple.
Due to present invention employs presetting bit method as described above, presetting bit precision and efficiency are greatly improved.Therefore,
Compared with background technology method, the invention has the advantages that:
1st, can preset bigger quantity of information, the presetting bit under any multiple under the ball machine angle can be called;
2nd, Zoom values when Zoom values when presetting bit is called are arranged with presetting bit are unrelated, can be to appoint when presetting bit is called
Meaning Zoom values;
3rd, it is easy to from motion tracking, is capable of achieving from motion tracking when Zoom values are given;
4th, according to special scenes, angle presetting bit setting and tracking are carried out, during angle change, by controller by the change of ball machine
Change information is sent to all-in-one, provides angle and Zoom value predictive values, the speed of presetting bit tracking can be greatly improved and smooths
Property.
The above, is only presently preferred embodiments of the present invention, not does any pro forma restriction to the present invention, it is every according to
According to any simple modification, equivalent variations made to above example in technical spirit of the invention, the guarantor of the present invention is each fallen within
Within the scope of shield.