CN105824532A - Recognizing and hash locating method of rectangular graphs - Google Patents
Recognizing and hash locating method of rectangular graphs Download PDFInfo
- Publication number
- CN105824532A CN105824532A CN201610151280.5A CN201610151280A CN105824532A CN 105824532 A CN105824532 A CN 105824532A CN 201610151280 A CN201610151280 A CN 201610151280A CN 105824532 A CN105824532 A CN 105824532A
- Authority
- CN
- China
- Prior art keywords
- rectangle
- coordinate
- axis
- point
- selected point
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0484—Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
- G06F3/04847—Interaction techniques to control parameter settings, e.g. interaction with sliders or dials
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Image Analysis (AREA)
Abstract
The invention provides a recognizing and hash locating method of rectangular graphs. In a condition that the quantity of graphs is large, the rectangular graphs can be quickly recognized to realize location; the execution efficiency is high; the application is wide. The recognizing and hash locating method of the rectangular graphs comprises the following steps of obtaining the quantity of the rectangular graphs in a rectangular graph library of a screen; obtaining the X-axis and Y-axis coordinates of one pair of across corners of each rectangle in the rectangular graph library of the screen; arranging the obtained X-axis and Y-axis coordinates of the pair of across corners of each rectangle according to a sequence from smaller ones to bigger ones or from the bigger ones to the smaller ones respectively and expressing the obtained X-axis and Y-axis coordinates of the pair of across corners of each rectangle in a form of a linear list respectively; obtaining a coordinate of a clicked point; separately and orderly comparing the X-axis coordinate and Y-axis coordinate of the selected point with the X-axis coordinates and the Y-axis coordinates of the two across corners of each rectangle respectively by adopting a binary search method, and eliminating the rectangle in which the selected point cannot be located; expressing the number of the rectangles left in step A5 to be the number of the rectangles, in which the selected point is situated, in the rectangular graph library of the screen.
Description
Technical field
The present invention relates to data structure techniques field, be specially a kind of rectangular graph identification hash localization method.
Background technology
At present, a lot of application softwaries need to carry out visible i.e. available design, need the most in the design process to draw a lot of figure, and these figures are all different size of rectangles, and they represent different types of data or effect.Such as in touch screen, when user needs to select certain figure to need to click on the region occupied by this figure when of carrying out certain operation, and system needs to judge whether to click certain figure at once and identification is which figure is selected for being for further processing.So, identify the most rapidly be which figure be chosen and position read this figure related data information become very important problem.Especially in the case of figure quantity is the hugest, correlation computations needs data volume to be processed the hugest, and execution efficiency is low;Secondly, much how to identify in the most selected method of figure, there is use background colour phase region method for distinguishing.In this approach, the background color of each figure is different, and after user chooses certain region, system carries out judging which figure is chosen according to the background color in clicked region.The method is suitable only for the occasion that some figure ground color is different, and as carried out selecting region on map, the scope of application is less.
Summary of the invention
For the problems referred to above, the invention provides a kind of rectangular graph identification hash localization method, occurring that figure enormous amount can quickly identify that rectangular graph realizes location constantly, execution efficiency is high, widely applicable.
Its technical scheme is such that a kind of rectangular graph identification hash localization method, and for the rectangular area of screen, operation selects, it is characterised in that:
Step A1: obtain the quantity of rectangular graph in the rectangular graph storehouse of screen;
Step A2: the X-axis at the one pair of which diagonal angle of each rectangle in the rectangular graph storehouse of acquisition screen and Y-axis coordinate;
Step A3: X-axis and the Y-axis coordinate at a pair diagonal angle of each rectangle obtained are arranged according to order from small to large or from big to small respectively, and represents with the form of linear list respectively;
Step A4: obtain the coordinate of the point clicked on;
Step A5: use binary chop by the X-axis coordinate of selected point and Y-axis coordinate the most respectively X-axis coordinate and Y-axis coordinate with two diagonal angles of each rectangle compare, the rectangle that the point selected by eliminating can not be located;
Step A6: the number of the rectangle stayed through A5 step is expressed as the rectangle number that selected point falls in the rectangular graph storehouse of screen, the point representing selected when the number of remaining rectangle is 1 uniquely falls and selects this rectangular area in this rectangle, then choose, when the number of remaining rectangle is more than 1, the rectangle that in remaining rectangle, the rectangle of the superiors is located as selected point and select this rectangular area, then represent do not have any one rectangular area selected when the number of remaining rectangle is less than 1.
It is further, chooses the X-axis in the upper left corner of each rectangle in rectangular graph storehouse and Y-axis coordinate and the X-axis in the lower right corner and Y-axis coordinate, and its comparative approach is as follows:
Step B1: use binary chop to be compared with the X-axis coordinate in the upper left corner of each rectangle by the coordinate of the X-axis of selected point, the coordinate of the X-axis of selected point may fall in corresponding rectangle more than or equal to the point selected by X-axis coordinate representation in the upper left corner of rectangle, gets rid of the X-axis coordinate rectangle more than the X-coordinate of selected point in the upper left corner;
Step B2: use binary chop to be compared with the Y-axis coordinate in the upper left corner of each rectangle stayed through previous step by the coordinate of the Y-axis of selected point, the coordinate of the Y-axis of selected point may fall in corresponding rectangle more than or equal to the point selected by Y-axis coordinate representation in the upper left corner of rectangle;Get rid of the Y-axis coordinate rectangle more than the Y coordinate of selected point in the upper left corner;
Step B3: use binary chop to be compared with the X-axis coordinate in the lower right corner leaving each rectangle through previous step by the coordinate of the X-axis of selected point, the coordinate of the X-axis of selected point may fall in corresponding rectangle less than or equal to the point selected by X-axis coordinate representation in the lower right corner of rectangle, gets rid of the X-axis coordinate rectangle less than the X-coordinate of selected point in the lower right corner;
Step B4: use binary chop to be compared with the Y-axis coordinate in the lower right corner leaving each rectangle through previous step by the coordinate of the Y-axis of selected point, the coordinate of the Y-axis of selected point may fall in corresponding rectangle less than or equal to the point selected by Y-axis coordinate representation in the lower right corner of rectangle;Get rid of the Y-axis coordinate rectangle less than the Y coordinate of selected point in the lower right corner;
Step B1, step B2, step B3, the carrying out order and can exchange two-by-two of step B4;
It is further, chooses the X-axis in the lower left corner of each rectangle in rectangular graph storehouse and Y-axis coordinate and the X-axis in the upper right corner and Y-axis coordinate, and its comparative approach is as follows:
Step C1: use binary chop to be compared with the X-axis coordinate in the lower left corner of each rectangle by the coordinate of the X-axis of selected point, the coordinate of the X-axis of selected point may fall in corresponding rectangle more than or equal to the point selected by X-axis coordinate representation in the lower left corner of rectangle, gets rid of the X-axis coordinate rectangle more than the X-coordinate of selected point in the lower left corner;
Step C2: use binary chop to be compared with the Y-axis coordinate in the lower left corner leaving each rectangle through previous step by the coordinate of the Y-axis of selected point, the coordinate of the Y-axis of selected point may fall in corresponding rectangle less than or equal to the point selected by Y-axis coordinate representation in the lower left corner of rectangle;Get rid of the Y-axis coordinate rectangle less than the Y coordinate of selected point in the lower left corner;
Step C3: use binary chop to be compared with the X-axis coordinate in the upper right corner leaving each rectangle through previous step by the coordinate of the X-axis of selected point, the coordinate of the X-axis of selected point may fall in corresponding rectangle less than or equal to the point selected by X-axis coordinate representation in the upper right corner of rectangle, gets rid of the X-axis coordinate rectangle less than the X-coordinate of selected point in the upper right corner;
Step C4: use binary chop to be compared with the Y-axis coordinate in the upper right corner of each rectangle stayed through previous step by the coordinate of the Y-axis of selected point, the coordinate of the Y-axis of selected point may fall in corresponding rectangle more than or equal to the point selected by Y-axis coordinate representation in the upper right corner of rectangle;Get rid of the Y-axis coordinate rectangle more than the Y coordinate of selected point in the upper right corner;
Step C1, step C2, step C3, the along order of step C4 can exchange two-by-two.
The invention has the beneficial effects as follows: much how to identify in the most selected method of figure, there is use background colour phase region method for distinguishing.In this approach, the background color of each figure is different, and after user uses certain region of click, system carries out judging which figure is chosen according to the background color in clicked region.The method is suitable only for the occasion that some figure ground color is different, as carried out selecting region on map.The method of the present invention can effectively solve the method can not widely used problem.
In this method that the present invention proposes, owing to have employed the general thought that set is subtracted each other, eliminated, it is not necessary to the information of each figure compares in detail, so being greatly accelerated speed and the efficiency of identification.Before carrying out gathering subtraction, this method employs the thinking of binary chop so that locating speed increases substantially.
When using the rectangular area of other traditional hash function identification actual clicks, calculated storage address is not continuous print, certainly exist the significant wastage of memory space, and what the size of the physical memory space that the hash function that the present invention proposes needs determined that, it it is exactly the number of existing rectangle, so the program can increase substantially the utilization rate of limited memory space, and result of calculation will not produce conflict phenomenon every time.
Accompanying drawing explanation
Fig. 1 is the exemplary plot of the rectangle picture distribution on the screen of the present invention;
Fig. 2 is the schematic diagram of the coordinate system of the present invention.
Detailed description of the invention
Below in conjunction with accompanying drawing, the present invention will be further described.
A kind of rectangular graph identification hash localization method, for the rectangular area of screen, operation selects, it is characterised in that:
Step A1: obtain the quantity of rectangular graph in the rectangular graph storehouse of screen;
Step A2: the X-axis at the one pair of which diagonal angle of each rectangle in the rectangular graph storehouse of acquisition screen and Y-axis coordinate;
Step A3: X-axis and the Y-axis coordinate at a pair diagonal angle of each rectangle obtained are arranged according to order from small to large or from big to small respectively, and represents with the form of linear list respectively;
Step A4: obtain the coordinate of the point clicked on;
Step A5: use binary chop by the X-axis coordinate of selected point and Y-axis coordinate the most respectively X-axis coordinate and Y-axis coordinate with two diagonal angles of each rectangle compare, the rectangle that the point selected by eliminating can not be located;
Step A6: the number of the rectangle stayed through A5 step is expressed as the rectangle number that selected point falls in the rectangular graph storehouse of screen, the point representing selected when the number of remaining rectangle is 1 uniquely falls and selects this rectangular area in this rectangle, then choose the rectangle that the rectangle being positioned at the superiors in remaining rectangle is located as selected point when the number of remaining rectangle is more than 1 and select this rectangular area, then represent do not have any one rectangular area selected when the number of remaining rectangle is less than 1.
It is further, chooses the X-axis in the upper left corner of each rectangle in rectangular graph storehouse and Y-axis coordinate and the X-axis in the lower right corner and Y-axis coordinate, and its comparative approach is as follows:
Step B1: use binary chop to be compared with the X-axis coordinate in the upper left corner of each rectangle by the coordinate of the X-axis of selected point, the coordinate of the X-axis of selected point may fall in corresponding rectangle more than or equal to the point selected by X-axis coordinate representation in the upper left corner of rectangle, gets rid of the X-axis coordinate rectangle more than the X-coordinate of selected point in the upper left corner;
Step B2: use binary chop to be compared with the Y-axis coordinate in the upper left corner of each rectangle stayed through previous step by the coordinate of the Y-axis of selected point, the coordinate of the Y-axis of selected point may fall in corresponding rectangle more than or equal to the point selected by Y-axis coordinate representation in the upper left corner of rectangle;Get rid of the Y-axis coordinate rectangle more than the Y coordinate of selected point in the upper left corner;
Step B3: use binary chop to be compared with the X-axis coordinate in the lower right corner leaving each rectangle through previous step by the coordinate of the X-axis of selected point, the coordinate of the X-axis of selected point may fall in corresponding rectangle less than or equal to the point selected by X-axis coordinate representation in the lower right corner of rectangle, gets rid of the X-axis coordinate rectangle less than the X-coordinate of selected point in the lower right corner;
Step B4: use binary chop to be compared with the Y-axis coordinate in the lower right corner leaving each rectangle through previous step by the coordinate of the Y-axis of selected point, the coordinate of the Y-axis of selected point may fall in corresponding rectangle less than or equal to the point selected by Y-axis coordinate representation in the lower right corner of rectangle;Get rid of the Y-axis coordinate rectangle less than the Y coordinate of selected point in the lower right corner;
Step B1, step B2, step B3, the carrying out order and can exchange two-by-two of step B4;
It is further, chooses the X-axis in the lower left corner of each rectangle in rectangular graph storehouse and Y-axis coordinate and the X-axis in the upper right corner and Y-axis coordinate, and its comparative approach is as follows:
Step C1: use binary chop to be compared with the X-axis coordinate in the lower left corner of each rectangle by the coordinate of the X-axis of selected point, the coordinate of the X-axis of selected point may fall in corresponding rectangle more than or equal to the point selected by X-axis coordinate representation in the lower left corner of rectangle, gets rid of the X-axis coordinate rectangle more than the X-coordinate of selected point in the lower left corner;
Step C2: use binary chop to be compared with the Y-axis coordinate in the lower left corner leaving each rectangle through previous step by the coordinate of the Y-axis of selected point, the coordinate of the Y-axis of selected point may fall in corresponding rectangle less than or equal to the point selected by Y-axis coordinate representation in the lower left corner of rectangle;Get rid of the Y-axis coordinate rectangle less than the Y coordinate of selected point in the lower left corner;
Step C3: use binary chop to be compared with the X-axis coordinate in the upper right corner leaving each rectangle through previous step by the coordinate of the X-axis of selected point, the coordinate of the X-axis of selected point may fall in corresponding rectangle less than or equal to the point selected by X-axis coordinate representation in the upper right corner of rectangle, gets rid of the X-axis coordinate rectangle less than the X-coordinate of selected point in the upper right corner;
Step C4: use binary chop to be compared with the Y-axis coordinate in the upper right corner of each rectangle stayed through previous step by the coordinate of the Y-axis of selected point, the coordinate of the Y-axis of selected point may fall in corresponding rectangle more than or equal to the point selected by Y-axis coordinate representation in the upper right corner of rectangle;Get rid of the Y-axis coordinate rectangle more than the Y coordinate of selected point in the upper right corner;
Step C1, step C2, step C3, the along order of step C4 can exchange two-by-two.
Embodiment 1: assume to there is graphics set G={G1, G2, G3..., Gi..., Gn, wherein n is the number of existing figure, and 1≤i≤n.G in set GiAll with < XTi, YTi, XBi, YBi, Ci> five-tuple form storage, wherein XTiAnd YTiIt is respectively figure GiThe x and y coordinates value in the upper left corner.XBiAnd YBiIt is respectively figure GiThe x and y coordinates value in the lower right corner.CiFor figure GiResiding hierachy number, as figure GiHide C time other figures are positioned at uppermosti=1, i.e. the superiors Ci=1, and C from top to bottomiRespectively be 2,3,4 ..., k ..., n.Wherein 1≤k≤n.
It addition, set up following four linear list respectively according to XTi、YTi、XBi、YBiSequence storage i value from small to large.Noting, initial point (0,0) is on upper left side, shown in coordinate system as accompanying drawing 2.
Lxt=< p1, p2, p3..., pj... pn>, wherein
Lyt=< q1, q2, q3..., qj... qn>, wherein
Lxb=< s1, s2, S3..., sj... sn>, wherein
Lyb=< t1, t2, t3..., tj... tn>, wherein
Finally set up interim graphics set GT=G.
After user clicks on certain rectangle on interface, according to the coordinate clicked on, (x y) calculates hash function f (x, y)=i.
Hash function f (x, y) concrete identification calculating process is as follows:
(1) system first obtain click coordinate (x, y).
(2) at LxtLinear list utilize binary chop algorithm positionMinimum pjValue, makes this minimum pjValue is pm, 1≤m≤n.PerformWherein LxtI () is for obtaining LxtI-th value in linear list, 1≤i≤n.If pmDo not exist or pm> n, then skip this step.
(3) at LytLinear list utilize binary chop algorithm positionMinimum qjValue, makes this minimum qjValue is qm, 1≤m≤n.PerformWherein LytI () is for obtaining LytI-th value in linear list, 1≤i≤n.If qmDo not exist or qm> n, then skip this step.
(4) at LxbLinear list utilize binary chop algorithm positionMaximum sjValue, makes this maximum sjValue is sm, 1≤m≤n.PerformWherein LxbI () is for obtaining LxbI-th value in linear list, 1≤i≤n.If smDo not exist, then skip this step.
(5) at LybLinear list utilize binary chop algorithm positionMaximum tjValue, makes this maximum tjValue is tm, 1≤m≤n.PerformWherein LybI () is for obtaining LybI-th value in linear list, 1≤i≤n.If tmDo not exist, then skip this step.
(6) making Count (GT) is the number of element in set GT.
If Count (GT)=1, i.e. GT={Gi, then f (x, y)=i.
If Count (GT) > 1, then (x, y)=Min (GT), Min (GT) result of calculation is all graphic element G in set GT to fiMiddle minimum CiI value corresponding to value.
If Count (GT) < 1, then f (x, y)=0.
Graphics set G={A, B, C, D, the E} of histogram valut as described in Figure 1, and each element content is as follows:
A=< XTA, YTA, XBA, YBA, 1>=<101,93,155,133,1>
B=< XTB, YTB, XBB, YBB, 1>=<128,171,241,248,1>
C=< XTC, YTC, XBC, YBC, 1>=<311,111,377,161,1>
D=< XTD, YTD, XBD, YBD, 1>=<252,72,280,326,1>
E=< XTE, YTE, XBE, YBE, 2>=<90,50,292,354,2>
Four ordered linear table contents are as follows:
Lxt=<5,1,2,4,3>
Lyt=<5,4,1,3,2>
Lxb=<1,2,4,5,3>
Lyb=<1,3,2,4,5>
Finally initialize GT=G={A, B, C, D, E}.
Assume that user clicks coordinate (218,224), i.e. (x, y)=(218,224) calculate f (218,224) process as follows:
(1) first system obtains the coordinate (218,224) of click.
(2) at LxtLinear list utilize binary chop algorithm location meetThe minimum p of conditionjValue is 4, i.e.Perform GT=GT-{C, D}={A, B, E}.
(3) at LytLinear list finds qmDo not exist, then skip this step.
(4) at LxbLinear list utilize binary chop algorithm location meetMaximum sjValue is 1, i.e.Perform GT=GT-{A}={A, B, E}-{A}={B, E}.
(5) at LybLinear list utilize binary chop algorithm location meetThe maximum t of conditionjValue is 2, i.e.Perform GT=GT-{A, C}={B, E}-{A, C}={B, E}.
(6) Count (GT)=2 is calculated.Due to Count (GT) > 1, then f (x, y)=Min (GT)=2.
Calculating through above, the figure currently selected is graphics set G={A, stores the B rectangular area that position is 2 in B, C, D, E}.
Embodiment 2: assume to there is graphics set G={G1, G2, G3..., Gi..., Gn, wherein n is the number of existing figure, and 1≤i≤n.G in set GiAll with < XTi, YTi, XBi, YBi, Ci> five-tuple form storage, wherein XTiAnd YTiIt is respectively figure GiThe x and y coordinates value in the lower left corner.XBiAnd YBiIt is respectively figure GiThe x and y coordinates value in the upper right corner.CiFor figure GiResiding hierachy number, as figure GiHide C time other figures are positioned at uppermosti=1, i.e. the superiors Ci=1, and C from top to bottomiRespectively be 2,3,4 ..., k ..., n.Wherein 1≤k≤n.
It addition, set up following four linear list respectively according to XTi、YTi、XBi、YBiSequence storage i value from small to large.Noting, initial point (0,0) is in lower left, shown in coordinate system as accompanying drawing 2.
Lxt=< p1, p2, p3..., pj... pn>, wherein
Lyt=< q1, q2, q3..., qj... qn>, wherein
Lxb=< s1, s2, s3..., sj... sn>, wherein
Lyb=< t1, t2, t3..., tj... tn>, wherein
Finally set up interim graphics set GT=G.
After user clicks on certain rectangle on interface, according to the coordinate clicked on, (x y) calculates hash function f (x, y)=i.
Hash function f (x, y) concrete identification calculating process is as follows:
(1) system first obtain click coordinate (x, y).
(2) at LxtLinear list utilize binary chop algorithm positionMinimum pjValue, makes this minimum pjValue is pm, 1≤m≤n;PerformWherein LxtI () is for obtaining LxtI-th value in linear list, 1≤i≤n.If pmDo not exist or pm+ 1 > n, then skip this step.
(3) at LytLinear list utilize binary chop algorithm positionMaximum qjValue, makes this minimum qjValue is qm, 1≤m≤n;PerformWherein LytI () is for obtaining LytI-th value in linear list, 1≤i≤n.If qmDo not exist or qm> n, then skip this step.
(4) at LxbLinear list utilize binary chop algorithm positionMaximum sjValue, makes this maximum sjValue is sm, 1≤m≤n;PerformWherein LxbI () is for obtaining LxbI-th value in linear list, 1≤i≤n.If smDo not exist, then skip this step.
(5) at LybLinear list utilize binary chop algorithm positionMaximum tjValue, makes this maximum tjValue is tm, 1≤m≤n;PerformWherein LybI () is for obtaining LybI-th value in linear list, 1≤i≤n.If tmDo not exist, then skip this step.
(6) making Count (GT) is the number of element in set GT.
If Count (GT)=1, i.e. GT={Gi, then f (x, y)=i.
If Count (GT) > 1, then (x, y)=Min (GT), Min (GT) result of calculation is all graphic element G in set GT to fiMiddle minimum CiI value corresponding to value.
Graphics set G={A, B, C, D, the E} of histogram valut as described in Figure 1, and each element content is as follows:
A=< XTA, YTA, XBA, YBA, 1>=<101,133,155,93,1>
B=< XTB, YTB, XBB, YBB, 1>=<128,248,241,171,1>
C=< XTC, YTC, XBC, YBC, 1>=<311,161,377,111,1>
D=< XTD, YTD, XBD, YBD, 1>=<252,326,280,72,1>
E=< XTE, YTE, XBE, YBE, 2>=<90,354,292,50,2>
Four ordered linear table contents are as follows:
Lxt=<5,1,2,4,3>
Lyt=<1,3,2,4,5>
Lxb=<1,2,4,5,3>
Lyb=<5,4,1,3,2>
Finally initialize GT=G={A, B, C, D, E}.
Assume that user clicks coordinate (218,224), i.e. (x, y)=(218,224) calculate f (218,224) process as follows:
(1) first system obtains the coordinate (218,224) of click.
(2) at LxtLinear list utilize binary chop algorithm positionMinimum pjValue is 4, i.e.Perform GT=GT-{C, D}={A, B, E}.
(3) at LytLinear list utilize binary chop algorithm positionMinimum qjValue is 2, i.e.Perform GT=GT-{A, C}={A, B, E}-{A, C}={B, E}.
(4) at LxbLinear list utilize binary chop algorithm positionMaximum sjValue is 1.Perform GT=GT-{A}={A, B, E}-{A}={B, E}.
(5) at LybLinear list utilize binary chop algorithm positionMaximum tjValue is 5.Perform GT=GT-{}={B, E}-{}={B, E}.
(6) Count (GT)=2 is calculated.Due to Count (GT) > 1, then f (x, y)=Min (GT)=2.
Calculating through above, the figure currently selected is graphics set G={A, stores the B rectangular area that position is 2 in B, C, D, E}.
Much how to identify in the most selected method of figure, there is use background colour phase region method for distinguishing.In this approach, the background color of each figure is different, and after user uses certain region of click, system carries out judging which figure is chosen according to the background color in clicked region.The method is suitable only for the occasion that some figure ground color is different, as carried out selecting region on map.The method of the present invention can effectively solve the method can not widely used problem.
In this method that the present invention proposes, owing to have employed the general thought that set is subtracted each other, eliminated, it is not necessary to the information of each figure compares in detail, so being greatly accelerated speed and the efficiency of identification.Before carrying out gathering subtraction, this method employs the thinking of binary chop so that locating speed increases substantially.
If comparing the coordinate information of each figure after choosing one by one, average number of comparisons isThe average number of comparisons that the method using the present invention to propose is carried out after click isThe growth along with n, P is can be seen that from the comparison of below table2Increasing degree be significantly less than P1, this means that the growth of the element number n along with graphics set G, and the method that the present invention proposes has the most superior execution efficiency, and the biggest superiority of n value is the most obvious.Figure number reaches some when, this method can identify selected figure quickly.
Following table is that growth pattern compares.
n | P1 | P2 |
1 | 4 | 4 |
2 | 6 | 5.509775 |
3 | 8 | 6.666667 |
4 | 10 | 7.60964 |
… | … | … |
10 | 22 | 11.2215 |
… | … | … |
50 | 102 | 19.1435 |
… | … | … |
100 | 202 | 22.89917 |
… | … | … |
When using the rectangular area of other traditional hash function identification actual clicks, calculated storage address is not continuous print, certainly exist the significant wastage of memory space, and what the size of the physical memory space that the hash function that the present invention proposes needs determined that, it it is exactly number n of existing rectangle, the linear list of graphics set as described in Figure 1 has only to 1, 2, 3, 4, 5 continuous print addresses, and the address of traditional hash function storage can be such as 1, 4, 7, 12, 20 the most discontinuous addresses, take 20 storage address significant wastage to memory space, the program can increase substantially the utilization rate of limited memory space, and result of calculation will not produce conflict phenomenon every time.
Claims (5)
1. a rectangular graph identification hash localization method, for the rectangular area of screen, operation selects, it is characterised in that:
Step A1: obtain the quantity of rectangular graph in the rectangular graph storehouse of screen;
Step A2: the X-axis at the one pair of which diagonal angle of each rectangle in the rectangular graph storehouse of acquisition screen and Y-axis coordinate;
Step A3: X-axis and the Y-axis coordinate at a pair diagonal angle of each rectangle obtained are arranged according to order from small to large or from big to small respectively, and represents with the form of linear list respectively;
Step A4: obtain the coordinate of the point clicked on;
Step A5: use binary chop by the X-axis coordinate of selected point and Y-axis coordinate the most respectively X-axis coordinate and Y-axis coordinate with two diagonal angles of each rectangle compare, the rectangle that the point selected by eliminating can not be located;
Step A6: the number of the rectangle stayed through A5 step is expressed as the rectangle number that selected point falls in the rectangular graph storehouse of screen, the point representing selected when the number of remaining rectangle is 1 uniquely falls and selects this rectangular area in this rectangle, then choose the rectangle being positioned at the superiors in remaining rectangle when the number of remaining rectangle is more than 1 and select this rectangular area as the selected rectangle making to fall of putting, then represent do not have rectangular area selected when the number of remaining rectangle is less than 1.
A kind of rectangular graph identification hash localization method the most according to claim 1, it is characterised in that: choosing the X-axis in the upper left corner of each rectangle in rectangular graph storehouse and Y-axis coordinate and the X-axis in the lower right corner and Y-axis coordinate, its comparative approach is as follows:
Step B1: use binary chop to be compared with the X-axis coordinate in the upper left corner of each rectangle by the coordinate of the X-axis of selected point, the coordinate of the X-axis of selected point may fall in corresponding rectangle more than or equal to the point selected by X-axis coordinate representation in the upper left corner of rectangle, gets rid of the X-axis coordinate rectangle more than the X-coordinate of selected point in the upper left corner;
Step B2: use binary chop to be compared with the Y-axis coordinate in the upper left corner of each rectangle stayed through previous step by the coordinate of the Y-axis of selected point, the coordinate of the Y-axis of selected point may fall in corresponding rectangle more than or equal to the point selected by Y-axis coordinate representation in the upper left corner of rectangle;Get rid of the Y-axis coordinate rectangle more than the Y coordinate of selected point in the upper left corner;
Step B3: use binary chop to be compared with the X-axis coordinate in the lower right corner leaving each rectangle through previous step by the coordinate of the X-axis of selected point, the coordinate of the X-axis of selected point may fall in corresponding rectangle less than or equal to the point selected by X-axis coordinate representation in the lower right corner of rectangle, gets rid of the X-axis coordinate rectangle less than the X-coordinate of selected point in the lower right corner;
Step B4: use binary chop to be compared with the Y-axis coordinate in the lower right corner leaving each rectangle through previous step by the coordinate of the Y-axis of selected point, the coordinate of the Y-axis of selected point may fall in corresponding rectangle less than or equal to the point selected by Y-axis coordinate representation in the lower right corner of rectangle;Get rid of the Y-axis coordinate rectangle less than the Y coordinate of selected point in the lower right corner.
A kind of rectangular graph identification hash localization method the most according to claim 2, it is characterised in that: step B1, step B2, step B3, the carrying out order and can exchange two-by-two of step B4.
A kind of rectangular graph identification hash localization method the most according to claim 1, it is characterised in that: choosing the X-axis in the lower left corner of each rectangle in rectangular graph storehouse and Y-axis coordinate and the X-axis in the upper right corner and Y-axis coordinate, its comparative approach is as follows:
Step C1: use binary chop to be compared with the X-axis coordinate in the lower left corner of each rectangle by the coordinate of the X-axis of selected point, the coordinate of the X-axis of selected point may fall in corresponding rectangle more than or equal to the point selected by X-axis coordinate representation in the lower left corner of rectangle, gets rid of the X-axis coordinate rectangle more than the X-coordinate of selected point in the lower left corner;
Step C2: use binary chop to be compared with the Y-axis coordinate in the lower left corner leaving each rectangle through previous step by the coordinate of the Y-axis of selected point, the coordinate of the Y-axis of selected point may fall in corresponding rectangle less than or equal to the point selected by Y-axis coordinate representation in the lower left corner of rectangle;Get rid of the Y-axis coordinate rectangle less than the Y coordinate of selected point in the lower left corner;
Step C3: use binary chop to be compared with the X-axis coordinate in the upper right corner leaving each rectangle through previous step by the coordinate of the X-axis of selected point, the coordinate of the X-axis of selected point may fall in corresponding rectangle less than or equal to the point selected by X-axis coordinate representation in the upper right corner of rectangle, gets rid of the X-axis coordinate rectangle less than the X-coordinate of selected point in the upper right corner;
Step C4: use binary chop to be compared with the Y-axis coordinate in the upper right corner of each rectangle stayed through previous step by the coordinate of the Y-axis of selected point, the coordinate of the Y-axis of selected point may fall in corresponding rectangle more than or equal to the point selected by Y-axis coordinate representation in the lower left corner of rectangle;Get rid of the Y-axis coordinate rectangle more than the Y coordinate of selected point in the upper right corner.
A kind of rectangular graph identification hash localization method the most according to claim 4, it is characterised in that: step C1, step C2, step C3, the carrying out order and can exchange two-by-two of step C4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610151280.5A CN105824532A (en) | 2016-03-16 | 2016-03-16 | Recognizing and hash locating method of rectangular graphs |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610151280.5A CN105824532A (en) | 2016-03-16 | 2016-03-16 | Recognizing and hash locating method of rectangular graphs |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105824532A true CN105824532A (en) | 2016-08-03 |
Family
ID=56523657
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610151280.5A Pending CN105824532A (en) | 2016-03-16 | 2016-03-16 | Recognizing and hash locating method of rectangular graphs |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105824532A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111127421A (en) * | 2019-12-20 | 2020-05-08 | 合肥联宝信息技术有限公司 | Method for positioning lower frame of B surface of electronic equipment and frame of B surface |
CN113453069A (en) * | 2021-06-18 | 2021-09-28 | 海信视像科技股份有限公司 | Display device and thumbnail generation method |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102034254A (en) * | 2010-09-29 | 2011-04-27 | 广东威创视讯科技股份有限公司 | Method for recognizing geometric figure |
CN102693296A (en) * | 2012-05-16 | 2012-09-26 | 南京信息工程大学 | Method for rapidly matching coordinates of mass two-dimension point data |
JP5295092B2 (en) * | 2009-12-24 | 2013-09-18 | 三菱電機株式会社 | Touch panel input device |
US20150082236A1 (en) * | 2013-09-13 | 2015-03-19 | Sharp Kabushiki Kaisha | Information processing apparatus |
CN105159522A (en) * | 2015-07-22 | 2015-12-16 | 深圳多新哆技术有限责任公司 | Method for response of virtual reality display device to operation of peripheral device |
US9245366B1 (en) * | 2014-01-03 | 2016-01-26 | Amazon Technologies, Inc. | Label placement for complex geographic polygons |
US20160026860A1 (en) * | 2013-03-14 | 2016-01-28 | Google Inc. | Systems, methods, and computer-readable media for determining a salient region of geographic map |
-
2016
- 2016-03-16 CN CN201610151280.5A patent/CN105824532A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5295092B2 (en) * | 2009-12-24 | 2013-09-18 | 三菱電機株式会社 | Touch panel input device |
CN102034254A (en) * | 2010-09-29 | 2011-04-27 | 广东威创视讯科技股份有限公司 | Method for recognizing geometric figure |
CN102693296A (en) * | 2012-05-16 | 2012-09-26 | 南京信息工程大学 | Method for rapidly matching coordinates of mass two-dimension point data |
US20160026860A1 (en) * | 2013-03-14 | 2016-01-28 | Google Inc. | Systems, methods, and computer-readable media for determining a salient region of geographic map |
US20150082236A1 (en) * | 2013-09-13 | 2015-03-19 | Sharp Kabushiki Kaisha | Information processing apparatus |
US9245366B1 (en) * | 2014-01-03 | 2016-01-26 | Amazon Technologies, Inc. | Label placement for complex geographic polygons |
CN105159522A (en) * | 2015-07-22 | 2015-12-16 | 深圳多新哆技术有限责任公司 | Method for response of virtual reality display device to operation of peripheral device |
Non-Patent Citations (2)
Title |
---|
KENNETH A.LAMBER等著: "《Java程序设计与数据结构》", 31 October 2005, 清华大学出版社 * |
成敢: ""图像可点击区域的快速确定"", 《电脑爱好者》 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111127421A (en) * | 2019-12-20 | 2020-05-08 | 合肥联宝信息技术有限公司 | Method for positioning lower frame of B surface of electronic equipment and frame of B surface |
CN111127421B (en) * | 2019-12-20 | 2022-02-08 | 合肥联宝信息技术有限公司 | Method for positioning lower frame of B surface of electronic equipment and frame of B surface |
CN113453069A (en) * | 2021-06-18 | 2021-09-28 | 海信视像科技股份有限公司 | Display device and thumbnail generation method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR102424803B1 (en) | Touch classification | |
CN101859326B (en) | Image searching method | |
KR20200037887A (en) | Method and apparatus for generating synthetic picture | |
CN104182974B (en) | A speeded up method of executing image matching based on feature points | |
CN104952083B (en) | A kind of saliency detection method based on the modeling of conspicuousness target background | |
CN113111212B (en) | Image matching method, device, equipment and storage medium | |
CN105068918B (en) | A kind of page method of testing and device | |
CN102855132B (en) | A kind of choosing method of Drawing Object and system | |
CN105809651A (en) | Image saliency detection method based on edge non-similarity comparison | |
WO2019205945A1 (en) | Method and computer apparatus for determining insertion position of advertisement, and storage medium | |
CN111160288A (en) | Gesture key point detection method and device, computer equipment and storage medium | |
CN103995864B (en) | A kind of image search method and device | |
CN109460770A (en) | Characteristics of image descriptor extracting method, device, computer equipment and storage medium | |
CN110909665A (en) | Multitask image processing method and device, electronic equipment and storage medium | |
CN105824532A (en) | Recognizing and hash locating method of rectangular graphs | |
CN103955713B (en) | A kind of icon-based programming method and apparatus | |
CN113538623B (en) | Method, device, electronic equipment and storage medium for determining target image | |
Suryawibawa et al. | Herbs recognition based on android using opencv | |
CN107358244B (en) | A kind of quick local invariant feature extracts and description method | |
CN103914825A (en) | Three-dimensional model texture coloring method based on image segmentation | |
CN104504692A (en) | Method for extracting obvious object in image on basis of region contrast | |
CN107452003A (en) | A kind of method and device of the image segmentation containing depth information | |
WO2022110492A1 (en) | Finger vein-based identity identification method and apparatus, computer device, and storage medium | |
CN108829248A (en) | A kind of mobile target selecting method and system based on the correction of user's presentation model | |
CN106469437B (en) | Image processing method and image processing apparatus |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20160803 |