CN103279234B - The method and system of location, touch point - Google Patents
The method and system of location, touch point Download PDFInfo
- Publication number
- CN103279234B CN103279234B CN201310205616.8A CN201310205616A CN103279234B CN 103279234 B CN103279234 B CN 103279234B CN 201310205616 A CN201310205616 A CN 201310205616A CN 103279234 B CN103279234 B CN 103279234B
- Authority
- CN
- China
- Prior art keywords
- marginal point
- edge
- point
- row
- touch area
- 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.)
- Active
Links
Landscapes
- Position Input By Displaying (AREA)
- Image Processing (AREA)
Abstract
A kind of method of location, touch point, including step: effective touch area based on effective touch area image to gathering that prestores stores, detected touch point position from effective touch area of described image, wherein, described effective touch area that prestores is determined by following steps: the gray scale of initial pictures is carried out rim detection, determines the first edge;When the lateral length of effective touch area is more than longitudinal length, when the gray value of marginal point is less than the first preset value, the gray value of monitoring marginal point neighbor pixel, if the gray value of neighbor pixel is more than the second preset value, then delete this marginal point, using neighbor pixel as marginal point;Delete the gray value of each marginal point marginal point outside the first preset range;Delete that abscissa is identical and the marginal point number marginal point more than two determine the second edge, the second edge compensated stretching, determine described in prestore effective touch area.Corresponding system is provided, improves detected touch point efficiency and accuracy.
Description
Technical field
The present invention relates to optical imaging touch screen technical field, particularly relate to the method and system of location, touch point.
Background technology
In optical imaging touch screen system, it is respectively provided with camera head in the upper left corner of touch screen and the upper right corner.Can be
Above or below photographic head, be respectively with light supply apparatus, on the left of touch screen, right side and downside be respectively provided with reflex reflector, reflective
Device can be retroreflecting material apparatus;Can also be on the left of touch screen, right side and downside be respectively provided with light-emitting device.Shooting
When having light source to penetrate near device, through reflex reflector, by light backtracking, the then light that left and right light-emitting device emits
Touch screen can be covered, and all can return to camera head.If there being touching object to enter touch area, then can block and be partially into
The light of photographic head, in the photo of photographic head shooting, present in white bright wisp region, black region is position, touch point.In vain
Color bright wisp region is reflectorized material or luminous source region, is properly termed as effective touch area.System needs to be taken the photograph by collection
As the image of head, then store entire image, and from entire image, find out position, touch point.In traditional method, to view picture figure
Storing, image data amount is big, and the transmission time is long, takies more hardware resource.Such as, if photographic head pixel resolution
For 480*640, the data volume of 1 pixel is 1 byte, then need to create the image buffer of 300K in internal memory.For embedding
For embedded system scheme, the biggest memory source demand is luxurious.Looking for position, touch point from view picture figure, efficiency is low,
Accuracy rate is low.
Summary of the invention
Based on this, it is necessary to during for storage, temporary resource is big, look for position, touch point is that efficiency is low, low the asking of accuracy rate
Topic, it is provided that the method and system of location, a kind of touch point.
A kind of method of location, touch point, including step:
Effective touch area based on effective touch area image to gathering that prestores stores, from having of described image
Detected touch point position in effect touch area, wherein, described in effective touch area that prestores determined by following steps:
The gray scale of initial pictures is carried out rim detection, determines the first edge;
When the lateral length of effective touch area is more than longitudinal length,
When the gray value of marginal point is less than the first preset value, the gray value of monitoring marginal point neighbor pixel, if phase
When the gray value of adjacent pixel is more than the second preset value, then delete this marginal point, using neighbor pixel as marginal point;
Judge the gray value of each marginal point whether in the first preset range, if it is not, then delete not in the first preset range
Interior marginal point;
Delete the marginal point that abscissa is identical and marginal point number is more than two, determine the second limit according to the edge after deleting
Edge,
According to described first edge, described second edge is carried out disconnected place to compensate, the second edge after compensating is extended
Direction stretches, determine described in prestore effective touch area.
A kind of touch point alignment system, including:
Effectively touch area memory module, for effective Petting Area based on effective touch area image to gathering that prestores
Territory stores;
Detected touch point position module, for described image effective from the storage of described effective touch area memory module
Detected touch point position in touch area;
Effective touch area that prestores determines module, for the gray scale of initial pictures is carried out rim detection, determines the first limit
Edge;When the lateral length of effective touch area is more than longitudinal length, when the gray value of marginal point is less than the first preset value, prison
Survey the gray value of marginal point neighbor pixel, if the gray value of neighbor pixel is more than the second preset value, then delete this limit
Edge point, using neighbor pixel as marginal point;Judge the gray value of each marginal point whether in the first preset range, if it is not, then
Delete the not marginal point in the first preset range;Delete the marginal point that abscissa is identical and marginal point number is more than two, according to
Edge after deletion determines the second edge, according to described first edge, described second edge is carried out disconnected place and compensates, after compensating
The second edge carry out bearing of trend stretching, determine described in prestore effective touch area.
The method and system of location, above-mentioned touch point, by the gray value of marginal point, method is known in preset range etc.
Not effective touch recognition scope, abandons useless image information, thus finds out the effective touch area prestored.Image is being entered
During row storage, only store effective touch area that the effective touch area prestored is corresponding, thus save internal memory.Touch in detection
During point position, detect from effective touch area, improve efficiency and accuracy.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet of the embodiment of the method one of inventive touch point location;
Fig. 2 is the schematic flow sheet determining effective touch area that prestores in the embodiment of the present invention one;
Fig. 3 is the edge graph after rim detection of the present invention;
Fig. 4 is the schematic diagram that feature of present invention filters;
Fig. 5 is the schematic flow sheet determining effective touch area that prestores in the embodiment of the present invention two;
Fig. 6 is the embodiment of the present invention 2 second edge graph;
Fig. 7 is the structural representation of inventive touch point positioning system embodiment.
Detailed description of the invention
Each embodiment below for the method and system of inventive touch point location is described in detail.
Each embodiment first against the method for location, touch point is described.
Embodiment one
See Fig. 1, for the schematic flow sheet of the embodiment of the method one of inventive touch point location, including step:
Step S101: effective touch area based on effective touch area image to gathering that prestores stores;
Step S102: detected touch point position from effective touch area of image.
Wherein, see Fig. 2, for the embodiment of the present invention one determining the schematic flow sheet of effective touch area that prestores, below
It is described, including step more than situation during longitudinal length with the lateral length of effective touch area:
Step S201: the gray scale of initial pictures is carried out rim detection, determines the first edge;
Step S202: when the gray value of marginal point is less than the first preset value, the gray scale of monitoring marginal point neighbor pixel
Value, if the gray value of neighbor pixel is more than the second preset value, then deletes this marginal point, using neighbor pixel as edge
Point;
Step S203: judge the gray value of each marginal point whether in the first preset range, if it is not, then delete not first
Marginal point in preset range;
Step S204: delete the marginal point that abscissa is identical and marginal point number is more than two, true according to the edge after deleting
Fixed second edge;
Step S205: according to the first edge, the second edge is carried out disconnected place and compensate, the edge after compensating is carried out extension side
To stretching, determine effective touch area that prestores.
In traditional method, because camera head is mounted in the left and right sides of touch screen, system needs by taking the photograph about gathering
As the image of device, then two pictures are stored, and obtain the position, touch point in two width figures respectively, according to two width figures
In Xiang, the position of touch point determines position on the touchscreen, touch point.And the present embodiment focuses on introducing how to determine every
Position, touch point on figure.This programme is by removing excess margins, and compensates the edge after removing, and obtains image
Prestore effective touch area, and based on prestoring, effective touch area of image is stored and detects by effective touch area, thus
The position, touch point in this image can be obtained.Of course, it is possible to use this programme method to ask two width figure each positions, touch point respectively
Put, thus obtain position on the touchscreen, touch point.Concrete position, touch point of how finding out from effective touch area is with existing
It is identical for having the method finding out touch point in technology from whole figure, simply finds range shorter, and concrete grammar is the most superfluous at this
State.
Owing to the angle of camera head shooting photo is different, it is possible to obtain the photo being probably laterally or longitudinally, and
Existing apparatus is can identify that photo is horizontal or longitudinal direction, so below with horizontal photo (i.e. effectively touch area
Lateral length more than longitudinal length) to determining that effective touch area that prestores is described in detail.
First, the gray scale of initial pictures being carried out rim detection, edge detection method can use limit of the prior art
Edge detection method, this programme is as a example by canny edge detection algorithm.The general process of canny algorithm is
1. use Gaussian filter noise reduction;
2. differential processes and obtains gradient magnitude and direction;
3. pair gradient carries out non-maxima suppression (non local maximum sets to 0);
4. gradient is filtered by dual threshold;
5. pair edge filtered out is attached.
It is of course also possible to use other edge detection methods, do not repeat them here.As it is shown on figure 3, be rim detection of the present invention
After edge graph.White lines be process after the edge that obtains.
After using edge detection method, always there will be one in edge is correct edge line, and one is correct limit
The edge line of the black pixel point composition near edge line.Because when seeking gradient, use
G(x,y)=dxi+dyj、
dxi=L(i+1,j)-L(i,j)、
dyj=L(i,j+1)-L(i,j)
Wherein, L is the gray value of image pixel, and (i j) is the coordinate figure of pixel.Owing to using dual threshold that gradient is carried out
Filter, the gray value of only two pixels separate the biggest time just can be saved, and when black pixel subtracts the value of white pixel point in advance
If time in scope, retaining white pixel point, i.e. white pixel point is marginal point;White pixel point subtracts the value of black pixel in preset range
Time, black pixel is marginal point.In order to avoid this situation that black pixel is marginal point, the present invention proposes a kind of scheme, when
The gray value of marginal point is less than (when marginal point is black pixel) during the first preset value, the ash of monitoring marginal point neighbor pixel
Angle value, if the gray value of neighbor pixel is more than the second preset value, then deletes this marginal point, using neighbor pixel as limit
Edge point.After so processing, gained edge is correct edge line.
Next, it is determined that whether the gray value of each marginal point is in the first preset range, do not preset first if it is not, then delete
In the range of marginal point.First preset range can draw according to statistics.This step purpose is to select at effective touch area ash
Edge in angle value, the gray value of some marginal point is higher, and the gray value of some marginal point can be lower, then these be discontented with
The marginal point of foot condition is deleted.
Then, delete the marginal point that abscissa is identical and marginal point number is more than two, the most same vertical line only exists a pair
The situation of marginal point pair stays, being filtered more than a pair, determines the second edge according to the edge after deleting.
According to the first edge, the second edge is carried out disconnected place to compensate, the second place, edge figure is begun stepping through inspection from zero row
Surveying, when detecting row and there is marginal point, marginal point, as determining marginal point, continues to examine the row of the second place, edge figure
Survey;When detection row do not exist marginal point, whether the detection row of corresponding detection the first place, edge figure exist marginal point, if the
One marginal existence marginal point, finds out from each marginal point at corresponding second edge of this marginal point and determines that the distance of marginal point is the
Marginal point in two preset range, compensates the second edge according to the marginal point found out, if the first edge does not exist limit
During edge point, continue the row of the second place, edge figure are scanned.
In a specific embodiment, the method that disconnected place compensates may is that the second edge, starts to maximum column from 0 row
Scanning, until finding the row that there is marginal point pair;If scanning when there is marginal point pair in prostatitis, then with marginal point above even
Logical, as the line pair of up-to-date connection;Scan when prostatitis is without marginal point pair, then from first edge institute these row in the drawings
Marginal point centering find out marginal point fixed with previous column to (line of up-to-date connection to) immediate marginal point pair, so
After couple together, as the line pair of up-to-date connection;Scan when prostatitis is without marginal point pair, and in the first edge
There is no marginal point pair, do not process yet.By the marginal point of (line of up-to-date connection to) previous column to extending transverse to this row,
And couple together with edge line above, as the line pair of up-to-date connection.After above procedure scans maximum column, return to up-to-date
The head (first row finding marginal point pair) of connection line pair, by this column border point to laterally extending toward 0 column direction.
In a specific embodiment, after determining the first edge, before determining the second edge, also include characteristic filter
One: the marginal point on same vertical line, the most adjacent marginal point is as the first marginal point pair, the two edges point of the first marginal point pair
Distance be not more than the first preset value, if it is greater, then filter.In this programme, the first preset value is set to 30 each pixels, 30 pictures
Element is that the maximum value possible according to white bright band width defines out, with specific reference to being actually needed setting.Such as Fig. 4, for this
The schematic diagram of bright characteristic filter one, wherein the pixel on a vertical line has 5 marginal points, and composition four, to marginal point pair, is respectively
Marginal point to one, in figure with 1 representing, marginal point to two, in figure with 2 representing, marginal point to three, in figure with 3 representing, marginal point pair
Four, represent with 4.As can be seen here marginal point to two and marginal point to four distance be above limit the first preset value, so
Can be filtered.Successively all marginal points being unsatisfactory for condition are i.e. filtered deleting.
In a specific embodiment, after determining the first edge, before determining the second edge, also include characteristic filter
Two: the marginal point on same vertical line, the most adjacent marginal point is as the second marginal point pair.The most each point to check 2 it
Between the brightness (i.e. gray value) of pixel of point midway whether reach the second preset value, this example schemes have employed 200 conducts
Second preset value (maximum is 255).In this example, the grey scale pixel value of white bright band region (i.e. effectively touch area) is all
More than 200, therefore take 200 as threshold value.If this threshold definitions obtains the biggest or the least all can improve False Rate, need basis
Practical situation carrys out statistical estimation.Successively all marginal points being unsatisfactory for condition are i.e. filtered deleting.
Features described above filtration one, characteristic filter two i.e. can only include one of which characteristic filter, also in any combination
Can include two kinds, the order between characteristic filter can be in no particular order.The present embodiment is applicable not only to effectively touch when prestoring
When the lateral length in region is more than longitudinal length, it is also possible to be applicable to when the lateral length of effective touch area is less than longitudinal length
Time situation, or the situation that other images are sideling, it is determined effective touch scope, specifically at this not according to the mode of slope
Repeat again.
In a specific embodiment, the gray scale to initial pictures also includes before carrying out edge detecting step: according in advance
If initial pictures is rotated by angle, effective touch area based on effective touch area image to gathering that prestores is deposited
Before storage step, also include, according to predetermined angle, image is rotated.Can realize detecting the angle of camera head shooting,
This angle rotation is first carried out so that it is unification rotates to be a direction, the most laterally, i.e. prestores when then obtaining shooting photo
Effectively the lateral length of touch area is more than longitudinal length.So, can be according to lateral length more than longitudinally in subsequent calculations
Length processes, and concrete grammar is similar as above, simply first does rotation processing, does not repeats them here.
Embodiment two
The present embodiment filters in combination with various features, and includes dispersion characteristic filter, makes filter effect more preferably, obtains
Effective touch area more accurate, thus save internal memory, the efficiency improving detected touch point and accuracy.The present embodiment only with
The effectively lateral length of touch area is described more than the situation of longitudinal length, and the lateral length of effective touch area is less than vertical
It is similar to the situation of length, no longer lists at this.
Step S101: effective touch area based on effective touch area image to gathering that prestores stores;
Step S102: detected touch point position from effective touch area of image.
Wherein, see Fig. 5, for the embodiment of the present invention two determines the schematic flow sheet of effective touch area that prestores, including
Step:
Step S501: the gray scale of initial pictures is carried out rim detection, determines the first edge;
Step S502: when the gray value of marginal point is less than the first preset value, the gray scale of monitoring marginal point neighbor pixel
Value, if the gray value of neighbor pixel is more than the second preset value, then deletes this marginal point, using neighbor pixel as edge
Point;
Step S503: judge the gray value of each marginal point whether in the first preset range, if it is not, then delete not first
Marginal point in preset range;
Step S504: in each marginal point that abscissa is identical, the most adjacent marginal point is as the 3rd marginal point pair, it is judged that
Whether the distance of the two edges point of each described 3rd marginal point pair is more than the 3rd preset value, if it is, it is big to delete described distance
Marginal point pair in the 3rd preset value;
Step S505: from delete after each 3rd marginal point centering, it is judged that each 3rd marginal point between, predeterminated position
The gray value of pixel whether less than the 4th preset value, if it is, delete described gray value less than the of the 4th preset value
Three marginal points pair;
Step S506: delete the marginal point that abscissa is identical and marginal point number is more than two;
Step S507: judge that total and described second edge the marginal point sum ratio of marginal point that each vertical coordinate is identical is
No it is less than the 5th preset value, if ratio is less than the 5th preset value, deletes the marginal point on the vertical coordinate that this ratio is corresponding, according to
Edge after deletion determines the second edge;
Step S508: according to the first edge, the second edge is carried out disconnected place and compensate, the edge after compensating is carried out extension side
To stretching, determine effective touch area that prestores.
Step S503, step S504, step S505, step S506, step S507 be properly termed as respectively characteristic filter one,
Characteristic filter two, characteristic filter three, characteristic filter four, characteristic filter five.In traditional method, because camera head is mounted in tactile
Touching the left and right sides of screen, system needs the image by gathering left and right camera head, is then stored by two pictures, and respectively
Obtain the position, touch point in two width figures, determine position on the touchscreen, touch point according to the position of touch point in two width images
Put.And the present embodiment focuses on introducing the position, touch point how determined on every figure.This programme is by using various features
Cross and filter to remove excess margins, and the edge after removing is compensated, obtain effective touch area that prestores of image, based on prestoring
Effective touch area of image is stored and detects by effectively touch area, such that it is able to the position, touch point obtained in this image
Put.Of course, it is possible to use this programme method to ask two width figure each positions, touch point respectively, thus obtain touch point on the touchscreen
Position.Touch point is found out in prior art from whole figure in concrete position, touch point of how finding out from effective touch area
Method is identical, simply finds range shorter, and concrete grammar does not repeats them here.
First, the gray scale of initial pictures being carried out rim detection, edge detection method can use limit of the prior art
Edge detection method, this programme is as a example by canny edge detection algorithm.The general process of canny algorithm is
1. use Gaussian filter noise reduction;
2. differential processes and obtains gradient magnitude and direction;
3. pair gradient carries out non-maxima suppression (non local maximum sets to 0);
4. gradient is filtered by dual threshold;
5. pair edge filtered out is attached.
It is of course also possible to use other edge detection methods, do not repeat them here.As it is shown on figure 3, be rim detection of the present invention
After edge graph.White lines be process after the edge that obtains.
After using edge detection method, always there will be one in edge is correct edge line, and one is correct limit
The edge line of the black pixel point composition near edge line.During because seeking gradient again, use
G(x,y)=dxi+dyj、
dxi=L(i+1,j)-L(i,j)、
dyj=L(i,j+1)-L(i,j)
Wherein, L is the gray value of image pixel, and (i j) is the coordinate figure of pixel.Owing to using dual threshold that gradient is carried out
Filter, the gray value of only two pixels separate the biggest time just can be saved, and when black pixel subtracts the value of white pixel point in advance
If time in scope, retaining white pixel point, i.e. white pixel point is marginal point;White pixel point subtracts the value of black pixel in preset range
Time, black pixel is marginal point.In order to avoid this situation that black pixel is marginal point, the present invention proposes a kind of scheme, when
The gray value of marginal point is less than (when marginal point is black pixel) during the first preset value, the ash of monitoring marginal point neighbor pixel
Angle value, if the gray value of neighbor pixel is more than the second preset value, then deletes this marginal point, using neighbor pixel as limit
Edge point.After so processing, gained edge is correct edge line.
Next, it is determined that whether the gray value of each marginal point is in the first preset range, do not preset first if it is not, then delete
In the range of marginal point.First preset range can draw according to statistics.This step purpose is to select at effective touch area ash
Edge in angle value, the gray value of some marginal point is higher, and the gray value of some marginal point can be lower, then these be discontented with
The marginal point of foot condition is deleted.
Then, the marginal point on same vertical line, the most adjacent marginal point is as the 3rd marginal point pair, the 3rd marginal point pair
The distance of two edges point be not more than the 3rd preset value, if it is greater, then filter.In this programme, the 3rd preset value is set to 30 pictures
Element, 30 pixels are that the maximum value possible according to white bright band width defines out, with specific reference to being actually needed setting.Such as figure
Shown in 4, wherein the pixel on a vertical line has 5 marginal points, and composition four is to marginal point pair, and respectively marginal point is to one, in figure
With 1 representing, marginal point to two, in figure with 2 representing, marginal point to three, in figure with 3 representing, marginal point to four, represent with 4.Thus
Visible marginal point to two and marginal point to four distance be above limit the first preset value, so can be filtered.Successively
All marginal points being unsatisfactory for condition are i.e. filtered deleting.
Each 3rd marginal point centering after deleting, the brightness to the pixel of the point midway between checking at 2 of each point
Whether (i.e. gray value) reaches the 4th preset value, and this example schemes have employed 200 as the 4th preset value (maximum is 255).
In this example, the grey scale pixel value of white bright band region (i.e. effectively touch area), all more than 200, therefore takes 200 conducts
Threshold value.If this threshold definitions obtains the biggest or the least False Rate that all can improve, need to carry out statistical estimation according to practical situation.Depend on
Secondary, by all marginal points of condition that are unsatisfactory for deleting.Successively by all marginal points of condition that are unsatisfactory for deleting
I.e. filter.
After deleting remaining edge, delete the marginal point that abscissa is identical and marginal point number is more than two, the most same
The situation only existing a pair marginal point pair on vertical line stays, being filtered more than a pair, after being scanned through by all marginal points (i.e.
After all marginal points compare), determine the second edge according to the edge after deleting.
Then, the marginal point that dispersion is big is deleted.Judge marginal point sum and the limit at the second edge that each vertical coordinate is identical
Edge point sum ratio, whether less than the 5th preset value, if ratio is less than the 5th preset value, deletes the vertical coordinate that this ratio is corresponding
On marginal point, according to delete after edge determine the second edge.5th preset value can draw according to test of many times statistics.?
In one specific embodiment, following method can be used to carry out filtering the big edge of dispersion:
First adding up whole marginal point, sum is designated as T.Add up the often capable marginal point S, S existed again and, divided by T, obtain ratio,
Calculate for convenience, ratio can be multiplied by 100, will its integer, naturally it is also possible to after directly carrying out by ratio mode
Step.The present embodiment illustrates with integer form, then the set after this ratio integer is designated as Rt.
Rt gathers sort descending, is then added up one by one (being i.e. worth bigger) arranged above, often adds once, do once
Relatively, until and during more than six preset values, then take the currency threshold value as next step, this example definition the 6th preset value is
75.Citing Rt set sort descending sequence be, 40,20,16,10... then 40+20+16 > 75, take 16 as threshold value.
Checking Rt set, the marginal point of this row, less than the row of threshold value 16, is filtered out by value.
The core of this filtration is to remove those less than the marginal point of pixel columns of certain ratio containing marginal point, i.e. those from
The marginal point that divergence is big is considered as noise spot.After this step comes, obtaining the second edge, the second edge is as confidence level
The highest edge aggregation.As shown in Figure 6, for the embodiment of the present invention 2 second edge graph.
According to the first edge, the second edge is carried out disconnected place to compensate, to the second edge, starts to scan to maximum column from 0 row,
Until finding the row that there is marginal point pair;If scanning when there is marginal point pair in prostatitis, then connect with marginal point above, as
The line pair of up-to-date connection;Scan when prostatitis is without marginal point pair, then from the first edge the edge of this row in the drawings
Point centering finds out marginal point fixed with previous column to (line of up-to-date connection to) immediate marginal point pair, then connects
Get up, as the line pair of up-to-date connection;Scan when prostatitis is without marginal point pair, and also do not have in the first edge
Marginal point pair, does not processes.By the marginal point of (line of up-to-date connection to) previous column to extending transverse to this row, and with front
The edge line in face couples together, as the line pair of up-to-date connection.After above procedure scans maximum column, return to up-to-date connection line
To head (first row finding marginal point pair), by this column border point to laterally extending toward 0 column direction.I.e. can obtain pre-
If effectively touch area.
In a specific embodiment, step S101 includes step:
Obtain the view data of image, be stored in rows in row data buffer zone, every line flag line number;
Judge that view data whether in the default line number prestoring effective touch area, is the most then stored in figure by line number
As in the corresponding line of relief area.
Particularly as follows: view data is transferred to main by the DCMI interface of standard by camera head view data line by line
In the row data buffer zone of board memory, every line flag line number;Row data buffer zone is double buffering, at data line end of transmission
Time, hardware, by automatic switchover row data buffer zone, then produces row and interrupts, and the data of next line may proceed to transmission simultaneously;Judge
Whether line number in the range of limiting, is the most then stored in view data in image buffer corresponding line, if it is not, do not store
In image buffer;Then judge whether image buffer reaches last column of effective touch area, the most then stop by
View data is stored in image buffer, otherwise continues.When the whole two field picture of camera head is transmitted, DCMI interface will produce
Raw frame interrupts.Line number is reset in frame interrupt processing.Wherein, by the line number of a variable record current line, each row interrupts then
Adding 1, each frame interrupts then resetting.Respectively with initial row and the end line of variable record effective range.If line number is more than or equal to
Initial row and less than end line, then it is assumed that this row is in effective range.Line number in effective range, is then deducted initial by this row
Row is as the line number of effective range image buffer, and row buffer data are copied the corresponding row of effective range image buffer
In.If line number equal to limited range terminate line number subtract 1 time, gathered with this two field picture of variable label.Define
The data volume of effect scope is less than the data volume of original image
Concrete storage mode is not limited to the present embodiment mode, other existing storing modes can also, set with specific reference to needs
Fixed, do not repeat them here.
In a specific embodiment, the gray scale to initial pictures also includes before carrying out edge detecting step: according in advance
If initial pictures is rotated by angle, effective touch area based on effective touch area image to gathering that prestores is deposited
Before storage step, also include, according to predetermined angle, image is rotated.Can first detect the angle of camera head shooting, so
Rear acquisition is first carried out this angle rotation when shooting photo so that it is unification rotates to be a direction, the most laterally, i.e. prestores
The lateral length of effect touch area is more than longitudinal length.So, can be according to lateral length more than the longest in subsequent calculations
Degree processes, and concrete grammar is similar as above, simply first does rotation processing, does not repeats them here.
The method positioned according to above-mentioned touch point, the present invention provides a kind of touch point alignment system.
See Fig. 7, for the structural representation of inventive touch point positioning system embodiment, including:
Effectively touch area memory module 701, effectively touches for based on effective touch area image to gathering that prestores
Touch region to store;
Detected touch point position module 702, for effective touch of the image from the storage of effective touch area memory module
Detected touch point position in region;
Effective touch area that prestores determines module 703, for the gray scale of initial pictures is carried out rim detection, determines first
Edge;When the lateral length of effective touch area is more than longitudinal length, when the gray value of marginal point is less than the first preset value,
The gray value of monitoring marginal point neighbor pixel, if the gray value of neighbor pixel is more than the second preset value, then deleting should
Marginal point, using neighbor pixel as marginal point;Judge the gray value of each marginal point whether in the first preset range, if it is not,
Then delete the marginal point not in the first preset range;Delete the marginal point that abscissa is identical and marginal point number is more than two, root
Determine the second edge according to the edge after deleting, according to the first edge, the second edge is carried out disconnected place and compensate, to the edge after compensating
Carry out bearing of trend stretching, determine effective touch area that prestores.
In a specific embodiment, effective touch area that prestores determines that module also includes: the first rotary module, for root
Rotating initial pictures according to predetermined angle, effective touch area memory module also includes: the second rotary module, for basis
Image is rotated by predetermined angle.
In a specific embodiment, effective touch area that prestores determines that module also includes: the first filtering module, for horizontal stroke
In each marginal point that coordinate is identical, the most adjacent marginal point is as the first marginal point pair, it is judged that the two of each first marginal point pair
The distance of marginal point, whether more than the 3rd preset value, when distance is more than three preset values, then deletes this distance pre-more than the 3rd
If the marginal point pair of value.
In a specific embodiment, effective touch area that prestores determines that module also includes: the second filtering module, for horizontal stroke
In each marginal point that coordinate is identical, neighboring edge o'clock is as the second marginal point pair two-by-two, it is judged that each second marginal point between,
Whether the gray value of the pixel of predeterminated position is less than the 4th preset value, and when gray value is less than four preset values, then deleting should
Gray value is less than the second marginal point pair of the 4th preset value.
In a specific embodiment, effective touch area that prestores determines that module also includes: the 3rd filtering module, for really
The ratio of the total marginal point sum with the second edge of marginal point that fixed each vertical coordinate is identical, by each ratio descending, will fall
Each ratio of sequence arrangement is added successively, often adds a ratio and determines a value, when this value is more than six preset values, takes in addend
Minimum ratio is as threshold value, it is judged that each ratio, whether less than threshold value, when ratio is less than threshold value, deletes the vertical coordinate that this ratio is corresponding
On marginal point.
In a specific embodiment, effective touch area that prestores determines that module includes: compensating module, for the second limit
Edge place figure begins stepping through detection from zero row, and when detecting row and there is marginal point, marginal point, as determining marginal point, continues the
The row of two place, edge figures detect;When there is not marginal point in detection row, the detection of corresponding detection the first place, edge figure
Whether row exist marginal point, when the first marginal existence marginal point, find out from each marginal point at corresponding second edge of this marginal point
With determine the distance of the marginal point marginal point in the second preset range, according to the marginal point found out, the second edge is mended
Repay, when the first edge does not exists marginal point, continue the row of the second place, edge figure are scanned.
In a specific embodiment, effective touch area memory module includes: row data buffer module, is used for obtaining figure
The view data of picture, stores in rows, every line flag line number;Image buffers module, for prestoring when line number
Time in the default line number of effect touch area, view data is stored in corresponding line.
Specific implementation has been described above, and does not repeats them here.Wherein it is possible to only include the first filtering module, second
One or more in filtering module, the 3rd filtering module, set with specific reference to needs.
Embodiment described above only have expressed the several embodiments of the present invention, and it describes more concrete and detailed, but also
Therefore the restriction to the scope of the claims of the present invention can not be interpreted as.It should be pointed out that, for those of ordinary skill in the art
For, without departing from the inventive concept of the premise, it is also possible to make some deformation and improvement, these broadly fall into the guarantor of the present invention
Protect scope.Therefore, the protection domain of patent of the present invention should be as the criterion with claims.
Claims (10)
1. the method for location, a touch point, it is characterised in that include step:
Effective touch area based on effective touch area image to gathering that prestores is stored in row data buffering in rows
Qu Zhong, every line flag line number, it is judged that whether described line number is in the default line number of described effective touch area that prestores, the most then
Described view data is stored in image buffer corresponding line, if line number is more than or equal to initial row and less than end line,
Then think that line number, in effective range, is deducted the initial row line number as effective range image buffer, and delayed by row by this row
Rush district's data to copy in the corresponding row of effective range image buffer;Detected touch point from effective touch area of described image
Position, wherein, described in effective touch area that prestores determined by following steps:
The gray scale of initial pictures is carried out rim detection, determines the first edge;
When the lateral length of effective touch area is more than longitudinal length,
When the gray value of marginal point is less than the first preset value, the gray value of monitoring marginal point neighbor pixel, if adjacent picture
When the gray value of vegetarian refreshments is more than the second preset value, then delete this marginal point, using neighbor pixel as marginal point;
Judge the gray value of each marginal point whether in the first preset range, if it is not, then delete not in the first preset range
Marginal point;
Delete the marginal point that abscissa is identical and marginal point number is more than two, determine the second edge according to the edge after deleting,
According to described first edge, described second edge is carried out disconnected place to compensate, the second edge after compensating is carried out bearing of trend
Stretching, determine described in prestore effective touch area.
The method of location, touch point the most according to claim 1, it is characterised in that
The described gray scale to initial pictures also includes before carrying out edge detecting step: according to predetermined angle to described initial pictures
Rotate,
Before described effective touch area based on effective touch area image to gathering that prestores carries out storing step, also wrap
Include, according to predetermined angle, described image is rotated.
Touch point the most according to claim 2 location method, it is characterised in that described determine the first edge after, institute
State before determining the second edge, further comprise the steps of:
In each marginal point that abscissa is identical, the most adjacent marginal point is as the first marginal point pair, it is judged that each described first limit
Whether the distance of the two edges point of edge point pair is more than the 3rd preset value, if it is, delete described distance more than the 3rd preset value
Marginal point pair;
Or
In each marginal point that abscissa is identical, neighboring edge o'clock is as the second marginal point pair two-by-two, it is judged that each described second edge
Point between, the gray value of the pixel of predeterminated position whether less than the 4th preset value, if it is, delete described gray value
The second marginal point pair less than the 4th preset value;
Or
In each marginal point that abscissa is identical, the most adjacent marginal point is as the 3rd marginal point pair, it is judged that each described 3rd limit
Whether the distance of the two edges point of edge point pair is more than the 3rd preset value, if it is, delete described distance more than the 3rd preset value
Marginal point pair;
Each 3rd marginal point centering after deleting, it is judged that each 3rd marginal point between, the ash of the pixel of predeterminated position
Whether angle value is less than the 4th preset value, if it is, delete the described gray value the 3rd marginal point pair less than the 4th preset value.
Touch point the most according to claim 2 location method, it is characterised in that described determine the second edge after, really
Prestore described in Ding before effective touch area, also include:
Judge that total and described second edge the marginal point sum ratio of marginal point that each vertical coordinate is identical is the most pre-less than the 5th
If value, if ratio is less than the 5th preset value, delete the marginal point on the vertical coordinate that this ratio is corresponding;
Or
Determine the ratio of the total marginal point sum with described second edge of marginal point that each vertical coordinate is identical, by each described ratio
Descending, is added successively by each ratio of descending, often adds a ratio and determines a value, when this value is preset more than the 6th
During value, take in addend minimum ratio as threshold value, it is judged that whether each described ratio is less than described threshold value, if ratio is less than described
Threshold value, deletes the marginal point on the vertical coordinate that this ratio is corresponding.
5. the method positioned according to the touch point described in Claims 1-4 any one, it is characterised in that described in described basis
First edge carries out disconnected place compensation process and includes described second edge:
From zero row, described second place, edge figure is begun stepping through detection, and when detecting row and there is marginal point, described marginal point is made
For determining marginal point, continue the row of described second place, edge figure are detected;When detection row do not exist marginal point, corresponding
Whether the described detection row detecting the first place, edge figure exist marginal point, if the first marginal existence marginal point, from this edge
Put the distance finding out and determining marginal point in each marginal point at corresponding second edge marginal point in the second preset range, according to
Described second edge is compensated by the described marginal point found out, if the first edge does not exists marginal point, continues described
The row of the second place, edge figure are scanned.
6. a touch point alignment system, it is characterised in that including:
Effectively touch area memory module, for effective touch area based on effective touch area image to gathering that prestores with
The form of row is stored in row data buffer zone, every line flag line number, it is judged that whether described line number effectively touches described prestoring
In the default line number in region, the most described view data is stored in image buffer corresponding line, if line number is more than
In initial row and less than end line, then it is assumed that line number, in effective range, is deducted initial row as effective range figure by this row
As the line number of relief area, and row buffer data are copied in the corresponding row of effective range image buffer;
Detected touch point position module, for effective touch of the described image from the storage of described effective touch area memory module
Detected touch point position in region;
Effective touch area that prestores determines module, for the gray scale of initial pictures is carried out rim detection, determines the first edge;When
When effectively the lateral length of touch area is more than longitudinal length, when the gray value of marginal point is less than the first preset value, monitor limit
The gray value of edge point neighbor pixel, if the gray value of neighbor pixel is more than the second preset value, then deletes this marginal point,
Using neighbor pixel as marginal point;Judge the gray value of each marginal point whether in the first preset range, if it is not, then delete not
Marginal point in the first preset range;Delete the marginal point that abscissa is identical and marginal point number is more than two, after deleting
Edge determine the second edge, according to described first edge, described second edge carried out disconnected place and compensates, to second after compensating
Edge carries out bearing of trend stretching, determine described in prestore effective touch area.
Touch point the most according to claim 6 alignment system, it is characterised in that
Described effective touch area that prestores determines that module also includes: the first rotary module, for according to predetermined angle at the beginning of described
Beginning image rotates,
Described effective touch area memory module also includes: the second rotary module, for entering described image according to predetermined angle
Row rotates.
8. according to the touch point alignment system described in claim 6 or 7, it is characterised in that described in effective touch area that prestores true
Cover half block also includes:
First filtering module, in each marginal point that abscissa is identical, the most adjacent marginal point as the first marginal point pair,
Judge whether the distance of the two edges point of each described first marginal point pair is more than the 3rd preset value, when distance is more than the 3rd preset value
Time, then delete this distance marginal point pair more than the 3rd preset value;
And/or
Second filtering module, in each marginal point that abscissa is identical, neighboring edge o'clock is as the second marginal point pair two-by-two, sentences
Disconnected each described second marginal point between, the gray value of the pixel of predeterminated position whether less than the 4th preset value, work as gray scale
When value is less than four preset values, then delete this gray value the second marginal point pair less than the 4th preset value;
And/or
3rd filtering module, for determining the total marginal point sum with described second edge of marginal point that each vertical coordinate is identical
Ratio, by each described ratio descending, is added successively by each ratio of descending, often adds a ratio and determines a value,
When this value is more than six preset values, take in addend minimum ratio as threshold value, it is judged that whether each described ratio is less than described threshold
Value, when ratio is less than described threshold value, deletes the marginal point on the vertical coordinate that this ratio is corresponding.
9. according to the touch point alignment system described in claim 6 or 7, it is characterised in that described in effective touch area that prestores true
Cover half block includes:
Compensating module, for described second place, edge figure is begun stepping through detection from zero row, when detecting row and there is marginal point,
Described marginal point, as determining marginal point, continues to detect the row of described second place, edge figure;When detection row do not exist
During marginal point, whether the described detection row of corresponding detection the first place, edge figure exist marginal point, when the first marginal existence edge
Point, finds out from each marginal point at corresponding second edge of this marginal point and determines that the distance of marginal point is in the second preset range
Marginal point, compensates described second edge according to the described marginal point found out, and when the first edge does not exists marginal point, continues
The continuous row to described second place, edge figure are scanned.
10. according to the touch point alignment system described in claim 6 or 7, it is characterised in that described effective touch area storage mould
Block includes:
Row data buffer module, for obtaining the view data of described image, stores, every line flag row in rows
Number;
Image buffers module, for when described line number is in the default line number of described effective touch area that prestores, by described figure
As data are stored in corresponding line.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310205616.8A CN103279234B (en) | 2013-05-28 | 2013-05-28 | The method and system of location, touch point |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310205616.8A CN103279234B (en) | 2013-05-28 | 2013-05-28 | The method and system of location, touch point |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103279234A CN103279234A (en) | 2013-09-04 |
CN103279234B true 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 | The method and system of location, touch point |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103279234B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105892753B (en) * | 2016-04-29 | 2019-01-01 | 努比亚技术有限公司 | A kind of method and device towards touch-screen equipment |
CN116204366B (en) * | 2023-05-06 | 2023-08-11 | 深圳卓创智能科技有限公司 | Tablet personal computer quality detection method, device, equipment and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1881255A (en) * | 2005-06-15 | 2006-12-20 | 华为技术有限公司 | Digital image edge information extracting method |
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 |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100975869B1 (en) * | 2008-10-17 | 2010-08-13 | 삼성모바일디스플레이주식회사 | Method and apparatus for detecting touch point |
KR101627715B1 (en) * | 2009-11-18 | 2016-06-14 | 엘지전자 주식회사 | Touch Panel, Driving Method for Touch Panel, and Display Apparatus having a Touch Panel |
CN103065307B (en) * | 2012-12-25 | 2015-12-09 | 上海交通大学 | The area merges detection method of SAR/SPOT image under non-precision registration |
-
2013
- 2013-05-28 CN CN201310205616.8A patent/CN103279234B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1881255A (en) * | 2005-06-15 | 2006-12-20 | 华为技术有限公司 | Digital image edge information extracting method |
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 |
Also Published As
Publication number | Publication date |
---|---|
CN103279234A (en) | 2013-09-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4528850B2 (en) | Defect detection apparatus, defect detection method, defect detection program, and computer-readable recording medium recording the program | |
US20070171286A1 (en) | Image superimposing apparatus | |
CN1910623A (en) | Image conversion method, texture mapping method, image conversion device, server-client system, and image conversion program | |
WO2014106445A1 (en) | Method and apparatus for detecting backlight | |
JP2008250949A (en) | Image processor, control program, computer-readable recording medium, electronic equipment and control method of image processor | |
JP2008250950A (en) | Image processor, control program, computer-readable recording medium, electronic equipment and control method of image processor | |
CN105744242A (en) | Image Processing Apparatus And Image Processing Method | |
CN104349080A (en) | Image processing method and electronic equipment | |
CN101477616A (en) | Human face detecting and tracking process | |
JP2008250951A (en) | Image processor, control program, computer-readable recording medium, electronic equipment, and control method of image processor | |
CN103279234B (en) | The method and system of location, touch point | |
CN112687231A (en) | Brightness and chrominance data extraction method, equipment and computer readable storage medium | |
JP2009229197A (en) | Linear defect detecting method and device | |
CN100525475C (en) | Method of detecting image definition | |
CN101995325A (en) | Appearance detection method and system of image sensor | |
CN1946140A (en) | Digital image processing method and picture taking device | |
CN103956055B (en) | A kind of method for snap control captured for vehicle image | |
CN103279235B (en) | The method and system of location, touch point | |
JP3695120B2 (en) | Defect inspection method | |
CN108875733B (en) | Infrared small target rapid extraction system | |
CN101461228A (en) | Image processing circuit, semiconductor device, and image processing device | |
US20050152616A1 (en) | Method and apparatus for automatic scanner defect detection | |
JP5637058B2 (en) | Bar counting method | |
US20160364627A1 (en) | Image determining method and object coordinate computing apparatus | |
JP2021190515A (en) | Workpiece left-over determination system |
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 |