A kind of method and device thereof of capacitance plate point recognition and tracking
Technical field
The present invention relates to a kind of method and device thereof of the recognition and tracking of capacitance plate point more particularly to a kind of capacitance plates
The method and device thereof of multiple spot recognition and tracking.
Background technique
With the progress of science and technology, computer system has become a part of people's life, and computer system
It increasingly minimizes, gives bringing great convenience property of people's life.The input unit common as computer system includes: mouse
Mark, keyboard, touch screen and similar device.In these input units, touch screen is by feat of easy to operate, functional diversities etc.
Advantage, the deep favor by people, touch screen technology have also obtained good development, perfect during people pursue.
Touch screen generally comprises a touch panel, a controller and a software driver, and user or stylus are logical
It crosses and simply selects or move cursor on touch panel, which can be examined by the sensor in touch panel
It surveys, computer system is then fed back to by controller, software driver;Department of computer science is then executed based on above-mentioned touch action
It unites preset operation.But with the fast development of smart machine, increasingly higher demands are proposed to touch technology, from hardware
From the point of view of, touch screen starts to develop to mutual capacitance screen from self-capacitance screen, from multilayer ITO (IndiumTinOxide, tin-doped indium oxide)
Develop into one way ITO, develops towards high transparency, high sensitivity and pinpoint accuracy.
For example, a kind of multi-point touch panel is disclosed in the Chinese patent application application No. is CN201110087942.4,
And the unlike signal for illustrating touch location on touch panel can be generated for every touch in multiple point touching;Specifically wrap
It includes: 1, receiving the initial data of each transparent capacitive sensing node numerical value of touch screen;2, it is individually made an uproar using median filtering removal
Point;3, gradient data is generated, and the gradient data is the capacitance based on each data point;4, touching is calculated based on gradient data
The boundary in region is touched, wherein calculating boundary includes determining which data is incorporated into together to constitute touch area;5, it calculates every
The coordinate of a touch area obtains the exact position that finger or stylus touch;This digital signal processing method is also known as ladder
Degree method.Inventor has found that gradient method is with the common certain methods of image procossing to capacitance in the implementation of the present invention
Distribution carries out operation, and this operation method complexity is higher, and under identical hardware condition, the points of identification are relatively fewer,
It is difficult to track multiple spot and the identification of complicated gesture provides support;And above-mentioned calculation method is in the case of two refer to closer
It can not handle, be easy to produce very big calculating error.
In order to solve the above-mentioned technical problem, the identification of point can be realized using the method for hierarchical search;For example, in China
Number of patent application is to seek in the Chinese patent application of CN200980141961.1 as shown in Figure 1, disclosing a kind of touch of touch screen
Method is looked for, which is filtered first, threshold value comparison, doubtful touch area is selected, then to single Petting Area
Domain carries out 8 to hierarchical search, determines whether each region has finger touch, and determine and touch points, then to each region benefit
Accurate coordinates are calculated with centroid method.Inventor has found in the implementation of the present invention, although CN200980141961.1 opponent
The identification of finger is higher, but needs fixed hardware store unit to carry out classification storage to every grade of node data, and identify
Method is complex, and under the processing speed of equal conditions, identifiable touch points are limited, configures inflexible.
In addition, the point about capacitance plate tracks, currently used mode is shortest distance updating method.For example, applying
It, specifically, will number to disclose a kind of method of capacitance plate point tracking in the Chinese patent application of CN201110087942.4
The coordinate of present frame and previous frame is temporarily matched, and is then ranked up according to a spacing, is matched according to spacing size,
By the point of successful matching labeled as having matched, if encountering repetition pairing, the temporarily pairing sequence again by unpaired point, until
All point all successful matchings, the coordinate of each successful matching can distribute one with check mark.As shown in Fig. 2, crunode represents
One frame touch point, dot represent present frame touch point, first successively carry out each point of previous frame with all the points of present frame
Distance operation is temporarily matched apart from the smallest, and the result of pairing is as follows for the first time:
The generation of 214 points of touch point repeats to match, so (202,212) (208,214) successful matching, other points carry out secondary
Pairing, found after pairing maximum point away from be 4.1, if this away from actual range be less than point and track threshold value, then it is assumed that match
Success, final pairing result are as follows:
After interim pairing, if some coordinate points pairing of discovery present frame is unsuccessful, which be may be considered newly
Touch point, if some coordinate points of previous frame do not have successful matching, then it is assumed that track corresponding to the point terminates, and the point is corresponding
It is deleted with checking the number.
But inventor is in the implementation of the present invention, in the method for finding this point tracking, however it remains certain
Complexity.
Summary of the invention
Timely capacitance plate point identifies for high, tracking that in order to solve the above technical problem, the present invention provides a kind of accuracys rate
With the method and device thereof of tracking.
On the one hand, the method for the recognition and tracking of a kind of capacitance plate point provided by the invention, comprising: it is each to obtain capacitance plate
The capacitance of a point;Threshold decision, the capacitance based on each point judge doubtful touch point;Sentence in connection region
Fixed, the connection regional determination is that the doubtful different touch areas for touching point formation are marked respectively;Part is most
Big value identification, the local maximum identification include by point capacitance in the different touch areas respectively with dynamic link table
Form store and be ranked up to dynamic link table according to the size of capacitance;Accurate calculation of points, according to the dynamic chained list
Capacitance after sequence is as a result, determine the point where maximum capacitor value;Point tracking, according to the calculation of points as a result, according to
Shortest distance updating method, variation track of the point between different frame where determining the maximum capacitor value.Therefore, it can use dynamic
State chained list is recorded and is sorted to the point (being referred to as node) in connection region, and the complexity for searching maximum value is reduced
Degree, and storage space utilization can be improved, identifiable points can also be configured flexibly.
Preferably, the local maximum identification further includes screening to the dynamic link table after sequence, and the screening is
The corresponding capacitance of point each in dynamic link table is compared with scheduled threshold value, is doubtful part greater than the point of the threshold value
Maximum value point.
It is further preferred that the local maximum identification further includes detecting to the local maximum, the inspection
Survey method be the doubtful local maximum point is compared with the capacitor of its four point up and down, if described four
The capacitor of a point is both less than the capacitor of the doubtful maximum value point, then can be determined that the doubtful local maximum point
For local maximum point.
Using above-mentioned preferred technical solution, it can be further reduced the point bit quantity for needing to calculate maximum value, it can be fast
It reads to search local maximum.
It is further preferred that the threshold value is arranged to dynamic chain after the sequence when the dynamic link table only has one
Maximum value corresponds to the 50% of the capacitance of point in table;When the dynamic link table is at least provided with two, and it is described at least
Two dynamic link tables respectively correspond at least two different touch areas, and the threshold value of each dynamic link table screening is arranged respectively to
Respectively maximum value corresponds to the 50% of the capacitance of point in dynamic link table after sequence;The non-maximum value of half can be filtered out in this way
Data quickly calculate separately the point of each region.
Preferably, the result that the local maximum is detected can have a maximum value point, can also have at least
Two maximum value points.Therefore, use technical solution provided by the invention that can carry out with multiple points in multi-touch region
It accurately identifies.
Preferably, the threshold decision includes that capacitance and base value table that hardware scanning goes out are carried out operation to obtain variation
Amount, variable quantity are more than certain threshold value, then can be determined as that doubtful touch point, threshold decision are exactly by doubtful touch point position mark
For new numerical tabular;It is remapped after the completion of label.
Preferably, the connection regional determination carries out neighborhood using haystack queue with the Extension algorithm in image procossing
Expansion search.
Preferably, the point tracking includes: to be compared the point of the previous frame of the touch point sum of present frame, and determination is worked as
Whether some point of the previous frame of some point sum of previous frame belongs to the same track;An annular team is created for each track
Column;The complexity for searching point tracking can be reduced, and storage can be further improved during point tracks in this way
Space utilization rate.
Preferably, effective coordinate in the corresponding queue in the track first passes through smothing filtering, then exports final seat
Scale value;It may therefore be assured that touching the smoothness and accuracy of point track.
On the other hand, the present invention also provides a kind of devices of capacitance plate point recognition and tracking characterized by comprising
Data acquisition module, for obtaining the capacitance of each point of capacitance plate;Threshold value judgment module, for being based on each point
Capacitance judge doubtful touch point;Connection regional determination module, the connection regional determination module is by the doubtful touching
The different touch areas for touching point formation are marked respectively;Local maximum identification module, the local maximum identify mould
Block according to capacitance plate point recognition and tracking described in any one of the above method, by point electricity in the different touch areas
Capacitance is stored in the form of dynamic link table respectively, and is ranked up to dynamic link table according to the size of capacitance;Accurate Points
Position computing module, the accurate point computing module according to capacitance plate point recognition and tracking described in any one of the above side
Method determines the point where maximum capacitor value;Point tracking module, the point tracking module is according to described in any one of the above
Capacitance plate point recognition and tracking method, variation rail of the point between different frame where determining the maximum capacitor value
Mark.
Using above-mentioned preferred technical solution, the point in connection region is recorded and sorted with dynamic link table, it can
To reduce the complexity for searching maximum value, raising storage space utilization.Further, an annular team is created for each track
It is filtered before column, output coordinate point, it is ensured that touch the smoothness and accuracy of point track.
Detailed description of the invention
Fig. 1 is a kind of flow chart of the point recognition methods using hierarchical search in the prior art;
Fig. 2 is a kind of matrix diagram of touch point capacitance in the prior art;
Fig. 3 is a kind of method flow diagram for capacitance plate point recognition and tracking that the embodiment of the present invention one provides;
Fig. 4 a, Fig. 4 b are the schematic diagram for the connection zone marker that the embodiment of the present invention one provides;
Fig. 5 is the touch area point capacitance matrix diagram that the embodiment of the present invention one provides;
Fig. 6 is the schematic diagram for the touch area point dynamic link table that the embodiment of the present invention one provides;
Fig. 7 is that the doubtful local maximum point of a kind of touch area point dynamic link table that the embodiment of the present invention one provides is shown
It is intended to;
Fig. 8 is a kind of structural block diagram for capacitance plate point recognition and tracking device that the embodiment of the present invention one provides;
Fig. 9 is a kind of flow chart of capacitance plate point recognition and tracking provided by Embodiment 2 of the present invention;
Figure 10 is point capacitance matrix diagram in touch area provided by Embodiment 2 of the present invention;
Figure 11 is the schematic diagram of point dynamic link table in touch area provided by Embodiment 2 of the present invention;
Figure 12 is the schematic diagram that a kind of capacitance plate point that the embodiment of the present invention three provides tracks circle queue;
Figure 13 is that a kind of capacitance plate point that the embodiment of the present invention three provides tracks the schematic diagram that circle queue matches chained list.
Specific embodiment
Specific embodiments of the present invention will be described in detail with reference to the accompanying drawing, it should be noted that these are specific
Explanation only allow those of ordinary skill in the art to be more easier, clearly understand the present invention, rather than limitation of the invention solution
It releases.
Embodiment one
As shown in figure 3, a kind of recognition and tracking method for capacitance plate point that embodiment provides, comprising:
S1. point parameter obtains, and obtains the capacitance of each point of capacitance plate.
S2. threshold decision, the capacitance based on each point judge doubtful touch point.
S3. connection regional determination, connection regional determination be by it is doubtful touch point formed different touch areas respectively into
Line flag.
S4. local maximum identify, local maximum identification include by point capacitance in different touch areas respectively with
The form of dynamic link table store and be ranked up to dynamic link table according to the size of capacitance.
S5. accurate calculation of points, according to capacitance after dynamic chain list sorting as a result, determining the point where maximum capacitor value.
S6. point tracks, and according to calculation of points as a result, according to shortest distance updating method, determines maximum capacitor value point
Variation track of the position between different frame.
The point in connection region (or can be claimed with dynamic link table using the above-mentioned technical proposal in the present embodiment
For node) it is recorded and is sorted, the complexity for searching maximum value is reduced, and storage space utilization can be improved, can known
Other points can also be configured flexibly.
Preferably, connection regional determination carries out contiguous range expansion using haystack queue with the Extension algorithm in image procossing
Search;Point in different touch areas is marked respectively, is prepared for the identification of subsequent local maximum.
Such as the schematic diagram that Fig. 4 a is connection zone marker provided in this embodiment, the corresponding threshold for passing through step S2 of the schematic diagram
Doubtful touch point bit matrix after value judgement can be determined that there are three doubtful touch areas from Fig. 4 a;Fig. 4 b is step S3 connection
Matrix after regional determination.Then it can be identified according to the label in Fig. 4 b by step S4 local maximum recognition methods
The maximum value in each region in the doubtful touch area of above three;It can be by the corresponding capacitance of each point in touch area
A chained list node is created, then chained list node is ranked up, specifically implementation, it can be by such as minor function come complete
At:
typedef struct
{
int xPos;
int yPos;
int touch_delta;
struct Pixer*next;
}Pixer;
Wherein, Pixer is the meaning of node, xPos, yPos indicates coordinate, and touch_delta indicates the capacitor of the position
Value.
Fig. 5 show point capacitance matrix diagram in touch area provided in this embodiment, and the numerical value in the matrix diagram is pair
Answer the specific capacitance of each point in doubtful contact region in Fig. 4 a, Fig. 4 b.Fig. 6 is by three doubtful touch areas in Fig. 5
Capacitance be ranked up according to above-mentioned local maximum recognition methods after schematic diagram;There are 9 points in the first touch area,
Wherein, the corresponding point capacitance of coordinate (3,3) is up to 98;There are 6 points in second touch area, wherein coordinate (8,3) is right
The point capacitance answered is up to 83;There are 9 points in third touch area, and wherein the corresponding point capacitance of coordinate (6,7) is most
Greatly 120.
Preferably, the local maximum identification in step S4 further includes screening to the dynamic link table after sequence, screening
It is to be compared the corresponding capacitance of point each in dynamic link table with scheduled threshold value, is doubtful office greater than the point of the threshold value
Portion's maximum value point.
It is further preferred that threshold value is arranged to after sorting maximum value pair in dynamic link table when dynamic link table only has one
Answer the 50% of the capacitance of point;Two dynamic link tables respectively correspond when dynamic link table is at least provided with two, and at least
At least two different touch areas, the threshold value of each dynamic link table screening are arranged respectively to after respectively sorting in dynamic link table
Maximum value corresponds to the 50% of the capacitance of point;The non-maximum value data that half can be filtered out in this way, quickly to each region
Point calculate separately.In this embodiment preferably, dynamic link table is successively arranged according to size order according to from top to bottom,
So the maximum value in dynamic link table, is exactly the gauge outfit of dynamic link table;Certain dynamic link table can also be according to from the bottom up, successively
It is arranged according to size order, maximum value is exactly to correspond to table tail in such dynamic link table.
According to above-mentioned preferred technical solution, the first threshold that corresponding first chained list in the first touch area is chosen is 49,
The second threshold that corresponding second chained list in second touch area is chosen is 41.5, and the third threshold value that third touch area is chosen is
60.Three chained lists are screened respectively, the node most probable greater than the threshold value becomes doubtful local maximum point;Such as Fig. 7 institute
Show, the first touch area also remains 5 doubtful local maximums, and the second touch area also remains 4 doubtful local maximums, third touching
It touches region and also remains 6 doubtful local maximums.
It is further preferred that the local maximum identification in step S4 further includes detecting to local maximum, detection
Method is to be compared doubtful local maximum point with the capacitor of its four point up and down, if the electricity of four points
Hold the capacitor for being both less than doubtful maximum value point, then can be determined that doubtful local maximum point is local maximum point.
It can be further reduced the point bit quantity for needing to calculate maximum value in this way, can read to search local maximum fastly.Specifically, Fig. 5
In in three regions local maximum point be respectively (3,3), (8,3), (6,7), and respectively with three points up and down
After the capacitor of four points is compared, the point of these three point place values is respectively greater than their four points up and down, institute
It is considered that finger or stylus touch point with these three points (3,3), (8,3), (6,7).
Step S6 point tracking in the present embodiment, can be handled using knearest neighbour method in the prior art, can also be with
Using other preferred technical solutions (can hereafter be described later in detail).
As shown in figure 8, the present embodiment also provides a kind of device 10 of capacitance plate point recognition and tracking, comprising: data obtain
Modulus block 1, for obtaining the capacitance of each point of capacitance plate;Threshold value judgment module 2, for the capacitance based on each point
Judge doubtful touch point;Connection regional determination module 3, the difference that connection regional determination module forms doubtful touch point
Touch area is marked respectively;Local maximum identification module 4, local maximum identification module is according to above-mentioned capacitance plate point
The method of recognition and tracking stores point capacitance in different touch areas in the form of dynamic link table respectively, and right
Dynamic link table is ranked up according to the size of capacitance;Accurate point computing module 5, accurate point computing module is according to above-mentioned electricity
The method for holding screen point recognition and tracking, determines the point where maximum capacitor value;Point tracking module 6, point tracking module
According to the method for above-mentioned capacitance plate point recognition and tracking, variation rail of the point between different frame where determining maximum capacitor value
Mark.And the device 10 of the capacitance plate point recognition and tracking is additionally provided with the sensor of capacitance size on detection capacitance plate, deposits
It stores up the memory module of above-mentioned various parameters and the data that sensor detects is filtered to reduce the filter module of noise.
Embodiment two
If Fig. 9 is the flow chart of a kind of capacitance plate point recognition and tracking that embodiment two provides: the detection of each frame by
Timer interruption initiate, the time interval controls of timer the scanning frame per second of capacitance plate can if the processing capacity of CPU is stronger
Suitably to shorten time interval, frame per second is improved, is conducive to the accuracy for improving track following in this way.When timer interruption occurs
After (step 201), triggering hardware (such as sensor) carries out single pass to capacitance plate, obtains capacitor value matrix (step 202);
The capacitance scanned and base value table are subjected to operation and obtain variable quantity while not touching (base value refers to the capacitance table that stores),
Variable quantity is more than certain threshold value;It can then be determined as doubtful touch area, doubtful touch node is exactly labeled as by threshold decision
New numerical tabular (step 203);It is remapped after the completion of label, because the connection of capacitance plate node and scanning circuit is not true
It is fixed, it needs to remap by searching for table (corresponding with hardware), obtains and be distributed corresponding numerical tabular (step 204) with capacitance plate;
Then connection regional determination (step 205) is carried out using the method being the same as example 1;Logarithm table is analyzed (step again
206), if not detecting doubtful touch area, it is determined as no touch point, directly progress base value table update (step
207) current interrupt processing (step 208), is exited;If there is touch area, then the area of touch area is calculated,
If being more than certain threshold value (step 209), it is believed that be large area touching, directly exit (step 208), if it is not, carrying out next
Step processing;Next using the local maximum recognition methods being the same as example 1, multiple spot point identification (step is carried out
210), calculation of points (step 211), then according to calculation of points as a result, judge whether there is the untreated (step 212) in touch point,
If there is touch point is untreated, returns to step 210 and re-start the identification of multiple spot point, if untreated without touch point, directly
Multiple spot tracking link (step 213) is entered, then output coordinate (step 214), after completing point identification and tracking, directly
It exits, into the processing of next frame, such circulation step 201.
The case where being greater than at one (several fingers lean on closer) progress will occur to the same region in the present embodiment
Illustrate, this situation can also be accurately identified using local maximum method, as shown in Figure 10, two be detected in the same region
Touch point: (6,7) (4,7).Such as Figure 11, the table of the leftmost side is the capacitance of 15 points in touch area according to big float
Sequence is stored in dynamic link table;Intermediate table is to carry out detection method, detection according to a kind of local maximum of description of embodiment
Threshold value be 125 ÷ 2=62.5, thus only 8 points can be used as doubtful maximum value point;Then by this 8 points
Capacitance respectively compared with its value up and down, it is possible to determine that only there are two point (6,7) and (4,7) be greater than it is each upper and lower
The value of left and right, it is possible to determine that the two points are that finger or stylus touch point.
Since the physics grid distance of capacitance plate is larger, the point identified needs to obtain by interpolation calculation accurately
Point, centroid method are preferred methods, and formula is as follows:
Wherein: X is coordinate value, and p is peak point coordinate;C is corresponding point mutual capacitance detected value.
Embodiment three
Embodiment three and embodiment two or embodiment one use identical point recognition methods, with embodiment one and embodiment
Two difference is that point tracking further optimizes, specifically: point tracking include: by the touch point of present frame and
The point of previous frame be compared, determine whether some point of the previous frame of some point sum of present frame belongs to the same rail
Mark;A circle queue is created for each track;In this way the complexity for searching point tracking can be reduced during point tracks
Degree, and storage space utilization can be further improved.
Preferably, effective coordinate in the corresponding queue in track first passes through smothing filtering, then exports final coordinate value;
It may therefore be assured that touching the smoothness and accuracy of point track.
In example 2 preferably, after will identify that the point come is calculated using centroid method, own to present frame
After the completion of coordinate points calculate, each coordinate saves as Coord type structural body, and all coordinate points of present frame are stored in Current_
In Frame_axis array.Coord_x, coord_y are coordinate value, and valid indicates changing coordinates validity;Then using following
Function is calculated:
typedef struct
{
int coord_x;
int coord_y;
int valid;
}Coord;
Coord Current_Frame_axis[current_touch_max];
After the completion of point identification, the point of the previous frame of the touch point sum of present frame is mainly compared by point tracking,
Determine whether some point of the previous frame of some point sum of present frame belongs to the same track.
Coord Track_fifo[touch_max][deepth_fifo];
Such as Figure 12, the corresponding group data structure of each circle queue is safeguarded, " using (English is indicated with usage) "
Indicate effective coordinate points in circle queue (English to be indicated with Track_fifo, the queue of first in first out), pointer (use by English
Index is indicated) indicate newest coordinate points pointer, can also indicate whether the track is effective with parameter " label ", parameter
" match_flag " indicates whether there is coordinate points and the track successful matching in present frame, and can use parameter " average_
Coord_x, average_coord_y " indicate coordinate points output of the track after the disposal of gentle filter.
If some coordinate points and circle queue (serial number of Track_fifo (m), m expression queue) of present frame are paired into
Function, then by the access queue, pointer (index) plus 1 uses (usage) plus 1, if current queue has expired (usage=
The depth (depth_fifo) of queue), then the coordinate saved at first is override, if present frame does not have coordinate and circle queue
(Track_fifo (m)) successful matching, usage subtract 1, and index is constant, and when usage reduces to 0, which is emptied, label=
0, corresponding track terminates.
If some coordinate points of present frame and existing Track_fifo are without successful matching, it is likely that be one
New track starts, which is saved in a not used queue (label=0), and index and usage are incremented by, several frames
Afterwards, after usage is greater than some threshold value (usually depth_fifo/2), track queue label is set 1, externally exports the rail
Mark coordinate, can effectively eliminate single-point noise in this way.
The shortest distance updating method used in the present embodiment, be by coordinate points all in present frame successively with track queue
In newest coordinate points carry out distance operation, then the pairing of the shortest distance is ranked up, if the shortest distance be less than threshold value
And without repeating pairing, then successful matching repeats to match if it exists, then the shortest distance is greater than the combination for repeating to match and carries out weight
New pairing, interim pairing result each time are stored in Track_Distance data structure, and by dynamic link table into
Row sequence.It as shown in figure 13, is by the node in Fig. 2 according to the chained list after shortest distance update in the present embodiment.
After the completion of all the points pairing of present frame, effective coordinate in the queue of track is passed through into smothing filtering, output is final
Coordinate value, the process of the identification of entire point and point tracking all terminates, and the timer interruption for waiting next time triggers new
One frame arithmetic.
The above-mentioned technical proposal used in the present embodiment, it is stable on GL6066 platform, 40M, capacitor are run in CPU
Under the hardware condition for shielding control module 10M, cooperate the mutual capacitance touch screen of 10 × 15 arrays, it can be achieved that 5 points it is real-time with
Track, frame per second highest can achieve 120f/s.
Example IV
In the capacitance plate point recognition and tracking method that the present embodiment can provide, point identification can use the prior art
In gradient method or hierarchical searching method, and point tracking method can using embodiment three provide technical solution: most
Short distance update method, and a circle queue is created for each track.In this way can also be during point track, reduction is looked into
The complexity for looking for point to track, and storage space utilization can be further improved.
Finally, it should be noted that above description is only highly preferred embodiment of the present invention, not the present invention is appointed
What formal limitation.Anyone skilled in the art, it is without departing from the scope of the present invention, all available
The way and technology contents of the disclosure above make many possible variations and simple replacement etc. to technical solution of the present invention, these
Belong to the range of technical solution of the present invention protection.