CN105844615A - Method of identifying regular rectangular area and apparatus thereof - Google Patents

Method of identifying regular rectangular area and apparatus thereof Download PDF

Info

Publication number
CN105844615A
CN105844615A CN201610153207.1A CN201610153207A CN105844615A CN 105844615 A CN105844615 A CN 105844615A CN 201610153207 A CN201610153207 A CN 201610153207A CN 105844615 A CN105844615 A CN 105844615A
Authority
CN
China
Prior art keywords
edge
widthwise
group
longitudinal edge
longitudinal
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
Application number
CN201610153207.1A
Other languages
Chinese (zh)
Other versions
CN105844615B (en
Inventor
徐祖亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN201610153207.1A priority Critical patent/CN105844615B/en
Publication of CN105844615A publication Critical patent/CN105844615A/en
Application granted granted Critical
Publication of CN105844615B publication Critical patent/CN105844615B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Analysis (AREA)

Abstract

The invention discloses a method of identifying a regular rectangular area and an apparatus thereof. The method comprises the following steps of carrying out edge point detection operation on an image containing the regular rectangular area so as to acquire edge points in the image; according to distribution of the acquired edge points, acquiring a transverse edge set including at least two transverse edges and a longitudinal edge set including at least two longitudinal edges; and constructing at least one transverse edge pair satisfying a predetermined condition from the transverse edge set. Each transverse edge pair is verified, the transverse edge pair which passes the verification is the effective transverse edge pair and the rectangular area determined by the effective transverse edge pair is the regular rectangular area. In the technical scheme in the invention, the regular rectangular area in the image can be accurately identified.

Description

The method and device of recognition rule rectangular area
Technical field
It relates to image identification technical field, particularly relate to method and the dress of recognition rule rectangular area Put.
Background technology
Developing rapidly recently as automatic test, various automated test tools emerge in an endless stream.Mesh Before have a lot of Web User Interface automated test frame on the market, such as WatiN, Selinimu, WebDriver, also Coded UI in VS2010 etc..These frameworks can be known Not and operate the control in Web, the operations such as analog subscriber inputs, click, it is achieved Web automatization surveys Examination.
But the automatic test stability being currently based on user interface is the highest, the figure that correlation technique is used As identification technology mainly uses Feature Points Matching mode, processing speed is relatively slow, and for special During demand region segmentation, the most only segmentation regular rectangular shape region, it is impossible to reach good segmentation effect.
Additionally, in other much application, there is also the demand of recognition rule rectangular area.
Summary of the invention
The disclosure provides the method and device of a kind of recognition rule rectangular area, using the teaching of the invention it is possible to provide higher identification Accuracy.
One side according to the disclosure, it is provided that a kind of method of recognition rule rectangular area, including: to bag Image containing regular rectangular shape region carries out endpoint detections computing and obtains the marginal point in image;According to obtaining The distribution of the described marginal point taken obtains including the widthwise edge group of at least two widthwise edges, and/or according to obtaining The distribution of the described marginal point taken obtains including the longitudinal edge group of at least two longitudinal edges;From described widthwise edge In group, structure meets at least one widthwise edge pair of predetermined condition, and/or constructs from described longitudinal edge group Meet at least one longitudinal edge pair of predetermined condition;To each widthwise edge to verifying, by checking Widthwise edge is to for effective widthwise edge pair, and the described effective widthwise edge rectangular area to determining is described rule square Shape region;Or to limit longitudinally in each to verifying, by the longitudinal edge of checking to for effective longitudinal edge Right, the described effective longitudinal edge rectangular area to determining is described regular rectangular shape region.
According to some embodiments, the image comprising regular rectangular shape region is carried out endpoint detections computing and obtains The marginal point taken in image includes: utilize preset algorithm image to carry out endpoint detections computing and acquisition figure Marginal point in Xiang, wherein said preset algorithm includes Laplacian operator, Canny operator, Sobel Operator, Prewitt operator, Kirsch operator, compass operator or Roberts Cross operator.
According to some embodiments, the image comprising regular rectangular shape region is carried out endpoint detections computing and obtains The marginal point taken in image includes: image is carried out smothing filtering;Image after smothing filtering is transported Calculate;The extreme point of detection calculations is to obtain the marginal point in image.
According to some embodiments, image is carried out smothing filtering and includes: use Gaussian function that image is carried out Smothing filtering.
According to some embodiments, obtain including at least two laterally according to the distribution of the described marginal point obtained The widthwise edge group on limit includes: carry out being grouped to obtain multiple widthwise edge according to ordinate value by described marginal point Edge point group, for each transverse edge point group, if the continuous boundary point that described transverse edge point group comprises Number is more than first threshold, then added as a widthwise edge by the line segment that described transverse edge point group is constituted Enter described widthwise edge group.
According to some embodiments, obtain including at least two longitudinal directions according to the distribution of the described marginal point obtained The longitudinal edge group on limit includes: carry out being grouped to obtain multiple longitudinal edge according to abscissa value by described marginal point Edge point group, for each longitudinal edge point group, if the continuous boundary point that described longitudinal edge point group comprises Number is more than Second Threshold, then added as a longitudinal edge by the line segment that described longitudinal edge point group is constituted Enter described longitudinal edge group.
According to some embodiments, from described widthwise edge group, to meet at least one of predetermined condition horizontal for structure While to including: for wantonly two widthwise edges in described widthwise edge group, if it is determined that described two widthwise edges Initial abscissa value difference and terminate abscissa value difference be respectively less than the 3rd threshold value, and described two horizontal strokes To the difference of the ordinate value on limit in the 4th threshold range, then using described two widthwise edges as one laterally Limit pair.
According to some embodiments, from described longitudinal edge group, structure meets at least one longitudinal direction of predetermined condition While to including: for wantonly two longitudinal edges in described longitudinal edge group, if it is determined that described two longitudinal edges The difference of initial ordinate value and terminate the difference of ordinate value and be respectively less than the 5th threshold value, and described two are indulged To the difference of the abscissa value on limit in the 6th threshold range, then using described two longitudinal edges as a longitudinal direction Limit pair.
According to some embodiments, each widthwise edge is included carrying out checking: find and described widthwise edge pair Corresponding longitudinal edge pair, if there is corresponding longitudinal edge pair, the most described widthwise edge is to for effective widthwise edge Right.
According to some embodiments, limit longitudinally in each is included carrying out checking: find and described longitudinal edge pair Corresponding widthwise edge pair, if there is corresponding widthwise edge pair, the most described longitudinal edge is to for effective longitudinal edge Right.
According to a further aspect in the invention, it is provided that the device of a kind of recognition rule rectangular area, including limit Edge point acquisition module, for carrying out endpoint detections computing to the image comprising regular rectangular shape region and obtaining Marginal point in image;Limit group acquisition module, for being wrapped according to the distribution of the described marginal point obtained Include the widthwise edge group of at least two widthwise edges, and/or wrapped according to the distribution of the described marginal point obtained Include the longitudinal edge group of at least two longitudinal edges;While to constructing module, for constructing from described widthwise edge group Meet at least one widthwise edge pair of predetermined condition, and/or structure meets predetermined from described longitudinal edge group At least one longitudinal edge pair of condition;Authentication module, is used for each widthwise edge verifying, passes through The widthwise edge of checking is to for effective widthwise edge pair, and the described effective widthwise edge rectangular area to determining is described Regular rectangular shape region;Or to limit longitudinally in each to verifying, by the longitudinal edge of checking to for effectively Longitudinal edge pair, the described effective longitudinal edge rectangular area to determining is described regular rectangular shape region.
According to some embodiments, described marginal point acquisition module is configured to utilize preset algorithm to carry out image Endpoint detections computing and obtain the marginal point in image, wherein said preset algorithm includes Laplacian Operator, Canny operator, Sobel operator, Prewitt operator, Kirsch operator, compass operator or Roberts Cross operator.
According to some embodiments, described marginal point acquisition module is configured that and image is carried out smothing filtering; Image after smothing filtering is carried out computing;The extreme point of detection calculations is to obtain the marginal point in image.
According to some embodiments, described marginal point acquisition module is configured to use Gaussian function to carry out image Smothing filtering.
According to some embodiments, described limit group acquisition module is configured that described marginal point according to vertical coordinate Value carries out being grouped to obtain multiple transverse edge point group, for each transverse edge point group, if described horizontal stroke The continuous boundary comprised to group of edge points is counted out more than first threshold, then by described transverse edge point group structure The line segment become adds described widthwise edge group as a widthwise edge;And/or by described marginal point according to horizontal stroke Coordinate figure carries out being grouped to obtain multiple longitudinal edge point group, for each longitudinal edge point group, if institute State the continuous boundary that longitudinal edge point group comprises and count out more than Second Threshold, then by described longitudinal edge point The line segment that group is constituted adds described longitudinal edge group as a longitudinal edge.
According to some embodiments, constructing module was configured that for appointing in described widthwise edge group by described limit Article two, widthwise edge, if it is determined that the difference of the initial abscissa value of described two widthwise edges and termination abscissa The difference of value is respectively less than the 3rd threshold value, and the difference of the ordinate value of described two articles of widthwise edges is at the 4th threshold range In, then using described two widthwise edges as a widthwise edge pair;And/or in described longitudinal edge group Wantonly two longitudinal edges, if it is determined that the difference of the initial ordinate value of described two longitudinal edges and the vertical seat of termination The difference of scale value is respectively less than the 5th threshold value, and the difference of the abscissa value of described two articles of longitudinal edges is at the 6th threshold value model In enclosing, then using described two longitudinal edges as a longitudinal edge pair.
According to some embodiments, described authentication module is configured that to find and indulges corresponding with described widthwise edge To limit pair, if there is corresponding longitudinal edge pair, it is determined that described widthwise edge is to for effective widthwise edge pair; Or find with described longitudinal edge corresponding widthwise edge pair, if there is corresponding widthwise edge pair, the most really Fixed described longitudinal edge is to for effective longitudinal edge pair.
Technical scheme according to some example embodiment of the disclosure, it is possible to accurately identify the regular square in image Shape region.
It should be appreciated that it is only exemplary and explanatory that above general description and details hereinafter describe , the disclosure can not be limited.
Accompanying drawing explanation
Accompanying drawing herein is merged in description and constitutes the part of this specification, it is shown that meet this Bright embodiment, and for explaining the principle of the present invention together with description.
Fig. 1 illustrates the method flow diagram of the recognition rule rectangular area according to an illustrative embodiments;
Fig. 2 illustrates the method flow diagram of the recognition rule rectangular area according to another exemplary embodiment;
Fig. 3 illustrates the method flow diagram of the recognition rule rectangular area according to another exemplary embodiment;
Fig. 4 illustrate according to the present invention one example embodiment to the widthwise edge process to verifying;
Fig. 5 illustrate according to another example embodiment of the present invention to the longitudinal edge process to verifying;
Fig. 6 illustrate according to another example embodiment of the present invention to the widthwise edge process to verifying;
Fig. 7 illustrates the block diagram of the device of the recognition rule rectangular area according to an illustrative embodiments.
Detailed description of the invention
It is described more fully with example embodiment referring now to accompanying drawing.But, example embodiment can be with many The form of kind is implemented, and is not understood as limited to embodiment set forth herein;On the contrary, it is provided that these are implemented Example makes the present invention will fully and completely, and the design of example embodiment is conveyed to this area all sidedly Technical staff.The most identical reference represents same or similar part, thus by omission to it Repeated description.
Additionally, described feature, structure or characteristic can be combined in any suitable manner one or In more embodiments.In the following description, it is provided that many details thus provide the reality to the present invention Execute fully understanding of example.It will be appreciated, however, by one skilled in the art that the technology of the present invention can be put into practice Scheme and do not have in described specific detail one or more, or other method, group can be used Unit, device, etc..In other cases, be not shown in detail or describe known features, method, device, Realize or operation is to avoid fuzzy each aspect of the present invention.
Block diagram shown in accompanying drawing is only functional entity, it is not necessary to must be with physically separate entity Corresponding.I.e., it is possible to use software form to realize these functional entitys, or at one or more softwares The module of hardening realizes the part of these functional entitys or functional entity, or at heterogeneous networks and/or Processor device and/or microcontroller device realize these functional entitys.
Rim detection is the basic problem in image procossing and computer vision, and the purpose of rim detection is mark Know the obvious point of brightness flop in digital picture.Notable change in image attributes generally reflects attribute Critical event and change.Different images gray scale is different, and boundary typically has obvious edge, utilizes this Feature can split image.But for specific demand region segmentation, the most only split regular rectangular shape Region, only relies on edge detection algorithm can not reach good segmentation effect.Present inventive concept provides A kind of image-recognizing method, can on the basis of edge detection algorithm the rectangular area of recognition rule.
Fig. 1 illustrates the method flow diagram of the recognition rule rectangular area according to an exemplary embodiment.This reality Execute example to be applicable to identify the rule button in image or there is the regular icon etc. of limbus, but this reality The application executing example is not limited to this.
As it is shown in figure 1, at S110, the image comprising regular rectangular shape region is carried out endpoint detections computing And obtain the marginal point in image.
The operation that image carries out the marginal point in endpoint detections computing acquisition image can use multiple side Method, the such as available Second-order Operator preset or single order operator carry out endpoint detections computing acquisition to image Marginal point in image.Second-order Operator can be Laplacian operator and Canny operator etc., one Rank operator can be Sobel operator, Prewitt operator, Kirsch operator, compass operator and Roberts Cross operator etc..Such as, Laplacian operator utilizes second dervative information, have each to The same sex, i.e. unrelated with change in coordinate axis direction, after coordinate axes rotates, gradient result is constant.Make image through two After the differential of rank, produce a precipitous zero cross point in edge, can determine whether limit according to this zero cross point Edge.The most such as, Canny edge detection operator is that John F.Canny developed in 1986 One multistage edge detection algorithm, signal to noise ratio is estimated with location product, is obtained optimization and approach by it Operator.
According to an embodiment, obtain marginal point and can use mode described below, but the invention is not restricted to This.
First image is carried out smothing filtering.Filter function can be to select Gauss according to human visual system Function, but the invention is not restricted to this.
Then, the image after smothing filtering is carried out computing, and the extreme point of detection calculations.To use As a example by Laplacian operator obtains the marginal point in image, to the smoothed image after smothing filtering Carrying out Laplace's operation, the extreme point of detection Laplace's operation is to obtain the marginal point in image. That is, using the zero cross point of second dervative as extreme point, and the bigger peak value of corresponding first derivative, thus Obtain the marginal point in image.
In S120, according to the distribution of the marginal point obtained, obtain including the horizontal stroke of at least two widthwise edges To limit group.
Various method can be used to obtain widthwise edge group.Such as, can be by acquired marginal point according to vertical seat Scale value carries out being grouped to obtain multiple transverse edge point group, for each transverse edge point group, if this is horizontal The continuous boundary that group of edge points comprises is counted out more than a first threshold, then this transverse edge point group constituted Line segment be included into widthwise edge group as a widthwise edge.Depending on this first threshold can be according to concrete application, Such as can use empirical value or statistical value etc. (lower same).
According to some embodiments, the marginal point drawn S110 respectively is according to vertical coordinate (Y-axis coordinate) value It is grouped, using marginal point identical for ordinate value (Y value) as one group of transverse edge point group undetermined. Then, for each group of transverse edge undetermined some group, travel through the abscissa value (X-axis coordinate) of each point, If abscissa value (X value) is continuously (such as: X value is 2,3,4,5 ... 24,25 continued presences) Some number more than a first threshold or in the range of a codomain, (bound of codomain can be according to specifically should With based on experience value or statistical value determines), then it is assumed that this group abscissa value (X value) continuous print point composition one Bar widthwise edge.Obtain all qualified widthwise edges according to this.
In S130, from described widthwise edge group, structure meets at least one widthwise edge of predetermined condition Right.Widthwise edge is to can be as two horizontal edges to determine a rectangular area.Meet the widthwise edge pair of predetermined condition Can be as two horizontal edges to determine that one meets intended rectangular area.
Various method construct widthwise edge pair can be used.Such as, in widthwise edge group wantonly two laterally Limit, if it is determined that the difference of the initial abscissa value of two widthwise edges and the difference of termination abscissa value are respectively less than 3rd threshold value, and the ordinate value of two articles of widthwise edges differ from the 4th threshold range, then by two widthwise edges As a widthwise edge pair.Depending on these threshold values or threshold range can be according to concrete application, such as, can use Empirical value or statistical value etc..
According to some embodiments, in widthwise edge group, take a pair widthwise edge, sit initial for their X-axis Scale value subtracts each other, and takes absolute value;Their X-axis is terminated coordinate figure subtract each other, take absolute value.
If it follows that the two of back absolute values are all within a threshold value (such as, the 3rd threshold value), Then continue to subtract each other this two limits coordinate figure in Y-axis, take absolute value, a step after entrance;Otherwise return Return back.
Then, if (such as, the 4th threshold value in the range of a codomain of the coordinate difference in back Y-axis Scope), then it is assumed that this can make up to be confirmed or the regular rectangular shape region of checking, a square to widthwise edge The starting point in shape region is the X in two widthwise edges, the minima (x in Y-coordinate valuemin, ymin), Terminating point is then X, the maximum (x in Y-coordinate valuemax, ymax).The rectangular area of composition can represent For Rect (xmin, ymin, xmax-xmin, ymax-ymin).Otherwise return the first step.Repeat into Row said process, until completing all paired of all widthwise edges and processing.
Rectangular area Rect (xmin, ymin, xmax-xmin, ymax-ymin) be meant that, with “xmin" as X-axis origin coordinates, with " ymin" as Y-axis origin coordinates, with “xmax-xmin" as rectangle width, with " ymax-ymin" as the rectangle model of rectangular elevation Enclose.
At S140, to each widthwise edge to verifying, by the widthwise edge of checking to for the most laterally Limit pair, effective widthwise edge rectangular area to determining is the expection regular rectangular shape region identified.
Can adopt in various manners to each widthwise edge to verifying.Some according to the present invention are implemented Example, to each widthwise edge is that find can be with widthwise edge to be verified to right to the mode verified The longitudinal edge pair answered, i.e. finding can be with the widthwise edge to be verified longitudinal edge to constituting enclosing square Right.If there is such longitudinal edge pair, widthwise edge the most to be verified is to for effective widthwise edge pair, its structure The rectangular area become is effective rectangular area.Such rectangular area can a corresponding rectangular buttons or rectangle Icon, but the invention is not restricted to this.
According to the scheme of example embodiment of the present invention, utilize endpoint detections, between widthwise edge Position relationship determines regular rectangular shape region, it is possible to accurately identify the regular rectangular shape region in image.It addition, Can have simple and accurate by rectangular area being verified the accuracy improving identification further The high advantage of rate.
Fig. 2 illustrates the method flow diagram of the recognition rule rectangular area according to another exemplary embodiment. The present embodiment is applicable to identify the rule button in image or have the regular icon etc. of limbus, but The application of the present embodiment is not limited to this.
The method of the recognition rule rectangular area according to another exemplary embodiment as shown in Figure 2 and Fig. 1 Shown method is similar to, and differing only according to the method shown in Fig. 2 is by obtaining longitudinal edge group and indulging To limit to carrying out region recognition.
As in figure 2 it is shown, at S210, the image comprising regular rectangular shape region is carried out endpoint detections computing And obtain the marginal point in image.This is similar with the process described in S110, and here is omitted.
In S220, according to the distribution of the marginal point obtained, obtain including the vertical of at least two longitudinal edges To limit group.
Similar with S120, various method can be used to obtain longitudinal edge group.Such as, can be by acquired limit Edge point carries out being grouped to obtain multiple longitudinal edge point group according to abscissa value, if longitudinal edge point group comprises Continuous boundary count out more than a Second Threshold, then the line segment this longitudinal edge point group constituted is as one Bar longitudinal edge.Obtain all qualified longitudinal edges according to this, obtain longitudinal edge group.This Second Threshold can It is different from pre-determined first threshold.
According to some embodiments, the marginal point drawn S210 respectively is according to abscissa (X-axis coordinate) value It is grouped, using marginal point identical for abscissa value (X value) as one group of longitudinal edge point group undetermined. Then, for each group of longitudinal edge undetermined some group, travel through the ordinate value (Y-axis coordinate) of each point, If ordinate value (Y value) is continuously (such as: Y value is 2,3,4,5 ... 24,25 continued presences) Some number more than a Second Threshold or in the range of a codomain, (bound of codomain can be according to specifically should With based on experience value or statistical value determines), then it is assumed that this group ordinate value (Y value) continuous print point constitute one Bar longitudinal edge.Obtain all qualified longitudinal edges according to this.
In S230, from described longitudinal edge group, structure meets at least one longitudinal edge of predetermined condition Right.Longitudinal edge is to can be as two longitudinal edges to determine a rectangular area.Meet the longitudinal edge pair of predetermined condition Can be as two longitudinal edges to determine that one meets intended rectangular area.
Similar with S130, various method construct longitudinal edge pair can be used.Such as, in longitudinal edge group Wantonly two longitudinal edges, if it is determined that the difference of the initial ordinate value of two longitudinal edges and terminate vertical coordinate The difference of value is respectively less than the 5th threshold value, and the difference of the abscissa value of two articles of longitudinal edges is in the 6th threshold range, Then using two longitudinal edges as a longitudinal edge pair.3rd threshold value can be identical with aforementioned 5th threshold value or not With, the 4th threshold range can be identical or different with aforementioned 6th threshold range.These threshold values or threshold range Depending on can be according to concrete application, such as, can use empirical value or statistical value etc..
According to some embodiments, in longitudinal edge group, take a pair longitudinal edge, sit initial for their Y-axis Scale value subtracts each other, and takes absolute value;Their Y-axis is terminated coordinate figure subtract each other, take absolute value.
If it follows that the two of back absolute values are all within a threshold value (such as, the 5th threshold value), Then continue to subtract each other this two limits coordinate figure in X-axis, take absolute value, a step after entrance;Otherwise return Return back.
Then, if (such as, the 6th threshold value in the range of a codomain of the coordinate difference in back X-axis Scope), then it is assumed that this can make up to be confirmed or the regular rectangular shape region of checking, a square to longitudinal edge The starting point in shape region is the Y in two longitudinal edges, the minima (x in X-coordinate valuemin, ymin), Terminating point is then Y, the maximum (x in X-coordinate valuemax, ymax).The rectangular area of composition can represent For Rect (xmin, ymin, xmax-xmin, ymax-ymin).Otherwise return the first step.Repeat into Row said process, until completing all paired of all longitudinal edges and processing.
At S240, to limit longitudinally in each to verifying, by the longitudinal edge of checking to for the most longitudinally Limit pair, effective longitudinal edge rectangular area to determining is the expection regular rectangular shape region identified.
Can adopt in various manners to limit longitudinally in each to verifying.Some according to the present invention are implemented Example, to limit is longitudinally in each that find can be with longitudinal edge to be verified to right to the mode verified The widthwise edge pair answered, i.e. finding can be with the longitudinal edge to be verified widthwise edge to constituting enclosing square Right.If there is such widthwise edge pair, longitudinal edge the most to be verified is to for effective longitudinal edge pair, its structure The rectangular area become is effective rectangular area.Such rectangular area can a corresponding rectangular buttons or rectangle Icon, but the invention is not restricted to this.
According to the scheme of example embodiment of the present invention, utilize endpoint detections, between longitudinal edge Position relationship determines regular rectangular shape region, it is possible to improve identification by verifying rectangular area Accuracy, has the advantages such as simple, easy-to-use and accuracy rate is high.
Fig. 3 illustrates the method flow diagram of the recognition rule rectangular area according to another exemplary embodiment. The present embodiment is applicable to identify the rule button in image or have the regular icon etc. of limbus, but The application of the present embodiment is not limited to this.
The method of the recognition rule rectangular area according to another exemplary embodiment as shown in Figure 3 and Fig. 1 Similar with the method shown in Fig. 2, differ only according to the method shown in Fig. 3 be by obtaining laterally and Longitudinal edge group and horizontal and vertical limit, to carrying out region recognition, have i.e. been used in combination shown in Fig. 1 and Fig. 2 Method and process, here is omitted.
Fig. 4 illustrate according to the present invention one example embodiment to the widthwise edge process to verifying.
As shown in Figure 4, at S410, at least one longitudinal edge obtained according to aforementioned process to carrying out time Go through.
At S420, choose a longitudinal edge pair, for the longitudinal edge pair currently chosen, utilize longitudinal edge pair Minimum and maximum abscissa respectively with minimum and maximum abscissa Xmin, Xmax of widthwise edge pair to be tested Subtract each other, can take absolute value, if it is determined that absolute value is all within predetermined threshold, then enter S430;Otherwise Return S410, continue to travel through at least one longitudinal edge pair.Without finding the longitudinal edge pair meeting condition, Widthwise edge the most to be tested is to not over checking, it is impossible to be used for determining a rectangular area.
At S430, for the longitudinal edge pair currently chosen, utilize the minimum and maximum vertical coordinate of longitudinal edge pair Minimum and maximum vertical coordinate Ymin, Ymax with widthwise edge pair to be tested subtract each other respectively, take absolute value, as Really absolute value is all within predetermined threshold, then it is assumed that widthwise edge to be tested is to for effective widthwise edge pair, and it is true Fixed rectangular area is the expection regular rectangular shape region identified.Otherwise return S410, continue traversal at least One longitudinal edge pair.Without finding the longitudinal edge pair meeting condition, widthwise edge the most to be tested is to not having Have by checking, it is impossible to be used for determining a rectangular area.
Fig. 5 illustrate according to another example embodiment of the present invention to the longitudinal edge process to verifying.
Process shown in Fig. 5 is similar with the process shown in Fig. 4, and differing only in is to utilize widthwise edge to right Longitudinal edge is to verifying.
As it is shown in figure 5, at S510, at least one widthwise edge obtained according to aforementioned process is traveled through.
At S520, choose a widthwise edge pair, for the widthwise edge pair currently chosen, utilize widthwise edge pair Minimum and maximum abscissa respectively with minimum and maximum abscissa Xmin, Xmax of longitudinal edge pair to be tested Subtract each other, take absolute value, if absolute value is all within predetermined threshold, then enter S530;Otherwise return S510, Continue to travel through at least one widthwise edge pair.Without finding the widthwise edge pair meeting condition, the most to be tested Longitudinal edge to not over checking, it is impossible to be used for determining a rectangular area.
At S530, for the widthwise edge pair currently chosen, utilize the minimum and maximum vertical coordinate of widthwise edge pair Minimum and maximum vertical coordinate Ymin, Ymax with longitudinal edge pair to be tested subtract each other respectively, take absolute value, as Really absolute value is all within predetermined threshold, then it is assumed that longitudinal edge to be tested is to for effective longitudinal edge pair, and it is true Fixed rectangular area is the expection regular rectangular shape region identified.Otherwise return S510, continue traversal at least One widthwise edge pair.Without finding the widthwise edge pair meeting condition, longitudinal edge the most to be tested is to not having Have by checking, it is impossible to be used for determining a rectangular area.
Fig. 6 illustrate according to another example embodiment of the present invention to the widthwise edge process to verifying.
Process shown in Fig. 6 and the difference of the process shown in Fig. 4 are to make utilization according to previously mentioned The longitudinal edge group obtained to widthwise edge to verifying.
As shown in Figure 6, at S610, the longitudinal edge group obtained according to aforementioned process is traveled through.
At S620, choose a longitudinal edge, for the longitudinal edge currently chosen, utilize the abscissa of longitudinal edge Subtract each other with the minimum abscissa Xmin of widthwise edge pair to be tested, take absolute value, if absolute value is at predetermined threshold Within value, then enter S630;Otherwise return S610, continue traversal longitudinal edge group.Full without finding The longitudinal edge of foot condition, widthwise edge the most to be tested is to not over checking, it is impossible to be used for determining a rectangle Region.
At S630, for the longitudinal edge currently chosen, utilize the minimum and maximum vertical coordinate of longitudinal edge respectively Subtract each other with minimum and maximum vertical coordinate Ymin, Ymax of widthwise edge pair to be tested, take absolute value, if absolutely To value all within predetermined threshold, then it is assumed that this longitudinal edge is an effective longitudinal edge, enter S640;No Then return S610, continue traversal longitudinal edge group.Without finding the longitudinal edge meeting condition, the most to be checked The widthwise edge tested is to not over checking, it is impossible to be used for determining a rectangular area.
At S640, the longitudinal edge group obtained according to aforementioned process is traveled through.
At S650, choose a longitudinal edge, for the longitudinal edge currently chosen, utilize the abscissa of longitudinal edge Subtract each other with the maximum abscissa Xmax of widthwise edge pair to be tested, take absolute value.If absolute value is at predetermined threshold Within value, then enter S660;Otherwise return S640, continue traversal longitudinal edge group.Full without finding The longitudinal edge of foot condition, widthwise edge the most to be tested is to not over checking, it is impossible to be used for determining a rectangle Region.
At S660, for the longitudinal edge currently chosen, utilize the minimum and maximum vertical coordinate of longitudinal edge respectively Subtract each other with minimum and maximum vertical coordinate Ymin, Ymax of widthwise edge pair to be tested, take absolute value, if absolutely To value all within predetermined threshold, then it is assumed that this longitudinal edge is another effective longitudinal edge.At this moment, can recognize For widthwise edge to be tested to for effective widthwise edge pair, its rectangular area determined is the expection rule identified Rectangular area.Otherwise return S640, continue traversal longitudinal edge group.The vertical of condition is met without finding Xiang Bian, widthwise edge the most to be tested is to not over checking, it is impossible to be used for determining a rectangular area.
It is likewise possible to utilize widthwise edge group to longitudinal edge to verifying, here is omitted.
It can be readily appreciated that based on present disclosure and teaching, it is also possible to use other various similar Mode is verified.
Fig. 7 illustrates the block diagram of the device of the recognition rule rectangular area according to an illustrative embodiments.
As it is shown in fig. 7, include edge according to the device 700 of the recognition rule rectangular area of present embodiment Point acquisition module 710, limit group acquisition module 720, limit are to constructing module 730 and authentication module 740.
The image that marginal point acquisition module 710 can be used for comprising regular rectangular shape region carries out endpoint detections Computing and obtain the marginal point in image.
According to example embodiment, marginal point acquisition module 710 can be configured to: image is carried out smothing filtering; Image after smothing filtering is carried out computing;The extreme point of detection calculations is to obtain the marginal point in image.
The distribution that limit group acquisition module 720 can be used for according to the described marginal point obtained obtains including at least two The widthwise edge group of bar widthwise edge.Limit group acquisition module 720 also can be according to the distribution of the described marginal point obtained Obtain including the longitudinal edge group of at least two longitudinal edges.
According to example embodiment, limit group acquisition module 720 can be configured to: by described marginal point according to vertical seat Scale value carries out being grouped to obtain multiple transverse edge point group, for each transverse edge point group, if described The continuous boundary that transverse edge point group comprises is counted out more than first threshold, then by described transverse edge point group The line segment constituted adds described widthwise edge group as a widthwise edge.Limit group acquisition module 720 also can be joined It is set to: carry out being grouped to obtain multiple longitudinal edge point group according to abscissa value by described marginal point, for Each longitudinal edge point group, if the continuous boundary that described longitudinal edge point group comprises is counted out more than second Threshold value, then add described longitudinal edge using the line segment that described longitudinal edge point group is constituted as a longitudinal edge Group.
While constructing module 730 be can be used for structure from described widthwise edge group meet at least the one of predetermined condition Individual widthwise edge pair.Predetermined condition is met while constructing module 730 also can be constructed from described longitudinal edge group At least one longitudinal edge pair.
According to example embodiment, while constructing module 730 be can be configured to: in described widthwise edge group Wantonly two widthwise edges, if it is determined that the difference of the initial abscissa value of described two widthwise edges and terminate horizontal seat The difference of scale value is respectively less than the 3rd threshold value, and the difference of the ordinate value of described two articles of widthwise edges is at the 4th threshold value model In enclosing, then using described two widthwise edges as a widthwise edge pair.While constructing module 730 be can also configure For: for wantonly two longitudinal edges in described longitudinal edge group, if it is determined that initiateing of described two longitudinal edges The difference of ordinate value and the difference of ordinate value of terminating are respectively less than the 5th threshold value, and described two longitudinal edges The difference of abscissa value is in the 6th threshold range, then using described two longitudinal edges as a longitudinal edge pair.
Authentication module 740 can be used for each widthwise edge verifying, by checking widthwise edge to for Effectively widthwise edge pair, the described effective widthwise edge rectangular area to determining is described regular rectangular shape region.Test Card module 740 also can be to limit longitudinally in each to verifying, by the longitudinal edge of checking to for the most longitudinally Limit pair, the described effective longitudinal edge rectangular area to determining is described regular rectangular shape region.
According to example embodiment, authentication module 740 is configured that to find and indulges corresponding with described widthwise edge To limit pair, if there is corresponding longitudinal edge pair, it is determined that described widthwise edge is to for effective widthwise edge pair. Authentication module 740 may be additionally configured to: finds with described longitudinal edge corresponding widthwise edge pair, if there is Corresponding widthwise edge pair, it is determined that described longitudinal edge is to for effective longitudinal edge pair.
The device 700 of recognition rule rectangular area according to embodiments of the present invention can realize previously described According to the method for the present application design, repeat no more with aforementioned similar explanation.
By above detailed description, those skilled in the art is it can be readily appreciated that according to embodiments of the present invention And device can have one or more of the following advantages.
According to some embodiments, the solution of the present invention can accurately identify rule on the basis of edge detection algorithm Rectangular area then, is applicable to identify the rule button in image or have the regular icon of limbus Deng.
According to some embodiments, it is possible to accurately identify the regular rectangular shape region in image.
According to some embodiments, can be by rectangular area being verified the standard improving identification further Really property, has the advantages such as simple and accuracy rate is high.
By the description of above embodiment, those skilled in the art is it can be readily appreciated that the embodiment of the present invention Method and corresponding module can by software or partial software hardening by the way of realize.Therefore, this The technical scheme of bright embodiment can embody with the form of software product, and this software product can store In a non-volatile memory medium (can be CD-ROM, USB flash disk, portable hard drive etc.), if including Dry instruction with so that calculating equipment (can be personal computer, server, mobile terminal or Person's network equipment etc.) perform method according to embodiments of the present invention.
It will be understood by those skilled in the art that accompanying drawing is the schematic diagram of example embodiment, the mould in accompanying drawing Block or flow process are not necessarily implemented necessary to the present invention, therefore cannot be used for limiting the protection of the present invention Scope.
It will be appreciated by those skilled in the art that above-mentioned each module can be distributed in device according to the description of embodiment In, it is also possible to carry out respective change and be disposed other than in one or more devices of the present embodiment.Above-mentioned reality The module executing example can merge into a module, it is also possible to is further split into multiple submodule.
More than it is particularly shown and described the exemplary embodiment of the present invention.It should be understood that the present invention is not Be limited to institute's inventive embodiment, on the contrary, it is intended to contain be included in claims spirit and In the range of various amendments and equivalent arrangements.

Claims (14)

1. the method for a recognition rule rectangular area, it is characterised in that including:
The edge image comprising regular rectangular shape region being carried out endpoint detections computing and obtain in image Point;
Distribution according to the described marginal point obtained obtains including the widthwise edge group of at least two widthwise edges, and / or obtain including the longitudinal edge group of at least two longitudinal edges according to the distribution of the described marginal point obtained;
From described widthwise edge group, structure meets at least one widthwise edge pair of predetermined condition, and/or from institute State structure in longitudinal edge group and meet at least one longitudinal edge pair of predetermined condition;
To each widthwise edge to verifying, by the widthwise edge of checking to for effective widthwise edge pair, described The effectively widthwise edge rectangular area to determining is described regular rectangular shape region;Or to limit longitudinally in each to entering Row checking, by the longitudinal edge of checking to for effective longitudinal edge pair, the described effective longitudinal edge square to determining Shape region is described regular rectangular shape region.
Method the most according to claim 1, it is characterised in that to comprising regular rectangular shape region The marginal point that image carries out endpoint detections computing and obtains in image includes: utilize preset algorithm to image Carrying out endpoint detections computing and obtain the marginal point in image, wherein said preset algorithm includes Laplacian operator, Canny operator, Sobel operator, Prewitt operator, Kirsch operator, sieve Calculate son or Roberts Cross operator.
Method the most according to claim 1, it is characterised in that to comprising regular rectangular shape region The marginal point that image carries out endpoint detections computing and obtains in image includes:
Image is carried out smothing filtering;
Image after smothing filtering is carried out computing;
The extreme point of detection calculations is to obtain the marginal point in image.
Method the most according to claim 3, it is characterised in that image is carried out smothing filtering bag Include: use Gaussian function that image is carried out smothing filtering.
Method the most according to claim 1, it is characterised in that:
Distribution according to the described marginal point obtained obtains including the widthwise edge group bag of at least two widthwise edges Include: carry out being grouped to obtain multiple transverse edge point group, for often according to ordinate value by described marginal point One transverse edge point group, if the continuous boundary that described transverse edge point group comprises is counted out more than the first threshold Value, then add described widthwise edge using the line segment that described transverse edge point group is constituted as a widthwise edge Group;And/or
Distribution according to the described marginal point obtained obtains including the longitudinal edge group bag of at least two longitudinal edges Include: carry out being grouped to obtain multiple longitudinal edge point group, for often according to abscissa value by described marginal point One longitudinal edge point group, if the continuous boundary that described longitudinal edge point group comprises is counted out more than the second threshold Value, then add described longitudinal edge using the line segment that described longitudinal edge point group is constituted as a longitudinal edge Group.
Method the most according to claim 1, it is characterised in that:
From described widthwise edge group, structure meets at least one widthwise edge of predetermined condition to including: for institute State wantonly two widthwise edges in widthwise edge group, if it is determined that the initial abscissa value of described two widthwise edges Difference and terminate the difference of abscissa value and be respectively less than the 3rd threshold value, and the ordinate value of described two widthwise edges Difference is in the 4th threshold range, then using described two widthwise edges as a widthwise edge pair;And/or
From described longitudinal edge group, structure meets at least one longitudinal edge of predetermined condition to including: for institute State wantonly two longitudinal edges in longitudinal edge group, if it is determined that the initial ordinate value of described two longitudinal edges Difference and terminate the difference of ordinate value and be respectively less than the 5th threshold value, and the abscissa value of described two longitudinal edges Difference is in the 6th threshold range, then using described two longitudinal edges as a longitudinal edge pair.
Method the most according to claim 1, it is characterised in that:
Each widthwise edge is included carrying out checking: find with described widthwise edge corresponding longitudinal edge pair, If there is corresponding longitudinal edge pair, the most described widthwise edge is to for effective widthwise edge pair;Or
Limit longitudinally in each is included carrying out checking: find with described longitudinal edge corresponding widthwise edge pair, If there is corresponding widthwise edge pair, the most described longitudinal edge is to for effective longitudinal edge pair.
8. the device of a recognition rule rectangular area, it is characterised in that including:
Marginal point acquisition module, for carrying out endpoint detections computing to the image comprising regular rectangular shape region And obtain the marginal point in image;
Limit group acquisition module, for obtaining including at least two horizontal strokes according to the distribution of the described marginal point obtained To the widthwise edge group on limit, and/or obtain including that at least two are indulged according to the distribution of the described marginal point obtained To the longitudinal edge group on limit;
While to constructing module, meet at least one horizontal stroke of predetermined condition for structure from described widthwise edge group To limit pair, and/or structure meets at least one longitudinal edge pair of predetermined condition from described longitudinal edge group;
Authentication module, is used for each widthwise edge verifying, by the widthwise edge of checking to for effectively Widthwise edge pair, the described effective widthwise edge rectangular area to determining is described regular rectangular shape region;Or it is right Limit is to verifying longitudinally in each, by the longitudinal edge of checking to for effective longitudinal edge pair, described the most vertical It is described regular rectangular shape region to the rectangular area determined to limit.
Device the most according to claim 8, it is characterised in that described marginal point acquisition module is joined The marginal point being set to utilize preset algorithm that image is carried out endpoint detections computing and obtain in image, wherein Described preset algorithm includes that Laplacian operator, Canny operator, Sobel operator, Prewitt calculate Son, Kirsch operator, compass operator or Roberts Cross operator.
Device the most according to claim 9, it is characterised in that described marginal point acquisition module is joined It is set to:
Image is carried out smothing filtering;
Image after smothing filtering is carried out computing;
The extreme point of detection calculations is to obtain the marginal point in image.
11. devices according to claim 10, it is characterised in that described marginal point acquisition module It is configured to use Gaussian function that image is carried out smothing filtering.
12. devices according to claim 8, it is characterised in that described limit group acquisition module configures For:
Carry out being grouped to obtain multiple transverse edge point group, for often according to ordinate value by described marginal point One transverse edge point group, if the continuous boundary that described transverse edge point group comprises is counted out more than the first threshold Value, then add described widthwise edge using the line segment that described transverse edge point group is constituted as a widthwise edge Group;And/or
Carry out being grouped to obtain multiple longitudinal edge point group, for often according to abscissa value by described marginal point One longitudinal edge point group, if the continuous boundary that described longitudinal edge point group comprises is counted out more than the second threshold Value, then add described longitudinal edge using the line segment that described longitudinal edge point group is constituted as a longitudinal edge Group.
13. devices according to claim 8, it is characterised in that constructing module is configured by described limit For:
For wantonly two widthwise edges in described widthwise edge group, if it is determined that initiateing of described two widthwise edges The difference of abscissa value and the difference of abscissa value of terminating are respectively less than the 3rd threshold value, and described two widthwise edges The difference of ordinate value is in the 4th threshold range, then using described two widthwise edges as a widthwise edge pair; And/or
For wantonly two longitudinal edges in described longitudinal edge group, if it is determined that initiateing of described two longitudinal edges The difference of ordinate value and the difference of ordinate value of terminating are respectively less than the 5th threshold value, and described two longitudinal edges The difference of abscissa value is in the 6th threshold range, then using described two longitudinal edges as a longitudinal edge pair.
14. devices according to claim 13, it is characterised in that described authentication module configures For:
Find with described widthwise edge corresponding longitudinal edge pair, if there is corresponding longitudinal edge pair, the most really Fixed described widthwise edge is to for effective widthwise edge pair;Or
Find with described longitudinal edge corresponding widthwise edge pair, if there is corresponding widthwise edge pair, the most really Fixed described longitudinal edge is to for effective longitudinal edge pair.
CN201610153207.1A 2016-03-17 2016-03-17 The method and device of recognition rule rectangular area Active CN105844615B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610153207.1A CN105844615B (en) 2016-03-17 2016-03-17 The method and device of recognition rule rectangular area

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610153207.1A CN105844615B (en) 2016-03-17 2016-03-17 The method and device of recognition rule rectangular area

Publications (2)

Publication Number Publication Date
CN105844615A true CN105844615A (en) 2016-08-10
CN105844615B CN105844615B (en) 2018-10-26

Family

ID=56588281

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610153207.1A Active CN105844615B (en) 2016-03-17 2016-03-17 The method and device of recognition rule rectangular area

Country Status (1)

Country Link
CN (1) CN105844615B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108805072A (en) * 2018-06-06 2018-11-13 西安纸贵互联网科技有限公司 A kind of qualitative recognition method and device of external diagnosis reagent
CN108830314A (en) * 2018-06-06 2018-11-16 西安纸贵互联网科技有限公司 A kind of sxemiquantitative recognition methods of external diagnosis reagent and device
CN113485705A (en) * 2021-06-30 2021-10-08 深圳软牛科技有限公司 QML Rectangle component-based frame selection method, device, equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101534370A (en) * 2008-03-11 2009-09-16 株式会社Pfu Image processor, image processing method, and computer program product
CN102034254A (en) * 2010-09-29 2011-04-27 广东威创视讯科技股份有限公司 Method for recognizing geometric figure
CN103593860A (en) * 2013-10-27 2014-02-19 沈阳建筑大学 Cutting method for any irregular blank
CN104714666A (en) * 2013-12-12 2015-06-17 鸿合科技有限公司 Intelligent pen and stroke recognition processing method thereof
CN104952072A (en) * 2015-06-16 2015-09-30 华中科技大学 Rectangle detection method based on genetic algorithm
US20160044196A1 (en) * 2014-08-08 2016-02-11 Kyocera Document Solutions Inc. Image processing apparatus

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101534370A (en) * 2008-03-11 2009-09-16 株式会社Pfu Image processor, image processing method, and computer program product
CN102034254A (en) * 2010-09-29 2011-04-27 广东威创视讯科技股份有限公司 Method for recognizing geometric figure
CN103593860A (en) * 2013-10-27 2014-02-19 沈阳建筑大学 Cutting method for any irregular blank
CN104714666A (en) * 2013-12-12 2015-06-17 鸿合科技有限公司 Intelligent pen and stroke recognition processing method thereof
US20160044196A1 (en) * 2014-08-08 2016-02-11 Kyocera Document Solutions Inc. Image processing apparatus
CN104952072A (en) * 2015-06-16 2015-09-30 华中科技大学 Rectangle detection method based on genetic algorithm

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108805072A (en) * 2018-06-06 2018-11-13 西安纸贵互联网科技有限公司 A kind of qualitative recognition method and device of external diagnosis reagent
CN108830314A (en) * 2018-06-06 2018-11-16 西安纸贵互联网科技有限公司 A kind of sxemiquantitative recognition methods of external diagnosis reagent and device
CN113485705A (en) * 2021-06-30 2021-10-08 深圳软牛科技有限公司 QML Rectangle component-based frame selection method, device, equipment and storage medium
CN113485705B (en) * 2021-06-30 2023-11-21 深圳软牛科技有限公司 QML (quality control language) component-based frame selection method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN105844615B (en) 2018-10-26

Similar Documents

Publication Publication Date Title
CN110503108A (en) Architecture against regulations recognition methods and device, storage medium, computer equipment
CN109376631B (en) Loop detection method and device based on neural network
CN109284674A (en) A kind of method and device of determining lane line
Min et al. Support vector machine approach to fall recognition based on simplified expression of human skeleton action and fast detection of start key frame using torso angle
EP2528035B1 (en) Apparatus and method for detecting a vertex of an image
CN103477352A (en) Gesture recognition using depth images
CN109640066B (en) Method and device for generating high-precision dense depth image
CN103119609B (en) A kind of method and apparatus determining video foreground main image area
CN109660783A (en) Virtual reality parallax correction
CN103020993A (en) Visual saliency detection method by fusing dual-channel color contrasts
CN105844615A (en) Method of identifying regular rectangular area and apparatus thereof
CN103488356A (en) Infrared camera three-dimensional imaging-based touch recognition method
US20200074149A1 (en) Method and apparatus for obtaining painting
CN113240678A (en) Plane information detection method and system
CN110415285A (en) Image processing method, device and electronic equipment
CN109833003B (en) Sweeping robot and method for dividing region thereof
CN102866885B (en) Method and device for confirming clicking position in webpage
Pasquale et al. Enabling depth-driven visual attention on the icub humanoid robot: Instructions for use and new perspectives
CN111768005A (en) Training method and device for lightweight detection model, electronic equipment and storage medium
JP5478520B2 (en) People counting device, people counting method, program
CN111784660B (en) Method and system for analyzing frontal face degree of face image
WO2015079054A1 (en) Estimating gaze from un-calibrated eye measurement points
Ranade et al. Novel single view constraints for manhattan 3d line reconstruction
CN107066982A (en) The recognition methods of human face characteristic point and device
WO2016001920A1 (en) A method of perceiving 3d structure from a pair of images

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant