CN103279234A - Method and system for positioning touch point - Google Patents
Method and system for positioning touch point Download PDFInfo
- Publication number
- CN103279234A CN103279234A CN2013102056168A CN201310205616A CN103279234A CN 103279234 A CN103279234 A CN 103279234A CN 2013102056168 A CN2013102056168 A CN 2013102056168A CN 201310205616 A CN201310205616 A CN 201310205616A CN 103279234 A CN103279234 A CN 103279234A
- Authority
- CN
- China
- Prior art keywords
- marginal point
- edge
- point
- touch area
- marginal
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 42
- 238000001514 detection method Methods 0.000 claims abstract description 24
- 238000012544 monitoring process Methods 0.000 claims abstract description 10
- 238000012217 deletion Methods 0.000 claims description 34
- 230000037430 deletion Effects 0.000 claims description 34
- 239000000872 buffer Substances 0.000 claims description 19
- 238000001914 filtration Methods 0.000 claims description 14
- 238000013500 data storage Methods 0.000 claims description 6
- 230000008569 process Effects 0.000 claims description 6
- 238000003708 edge detection Methods 0.000 abstract description 11
- 239000004744 fabric Substances 0.000 description 6
- 201000007094 prostatitis Diseases 0.000 description 6
- 230000005540 biological transmission Effects 0.000 description 4
- 239000006185 dispersion Substances 0.000 description 4
- 230000009977 dual effect Effects 0.000 description 4
- 230000011514 reflex Effects 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000008570 general process Effects 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000002776 aggregation Effects 0.000 description 1
- 238000004220 aggregation Methods 0.000 description 1
- 230000003139 buffering effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
Images
Landscapes
- Position Input By Displaying (AREA)
- Image Processing (AREA)
Abstract
A method of touch point location comprising the steps of: storing an effective touch area of a collected image based on a pre-stored effective touch area, and detecting a touch point position from the effective touch area of the image, wherein the pre-stored effective touch area is determined by the following steps: carrying out edge detection on the gray scale of the initial image to determine a first edge; when the transverse length of the effective touch area is larger than the longitudinal length, when the gray value of the edge point is smaller than a first preset value, monitoring the gray value of an adjacent pixel point of the edge point, and if the gray value of the adjacent pixel point is larger than a second preset value, deleting the edge point and taking the adjacent pixel point as the edge point; deleting edge points of which the gray values of the edge points are outside a first preset range; deleting edge points with the same abscissa and the number of the edge points larger than two, determining a second edge, performing compensation stretching on the second edge, and determining the pre-stored effective touch area. A corresponding system is provided, and the touch point detection efficiency and accuracy are improved.
Description
Technical field
The present invention relates to optical imagery touch screen technology field, particularly relate to the method and system of location, touch point.
Background technology
In the optical imagery touch-screen system, respectively be provided with camera head in the upper left corner and the upper right corner of touch-screen.Can be to be respectively with light supply apparatus above or below camera, respectively be provided with reflex reflector at touch-screen left side, right side and downside, reflex reflector can be the retroreflecting material apparatus; Also can be respectively to be provided with light-emitting device at touch-screen left side, right side and downside.When having light source to penetrate near the camera head, through reflex reflector, the former road of light is returned, then the light-emitting device light that emits in the left and right sides can cover touch-screen, and all can turn back to camera head.If there is the object of touch to enter the touch area, then can block the light that part enters camera, the black region that exists in the white bright wisp zone in the photo that camera is taken is the position, touch point.White bright wisp zone is reflectorized material or light emitting source region, can be called effective touch area.System need store entire image then by the image of acquisition camera, and finds out the position, touch point from entire image.In the classic method, figure stores to view picture, and image data amount is big, and the transmission time is long, takies more hardware resource.Such as, if the camera pixel resolution is 480*640, the data volume of 1 pixel is 1 byte, then need create the image buffer of 300K in internal memory.For the embedded system scheme, so big memory source demand is luxurious.Look for the position, touch point from view picture figure, efficient is low, and accuracy rate is low.
Summary of the invention
Based on this, be necessary at when storage the temporary resource big, to look for the position, touch point be the problem that efficient is low, accuracy rate is low, and the method and system of location, a kind of touch point is provided.
The method of location, a kind of touch point comprises step:
Based on effective touch area that prestores effective touch area of the image of collection is stored, detected touch point position from effective touch area of described image, wherein, described effective touch area that prestores is determined by following steps:
Gray scale to initial pictures is carried out rim detection, determines first edge;
When the lateral length of effective touch area during greater than longitudinal length,
When the gray-scale value of marginal point during less than first preset value, the gray-scale value of monitoring marginal point neighbor pixel, if the gray-scale value of neighbor pixel during greater than second preset value, is then deleted this marginal point, with neighbor pixel as marginal point;
The gray-scale value of judging each marginal point whether in first preset range, if not, the deletion marginal point in first preset range not then;
Identical and the marginal point number of deletion horizontal ordinate is determined second edge greater than two marginal point according to the edge after the deletion,
, second edge after the compensation is carried out bearing of trend stretch the break place compensation of described second edge according to described first edge, determine described effective touch area that prestores.
A kind of touch point positioning system comprises:
Effectively the touch area memory module is used for based on effective touch area that prestores effective touch area of the image of collection being stored;
The detected touch point position module is used for from the detected touch point position, effective touch area of the described image of described effective touch area memory module storage;
Effective touch area determination module that prestores is used for the gray scale of initial pictures is carried out rim detection, determines first edge; When the lateral length of effective touch area during greater than longitudinal length, when the gray-scale value of marginal point during less than first preset value, the gray-scale value of monitoring marginal point neighbor pixel, if the gray-scale value of neighbor pixel is during greater than second preset value, then delete this marginal point, with neighbor pixel as marginal point; The gray-scale value of judging each marginal point whether in first preset range, if not, the deletion marginal point in first preset range not then; Identical and the marginal point number of deletion horizontal ordinate is greater than two marginal point, determine second edge according to the edge after the deletion,, second edge after the compensation is carried out bearing of trend stretch the break place compensation of described second edge according to described first edge, determine described effective touch area that prestores.
The method and system of location, above-mentioned touch point, the gray-scale value by marginal point whether in preset range etc. method identify effective touch recognition scope, abandon useless image information, thereby find out the effective touch area that prestores.When image is stored, only store effective touch area of the effective touch area correspondence that prestores, thereby saved internal memory.When the detected touch point position, from effective touch area, detect, improved efficient and accuracy.
Description of drawings
Fig. 1 is the schematic flow sheet of the method embodiment one of location, touch point of the present invention;
Fig. 2 is the schematic flow sheet of effective touch area of determining in the embodiment of the invention one to prestore;
Fig. 3 is the outline map after the rim detection of the present invention;
Fig. 4 filters one synoptic diagram for feature of the present invention;
Fig. 5 is the schematic flow sheet of effective touch area of determining in the embodiment of the invention two to prestore;
Fig. 6 is the embodiment of the invention 2 second outline maps;
Fig. 7 is the structural representation of touch point positioning system embodiment of the present invention.
Embodiment
Below be described in detail at each embodiment of the method and system of location, touch point of the present invention.
At first each embodiment at the method for touch point location is described.
Embodiment one
Referring to Fig. 1, the schematic flow sheet for the method embodiment one of location, touch point of the present invention comprises step:
Step S101: store effective touch area of the image of collection effective touch area based on prestoring;
Step S102: detected touch point position from effective touch area of image.
Wherein, referring to Fig. 2, be the schematic flow sheet of effective touch area of determining in the embodiment of the invention one to prestore, below the situation during greater than longitudinal length is described with the lateral length of effective touch area, comprises step:
Step S201: the gray scale to initial pictures is carried out rim detection, determines first edge;
Step S202: when the gray-scale value of marginal point during less than first preset value, the gray-scale value of monitoring marginal point neighbor pixel, if the gray-scale value of neighbor pixel during greater than second preset value, is then deleted this marginal point, with neighbor pixel as marginal point;
Step S203: the gray-scale value of judging each marginal point whether in first preset range, if not, the deletion marginal point in first preset range not then;
Step S204: the identical and marginal point number of deletion horizontal ordinate is determined second edge greater than two marginal point according to the edge after the deletion;
Step S205: to the break place compensation of second edge, the edge after the compensation is carried out bearing of trend stretch effective touch area of determining to prestore according to first edge.
In the classic method, because camera head is mounted in the left and right sides of touch-screen, system need be by gathering the image of left and right sides camera head, then two pictures are stored, and obtain position, touch point among two width of cloth figure respectively, determine the position of touch point on touch-screen according to touch point position in two width of cloth images.And present embodiment focuses on introducing the position of how determining on every figure, touch point.This programme is by removing unnecessary edge, and the edge after removing compensated, obtain the effective touch area of prestoring of image, based on effective touch area that prestores effective touch area of image is stored and detected, thereby can obtain position, touch point in this image.Certainly, can adopt this programme method to ask two width of cloth figure position, touch point separately respectively, thereby obtain the position of touch point on touch-screen.Concrete how to find out the method for finding out the touch point in position, touch point and the prior art from whole figure from effective touch area be identical, is that the searching scope is dwindled, and concrete grammar does not repeat them here.
Because the angle difference that camera head is taken pictures, so can obtain may be photo laterally or longitudinally, and be that can to identify photo be horizontal or longitudinally in the existing apparatus, so followingly with horizontal photo (being that the lateral length of effective touch area is greater than longitudinal length) effective touch area of determining to prestore is described in detail.
At first, the gray scale of initial pictures is carried out rim detection, edge detection method can adopt edge detection method of the prior art, and this programme is example with the canny edge detection algorithm.The general process of canny algorithm is
1. use the Gaussian filter noise reduction;
2. differential is handled and is obtained gradient magnitude and direction;
3. gradient is carried out non-maximum value and suppress (non local maximal value puts 0);
4. dual threshold filters gradient;
5. the edge that filters out is connected.
Certainly, also can adopt other edge detection methods, not repeat them here.As shown in Figure 3, be the outline map after the rim detection of the present invention.The white lines are the edges that obtain after handling.
Because after adopting edge detection method, always occurring one in the edge is correct edge line, one is the edge line that near the black pixel point the correct edge line is formed.Because when asking gradient, employing be
G(x,y)=dx
i+dy
j、
dx
i=L(i+1,j)-L(i,j)、
dy
j=L(i,j+1)-L(i,j)
Wherein, L is the gray-scale value of image pixel, and (i j) is the coordinate figure of pixel.Owing to adopt dual threshold that gradient is filtered, have only that two gray values of pixel points are separate just can be saved when very big, and the value that subtracts white pixel point when black pixel is in preset range the time, reservation white pixel point, namely white pixel point is marginal point; The value that the white pixel point subtracts black pixel is in preset range the time, and black pixel is marginal point.Be this situation of marginal point for fear of black pixel, the present invention proposes a kind of scheme, when the gray-scale value of marginal point during less than first preset value when pixel (marginal point be black), the gray-scale value of monitoring marginal point neighbor pixel, if the gray-scale value of neighbor pixel is during greater than second preset value, then delete this marginal point, with neighbor pixel as marginal point.After handling like this, the gained edge is correct edge line.
Then, the gray-scale value of judging each marginal point whether in first preset range, if not, the deletion marginal point in first preset range not then.First preset range can draw according to statistics.This step purpose is the edge of selecting in the gray-scale value of effective touch area, and the gray-scale value of some marginal point is higher, and the gray-scale value of some marginal point can hang down, the marginal point deletion that then these is not satisfied condition.
Then, the identical and marginal point number of deletion horizontal ordinate is greater than two marginal point, and right situation stays namely only to have a pair of marginal point on the same vertical line, surpasses a pair of being filtered, and determines second edge according to the edge after the deletion.
, second edge place figure is begun traversal from zero row detect the break place compensation of second edge according to first edge, when detecting row and have marginal point, marginal point continues the row of second edge place figure are detected as determining marginal point; When there is not marginal point in the detection row, whether the corresponding detection row that detect first edge place figure exist marginal point, if the first marginal existence marginal point, from each marginal point at corresponding second edge of this marginal point, find out the marginal point of distance in second preset range with definite marginal point, according to the marginal point of finding out second edge is compensated, when if there is not marginal point in first edge, continue the row of second edge place figure are scanned.
In a specific embodiment, the method for disconnected place compensation can be: to second edge, scan to maximum column since 0 row, until finding the row that exist marginal point right; There is marginal point right if scan when the prostatitis, then is communicated with the marginal point of front, right as the line of up-to-date connection; If scanning when the prostatitis does not have marginal point right, then from first edge in the drawings the marginal point centering of these row find out right to (the up-to-date line that is communicated with to) immediate marginal point with the fixed marginal point of previous column, couple together then, right as the line of up-to-date connection; Do not have marginal point right if scan when the prostatitis, and in first edge, do not have marginal point right yet, then do not process.Marginal point that will (line of up-to-date connection to) previous column is to extending transverse to this row, and couples together with the edge line of front, and is right as the line of up-to-date connection.Above process scanning is got back to the right head of up-to-date connection line (first finds the right row of marginal point) after maximum column, this column border point is extended laterally past 0 column direction.
In a specific embodiment, determine after first edge, determine before second edge, also comprise feature filtration one: the marginal point on the same vertical line, adjacent in twos marginal point is right as first marginal point, the distance of the two edges point that first marginal point is right is not more than first preset value, if greater than, then filter.First preset value is made as 30 each pixel in this programme, and 30 pixels are that the maximum possible value defined according to white bright band width comes out, and specifically set according to actual needs.As Fig. 4, synoptic diagram for feature filtration one of the present invention, wherein the pixel on vertical line has 5 marginal points, it is right to form four pairs of marginal points, be respectively marginal point among one, the figure with 1 represent, marginal point among two, the figure with 2 represent, marginal point is to three, among the figure with 3 represent, marginal point is to four, represent with 4.This shows marginal point to two and marginal point four distance has all been surpassed first preset value that limits, so can be filtered.The marginal point that all are not satisfied condition filters deleting namely successively.
In a specific embodiment, determine after first edge that determine before second edge, also comprise feature filtration two: the marginal point on the same vertical line, adjacent in twos marginal point is right as second marginal point.Whether each point reaches second preset value to the brightness (being gray-scale value) of the pixel that checks the point midway between 2 then, and this example scheme has adopted 200 as second preset value (maximal value is 255).In this example, the grey scale pixel value of white bright band zone (being effective touch area) all is to surpass 200, therefore gets 200 as threshold value.If this threshold value defines too greatly or all can improve False Rate too for a short time, need come statistical estimation according to actual conditions.The marginal point that all are not satisfied condition filters deleting namely successively.
Above-mentioned feature filters one, feature filters two can combination in any, namely can include only wherein a kind of feature and filter, and also can comprise two kinds, and the order between feature is filtered can be in no particular order.When present embodiment is not only applicable to lateral length when effective touch area that prestores greater than longitudinal length, situation when also going for lateral length when effective touch area less than longitudinal length, perhaps other images situation sideling, mode according to slope is determined effective touch scope to it, does not specifically repeat them here.
In a specific embodiment, the gray scale of initial pictures is carried out also comprising before the edge detecting step: according to preset angles initial pictures is rotated, carry out before the storing step effective touch area of the image gathered effective touch area based on prestoring, also comprise, according to preset angles image is rotated.Can realize detecting the angle that camera head is taken, obtain then and earlier it is carried out this angle rotation when taking pictures, make it unifiedly rotate to be a direction, such as laterally, the lateral length of effective touch area that namely prestores is greater than longitudinal length.Like this, can handle greater than longitudinal length according to lateral length in subsequent calculations, concrete grammar is just done rotation earlier and is handled with above similar, does not repeat them here.
Embodiment two
Present embodiment filters in conjunction with various features simultaneously, and comprises the filtration of dispersion feature, makes filter effect better, and the effective touch area that obtains is more accurate, thus efficient and the accuracy of having saved internal memory, having improved detected touch point.Present embodiment only is described with the lateral length of the effective touch area situation greater than longitudinal length, and effectively the lateral length of touch area is similar less than the situation of longitudinal length, no longer lists at this.
Step S101: store effective touch area of the image of collection effective touch area based on prestoring;
Step S102: detected touch point position from effective touch area of image.
Wherein, referring to Fig. 5, the schematic flow sheet for effective touch area of determining in the embodiment of the invention two to prestore comprises step:
Step S501: the gray scale to initial pictures is carried out rim detection, determines first edge;
Step S502: when the gray-scale value of marginal point during less than first preset value, the gray-scale value of monitoring marginal point neighbor pixel, if the gray-scale value of neighbor pixel during greater than second preset value, is then deleted this marginal point, with neighbor pixel as marginal point;
Step S503: the gray-scale value of judging each marginal point whether in first preset range, if not, the deletion marginal point in first preset range not then;
Step S504: in identical each marginal point of horizontal ordinate, adjacent in twos marginal point is right as the 3rd marginal point, whether judge the distance of the two edges point that each described the 3rd marginal point is right greater than the 3rd preset value, if it is right greater than the marginal point of the 3rd preset value then to delete described distance;
Step S505: each the 3rd marginal point centering after the deletion, judge each the 3rd marginal point between, whether the gray values of pixel points of predeterminated position less than the 4th preset value, if it is right less than the 3rd marginal point of the 4th preset value then to delete described gray-scale value;
Step S506: the identical and marginal point number of deletion horizontal ordinate is greater than two marginal point;
Step S507: judge that whether the total ratio of the total marginal point with described second edge of the identical marginal point of each ordinate is less than the 5th preset value, if ratio is less than the 5th preset value, delete the marginal point on the ordinate of this ratio correspondence, determine second edge according to the edge after the deletion;
Step S508: to the break place compensation of second edge, the edge after the compensation is carried out bearing of trend stretch effective touch area of determining to prestore according to first edge.
Step S503, step S504, step S505, step S506,, step S507 can be called respectively that feature filters one, feature filters two, feature filters three, feature filters four, feature filters five.In the classic method, because camera head is mounted in the left and right sides of touch-screen, system need be by gathering the image of left and right sides camera head, then two pictures are stored, and obtain position, touch point among two width of cloth figure respectively, determine the position of touch point on touch-screen according to touch point position in two width of cloth images.And present embodiment focuses on introducing the position of how determining on every figure, touch point.This programme filters to remove unnecessary edge by adopting various features to cross, and the edge after removing compensated, obtain the effective touch area of prestoring of image, based on effective touch area that prestores effective touch area of image is stored and detected, thereby can obtain position, touch point in this image.Certainly, can adopt this programme method to ask two width of cloth figure position, touch point separately respectively, thereby obtain the position of touch point on touch-screen.Concrete how to find out the method for finding out the touch point in position, touch point and the prior art from whole figure from effective touch area be identical, is that the searching scope is dwindled, and concrete grammar does not repeat them here.
At first, the gray scale of initial pictures is carried out rim detection, edge detection method can adopt edge detection method of the prior art, and this programme is example with the canny edge detection algorithm.The general process of canny algorithm is
1. use the Gaussian filter noise reduction;
2. differential is handled and is obtained gradient magnitude and direction;
3. gradient is carried out non-maximum value and suppress (non local maximal value puts 0);
4. dual threshold filters gradient;
5. the edge that filters out is connected.
Certainly, also can adopt other edge detection methods, not repeat them here.As shown in Figure 3, be the outline map after the rim detection of the present invention.The white lines are the edges that obtain after handling.
Because after adopting edge detection method, always occurring one in the edge is correct edge line, one is the edge line that near the black pixel point the correct edge line is formed.Because when asking gradient again, employing be
G(x,y)=dx
i+dy
j、
dx
i=L(i+1,j)-L(i,j)、
dy
j=L(i,j+1)-L(i,j)
Wherein, L is the gray-scale value of image pixel, and (i j) is the coordinate figure of pixel.Owing to adopt dual threshold that gradient is filtered, have only that two gray values of pixel points are separate just can be saved when very big, and the value that subtracts white pixel point when black pixel is in preset range the time, reservation white pixel point, namely white pixel point is marginal point; The value that the white pixel point subtracts black pixel is in preset range the time, and black pixel is marginal point.Be this situation of marginal point for fear of black pixel, the present invention proposes a kind of scheme, when the gray-scale value of marginal point during less than first preset value when pixel (marginal point be black), the gray-scale value of monitoring marginal point neighbor pixel, if the gray-scale value of neighbor pixel is during greater than second preset value, then delete this marginal point, with neighbor pixel as marginal point.After handling like this, the gained edge is correct edge line.
Then, the gray-scale value of judging each marginal point whether in first preset range, if not, the deletion marginal point in first preset range not then.First preset range can draw according to statistics.This step purpose is the edge of selecting in the gray-scale value of effective touch area, and the gray-scale value of some marginal point is higher, and the gray-scale value of some marginal point can hang down, the marginal point deletion that then these is not satisfied condition.
Then, the marginal point on the same vertical line, adjacent in twos marginal point is right as the 3rd marginal point, and the distance of the two edges point that the 3rd marginal point is right is not more than the 3rd preset value, if greater than, then filter.The 3rd preset value is made as 30 pixels in this programme, and 30 pixels are that the maximum possible value defined according to white bright band width comes out, and specifically set according to actual needs.As shown in Figure 4, wherein the pixel on vertical line has 5 marginal points, and it is right to form four pairs of marginal points, be respectively marginal point among one, the figure with 1 represent, marginal point among two, the figure with 2 represent, marginal point among three, the figure with 3 represent, marginal point is to four, represent with 4.This shows marginal point to two and marginal point four distance has all been surpassed first preset value that limits, so can be filtered.The marginal point that all are not satisfied condition filters deleting namely successively.
Each the 3rd marginal point centering after the deletion, whether each point reaches the 4th preset value to brightness (being gray-scale value) of the pixel that checks the point midway between 2, and this example scheme has adopted 200 as the 4th preset value (maximal value is 255).In this example, the grey scale pixel value of white bright band zone (being effective touch area) all is to surpass 200, therefore gets 200 as threshold value.If this threshold value defines too greatly or all can improve False Rate too for a short time, need come statistical estimation according to actual conditions.Successively, the marginal point that all are not satisfied condition is to deleting.The marginal point that all are not satisfied condition filters deleting namely successively.
From delete remaining edge, back, identical and the marginal point number of deletion horizontal ordinate is greater than two marginal point, be only to have a pair of marginal point on the same vertical line right situation stays, surpass a pair of being filtered, all marginal points are scanned back (namely all marginal points compare the back), determined second edge according to the edge after the deletion.
Then, the big marginal point of deletion dispersion.Whether judge the marginal point sum ratio at the identical marginal point of each ordinate sum and second edge less than the 5th preset value, if ratio, is deleted the marginal point on the ordinate of this ratio correspondence less than the 5th preset value, determine second edge according to the edge after the deletion.The 5th preset value can draw according to the test of many times statistics.In a specific embodiment, can adopt following method to filter the big edge of dispersion:
At first add up whole marginal points, sum is designated as T.Add up the marginal point S that every row exists again, S obtains ratio divided by T, calculates for convenience, ratio can be multiply by 100, is about to its integer, can certainly directly carry out later step with the ratio mode.Present embodiment describes with integer form, and then the set after this ratio integer is designated as Rt.
Rt gathers sort descending, will arrange (namely value is bigger) of front then and add up one by one, whenever adds once, does once and compares, and up to greater than the 6th preset value the time, then gets currency as next step threshold value, and it is 75 that this example defines the 6th preset value.For example the sequence of Rt set sort descending is, 40,20,16,10... 40+20+16 then 75, get 16 as threshold value.
Rt set is checked value is less than the row of threshold value 16, the marginal point of this row is filtered out.
The core of this filtration is that those are contained the marginal point that marginal point is less than the pixel column of certain ratio removes, and namely the marginal point that those dispersions are big is considered to noise spot.After this step of process is come, obtain second edge, second edge is as the highest edge aggregation of degree of confidence.As shown in Figure 6, be the embodiment of the invention 2 second outline maps.
,, scan to maximum column since 0 row, until finding the row that exist marginal point right second edge the break place compensation of second edge according to first edge; There is marginal point right if scan when the prostatitis, then is communicated with the marginal point of front, right as the line of up-to-date connection; If scanning when the prostatitis does not have marginal point right, then from first edge in the drawings the marginal point centering of these row find out right to (the up-to-date line that is communicated with to) immediate marginal point with the fixed marginal point of previous column, couple together then, right as the line of up-to-date connection; Do not have marginal point right if scan when the prostatitis, and in first edge, do not have marginal point right yet, then do not process.Marginal point that will (line of up-to-date connection to) previous column is to extending transverse to this row, and couples together with the edge line of front, and is right as the line of up-to-date connection.Above process scanning is got back to the right head of up-to-date connection line (first finds the right row of marginal point) after maximum column, this column border point is extended laterally past 0 column direction.Namely can obtain default effective touch area.
In a specific embodiment, step S101 comprises step:
Obtain the view data of image, be stored in the line data buffer zone every row labels row number with the form of row;
Judge row number whether in the default row of effective touch area that prestores number, if, then with image data storage in the image buffer corresponding line.
Be specially: the camera head view data is transferred to view data in the line data buffer zone of mainboard internal memory line by line by the DCMI interface of standard, every row labels row number; The line data buffer zone is double buffering, and when the data line end of transmission, hardware produces automatic switchover line data buffer zone then row and interrupts, and the data of next line can continue transmission simultaneously; Judge row number whether in limited range, if, then with image data storage in the image buffer corresponding line, if not, then be not stored in the image buffer; Judge then whether image buffer reaches last column of effective touch area, if then stop image data storage in image buffer, otherwise continue.When the whole two field picture transmission of camera head is finished, the DCMI interface will produce frame and interrupt.In interrupting handling, frame resets capable number.Wherein, with the row of variable record current line number, each row interrupts then adding 1, and each frame interrupts then zero clearing.Record initial row and the end line of effective range respectively with variable.If capable number is thought then that more than or equal to initial row and less than end line this row is in effective range.This row then will the number of going deducts initial row as the row of effective range image buffer number in effective range, and the row buffer data are copied in the corresponding row of effective range image buffer.If row number equals the limited range end line and number subtracts at 1 o'clock, gathered with this two field picture of variable mark and finished.Limit the data volume of effective range less than the data volume of original image
Concrete storage mode is not limited to the present embodiment mode, and other existing storing modes are also passable, specifically sets as required, does not repeat them here.
In a specific embodiment, the gray scale of initial pictures is carried out also comprising before the edge detecting step: according to preset angles initial pictures is rotated, carry out before the storing step effective touch area of the image gathered effective touch area based on prestoring, also comprise, according to preset angles image is rotated.Can detect the angle that camera head is taken earlier, obtain then and earlier it is carried out this angle rotation when taking pictures, make it unifiedly rotate to be a direction, such as laterally, the lateral length of effective touch area that namely prestores is greater than longitudinal length.Like this, can handle greater than longitudinal length according to lateral length in subsequent calculations, concrete grammar is just done rotation earlier and is handled with above similar, does not repeat them here.
Method according to location, above-mentioned touch point the invention provides a kind of touch point positioning system.
Referring to Fig. 7, the structural representation for touch point positioning system embodiment of the present invention comprises:
Effectively touch area memory module 701 is used for based on effective touch area that prestores effective touch area of the image of collection being stored;
Detected touch point position module 702 is used for from the detected touch point position, effective touch area of the image of effective touch area memory module storage;
The effective touch area determination module 703 that prestores is used for the gray scale of initial pictures is carried out rim detection, determines first edge; When the lateral length of effective touch area during greater than longitudinal length, when the gray-scale value of marginal point during less than first preset value, the gray-scale value of monitoring marginal point neighbor pixel, if the gray-scale value of neighbor pixel is during greater than second preset value, then delete this marginal point, with neighbor pixel as marginal point; The gray-scale value of judging each marginal point whether in first preset range, if not, the deletion marginal point in first preset range not then; Identical and the marginal point number of deletion horizontal ordinate is determined second edge greater than two marginal point according to the edge after the deletion, to the place's compensation of break of second edge, the edge after the compensation is carried out bearing of trend stretching, effective touch area of determining to prestore according to first edge.
In a specific embodiment, effective touch area determination module that prestores also comprises: first rotary module, be used for according to preset angles initial pictures being rotated, effectively the touch area memory module also comprises: second rotary module is used for according to preset angles image being rotated.
In a specific embodiment, effective touch area determination module that prestores also comprises: first filtering module, be used for each identical marginal point of horizontal ordinate, adjacent in twos marginal point is right as first marginal point, judge that whether the distance of the two edges point that each first marginal point is right is greater than the 3rd preset value, when distance during greater than the 3rd preset value, it is right greater than the marginal point of the 3rd preset value then to delete this distance.
In a specific embodiment, effective touch area determination module that prestores also comprises: second filtering module, be used for each identical marginal point of horizontal ordinate, neighboring edge is o'clock right as second marginal point in twos, judge each second marginal point between, whether the gray values of pixel points of predeterminated position less than the 4th preset value, when gray-scale value during less than the 4th preset value, it is right less than second marginal point of the 4th preset value then to delete this gray-scale value.
In a specific embodiment, effective touch area determination module that prestores also comprises: the 3rd filtering module, the ratio that is used for the marginal point sum at the identical marginal point sum of definite each ordinate and second edge, with each ratio descending sort, each ratio addition successively with descending sort, whenever add a ratio and determine a value, when this is worth greater than the 6th preset value, get in the addend minimum ratio as threshold value, judge that whether each ratio is less than threshold value, when ratio less than threshold value, delete the marginal point on the ordinate of this ratio correspondence.
In a specific embodiment, effective touch area determination module that prestores comprises: compensating module, detect for second edge place figure is begun traversal from zero row, when there is marginal point in the detection row, marginal point continues the row of second edge place figure are detected as determining marginal point; When there is not marginal point in the detection row, whether the corresponding detection row that detect first edge place figure exist marginal point, when the first marginal existence marginal point, from each marginal point at corresponding second edge of this marginal point, find out the marginal point of distance in second preset range with definite marginal point, according to the marginal point of finding out second edge is compensated, when there is not marginal point in first edge, continue the row of second edge place figure are scanned.
In a specific embodiment, effectively the touch area memory module comprises: the line data buffer module, be used for obtaining the view data of image, and store every row labels row number with the form of row; The image buffers module is used for when in the default row of capable number effective touch area that prestoring number, with image data storage in corresponding line.
Specific implementation is above described, does not repeat them here.Wherein, can include only one or more in first filtering module, second filtering module, the 3rd filtering module, specifically set as required.
The above embodiment has only expressed several embodiment of the present invention, and it describes comparatively concrete and detailed, but can not therefore be interpreted as the restriction to claim of the present invention.Should be pointed out that for the person of ordinary skill of the art without departing from the inventive concept of the premise, can also make some distortion and improvement, these all belong to protection scope of the present invention.Therefore, the protection domain of patent of the present invention should be as the criterion with claims.
Claims (11)
1. the method for location, a touch point is characterized in that, comprises step:
Based on effective touch area that prestores effective touch area of the image of collection is stored, detected touch point position from effective touch area of described image, wherein, described effective touch area that prestores is determined by following steps:
Gray scale to initial pictures is carried out rim detection, determines first edge;
When the lateral length of effective touch area during greater than longitudinal length,
When the gray-scale value of marginal point during less than first preset value, the gray-scale value of monitoring marginal point neighbor pixel, if the gray-scale value of neighbor pixel during greater than second preset value, is then deleted this marginal point, with neighbor pixel as marginal point;
The gray-scale value of judging each marginal point whether in first preset range, if not, the deletion marginal point in first preset range not then;
Identical and the marginal point number of deletion horizontal ordinate is determined second edge greater than two marginal point according to the edge after the deletion,
, second edge after the compensation is carried out bearing of trend stretch the break place compensation of described second edge according to described first edge, determine described effective touch area that prestores.
2. the method for location, touch point according to claim 1 is characterized in that,
Described gray scale to initial pictures carries out also comprising before the edge detecting step: according to preset angles described initial pictures is rotated,
Describedly based on effective touch area that prestores effective touch area of the image gathered is carried out also comprising before the storing step, according to preset angles described image is rotated.
3. the method for location, touch point according to claim 2 is characterized in that, after described definite first edge, before described definite second edge, also comprises step:
In identical each marginal point of horizontal ordinate, adjacent in twos marginal point is right as first marginal point, whether judge the distance of the two edges point that each described first marginal point is right greater than the 3rd preset value, if it is right greater than the marginal point of the 3rd preset value then to delete described distance;
Or
In identical each marginal point of horizontal ordinate, neighboring edge is o'clock right as second marginal point in twos, judge each described second marginal point between, whether the gray values of pixel points of predeterminated position less than the 4th preset value, if it is right less than second marginal point of the 4th preset value then to delete described gray-scale value;
Or
In identical each marginal point of horizontal ordinate, adjacent in twos marginal point is right as the 3rd marginal point, whether judge the distance of the two edges point that each described the 3rd marginal point is right greater than the 3rd preset value, if it is right greater than the marginal point of the 3rd preset value then to delete described distance;
Each the 3rd marginal point centering after the deletion, judge each the 3rd marginal point between, whether the gray values of pixel points of predeterminated position less than the 4th preset value, if it is right less than the 3rd marginal point of the 4th preset value then to delete described gray-scale value.
4. the method for location, touch point according to claim 2 is characterized in that, after described definite second edge, determines also to comprise before described effective touch area that prestores:
Whether judge the marginal point sum ratio at the identical marginal point of each ordinate sum and described second edge less than the 5th preset value, if ratio, is deleted the marginal point on the ordinate of this ratio correspondence less than the 5th preset value;
Or
Determine the ratio of the identical marginal point of each ordinate sum and the marginal point sum at described second edge, with each described ratio descending sort, each ratio addition successively with descending sort, whenever add a ratio and determine a value, when this value during greater than the 6th preset value, get in the addend minimum ratio and judge that as threshold value whether each described ratio is less than described threshold value, if ratio, is deleted the marginal point on the ordinate of this ratio correspondence less than described threshold value.
5. according to the method for location, any described touch point of claim 1 to 4, it is characterized in that described described second edge break according to described first edge located compensation process and comprise:
Described second edge place figure is begun traversal from zero row detect, when there was marginal point in the detection row, described marginal point continued the row of described second edge place figure are detected as determining marginal point; When there is not marginal point in the detection row, whether the corresponding described detection row that detect first edge place figure exist marginal point, if the first marginal existence marginal point, from each marginal point at corresponding second edge of this marginal point, find out the marginal point of distance in second preset range with definite marginal point, according to the described marginal point of finding out described second edge is compensated, when if there is not marginal point in first edge, continue the row of described second edge place figure are scanned.
6. according to the method for location, any described touch point of claim 1 to 4, it is characterized in that described effective touch area of the image of collection the storage based on effective touch area that prestores comprises step:
Obtain the view data of described image, be stored in the line data buffer zone every row labels row number with the form of row;
Judge described row number whether in the default row of described effective touch area that prestores number, if, then with described image data storage in the image buffer corresponding line.
7. a touch point positioning system is characterized in that, comprising:
Effectively the touch area memory module is used for based on effective touch area that prestores effective touch area of the image of collection being stored;
The detected touch point position module is used for from the detected touch point position, effective touch area of the described image of described effective touch area memory module storage;
Effective touch area determination module that prestores is used for the gray scale of initial pictures is carried out rim detection, determines first edge; When the lateral length of effective touch area during greater than longitudinal length, when the gray-scale value of marginal point during less than first preset value, the gray-scale value of monitoring marginal point neighbor pixel, if the gray-scale value of neighbor pixel is during greater than second preset value, then delete this marginal point, with neighbor pixel as marginal point; The gray-scale value of judging each marginal point whether in first preset range, if not, the deletion marginal point in first preset range not then; Identical and the marginal point number of deletion horizontal ordinate is greater than two marginal point, determine second edge according to the edge after the deletion,, second edge after the compensation is carried out bearing of trend stretch the break place compensation of described second edge according to described first edge, determine described effective touch area that prestores.
8. touch point according to claim 7 positioning system is characterized in that,
Described effective touch area determination module that prestores also comprises: first rotary module, be used for according to preset angles described initial pictures being rotated,
Described effective touch area memory module also comprises: second rotary module is used for according to preset angles described image being rotated.
9. according to claim 7 or 8 described touch point positioning systems, it is characterized in that described effective touch area determination module that prestores also comprises:
First filtering module, be used for each identical marginal point of horizontal ordinate, adjacent in twos marginal point is right as first marginal point, judge that whether the distance of the two edges point that each described first marginal point is right is greater than the 3rd preset value, when distance during greater than the 3rd preset value, it is right greater than the marginal point of the 3rd preset value then to delete this distance;
And/or
Second filtering module, be used for each identical marginal point of horizontal ordinate, neighboring edge is o'clock right as second marginal point in twos, judge each described second marginal point between, whether the gray values of pixel points of predeterminated position less than the 4th preset value, when gray-scale value during less than the 4th preset value, it is right less than second marginal point of the 4th preset value then to delete this gray-scale value;
And/or
The 3rd filtering module, the ratio that is used for the marginal point sum at the identical marginal point sum of definite each ordinate and described second edge, with each described ratio descending sort, with each ratio addition successively of descending sort, whenever add a ratio and determine a value, when this is worth greater than the 6th preset value, get in the addend minimum ratio as threshold value, whether judge each described ratio less than described threshold value, when ratio less than described threshold value, delete the marginal point on the ordinate of this ratio correspondence.
10. according to claim 7 or 8 described touch point positioning systems, it is characterized in that described effective touch area determination module that prestores comprises:
Compensating module detects for described second edge place figure is begun traversal from zero row, and when there was marginal point in the detection row, described marginal point continued the row of described second edge place figure are detected as determining marginal point; When there is not marginal point in the detection row, whether the corresponding described detection row that detect first edge place figure exist marginal point, when the first marginal existence marginal point, from each marginal point at corresponding second edge of this marginal point, find out the marginal point of distance in second preset range with definite marginal point, according to the described marginal point of finding out described second edge is compensated, when there is not marginal point in first edge, continue the row of described second edge place figure are scanned.
11., it is characterized in that described effective touch area memory module comprises according to claim 7 or 8 described touch point positioning systems:
The line data buffer module is used for obtaining the view data of described image, stores every row labels row number with the form of row;
The image buffers module is used for when described row number is in the default row of described effective touch area that prestores number, with described image data storage in corresponding line.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310205616.8A CN103279234B (en) | 2013-05-28 | 2013-05-28 | Method and system for positioning touch point |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310205616.8A CN103279234B (en) | 2013-05-28 | 2013-05-28 | Method and system for positioning touch point |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103279234A true CN103279234A (en) | 2013-09-04 |
CN103279234B CN103279234B (en) | 2016-12-28 |
Family
ID=49061787
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310205616.8A Active CN103279234B (en) | 2013-05-28 | 2013-05-28 | Method and system for positioning touch point |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103279234B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105892753A (en) * | 2016-04-29 | 2016-08-24 | 努比亚技术有限公司 | Method and device for touch screen equipment |
CN116204366A (en) * | 2023-05-06 | 2023-06-02 | 深圳卓创智能科技有限公司 | Tablet personal computer quality detection method, device, equipment and storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1881255A (en) * | 2005-06-15 | 2006-12-20 | 华为技术有限公司 | Digital image edge information extracting method |
CN101727239A (en) * | 2008-10-17 | 2010-06-09 | 三星移动显示器株式会社 | Method and apparatus for detecting touch point and display device |
CN102404594A (en) * | 2011-10-31 | 2012-04-04 | 庞志勇 | 2D-to-3D conversion method based on image edge information |
CN102479006A (en) * | 2010-11-26 | 2012-05-30 | 纬创资通股份有限公司 | Method for correcting interested area and related optical touch module |
EP2523076A2 (en) * | 2009-11-18 | 2012-11-14 | LG Electronics Inc. | Touch panel, touch panel drive method and display device comprising a touch panel |
CN103065307A (en) * | 2012-12-25 | 2013-04-24 | 上海交通大学 | Satellite for earth probationary observation (SAR/SPOT) graphical regional integration detection method under non-precision registration |
-
2013
- 2013-05-28 CN CN201310205616.8A patent/CN103279234B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1881255A (en) * | 2005-06-15 | 2006-12-20 | 华为技术有限公司 | Digital image edge information extracting method |
CN101727239A (en) * | 2008-10-17 | 2010-06-09 | 三星移动显示器株式会社 | Method and apparatus for detecting touch point and display device |
EP2523076A2 (en) * | 2009-11-18 | 2012-11-14 | LG Electronics Inc. | Touch panel, touch panel drive method and display device comprising a touch panel |
CN102479006A (en) * | 2010-11-26 | 2012-05-30 | 纬创资通股份有限公司 | Method for correcting interested area and related optical touch module |
CN102404594A (en) * | 2011-10-31 | 2012-04-04 | 庞志勇 | 2D-to-3D conversion method based on image edge information |
CN103065307A (en) * | 2012-12-25 | 2013-04-24 | 上海交通大学 | Satellite for earth probationary observation (SAR/SPOT) graphical regional integration detection method under non-precision registration |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105892753A (en) * | 2016-04-29 | 2016-08-24 | 努比亚技术有限公司 | Method and device for touch screen equipment |
CN105892753B (en) * | 2016-04-29 | 2019-01-01 | 努比亚技术有限公司 | A kind of method and device towards touch-screen equipment |
CN116204366A (en) * | 2023-05-06 | 2023-06-02 | 深圳卓创智能科技有限公司 | Tablet personal computer quality detection method, device, equipment and storage medium |
CN116204366B (en) * | 2023-05-06 | 2023-08-11 | 深圳卓创智能科技有限公司 | Tablet personal computer quality detection method, device, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN103279234B (en) | 2016-12-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8559748B2 (en) | Edge detection | |
US6661838B2 (en) | Image processing apparatus for detecting changes of an image signal and image processing method therefor | |
CN102663696B (en) | Denoising method of enlarged image and system thereof | |
JP4885789B2 (en) | Image processing method, image region detection method, image processing program, image region detection program, image processing device, and image region detection device | |
CN100571333C (en) | Method and device thereof that a kind of video image is handled | |
CN103996170A (en) | Image edge saw-tooth eliminating method with super resolution | |
CN111292228B (en) | Lens defect detection method | |
CN108174057A (en) | It is a kind of using video image interframe difference to the method and device of picture fast noise reduction | |
JP2012098045A (en) | Crack detector and crack detection program | |
JP6021665B2 (en) | Image processing apparatus, image processing method, and computer program | |
CN106651837A (en) | White glass plate surface edge breakage defect detecting method | |
KR101236223B1 (en) | Method for detecting traffic lane | |
CN103279234A (en) | Method and system for positioning touch point | |
CN111063029A (en) | Map construction method and device, computer readable storage medium and robot | |
CN102629969A (en) | Smear eliminating method during shooting of plane objects | |
CN103279235A (en) | Method and system for positioning touch point | |
CN102096906B (en) | Panoramic binary image-based reversal processing method and device | |
CN101461228A (en) | Image processing circuit, semiconductor device, and image processing device | |
CN104112271A (en) | Detection method and system for housing side defect of mobile terminal | |
JP6218514B2 (en) | Pedestrian detection device and traffic control system | |
CN112598652A (en) | Liquid crystal display edge broken line detection method based on gradient transformation | |
US8837834B2 (en) | Method and device for identifying an image acquisition feature of a digital image and apparatus for implementing such a device | |
JP2011191884A (en) | White line detection device | |
TR201811588T4 (en) | A method and image processing device for determining non-discrimination. | |
US20080310751A1 (en) | Method And Apparatus For Providing A Variable Blur |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |