CN104050659A - Method for measuring workpiece linear edges - Google Patents

Method for measuring workpiece linear edges Download PDF

Info

Publication number
CN104050659A
CN104050659A CN201410225004.XA CN201410225004A CN104050659A CN 104050659 A CN104050659 A CN 104050659A CN 201410225004 A CN201410225004 A CN 201410225004A CN 104050659 A CN104050659 A CN 104050659A
Authority
CN
China
Prior art keywords
edge
edges
image
marginal
marginal point
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201410225004.XA
Other languages
Chinese (zh)
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.)
Huazhong University of Science and Technology
Guangdong Hust Industrial Technology Research Institute
Original Assignee
Huazhong University of Science and Technology
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 Huazhong University of Science and Technology filed Critical Huazhong University of Science and Technology
Priority to CN201410225004.XA priority Critical patent/CN104050659A/en
Publication of CN104050659A publication Critical patent/CN104050659A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses a method for measuring workpiece linear edges. The method comprises the following steps that (1) an interested area of a workpiece image is selected, and the edges of a target in the image are extracted; (2) edge length threshold values are set, and the edges are processed according to the threshold values so as to remove chaotic edges and noise; (3) a plurality of edge points on each edge are collected as sample points, least square fit is conducted, fitted straight lines corresponding to all the edges are obtained, and thus Hesse paradigms are obtained; (4) the distances between all the edge points and the corresponding fitted straight lines are calculated, and the edge points corresponding to large outliers are removed with a Tukey weighting function; (5) the step (3) and the step (4) are cycled repeatedly, final describing equations of all the edges can be obtained, and the workpiece edges can be measured. According to the method, calculation is fast and accurate, the influences of large concave points and convex points on the edges of objects on information extraction are lowered, and the accuracy of measuring results is improved.

Description

A kind of method of measuring workpieces linear edge
Technical field
The invention belongs to technical field of image processing, relate to the method at a kind of slotted line workpiece edge.
Background technology
Now commercial production is towards integrated, intelligent development, and more workpiece informational needs is extracted, such as the degree of tilt of workpiece linear edge, fringe spacing, edge length etc. marginal information.
Traditional marginal information measurement is carried out hand dipping by ruler or other instruments and is completed, this manual mode not only accuracy of measurement is not high, and complicated operation, efficiency are very low, can not meet and in modern industry, improve the quality of products and the requirement of the production efficiency of whole production line.
For overcoming the problems referred to above, there is at present a kind of two-dimensional measurement technology, its image processing method formula is carried out marginal information measurement, can promote well accuracy of measurement and operation more accurately with rapid.Two-dimensional measurement technology refers to video camera replacement human eye detected object is taken pictures, through image processing algorithms such as image processing and edge extractings, can obtain the information of detected object, thereby guidance machine carries out associative operation.
At present common two-dimensional linear measuring method comprises two kinds of Hough transformation and least square methods.Wherein, Hough transformation calculated amount is large, and the line segment less for pixel cannot detect, and parameter space is difficult to ask for optimized parameter.Although and simple least square method calculated amount is little, computing velocity is fast, for large outlier poor robustness, measurement result can be subject to the impact of the sags and crests that edge is large.
Summary of the invention
For the deficiencies in the prior art, the present invention proposes a kind of method and apparatus of energy stability and high efficiency measuring workpieces linear edge, be intended to improve the robustness of measurement result to large outlier, thereby improve the accuracy of measurement result.
For achieving the above object, according to one aspect of the present invention, provide a kind of measuring method of workpiece linear edge, obtain the marginal information of workpiece by the processing to workpiece image, it is characterized in that, the method comprises the steps:
(1) choose the area-of-interest (ROI) of workpiece image, extract the edge of target in image;
(2) edge length threshold value is set, and edge step (1) being obtained according to this threshold value processes, to reject wherein disorderly edge and noise, thus the edge after obtaining upgrading;
(3) gather multiple marginal points on every edge as sampling point, and carry out least square fitting, obtain each the fitting a straight line that edge is corresponding, thereby obtain black plug normal form;
(4) the each marginal point calculating on every edge arrives the distance of its corresponding fitting a straight line, and utilizes Tukey weighting function, rejects the wherein large corresponding marginal point of outlier, thereby obtains each the marginal point that edge is corresponding after upgrading;
(5) repeatedly after circulation step (3) and step (4), can obtain each the final descriptive equation in edge, thereby obtain the information between each marginal information and each edge, realize the measurement of the edge of work.
Preferably, described fitting a straight line is black plug normal form, and it is specifically expressed as:
ax+by+c=0
In formula, a, b, c is black plug normal form coefficient, a 2+ b 2=1, c=-(au x+ bu y), (x, y) is marginal point coordinate; (x i, y i) be any marginal point coordinate on edge preferably, described marginal point is to the distance δ of corresponding fitting a straight line ifor:
| δ i | = | ax i + by i + c | a 2 + b 2 = | ax i + by i + c |
Tukey weighting function is expressed as:
ω ( δ ) = ( 1 - ( δ / τ ) 2 ) 2 | δ | ≤ τ 0 | δ | > τ
σ represents distance between beeline and dot, and τ represents wave absorption function, for robustness deviation, median| δ i| be the intermediate value of distance, for | δ | the marginal point that > τ is corresponding, be considered as outlier, reject.
Preferably, described edge comprises edge tilt degree, and between each edge, information comprises distance between two straight lines.
Preferably, in described step (1), preferably adopt Canny operator extraction image border, specifically comprise:
(1.1) former image is carried out to gaussian filtering;
(1.2) calculated direction derivative, the amplitude of compute gradient;
(1.3) maximum value suppresses, and obtains the edge of work;
In the present invention, first utilize object edge point in canny operator extraction image, to the sampling point extracting, by least square fitting, find the black plug normal form that is applicable to describing linear edge; Ask on straight line each point to the distance of straight line; Utilize Tukey weighting function, remove large outlier; By the matching that iterates, obtain the descriptive equation of linear edge.
In general, method of the present invention, with respect to prior art, has following technique effect:
(1) there is good robustness for the linear edge that has salient point or concave point;
(2) reduced the complexity of computing, speed is fast, and is easy to programming and realizes;
Brief description of the drawings
Fig. 1 is the measuring method process flow diagram of the embodiment of the present invention;
Fig. 2 is the applied image collecting device structural representation of the measuring method of the embodiment of the present invention;
Fig. 3 is that the measuring method of the embodiment of the present invention is at profile fitting effect schematic diagram under normal circumstances;
Fig. 4 is that the measuring method of the embodiment of the present invention has the fitting effect schematic diagram in salient point situation at profile.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.In addition,, in each embodiment of described the present invention, involved technical characterictic just can combine mutually as long as do not form each other conflict.
The concrete implementation step of the method for the measuring workpieces linear edge of the embodiment of the present invention is described as follows:
The first step: choose the region of interest ROI of target image, utilize the edge of target in Canny operator extraction image, the edge obtaining is carried out to edge tracking, and numbering.
What in the present embodiment, preferably adopt is Canny operator, and this algorithm is mature and stable, and extraction effect is good, belongs to the algorithm of this area maturation.But in the present invention, be not limited to adopt above-mentioned algorithm to carry out edge extracting.
In the present embodiment, utilize the algorithm steps of Canny operator as follows:
(1.1) former image is carried out to gaussian filtering;
(1.2) calculated direction derivative, the amplitude of compute gradient; Wherein, the directional derivative of X and Y-direction is respectively:
P[i,j]=(S[i,j+1]-S[i,j]+S[i+1,j+1]-S[i+1,j])/2;
Q[i,j]=(S[i,j]-S[i+1,j]+S[i,j+1]-S[i+1,j+1])/2;
Gradient magnitude: M [ i , j ] = P [ i , j ] 2 + Q [ i , j ] 2
Gradient direction: θ [i, j]=arctan2 (Q[i, j], P[i, j])
Wherein: (i, j) represents the coordinate position of point on image, S[i, j] represent the pixel value of this point.
(1.3) utilize above-mentioned directional derivative, the amplitude of compute gradient, carries out maximum value inhibition, obtains the edge of work.
(1.4) edge is followed the tracks of, and the point on same edge is stored in same array.
Second step: edge length threshold value is set, rejects disorderly edge and noise, again edge number consecutively.
Minimum edge length threshold l is set min, when the edge length detecting is less than l mintime, this edge is deleted, when the edge length detecting is greater than l mintime, by this Edge preserving.Finally again edge with a grain of salt institute is renumberd.Length threshold l mincan specifically select according to actual demands such as measuring accuracy.
The 3rd step: the sampling point at every the edge obtaining after second step is carried out respectively to least square fitting, obtain black plug normal form coefficient information;
(3.1) least square method (claiming again least square method) is a kind of mathematical optimization technology.The optimal function that it finds data by the quadratic sum of minimum error is mated.Utilize least square method can try to achieve easily unknown data, and make the quadratic sum of error between these data of trying to achieve and real data for minimum.Its concrete steps are:
Obtaining after image edge, can obtain series of points (x 1, y 1), (x 2, y 2) ... distance by least square method and the 4th step mid point to straight line:
ϵ 2 = Σ i = 1 n w i ( ax i + by i + c ) 2 W ifor additional weight
What need now is to ask for to work as ε 2hour, a, b, the best value of c;
(3.1.1), herein for asking constrained fitting a straight line equation, in the present embodiment, preferably adopt Lagrange multiplier, order:
ϵ 2 = Σ i = 1 n w i ( ax i + by i + c ) 2 - λn ( a 2 + b 2 - 1 )
(3.1.2) in first round matching, preferably make w i=1 (in all the other matchings of taking turns, additional weight is calculated by Tukey weighting function), obtains:
ϵ 2 = Σ i = 1 n ( ax i + by i + c ) 2 - λn ( a 2 + b 2 - 1 )
(3.1.3) require ε 2minimum value, and a 2+ b 2=1, therefore the minimum value of demand Lagrange multiplier only, by the relation of extreme point and minimum value, is first asked Lagrangian
Extreme point, first to ε 2in c ask first order derivative, and to make it be zero, obtains:
∂ ϵ 2 ∂ c = 2 Σ i = 1 n ( ax i + by i + c ) = 0
Order: u x = 1 n Σ i = 1 n x i With u y = 1 n Σ i = 1 n y i
Can obtain: c=-(au x+ bu y) substitution ε 2:
ϵ 2 = Σ i = 1 n ( a ( x i - u x ) + b ( y i - u y ) ) 2 - λn ( a 2 + b 2 - 1 )
(3.1.4) ask single order to lead to a and b respectively, obtain:
∂ ϵ 2 ∂ a = 2 Σ i = 1 n ( a ( x i - u x ) + b ( y i - u y ) ) ( x i - u x ) - 2 λna = 0 ∂ ϵ 2 ∂ b = 2 Σ i = 1 n ( a ( x i - u x ) + b ( y i - u y ) ) ( y i - u y ) - 2 λnb = 0
(3.1.5) order u xx = 1 n - 1 Σ i = 1 n ( x i - u x ) 2 , u yy = 1 n - 1 Σ i = 1 n ( y i - u y ) 2 With u xy = 1 n - 1 Σ i = 1 n ( x i - u x ) ( y i - u y )
Obtain:
u xx u xy u xy u yy a b = λ a b
(3.1.6) right ϵ 2 = Σ i = 1 n ( a ( x - u r ) + b ( y - u y ) ) 2 Be out of shape and have: ε 2=(n-1) λ
So can know, allow ε 2minimum, though λ minimum, therefore:
[ u xx u xy u xy a yy - λ 1 0 0 1 ] a b = 0
Solve:
a b = 1 u xy + ( λ - u xx ) 2 u xy λ - u xx = 1 u xy + ( λ - u yy ) 2 u yy - λ - u xy
(3.2) black plug normal form is expressed as:
Ax+by+c=0 is a wherein 2+ b 2=1
A in formula, b, c is black plug normal form coefficient, (x, y) is marginal point coordinate;
The 4th step: calculate each marginal point to the distance of obtaining straight line, utilize Tukey weighting function, reject large outlier.
(4.1) by a in the 3rd step 2+ b 2=1 restriction, point is to distance δ between straight line ifor:
| δ i | = | ax i + by i + c | a 2 + b 2 = | ax i + by i + c |
(4.2) Tukey weighting function is expressed as:
ω ( δ ) = ( 1 - ( δ / τ ) 2 ) 2 | δ | ≤ τ 0 | δ | > τ
Getting robustness deviation is: median| δ i| represent to get the intermediate value of distance.
Make wave absorption factor be: τ = 2 σ δ 1
For | δ | the point of≤τ, its weighted value slides between 1~0, for | δ | the point of > τ, be considered as outlier, reject.
The 5th step: to remaining marginal point, repeat the 3rd step to the four steps, until the slope differences of the straight line finally obtaining and last straight line, intercept is poor is all less than corresponding slope differences threshold epsilon 1with the poor threshold epsilon of intercept 2time stop iteration, obtain every final descriptive equation in edge.
Slope differences threshold epsilon in the present invention 1with the poor threshold epsilon of intercept 2can specifically select with precision according to the actual requirements.
The 6th step: by descriptive equation, can obtain the information between every edge or each edge, comprise:
(6.1) edge tilt degree: θ=arctan (a/b) is when edge is not orthogonal to while being also not parallel to x axle;
Article (6.2) two, distance: h=|b between straight line 1-b 2| * cos (θ) parallel stripes.
By method proposed by the invention, utilize least square method and Tukey weighting function to process target image edge, can get rid of large outlier edge data and extract the impact producing, meanwhile, algorithm complex is not high, is convenient to programming and realizes.
As shown in Figure 2, the device of the measuring workpieces linear edge of the embodiment of the present invention comprises area source 1, and what camera lens was housed adopts figure camera 3, image pick-up card 4, the computing machine 5 of integrated image process software for detection of workpiece.Described back light 1 be arranged on adopt figure camera 3 under, this light source 1 and camera 3 be fixed on can be vertical and the support of Level tune on, workpiece for measurement 2 is positioned on area source 1, be preferably placed at back light 1 directly over, image pick-up card 4 is connected with industrial computer 5 with camera 3 respectively by data line.
While gathering image, open successively respectively computing machine 5, adopt figure camera 3 and back light 1, adopt the image that figure camera 3 collects, by image pick-up card 4, data are passed to computing machine, the image processing software that computing machine 5 is write by above-mentioned fitting algorithm, calculates the linear marginal information of workpiece, as angle, edge length etc., information that simultaneously also can be based between the many stripeds of single edges acquisition of information.
Fig. 3, is the image border detecting shown in dotted line in Fig. 4.
Those skilled in the art will readily understand; by method and apparatus proposed by the invention; it is only preferred embodiment of the present invention; not in order to limit the present invention; all any amendments of doing within the spirit and principles in the present invention, be equal to and replace and improvement etc., within all should being included in protection scope of the present invention.

Claims (5)

1. a method for measuring workpieces linear edge, by the marginal information of the processing acquisition workpiece to workpiece image, is characterized in that, the method comprises the steps:
(1) choose the area-of-interest (ROI) of workpiece image, extract the edge of target in image;
(2) edge length threshold value is set, and edge step (1) being obtained according to this threshold value processes, to reject wherein disorderly edge and noise, thus the edge after obtaining upgrading;
(3) gather multiple marginal points on every edge as sampling point, and carry out least square fitting, obtain each the fitting a straight line that edge is corresponding, thereby obtain black plug normal form;
(4) the each marginal point calculating on every edge arrives the distance of its corresponding fitting a straight line, and utilizes Tukey weighting function, rejects the wherein large corresponding marginal point of outlier, thereby obtains each the marginal point that edge is corresponding after upgrading;
(5) repeatedly after circulation step (3) and step (4), can obtain each the final descriptive equation in edge, thereby obtain the information between each marginal information and each edge, realize the measurement of the edge of work.
2. the method for measuring workpieces linear edge according to claim 1, wherein, described fitting a straight line is black plug normal form, and it is specifically expressed as:
ax+by+c=0
In formula, a, b, c is black plug normal form coefficient, a 2+ b 2=1, c=-(au x+ bu y), (x, y) is marginal point coordinate; (x i, y i) be any marginal point coordinate on edge, n is number a little.
3. the method for measuring workpieces linear edge according to claim 1 and 2, wherein, described marginal point is to the distance δ of corresponding fitting a straight line ifor:
| δ i | = | ax i + by i + c | a 2 + b 2 = | ax i + by i + c |
Tukey weighting function is expressed as:
ω ( δ ) = ( 1 - ( δ / τ ) 2 ) 2 | δ | ≤ τ 0 | δ | > τ
σ represents distance between beeline and dot, and τ represents wave absorption function, for robustness deviation, median| δ i| be the intermediate value of distance;
Utilize Tukey weighting function, reject the wherein large corresponding marginal point of outlier and be: for | δ | the marginal point that > τ is corresponding, be considered as outlier, reject.
4. according to the method for the measuring workpieces linear edge described in any one in claim 1-3, wherein, described edge comprises edge tilt degree, and between each edge, information comprises distance between two straight lines.
5. according to the method for the measuring workpieces linear edge described in any one in claim 1-4, wherein, in described step (1), preferably adopt Canny operator extraction image border, specifically comprise:
(1.1) former image is carried out to gaussian filtering;
(1.2) calculated direction derivative, the amplitude of compute gradient;
(1.3) maximum value suppresses, and obtains the edge of work.
CN201410225004.XA 2014-05-26 2014-05-26 Method for measuring workpiece linear edges Pending CN104050659A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410225004.XA CN104050659A (en) 2014-05-26 2014-05-26 Method for measuring workpiece linear edges

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410225004.XA CN104050659A (en) 2014-05-26 2014-05-26 Method for measuring workpiece linear edges

Publications (1)

Publication Number Publication Date
CN104050659A true CN104050659A (en) 2014-09-17

Family

ID=51503442

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410225004.XA Pending CN104050659A (en) 2014-05-26 2014-05-26 Method for measuring workpiece linear edges

Country Status (1)

Country Link
CN (1) CN104050659A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109559306A (en) * 2018-11-27 2019-04-02 广州供电局有限公司 Crosslinked polyetylene insulated layer surface planarization detection method based on edge detection
CN109614698A (en) * 2018-12-10 2019-04-12 广东工业大学 The up-front geometric shape approximating method of a kind of pair of engine blade, device and medium
CN113160161A (en) * 2021-04-14 2021-07-23 歌尔股份有限公司 Method and device for detecting defects at edge of target

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109559306A (en) * 2018-11-27 2019-04-02 广州供电局有限公司 Crosslinked polyetylene insulated layer surface planarization detection method based on edge detection
CN109559306B (en) * 2018-11-27 2021-03-12 广东电网有限责任公司广州供电局 Crosslinked polyethylene insulating layer surface smoothness detection method based on edge detection
CN109614698A (en) * 2018-12-10 2019-04-12 广东工业大学 The up-front geometric shape approximating method of a kind of pair of engine blade, device and medium
CN109614698B (en) * 2018-12-10 2023-07-28 广东工业大学 Geometric shape fitting method, device and medium for front edge of engine blade
CN113160161A (en) * 2021-04-14 2021-07-23 歌尔股份有限公司 Method and device for detecting defects at edge of target

Similar Documents

Publication Publication Date Title
CN107063228B (en) Target attitude calculation method based on binocular vision
CN103236064B (en) A kind of some cloud autoegistration method based on normal vector
Xia et al. A fast edge extraction method for mobile LiDAR point clouds
CN103020945B (en) A kind of remote sensing image registration method of Multiple Source Sensor
CN104050660A (en) Method for measuring workpiece round edges
CN105806315B (en) Noncooperative target relative measurement system and measuring method based on active coding information
CN103727930B (en) A kind of laser range finder based on edge matching and camera relative pose scaling method
CN101256156B (en) Precision measurement method for flat crack and antenna crack
CN103292701A (en) Machine-vision-based online dimensional measurement method of precise instrument
CN105021124A (en) Planar component three-dimensional position and normal vector calculation method based on depth map
CN103425988A (en) Real-time positioning and matching method with arc geometric primitives
CN103559711A (en) Motion estimation method based on image features and three-dimensional information of three-dimensional visual system
CN104299247A (en) Video object tracking method based on self-adaptive measurement matrix
CN107909018B (en) Stable multi-mode remote sensing image matching method and system
CN103295239A (en) Laser-point cloud data automatic registration method based on plane base images
CN104121902A (en) Implementation method of indoor robot visual odometer based on Xtion camera
CN103679701B (en) Crystal pattern based on Support vector regression is as outline of straight line detection method
CN105389774A (en) Method and device for aligning images
CN102169581A (en) Feature vector-based fast and high-precision robustness matching method
CN102865859A (en) Aviation sequence image position estimating method based on SURF (Speeded Up Robust Features)
CN107886539B (en) High-precision gear visual detection method in industrial scene
CN103136525A (en) Hetero-type expanded goal high-accuracy positioning method with generalized Hough transposition
CN104298990A (en) Rapid graph matching and recognition method based on skeleton graphs
CN106340010A (en) Corner detection method based on second-order contour difference
CN105354555A (en) Probabilistic graphical model-based three-dimensional face recognition method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20161201

Address after: 430074 Hubei Province, Wuhan city Hongshan District Luoyu Road No. 1037

Applicant after: Huazhong University of Science and Technology

Applicant after: GUANGDONG HUST INDUSTRIAL TECHNOLOGY RESEARCH INSTITUTE

Address before: 430074 Hubei Province, Wuhan city Hongshan District Luoyu Road No. 1037

Applicant before: Huazhong University of Science and Technology

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20140917