Content of the invention
A kind of multiple edge defect inspection method and device are provided in the embodiment of the present invention, to solve inspection of the prior art
Survey
The low problem of efficiency.
In order to solve above-mentioned technical problem, the embodiment of the present invention has invented following technical scheme:
A kind of multiple edge defect inspection method is embodiments provided, the method includes:
From detection target image, the marginal point of the detection target is obtained, and wherein, the detection target image includes many
Bar edge;
By the group of edge points on each bar edge into reference edge group;
The reference edge group is scored, determines the high reference edge group of scoring for fitting edge group and candidate edge
Group;
The marginal point being fitted in edge group is fitted, edge is fitted accordingly;
When the marginal point in candidate edge group is more than defect threshold distance to the distance at accordingly fitting edge, determine described
Defect Edge point of the marginal point in candidate edge group for respective edges.
Alternatively, carrying out scoring to the reference edge group includes:
Determine marginal dimension threshold value;
Calculate the reference distance between the neighboring edge point in reference edge group;
According to the reference distance and the difference of the marginal dimension threshold value, the scoring of the reference edge group is calculated.
Alternatively, according to the reference distance and the difference of the dimension threshold, the scoring of the reference edge group is calculated,
Including:
According to the complexity of detection object edge, multiple difference ranges corresponding with scoring are preset;
When the difference belongs to the difference range, determine the corresponding scoring of the difference range as the reference edge
The scoring of edge group.
Alternatively, the marginal point of the detection target, from detection target image, is obtained, including:
Determine that any one edge in detection target image is reference edge;
Along the reference edge, detection target image is divided into multiple sample projection regions, wherein, the sample projection
Bearing of trend of the region perpendicular to the reference edge;
From the sample projection region, the marginal point of the detection target is extracted.
Alternatively, the determination marginal dimension threshold value, including:
According to the sample projection region and the overlapping positions of the reference edge, the marginal dimension threshold value is determined.
Alternatively, the group of edge points by each bar edge is into reference edge group, including:
Determine the position range of each bar actual edge in detection target image;
By the group of edge points in the range of diverse location into reference edge group.
The embodiment of the present invention also provides a kind of multiple edge defect detecting device, and the device includes:
Marginal point acquisition module, for from detection target image, obtaining the marginal point of the detection target, wherein, institute
Stating detection target image includes a plurality of edge;
Reference edge group generation module, for by the group of edge points on each bar edge into reference edge group;
Reference edge group grading module, for scoring to the reference edge group, determines the high reference edge of scoring
Group is fitting edge group and candidate edge group;
Edge group fitting module, for being fitted to the marginal point being fitted in edge group, is fitted edge accordingly;
Edge defect determining module is big to intramarginal distance is fitted accordingly for working as the marginal point in candidate edge group
When defect threshold distance, the Defect Edge point of the marginal point for respective edges of the candidate edge group is determined.
Alternatively, the reference edge group grading module includes:
Marginal dimension threshold determination module, for determining marginal dimension threshold value;
Reference distance computing module, for calculating the reference distance between each marginal point in reference edge group;
Reference edge group score calculation module, for according to the reference distance and the difference of the dimension threshold, calculating
The scoring of the reference edge group.
Alternatively, the reference edge group score calculation module includes:
Difference range presetting module, for the complexity according to detection object edge, presets corresponding with scoring multiple
Difference range;
Reference edge group scoring determining module, for when the difference belongs to the difference range, determining the difference
Scoring of the corresponding scoring of scope as the reference edge group.
Alternatively, the marginal point acquisition module includes:
Reference edge determining module, for determining that any one edge in detection target image is reference edge;
Sample projection region division module, for along the reference edge, being divided into multiple samplings by detection target image
View field, wherein, bearing of trend of the sample projection region perpendicular to the reference edge;
Edge point extraction module, for from the sample projection region, extracting the marginal point of the detection target.
Alternatively, the marginal dimension threshold determination module, for according to the sample projection region and the reference edge
The overlapping positions of edge, determine the marginal dimension threshold value.
Alternatively, the reference edge group generation module includes:
Position range determining module, for determining the position range at each edge in detection target image;
Reference edge group molded tissue block, for by the group of edge points in the range of diverse location into reference edge group.
The technical scheme that embodiments of the invention are provided can include following beneficial effect:Provided in an embodiment of the present invention one
Multiple edge defect inspection method and device is planted, by from detection target image, obtaining the marginal point of the detection target, described
Detection target image includes a plurality of edge;By the group of edge points on each bar edge into reference edge group;To the reference edge group
Scored, determine the high reference edge group of scoring for fitting edge group and candidate edge group;To the edge being fitted in edge group
Point is fitted, and is fitted edge accordingly;When the marginal point in candidate edge group is more than to the distance at accordingly fitting edge
During defect threshold distance, Defect Edge point of the marginal point in the candidate edge group for respective edges is determined.The edge defect
Detection method while carrying out edge positioning and defects detection, can effectively increase edge and lack to a plurality of edge of detection target
Sunken detection efficiency.
It should be appreciated that above general description and detailed description hereinafter are only exemplary and explanatory, not
The present invention can be limited.
Specific embodiment
In order that those skilled in the art more fully understand the technical scheme in the present invention, below in conjunction with of the invention real
Apply the accompanying drawing in example, to the embodiment of the present invention in technical scheme be clearly and completely described, it is clear that described enforcement
Example is only a part of embodiment of the invention, rather than whole embodiment.Embodiment in based on the present invention, this area are common
The every other embodiment obtained under the premise of creative work is not made by technical staff, should all belong to protection of the present invention
Scope.
The embodiment of the present invention provides a kind of multiple edge defect inspection method, first the multiple edge defect to the embodiment of the present invention
Detection method is illustrated, and referring to Fig. 1, is that a kind of flow process of multiple edge defect inspection method provided in an embodiment of the present invention is illustrated
Figure, the method include:
Step S101:From detection target image, the marginal point of the detection target, wherein, the detection target are obtained
Image includes a plurality of edge.
To detect target edge in carry out defects detection when, the detection target potentially includes a plurality of edge.Mobile phone
Side generally include 2 edges of top edge and lower limb, need to detect top edge and lower limb with the presence or absence of convex epirelief or indenture
Defect;Liquid crystal display generally includes inside casing and housing, therefore in length or width, corresponding two edges of inside casing, outward
Corresponding two edges of frame, that is, need to detect that 4 edges whether there is defect.In detection process, capture apparatus obtain detection mesh
Image;For example capture apparatus can shoot the side of mobile phone, obtain the detection target for including 2 edges of top edge and lower limb
Image;Capture apparatus can shoot whole LCDs, obtain the detection target image for including 4 edges.
And, detection target also includes different types of edge, such as linear edge or arc edge etc..The top of mobile phone
Edge and lower limb, it can be understood as linear edge;Bolt washer is a kind of circular ring structure, including two edges of inner ring and outer rings,
The inner annular edge and outer shroud edge can be understood as arc edge.
In detection target image, due to the generally corresponding larger gray scale difference in edge, therefore pass through to detecting target image
Carry out gray analysis and can determine multiple edges in the detection target image, and then using any on edge as the edge
Marginal point.In the specific implementation, the detection target image can include black white image or coloured image;By to black white image
Gray analysis, determine detection target marginal point;For coloured image, the coloured image can be converted into gray-scale maps,
Gray analysis are carried out again, so that it is determined that the marginal point of detection target.And, in detection process, detection ambient lighting, shooting set
Standby hardware parameter is arranged and detection product is uneven so that the marginal point extracted from detection target image potentially includes void
False marginal point, that is, actual edge number of the number of edge points for actually obtaining more than detection target.
Referring to Fig. 2, it is a kind of schematic flow sheet of marginal point acquisition methods provided in an embodiment of the present invention, the method includes
Following steps:
Step S1011:Determine that any one edge in detection target image is reference edge.
Referring to Fig. 3, it is a kind of schematic diagram of detection target image provided in an embodiment of the present invention, in detection target image
In, detection target 110 includes edge 111 and edge 112, and the edge 111 and edge 112 are linear edge, can be with
Wherein any one edge is selected as the reference edge.For example using edge 111 as reference edge, or by edge 112
As reference edge.
Equally, when the edge of detection target is radiused edges, can will be corresponding to corresponding for internal ring edge or outer shroud
Edge is used as reference edge.
Step S1012:Along the reference edge, detection target image is divided into multiple sample projection regions, wherein, institute
State bearing of trend of the sample projection region perpendicular to the reference edge.
According to the result of step S1011, the embodiment of the present invention using edge 111 as reference edge, to sample projection region
Partition process be described in detail.
See also Fig. 3, along the bearing of trend that reference edge is edge 111, detection target image is divided into multiple adopting
Sample view field 113.Wherein, in embodiments of the present invention, the sample projection region 113 is affine rectangle;The sampling is thrown
The axis in shadow zone domain 113 perpendicular to edge 111, and multiple sample projection regions 113 with same intervals, be uniformly distributed.When
So in the specific implementation, the sample projection region 113 can also be other affine shapes such as circular, oval;And, described adopt
Sample view field 113 also need not be perpendicular to the bearing of trend at edge 111, and the axis in for example described sample projection region can be with
Edge 111 is at an acute angle etc..
For arc edge, reference edge is also circular arc, can divide multiple samplings along the circular arc of the reference edge
View field.
Step S1013:From the sample projection region, the marginal point of the detection target is extracted.
Referring to Fig. 4, a kind of close-up schematic view in the Projection Sampling region provided for present example, in each sampling
In view field, according to gray scale difference value, multiple marginal points are can determine.In embodiments of the present invention, in a sample projection area
4 marginal points, i.e. marginal point 1, marginal point 2, marginal point 3 and marginal point 4 is determined in domain 113;In this 4 marginal points,
There is the marginal point of the marginal point and false edge point of actual edge.Equally, for other sample projection regions, can be in phase
In the sample projection region that answers, extract and draw multiple marginal points accordingly.
By detection target image is divided into multiple sample projection regions, and extract the side in the sample projection region
Marginal point of the edge point as detection target, substantial amounts of marginal point can more accurately describe the actual shape at each edge of detection target
Condition, so that improve the precision of edge defect detection.
Step S102:By the group of edge points on each bar edge into reference edge group.
By the group of edge points on each bar edge into reference edge group, wherein, the number of marginal point in the reference edge group
Equal with the actual edge number of detection target.In order to detect that the defect of mobile phone side, detection target have 2 actual edges,
Then each described reference edge group includes 2 marginal points, by 4 marginal point combination of two as shown in Figure 4, constitutes 6 references
Edge group.Specifically, reference edge edge group include the first reference edge group (marginal point 1, marginal point 2), the second reference edge
Edge group (marginal point 1, marginal point 3), the 3rd reference edge group (marginal point 1, marginal point 4), the 4th reference edge group (marginal point 2,
Marginal point is 3), (marginal point 2, marginal point is 4), (marginal point 3, marginal point is 4) for the 6th reference edge group for the 5th reference edge group.
When detection target has 3 actual edges, then each reference edge group includes 3 marginal points, by as described in Figure 4
In 4 marginal points, any three group of edge points are into the reference edge group.Specifically, the reference edge group includes the first reference
Edge group (marginal point 1, marginal point 2, marginal point 3), the second reference edge group (marginal point 1, marginal point 2, marginal point 4), the 3rd
(marginal point is 4) for marginal point 1, marginal point 3 for reference edge group.
And, when the reference edge group is constituted, corresponding marginal point is organized with permanent order, for example described fixation is suitable
It can be order from top to bottom or from inside to outside etc..Then in above-mentioned reference edge group, a reference edge is certainly existed
Group, it is ensured that marginal point therein is corresponding in turn to the actual edge of detection target.
In order to improve the formation efficiency of reference edge group, the embodiment of the present invention also provides a kind of generation side of reference edge group
Method, the method are comprised the following steps:
Step S1021:Determine the position range of each bar actual edge in detection target image.
When detecting that target has linear edge, such as detection target is mobile phone, carries out defects detection to the side of mobile phone.
In the detection target image for obtaining, the actual edge of mobile phone is that top edge and lower limb have fixed position, it is contemplated that inspection
Error during survey, it may be determined that top edge and lower limb distinguish corresponding position range.For example, corresponding detection mesh is set up
Logo image coordinate system, the actual edge of mobile phone are arranged parallel to X-axis, then the excursion of corresponding Y direction is the reality
The position range at edge.
When detecting that target has arc edge, such as detection target is bolt washer, and the edge of bolt washer is carried out
Defects detection.In the detection target image for obtaining, the actual edge of bolt washer is that inner annular edge and outer shroud edge have admittedly
Fixed position, it also is contemplated that the error in detection process, it may be determined that inner annular edge and outer annular edge edge distinguish corresponding position
Scope.For example, detection target image coordinate system is set up, to detect the center of circle of the corresponding arc edge of target as origin, internal ring
The corresponding corresponding annulus scope of the position range at edge or outer shroud edge.
Step S1022:By the group of edge points in the range of diverse location into reference edge group.
See also Fig. 4, when detecting that target has 2 actual edges, 2 actual edges are determined according to step S1021
The corresponding position range of difference, determines that marginal point 1 and marginal point 2 belong to the corresponding position range of first actual edge, edge
Point 3 and marginal point 4 belong to the corresponding position range of Article 2 actual edge, then by the group of edge points in the range of diverse location into ginseng
Examine edge group.Specifically, the reference edge group for (marginal point 1, marginal point 3), (marginal point 1, marginal point 4), (marginal point 2,
Marginal point is 3) and (marginal point 2, marginal point is 4).
When detecting that target has 3 actual edges, marginal point 1 belongs to the position range of first actual edge, edge
The position ranges that point 2 belongs to Article 2 actual edge, marginal point 3 and marginal point 4 belong to the position range of Article 3 actual edge,
The reference edge group for then constituting is for (marginal point is 3) and (marginal point is 4) for marginal point 1, marginal point 2 for marginal point 1, marginal point 2.
The generation of reference edge group can be effectively improved by by the group of edge points of diverse location scope into reference edge group
Efficiency, and the screening by the position range, can effectively reject false edge point, be equally beneficial for improving rim detection
Efficiency.
Step S103:The reference edge group is scored, determines that the high reference edge group of scoring is fitting edge group
With candidate edge group.
In order to screen to reference edge group, in the embodiment of the present invention, to each reference edge determined in step S102
Edge group, is scored by " to size " interpretational criteria.Referring to Fig. 5, it is a kind of reference edge group provided in an embodiment of the present invention
The schematic flow sheet of methods of marking, the method are comprised the following steps:
Step S1031:Determine marginal dimension threshold value.
Due to different sample projection regions position or the axis in sample projection region and the angle of actual edge different
When, different marginal dimension threshold values may be corresponded to, therefore, in the specific implementation, it is thus necessary to determine that corresponding marginal dimension threshold value.
Under the first performance, detect that the actual edge of target is linear edge, the linear edge is parallel to each other,
And adjacent linear edge has constant spacing.If the axis in sample projection region is perpendicular to the linear edge, can be with
Using the constant spacing of adjacent linear edge as marginal dimension threshold value.If such as detection target has 3 edges, will
Space D 1 between first edge and Article 2 edge, and 2 conduct of space D between Article 2 edge and Article 3 edge
The marginal dimension threshold value.If the axis in sample projection region and the linear edge out of plumb, for example at an angle, then
Corresponding marginal dimension threshold value can be obtained according to the constant spacing and the conversion of the angle;If equally detection target has
Have 3 edges, can according to the angle of the axis in sample projection region and the linear edge, calculate make a call to first edge with
Corresponding marginal dimension threshold value D1 in Article 2 edge ', and the corresponding marginal dimension threshold value in Article 2 edge and Article 3 edge
D2 ', using D1 ' and D2 ' as the marginal dimension threshold value.
Under second performance, detect that the actual edge of target is linear edge, but the linear edge is not parallel.
According to the reference edge that step S101 determines, if the axis in sample projection region is perpendicular to reference edge, adjacent straight line
Spacing between edge according to the overlapping positions of view field and the reference edge and regular change, alternatively, according to adopting
Sample view field determines the marginal dimension threshold value with the overlapping positions of the reference edge.If the axis in sample projection region
Reference edge is not orthogonal to, then according to the angle of the axis in sample projection region and the reference edge, and the sampling is thrown
Shadow zone domain and the overlapping positions of the reference edge, calculate and determine the marginal dimension threshold value.
Under the third performance, detect that the actual edge of target is arc edge, the arc edge is concentric circular.
If the axis in sample projection region is perpendicular to the normal direction of a wherein arc edge, by the radius at adjacent circular arc edge
Difference is used as the marginal dimension threshold value.If the axis in sample projection region is not orthogonal to the normal side of a wherein arc edge
To, then according to the semidiameter at adjacent circular arc edge and the angle of the axis in sample projection region and arc edge normal direction,
Conversion obtains the marginal dimension threshold value.
Under the 4th kind of performance, detect that the actual edge of target is arc edge, the arc edge is off-centre operation,
That is the spacing at adjacent circular arc edge is unequal.According to the reference edge that step S101 determines, when the axis in sample projection region hangs down
Directly when the normal of reference edge, converted according to geometry, sample projection region overlapping positions different from reference edge can be calculated
Corresponding marginal dimension threshold value.Equally, when the axis in sample projection region is not orthogonal to the normal of reference edge, according to adopting
The axis of sample view field and the angle of the normal of reference edge, can obtain corresponding marginal dimension threshold by geometry conversion
Value.
Step S1032:Calculate the reference distance between the neighboring edge point in reference edge group.
According to the reference edge group that step 102 determines, when detecting that target has 2 actual edges, calculate marginal point 1 with
Reference distance of the distance between the marginal point 2 as the first reference edge group;Calculate the distance between marginal point 1 and marginal point 3
Reference distance as the second reference edge group;The distance between marginal point 1 and marginal point 3 are calculated as the 3rd reference edge group
Reference distance;The distance between marginal point 2 and marginal point 3 are calculated as the reference distance of the 4th reference edge group;Calculate side
The reference distance of the distance between edge point 2 and marginal point 4 as the 5th reference edge group;Calculate between marginal point 3 and marginal point 4
Distance as the 6th reference edge group reference distance.
When detecting that target has 3 actual edges, the distance between marginal point 1 and marginal point 2, and marginal point is calculated
The distance between 2 and marginal point 3, used as the reference distance of the first reference edge group;Calculate between marginal point 1 and marginal point 2
Distance, and the distance between marginal point 2 and marginal point 4, used as the reference distance of the second reference edge group;Calculate marginal point 1
The distance between with marginal point 3, and the distance between marginal point 3 and marginal point 4, as the 3rd reference edge group reference away from
From.
Step S1033:According to the reference distance and the difference of the marginal dimension threshold value, the reference edge group is calculated
Scoring.
In the specific implementation, the mathematical conversion relation of the difference and the scoring of reference edge group can be set up, so as to true
The scoring of each reference edge group fixed.For example, when detecting that target has 2 actual edges, the reference of the first reference edge group
The difference is multiplied by proportionality coefficient, is calculated the scoring of the first reference edge group by distance and the difference of marginal dimension threshold value
For 70;Accordingly, by same calculation, the scoring for obtaining the second reference edge group is the 80, the 3rd reference edge group
The scoring that scores as the 90, the 4th reference edge group is 60 and the 6th reference edge group for the scoring of the 75, the 5th reference edge group
Frequency division be 50.
Equally, when detecting that target has 3 actual edges, each reference edge group has 2 reference distances, accordingly
The marginal dimension threshold value also has 2 marginal dimension threshold values, as the marginal point in reference edge group is arranged in a fixed order
Sequence, then the reference distance also carry out mathematic interpolation with corresponding marginal dimension threshold value.Specifically, the edge in reference edge group
Point arrange in accordance with the order from top to bottom, i.e., corresponding first actual edge, the second actual edge and the 3rd actual edge suitable
Sequence, then for the first reference edge group, the reference distance of calculating marginal point 1 to marginal point 2 and the first actual edge and second are in fact
The difference of the corresponding marginal dimension threshold value in border edge, and marginal point 2 is calculated to reference distance and the second actual side of marginal point 3
The difference of edge marginal dimension threshold value corresponding with the 3rd actual edge, the mean value calculation first according to above-mentioned 2 differences are referred to
The scoring of edge group.For the second reference edge group and the 3rd reference edge group calculate described reference edge in the same way
The scoring of group.
It should be noted that in embodiments of the present invention above-mentioned mathematics transformational relation is not limited, and the reference
The scoring of edge group is also not limited to hundred-mark system, for example, can also be 5 points of systems, ten point systems etc.;And above-mentioned reference distance also may be used
Think the distance between any two marginal point in reference edge group, above-mentioned marginal dimension threshold value can also be any two reality
The marginal dimension threshold value that edge determines, need to only ensure the position of the edge point position order corresponding to reference distance and actual edge
Sequence consensus, i.e., in reference edge group the marginal point of primary importance and the 3rd position marginal point determine reference away from
From the marginal dimension threshold value determined with first actual edge and Article 3 actual edge carries out mathematic interpolation.
In addition, for the motility and the precision that improve the scoring of reference edge group, in embodiments of the present invention, referring to Fig. 6, being
The schematic flow sheet of another kind of reference edge group methods of marking provided in an embodiment of the present invention, the method is in method shown in Fig. 5
On the basis of show a kind of computational methods of reference edge group scoring, including:
Step S1034:According to the complexity of detection object edge, multiple difference ranges corresponding with scoring are preset.
In the specific implementation, for same detection target, on zones of different position, the actual edge of the detection target
Complexity may be different, for example some region actual edges lean on close, and in some region actual edge wide aparts;
Or, some wire drawing process have been done near some region actual edges, it is possible to create more complicated texture causes interference, and
Other region actual edges are relatively smooth.In embodiments of the present invention, lean on close of actual edge or due to making work
The corresponding complexity in region that skill etc. introduces more interference is higher.
In the higher region of detection object edge complexity, the difference model of multiple smaller spacings corresponding with scoring is set
Enclose.For example, the difference range is arranged with 0.1 spacing, difference range [- 0.05,0.05], corresponding scoring are 100;Difference
Scope [- 0.1, -0.05), (0.05,0.1], corresponding scoring is 90 etc..
In the relatively low region of detection object edge complexity, the difference model of multiple large pitch corresponding with scoring row is set
Enclose.For example, the difference range is arranged with 0.2 spacing, difference range [- 0.1,0.1], corresponding scoring are 100;Difference model
Enclose [- 0.2, -0.1), (0.1,0.2], corresponding scoring is 90 etc..
Certainly, in the specific implementation, in same detection object edge region, the spacing of the difference range also needs not to be flat
It is respectively provided with, the spacing of such as 100 corresponding difference ranges of scoring is 0.1, and the spacing of the 90 corresponding difference ranges that score can be
0.2 etc..
Step S1035:When the difference belongs to the difference range, the corresponding scoring conduct of the difference range is determined
The scoring of the reference edge group.
When reference distance and the difference of respective edges dimension threshold, when belonging to corresponding difference range, by the difference model
Corresponding scoring is enclosed as the scoring of the reference edge group.Specifically, for the detection target for including 2 actual edges, such as
Fruit corresponds to sample projection region and is located at the higher region of detection object edge complexity, then according to the first reference edge group to the 6th
Reference edge group distinguishes the difference range belonging to corresponding difference, determines the scoring of each reference edge group.Such as first ginseng
The difference for examining edge group belongs to the scope of [- 0.1, -0.05), (0.05,0.1], then the scoring of the first reference edge group is 90, the
The difference of two reference edge groups belongs to [0.05,0.05], then the scoring of the second reference edge group is 100 etc..
For the detection target of 3 actual edges, if corresponding sample projection region is located at detection object edge complexity
Relatively low region, then the difference model according to belonging to the first reference edge group to the 3rd reference edge group distinguishes corresponding difference
Enclose, determine the scoring of each reference edge group.The difference of such as the first reference edge group belongs to [- 0.1,0.1], then the first reference
The scoring of edge group is 100, and the difference of the second reference edge group belongs to [- 0.2, -0.1), (0.1,0.2], then the second reference edge
The scoring of edge group is 90 etc..
Further, in order to accurately score to each reference edge group, other interpretational criterias can also be used, for example
" first edge " standard comments criterion, " most strong edge " interpretational criteria.
Wherein, described " first edge " interpretational criteria is:According to each reference edge point in reference edge group near phase
The degree at edge is answered, the scoring of the reference edge group is determined.Specifically, when detecting that target has 2 edges, in the first ginseng
Examine in edge group, top edge of the marginal point 1 the closer to detection target, then the scoring of marginal point 1 is higher, and marginal point 2 is the closer to inspection
The lower limb of target is surveyed, then the scoring of marginal point 2 is higher, the meansigma methodss that marginal point 1 and marginal point 2 are scored, as the first ginseng
Examine the scoring of edge group;In the same way, the scoring of the second reference edge group to the 6th reference edge group is calculated.When detection mesh
When mark has 3 edges, in the first reference edge group, top edge of the marginal point 1 the closer to detection target, then marginal point 1
Scoring is higher, lower limb of the marginal point 3 the closer to detection target, then the scoring of marginal point 3 is higher, and marginal point 2 is the closer to detection
The center line of target, then the scoring of marginal point 2 is higher, using the meansigma methodss of the scoring of marginal point 1, marginal point 2 and marginal point 3 as
The scoring of one reference edge group;In the same way, the scoring of the second reference edge group to the 3rd reference edge group is calculated.
" most strong edge " interpretational criteria is:According to the contrast of reference edge point, the scoring of reference edge group is determined,
The contrast of reference edge point is higher, and corresponding scoring is higher.Specifically, when detecting that target has 2 edges, in the first ginseng
Examine in edge group, according to the contrast of marginal point 1, determine the scoring of marginal point 1, according to the contrast of marginal point 2, determine edge
The scoring of point 2, scoring of the meansigma methodss that marginal point 1 and marginal point 2 are scored as the first reference edge group;With same side
Formula, calculates the scoring of the second reference edge group to the 6th reference edge group.When detecting that target has 3 edges, in the first ginseng
Examine in edge group, according to the contrast of marginal point 1, calculate the scoring of marginal point 1, according to marginal point 2 to comparing, calculate edge
The scoring of point 2, according to the contrast of marginal point 3, calculates the scoring of marginal point 3, by the scoring of marginal point 1, the scoring of marginal point 2
And the meansigma methodss of the scoring of marginal point 3 are used as the scoring of the first reference edge group;In the same way, the second reference edge is calculated
The scoring of edge group to the 3rd reference edge group.
It should be noted that in the specific implementation, any one interpretational criteria above-mentioned, any two can be adopted to evaluate accurate
Combination then or three interpretational criterias mode used at the same time, score to reference edge group.When simultaneously using above-mentioned two
During individual interpretational criteria, commenting for each reference edge group can be calculated by the mathematical calculation mode such as arithmetic average or weighted average
Point.
By above description, each reference edge group in all sample projection regions is scored, at each
In the corresponding reference edge group of view field, determine scoring highest reference edge group as fitting edge group and candidate edge
Group.For example when detecting that target includes 2 actual edges, in a sample projection region, corresponding 6 reference edge groups, pass through
Scoring, the scoring highest of the first reference edge group, then using the first reference edge group as fitting edge group and candidate edge group;With
Same mode, determines the corresponding scoring highest reference edge group in each sample projection region as corresponding fitting edge group
With candidate edge group.
Step S104:Marginal point in fitting edge group is fitted, edge is fitted accordingly.
Each to should determine that corresponding fitting edge group, is fitted identical bits in edge group by each sample projection region
The marginal point that puts is fitted to corresponding fitting edge.
When detecting that target includes 2 actual edges, fitting edge group includes 2 marginal points;By each fitting side
The marginal point of primary importance in edge group, fitting obtain the first fitting edge;Edge by the second position in each fitting edge group
Point, fitting obtain the second fitting edge.
When detecting that target includes 3 actual edges, fitting edge group includes 3 marginal points;By each fitting side
The marginal point of primary importance in edge group, fitting obtain the first fitting edge;Edge by the second position in each fitting edge group
Point, fitting obtain the second fitting edge;By the marginal point of the 3rd position in each fitting edge group, fitting obtains the 3rd fitting side
Edge.
Equally, for the detection target with arbitrarily a plurality of edge, can obtain equal with actual edge number a plurality of
Fitting edge.
After edge is fitted accordingly, in order to obtain more accurately being fitted edge, edge defect detection essence is improved
Degree, alternatively, further comprising the steps of:
Step S201:When the marginal point in fitting edge group is more than outlier threshold distance to the distance at accordingly fitting edge
When, corresponding marginal point to be rejected, fitting again updates corresponding fitting edge.
As a example by including the detection target of 2 actual edges, after the first fitting edge and the second fitting edge is obtained,
In digital simulation edge group the marginal point of primary importance to first fitting edge distance, if the distance be more than outlier threshold away from
From, then the marginal point of primary importance in fitting edge group is rejected, if the distance is less than or equal to outlier threshold distance,
Any operation is not then done;Distance of the marginal point of the second position to the second fitting edge in digital simulation edge group, if should be away from
From more than with a distance from outlier threshold, then the marginal point of the second position in fitting edge group is rejected, if the distance be less than or
Outlier threshold distance is equal to, does not then do any operation.
The fitting edge group in each sample projection region is carried out after above-mentioned process, with process after fitting edge group first
The marginal point of position reappears fitting, updates first and is fitted edge, with process after the fitting edge group second position marginal point weight
New fitting, updates second and is fitted edge.
Step S202:In each sample projection region, accordingly it is fitted to after updating according to marginal point in reference edge group
The distance at edge, is scored again to reference edge group, and the high reference edge group that will score is updated to candidate edge group and plan
Close edge group.
As a example by the same detection target to include 2 actual edges, in each sample projection region, each reference edge
Group includes 2 marginal points, the marginal point distance first of primary importance is fitted that Edge Distance is nearer, then the marginal point of primary importance
Scoring is higher;The fitting Edge Distance of second position marginal point distance second is nearer, then the scoring of the marginal point of the second position is higher;
The scoring of primary importance marginal point and the scoring of second position marginal point are averaged, as the scoring of reference edge group, right
All of reference edge group is scored again.The high reference edge group that will score is updated to candidate edge group and fitting edge
Group.
It should be noted that in the specific implementation, above-mentioned steps S104, step S201 and step S202 can be carried out
Successive ignition, to obtain the fitting edge for best suiting actual edge, so that optimize edge defect accuracy of detection.
Step S105:When the marginal point in candidate edge group is more than defect threshold distance to the distance at accordingly fitting edge
When, determine Defect Edge point of the marginal point in the candidate edge group for respective edges.
For the detection target for including 2 actual edges, the marginal point of primary importance in candidate edge group is calculated to first
The distance at fitting edge, if the distance is more than defect threshold distance, it is determined that the primary importance in the candidate edge group
Marginal point for first actual edge (such as top edge) edge defect point, if the distance be less than or equal to defect threshold value away from
From the marginal point of the primary importance in the candidate edge group is normal marginal point;Calculate the second position in candidate edge group
Distance of the marginal point to the second fitting edge, if the distance is more than defect threshold distance, it is determined that in the candidate edge group
Edge defect point of the marginal point of the second position for Article 2 actual edge (such as lower limb), if the distance is less than or equal to
Defect threshold distance, then the marginal point of the second position in the candidate edge group is normal marginal point.
Equally, when detecting that target has 3 or more than 3 actual edges, in the manner described above, it may be determined that each bar reality
The Defect Edge point at border edge.Then, Defect Edge point is merged, the flaw size and area of respective edges can be calculated
Deng, defect is quantified, being convenient for technical staff carries out statistical analysiss to edge defect.
Described from above-described embodiment, multiple edge defect inspection method provided in an embodiment of the present invention, by from detection
In target image, the marginal point of the detection target is obtained, and the detection target image includes a plurality of edge;By on each bar edge
Group of edge points into reference edge group;The reference edge group is scored, determines the high reference edge group of scoring for fitting
Edge group and candidate edge group;The marginal point being fitted in edge group is fitted, edge is fitted accordingly;When candidate side
Marginal point in edge group to accordingly fitting edge distance be more than defect threshold distance when, determine the side in the candidate edge group
Defect Edge point of the edge point for respective edges.The edge defect detection algorithm can be to a plurality of edge of detection target, while entering
Row edge positioning and defects detection, effectively increase edge defect detection efficiency.
By the description of above embodiment of the method, those skilled in the art can be understood that the present invention can
Mode by software plus required general hardware platform is realizing, naturally it is also possible to by hardware, but in many cases the former
It is more preferably embodiment.Such understanding is based on, technical scheme substantially makes tribute to prior art in other words
The part that offers can be embodied in the form of software product, and the computer software product is stored in a storage medium, bag
Include some instructions to use so that a computer equipment (can be personal computer, server, or network equipment etc.) executes
The all or part of step of each embodiment methods described of the invention.And aforesaid storage medium includes:Read only memory
(ROM), random access memory (RAM), magnetic disc or CD etc. are various can be with the medium of store program codes.
Corresponding with the multiple edge defect inspection method embodiment that the present invention is provided, present invention also offers a kind of multiple edge
Defect detecting device.
Referring to Fig. 7, it is a kind of structural representation of multiple edge defect detecting device provided in an embodiment of the present invention, the device
Including:
Marginal point acquisition module 11, for from detection target image, obtaining the marginal point of the detection target, wherein,
The detection target image includes a plurality of edge;
Reference edge group generation module 12, for by the group of edge points on each bar edge into reference edge group;
Reference edge group grading module 13, for scoring to the reference edge group, determines the high reference edge of scoring
Edge group is fitting edge group and candidate edge group;
Edge group fitting module 14, for being fitted to the marginal point being fitted in edge group, is fitted side accordingly
Edge;
Edge defect determining module 15, for when the marginal point in candidate edge group is to being fitted intramarginal distance accordingly
During more than defect threshold distance, the Defect Edge point of the marginal point for respective edges of the candidate edge group is determined.
In order to screen to reference edge group, in the embodiment of the present invention, to determining in reference edge group generation module 12
Each reference edge group, scored by " to size " interpretational criteria, referring to Fig. 8, be provided in an embodiment of the present invention one
The structural representation of reference edge group grading module is planted, the reference edge group grading module 13 includes:
Marginal dimension threshold determination module 131, for determining marginal dimension threshold value;And, in the specific implementation, the side
Edge dimension threshold determining module 131 can be with the overlapping positions according to the sample projection region and the reference edge, determination
The marginal dimension threshold value;
Reference distance computing module 132, for calculating the reference distance between each marginal point in reference edge group;
Reference edge group score calculation module 133, for according to the reference distance and the difference of the dimension threshold, counting
Calculate the scoring of the reference edge group.
In order to improve motility and the precision of the scoring of reference edge group, referring to Fig. 9, it is provided in an embodiment of the present invention another
The structural representation of reference edge group grading module is planted, the reference edge group grading module 13 can also include:
Difference range presetting module 134, for the complexity according to detection object edge, presets corresponding with scoring many
Individual difference range;
Reference edge group scoring determining module 135, for when the difference belongs to the difference range, determining the difference
Scoring of the corresponding scoring of value scope as the reference edge group.
In order to more accurately describe the actual state at each edge of detection target, so as to improve the essence of edge defect detection
Degree, referring to Figure 10, is a kind of structural representation of marginal point acquisition module provided in an embodiment of the present invention, and the marginal point is obtained
Module 11 includes:
Reference edge determining module 111, for determining that any one edge in detection target image is reference edge;
Sample projection region division module 112, for along the reference edge, being divided into multiple adopting by detection target image
Sample view field, wherein, bearing of trend of the sample projection region perpendicular to the reference edge;
Edge point extraction module 113, for from the sample projection region, extracting the marginal point of the detection target.
And, in order to improve the formation efficiency of reference edge group, referring to Figure 11, it is a seed ginseng provided in an embodiment of the present invention
The structural representation of edge group generation module is examined, the reference edge group generation module 12 includes:
Position range determining module 121, for determining the position range of each bar actual edge in detection target image;
Reference edge group molded tissue block 122, for by the group of edge points in the range of diverse location into reference edge group.
In order to obtain more accurately being fitted edge, a kind of multiple edge defect detecting device provided in an embodiment of the present invention is also wrapped
Fitting edge update module 21 and reference edge group grading module 22 again are included, wherein:
Fitting edge update module 21, for when the marginal point in fitting edge group is to the distance for being accordingly fitted edge
More than outlier threshold apart from when, corresponding marginal point is rejected, fitting again updates corresponding fitting edge;
Reference edge group grading module 22 again, in each sample projection region, according to reference edge group
The distance at middle marginal point corresponding fitting edge to after updating, is scored to reference edge group, again by the high reference edge that scores
Edge group is updated to candidate edge group and fitting edge group.
As seen from the above-described embodiment, multiple edge defect detecting device provided in an embodiment of the present invention, by from detection target
In image, the marginal point of the detection target is obtained, and the detection target image includes a plurality of edge;By the side on each bar edge
Edge point constitutes reference edge group;The reference edge group is scored, determines that the high reference edge group of scoring is fitting edge
Group and candidate edge group;The marginal point being fitted in edge group is fitted, edge is fitted accordingly;When candidate edge group
In marginal point to accordingly fitting edge distance be more than defect threshold distance when, determine the marginal point in the candidate edge group
Defect Edge point for respective edges.The edge defect detection algorithm can be to a plurality of edge of detection target, while carrying out side
Edge positioning and defects detection, effectively increase edge defect detection efficiency.
It should be noted that herein, the relational terms of such as " first " and " second " or the like are used merely to one
Individual entity or operation are made a distinction with another entity or operation, and are not necessarily required or implied these entities or operate it
Between exist any this actual relation or order.And, term " including ", "comprising" or its any other variant are intended to
Cover including for nonexcludability, so that a series of process, method, article or equipment including key elements not only includes those
Key element, but also other key elements including being not expressly set out, or also include for this process, method, article or set
Standby intrinsic key element.In the absence of more restrictions, the key element for being limited by sentence "including a ...", it is not excluded that
Also there is other identical element in process, method, article or the equipment for including the key element.
The above is only the specific embodiment of the present invention, makes skilled artisans appreciate that or realizing this
Bright.Multiple modifications of these embodiments will be apparent to one skilled in the art, as defined herein
General Principle can be realized without departing from the spirit or scope of the present invention in other embodiments.Therefore, the present invention
The embodiments shown herein is not intended to be limited to, and is to fit to and the principle and features of novelty phase one that is invented herein
The most wide scope for causing.