Embodiment
In order to make purpose of the present invention, technical scheme and advantage clearer,, the present invention is further elaborated below in conjunction with drawings and Examples.Should be appreciated that specific embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
In embodiments of the present invention, determine the current numerical value that scans, and judge whether to be new grouping according to the numerical value of this current point, be all frontier points that then detect this new grouping, otherwise by the next point of direction of scanning surface sweeping, whether effective according to boundaries of packets point number threshold decision current group at last, effectively then keep invalid then clear 0.
In embodiments of the present invention, be the explanation that embodiment carries out the division methods of screen area with the touch screen, but be not limited to touch screen, as long as the data on screen exist the clearly definition of region point and non-region point can carry out area dividing.
In embodiments of the present invention:
(1): the point that defines on each zone boundary is a frontier point.Also can be defined as: if having the point on the direction at least in 4 directions in the upper and lower, left and right of a point is 0, and then this is a frontier point.
(2): the point that definition is surrounded by frontier point is an internal point.Also can be defined as: if the point on 4 directions in the upper and lower, left and right of a point all is non-0, then this is an internal point.In addition, testing process can't also can be thought internal point by detected " 1 " point.
(3): define each the grouping in first point that is scanned be the initial point of this grouping, initial point must be a frontier point.
Frontier point and internal point have constituted a packet zone jointly, and the frontier point of each packet zone and internal point are called the unit of this packet zone.
Fig. 1 shows the main flow process of the touch-screen multizone detection method that the embodiment of the invention provides, and its detailed step is as follows:
In step S101, by the current point of direction of scanning scanning screen, determine the numerical value of this current point, when the numerical value of this current point is 1, execution in step S102.
In embodiments of the present invention, the method that detects according to scanning scans the point of touch-screen, and wherein, this scanning detects and comprises scanning process and testing process, distinguish corresponding direction of scanning and detection side to.
As shown in Figure 2, each node is represented one 1 or 0 data among the figure, on behalf of this point, 1 be touched, on behalf of this point, 0 be not touched, 8 directions all have data for convenience of explanation and around guaranteeing each data point in the screen, the embodiment of the invention is that the square virtual screen example that virtual data 0 constitute describes with 4 limits shown in Figure 3, but be not limited to 4 limits is 0 virtual foursquare screen, this screen area can have any shape and size, scanning process can not scan virtual data 0, but testing process can detect this virtual data 0.
As shown in Figure 4, the direction of scanning be from top to bottom, scanning from left to right, promptly begin to scan (0 for initial point with coordinate (0,0) point, 9) point is then from (1,0) spot scan to (1,9) point, go down successively, scan (9,9) point at last, finish screen scanning and detect; The corresponding scanning process in direction of scanning, scanning process provides the grouping initial point for testing process, and gives the packet numbering of correspondence for internal point of each effective grouping.
As shown in Figure 5, the detection side is to being the criterion that starting point detects the some time institute foundation on 8 directions that are adjacent for detecting with certain point: the detection side is to serving as clockwise, promptly begin to detect from direction 0, be direction 7 at last, the detection side is to corresponding testing process, and testing process detects the process of these new all frontier points of grouping for the new grouping initial point that scans according to scanning process.
In embodiments of the present invention, direction of scanning and detection side to selection multiple situation can be arranged, the selection of every kind of direction of scanning all has corresponding with it similar scanning process and testing process, and what the embodiment of the invention provided only is one of multiple realization situation, but not in order to restriction the present invention.
In embodiments of the present invention, during according to current of direction of scanning scanning screen, the type of the current point of screen has three kinds, i.e. " 0 " point, " 1 " point and greater than 1 point is when the point that scans during greater than 1 point, then continues to scan next point for " 0 " point and numerical value, therefore, in this step, if the numerical value of this current point is 1, then current point is the initial point of new grouping or the internal point of existing grouping.
In step S102, judge that numerical value is the type of 1 current point, this numerical value is that the type of 1 current point may be the internal point of new grouping initial point or existing grouping, when this numerical value when being 1 current point for the internal point of existing grouping, execution in step S103; When this numerical value when being 1 current point, enter testing process, execution in step S104 for new grouping initial point.
In step S103, be that the existing packet numbering at 1 current some place is given this point with this numerical value.
In embodiments of the present invention, when numerical value when being 1 current point for the internal point of existing grouping, definition according to internal point, this internal point is between the frontier point of the corresponding existing grouping of this point, and the numerical value that is somebody's turn to do existing boundaries of packets point is numbering of this existing grouping, therefore gives numbering that this internal point can guarantee that this numerical value that has all unit of grouping all is this existing grouping the numerical value of this existing boundaries of packets point.
In step S104, be new packet numbering with current some assignment, wherein, the value of each grouped element is the numbering of this place, unit grouping on the screen.
In embodiments of the present invention, should current some assignment be that to comprise the initial point assignment of newly dividing into groups be new packet numbering to new packet numbering and be new packet numbering with new boundaries of packets point assignment.
In this embodiment, when this current point is new boundaries of packets point, boundaries of packets point number storage of variables in the storage unit is added up 1, for example the number storage of variables of current group frontier point is S-1, then detect once more after the new boundaries of packets point, the number storage of variables of new boundaries of packets point is changed to S, continues successively, testing process is put 0 variable after finishing again.
In step S105, be starting point with the new grouping initial point behind the new packet numbering of assignment, by the point of detection side's 8 directions around this new grouping initial point of detection.
In embodiments of the present invention, as shown in Figure 3, Figure 4:
(1): the x2 that sets up an office for point certain around the x1 a bit, then exist some point to be positioned at simultaneously around an x1 and the some x2.And, when an x2 is in the even number direction position (0,2,4,6) of an x1,4 points are arranged; When an x2 is in the odd number direction position (1,3,5,7) of an x1,2 points are arranged.
(2): on the dir of x1 direction, then put x1 on the dir-4 of x2 direction as fruit dot x2.
(3): since direction of scanning and detection side to, all data in each grouping only can be present on this grouping initial point (4,5,6,7) direction.
(4): can be drawn by (1) and (2), when an x1 detects an x2, be starting point when detecting with an x2 again, for fear of the direction of going check point x1 to detect again, then can by dir-4+2=dir-2 or dir-4+3=dir-1 be an x2 initial detection side to.
Therefore, in this embodiment, when this current point was the grouping initial point, the detection side was to being direction 4 to 7 shown in Figure 3, and the initial detection side of other points subtracts 2 to the direction that detects this point for a last point.
(5): if the border of certain grouping is checked up 0, then by the remaining point of this grouping constitute the frontier point number of grouping necessarily less than the frontier point number of original grouping.
Therefore, the frontier point of the grouping that the remaining point in clear 0 this boundaries of packets point back constitutes also can be by clear 0, final whole group clear 0.
In step S106, judge this new grouping initial point around 8 directions whether to have numerical value be non-0 point, be execution in step S107 then, otherwise expression this new grouping only comprises grouped element of initial point, execution S110.
In step S107, when to have numerical value on certain direction be non-0 point, judge whether this numerical value is at non-0 is the new boundaries of packets point that detected, be execution in step S108 then, otherwise return execution in step S104.
In embodiments of the present invention, when this numerical value is non-0 point when being new boundaries of packets point, returning execution in step S104, should new boundaries of packets point assignment be new packet numbering.
In step S108, judge whether this new boundaries of packets point is this grouping initial point, be execution in step S109 then, otherwise execution in step S105.
In step S109, when this numerical value is non-0 new boundaries of packets point during for this grouping initial point, judge around this grouping initial point this boundaries of packets point whether all detection finish, be execution in step S110 then, otherwise execution in step S114.
In embodiments of the present invention, owing to direction of scanning and detection side to reason, all frontier points in each grouping only can be present on this grouping initial point (4,5,6,7) direction, therefore have only when being positioned at (4 of grouping initial point, 5,6,7) all the boundaries of packets points on the direction are all detected just thinks that this packet zone detects after intact and finishes.
In step S110, when the new detection of packets that with new grouping initial point is starting point is finished, obtain the number of this new boundaries of packets point.
In embodiments of the present invention, as describing among the step S104, when the packet detection that is starting point with new grouping initial point is finished, obtain the numerical value S of new boundaries of packets point number storage of variables in the storage unit, S is the number of this new boundaries of packets point.
Whether in step S111, whether the number of judging this new boundaries of packets point more than or equal to boundaries of packets point number threshold value, promptly judge should new grouping effectively, is execution in step S113 then, otherwise execution in step S112.
In embodiments of the present invention, the minimum zone that this boundaries of packets point number threshold value is influenced when being touch screen, as the number S of this new boundaries of packets point during more than or equal to boundaries of packets point number threshold value, this new grouping is effective grouping, otherwise is null packets.Wherein, boundaries of packets point number threshold value can be the configuration data that screen system carries, also can be the numerical value that the user sets in advance voluntarily, boundaries of packets point number threshold value is stored in storage unit, the user can be provided with the size of boundaries of packets point number threshold value voluntarily according to actual screen and actual needs, when needs boundaries of packets point number threshold value, call relatively from this storage unit and to get final product.
In step S112, clear 0 frontier point.
In embodiments of the present invention, when this new boundaries of packets point number less than boundaries of packets point number threshold value, promptly divide into groups new grouped element to be put 0 when invalid.
In step S113, scanning detects other groupings and is scanned detection fully up to screen.
As one embodiment of the present of invention, after the detection of packets that new grouping initial point with this is a starting point is finished, promptly all these new boundaries of packets points that link to each other with this new grouping initial point all detect and finish when getting back to this new grouping initial point, according to the point on the continuation scanning screen in direction of scanning as mentioned above, promptly according to from the bottom up, direction from left to right continues scanning, in scanning process, the point that may scan is: initial point newly divides into groups, the internal point of existing boundaries of packets point and existing grouping, wherein existing boundaries of packets point has given the numbering of corresponding grouping and greater than 1, therefore the numerical value that scans is that 1 point is the internal point of new grouping initial point or existing grouping.
In embodiments of the present invention, each effectively all is endowed an identical packet numbering in all unit of grouping, and the grouping with same packets numbering is exactly a touch screen zone, according to above-mentioned flow process, if touch-screen is enough big, algorithm can detect any a plurality of touch screen zone in theory.
In embodiments of the present invention, more than the process of telling carry out all in the ideal case, ideal situation is meant that the internal point of each grouping all is the situation of " 1 " point.In fact, because the influence of factors such as people, environment and screen construction, the internal point numerical value that is positioned at grouping may be 0 and since this numerical value be 0 internal point between the frontier point or internal point of correspondence grouping, this internal point can cause certain influence to its point on every side.
In embodiments of the present invention, noise comprises two kinds of situations: a kind of is invalid zone in the screen area; Another kind is the point of 0 in the effective coverage, in this embodiment, by the judgement of validity inactive area is put 0 with noise filtering; For the point of 0 in the effective coverage, a kind of method of filtering is to redefine packets inner point and frontier point: if in 4 directions in upper and lower, left and right of certain point (comprising " 0 " and " 1 ") at least 3 directions o'clock greater than 0, then this is the packets inner point; As long as the point in 4 directions in upper and lower, left and right of certain point at least 2 directions is 0, then this is the boundaries of packets point.The point that is judged as packets inner point can be endowed corresponding packet numbering.Because the direction of scanning is according to from top to bottom, from left to right scans, what scanning process at first scanned before scanning certain point is this direction (1,2,3,0) point on, what scan then is direction (4,7,6,5) point on is therefore with (0,2 of packets inner point, 4,6) this point of the value assignment of 2 directions in the direction or 0 direction gets final product filtering noise, and the internal point that this method can not the filtering form of ownership is the noise and the influence thereof of " 0 ", but level and smooth touch area.The method of another filtering is in testing process each boundaries of packets point coordinate to be preserved, when every of scanning process scanning, judge all whether this point coordinate belongs in certain boundaries of packets point coordinate institute restricted portion then: be the numbering of then this point being given corresponding grouping, continue scanning then down a bit; Otherwise the value according to this point is carried out normal scanning process.The relatively expensive source of this method, but internal point that can the filtering arbitrary form is the noise and the influence thereof of " 0 ".Present embodiment adopts first method.。
Fig. 6 is the touch-screen multizone detection system block diagram that the embodiment of the invention provides, and for convenience of explanation, has only provided the part relevant with the embodiment of the invention among the figure.
Screen point numerical value determination module 11 is determined the numerical value of current point by the current point of direction of scanning scanning screen, and the numerical value of this current point is non-0, the type of wherein current point be new grouping initial point, existing grouping internal point, have the boundaries of packets point.
Detect grouping module 12 when current point value non-0, and current point is when newly dividing into groups initial point, the initial point assignment of will newly dividing into groups is new packet numbering, and detects all boundaries of packets points of the new new grouping in grouping initial point place, is new packet numbering with detected new boundaries of packets point assignment.
In embodiments of the present invention, when current point was new grouping initial point, the initial point assignment module 121 initial point assignment of will newly dividing into groups was new packet numbering; Detection module 122 by the detection side to, be that starting point detects around the new grouping initial point 8 directions whether to have numerical value be non-0 point with new grouping initial point; New boundaries of packets point judge module 123 is when detection module 122 detects when to have numerical value be non-0 point, judges this numerical value is whether non-0 point is the new boundaries of packets point that detected, and is then, and continuation judges this numerical value is whether non-0 point is the initial point that newly divides into groups; Otherwise new boundaries of packets point assignment module 124 is that non-0 some assignment is new packet numbering with this numerical value, and numerical value is that non-0 point is new boundaries of packets point;
New grouping initial point judge module 125 when new boundaries of packets point judge module 123 these numerical value of judgement be that non-0 point is when being the new boundaries of packets point that detected, judge numerical value is whether non-0 point is the initial point that newly divides into groups, be then, judge whether all the new boundaries of packets points around the new grouping initial point are all tested; Otherwise detect to continuation according to the detection side.
Grouping validity determination module 13 is determined the validity of this grouping according to the number of new boundaries of packets point.
In embodiments of the present invention, detect and to finish frontier point that judge module 131 judges that the detection side of new grouping initial point makes progress and whether all detect and finish; 131 judgement detections are finished if judge module is finished in detection, then new 132 numbers of obtaining new boundaries of packets point of boundaries of packets point number acquisition module, if there is not detection not finish, then continuation detects the residue direction of this new grouping initial point; Grouping validity judge module 133 is judged the number of the new boundaries of packets point that new boundaries of packets point number acquisition module 132 obtains and the size of boundaries of packets point number threshold value, when the number of new boundaries of packets point during more than or equal to boundaries of packets point number threshold value, this new grouping is effective; When the number of new boundaries of packets point during less than boundaries of packets point number threshold value, this new grouping is invalid.
As one embodiment of the present of invention, the type of the current point of determining when screen point numerical value determination module 11 is during for the internal point of existing grouping, packets inner point assignment numbering module 14 should have packet numbering and give current point, wherein, the internal point of this existing grouping is positioned in the middle of the existing boundaries of packets point; Finish judge module 131 when detection and confirm this new boundaries of packets point around the new grouping initial point all during detected finishing back continuation scanning process, packets inner point assignment is numbered module 14 meetings be corresponding packet numbering by the packets inner point assignment that will scan.
In embodiments of the present invention, because people, the influence of factor such as environment and screen construction, having numerical value is 0 internal point, if do not handle, this point can not be endowed the numbering of corresponding grouping and can produce certain influence to the point around it, because numerical value is that 0 internal point is between two frontier points of this grouping, therefore before detecting this point, must detect the boundaries of packets point earlier, when scanning certain point, at first judge (0 of this point, 2,4,6) whether 3 numerical value are arranged greater than 0 point and wherein have a point value at least on the direction greater than 1, if, then packets inner point assignment numbering module 14 with numerical value in these three directions greater than 1 point (priority: 2,0,4,6) numerical value is given this internal point, if not, then finishes.
In embodiments of the present invention, with the numerical value that scans is that 1 new grouping initial point is given new packet numbering, and be 8 directions around starting point detects with this new grouping initial point, it with numerical value on 8 directions around this new grouping initial point 1 the new packet numbering of new boundaries of packets point assignment, whether number and the boundaries of packets point number threshold decision current group according to this new boundaries of packets point be effective then, invalid grouping is carried out clearly 0, realize the secondary filtering of touch-screen, and reduced the resource and the clock request of screen system.
The above only is preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of being done within the spirit and principles in the present invention, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.