CN104050660A - Method for measuring workpiece round edges - Google Patents
Method for measuring workpiece round edges Download PDFInfo
- Publication number
- CN104050660A CN104050660A CN201410226307.3A CN201410226307A CN104050660A CN 104050660 A CN104050660 A CN 104050660A CN 201410226307 A CN201410226307 A CN 201410226307A CN 104050660 A CN104050660 A CN 104050660A
- Authority
- CN
- China
- Prior art keywords
- edge
- circle
- edges
- image
- 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
Links
Abstract
The invention discloses a method for measuring workpiece round edges. The method comprises the steps (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, and round edge describing equation expressions corresponding to all the edges are obtained; (4) the distances between all the edge points on all the edges and the corresponding circle centers are calculated and compared with radiuses corresponding to the circles, 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 the edges can be obtained, and edge information can be obtained. According to the method, calculation is fast and accurate, the influences of large concave points and convex points on the object edges on the edge information extraction are lowered, and the round edge information of workpieces can be extracted accurately.
Description
Technical field
The invention belongs to technical field of image processing, relate to a kind of method of measuring workpieces circular edge.
Background technology
Now commercial production is towards integrated, intelligent development, and more workpiece informational needs is extracted, such as the position of circular hole, radius of circle, distance between two circles, curved edge circularity etc.
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, the approximating method of conventional extraction circular information be center of gravity using sampling point as the center of circle, the mean value of the distance using sampling point to this center of gravity is as radius.This method is quick, but method is coarse, and is only suitable for asking for all known situations of circular contour.Also having a kind of method is to utilize the perpendicular bisector of the upper any two points of circle by the geometric properties in the center of circle, by any two adjacent spots as perpendicular bisector, using all crossing intersection points between two of these perpendicular bisectors as the center of circle.This kind of method can adapt to the situation that partial contour is known, but is easily subject to the impact of large outlier or noise, causes asking for precision not high.Also have some otherly based on geometric approximation, or method based on statistics, but all can not obtain good round fitting effect to large outlier.
Summary of the invention
The object of the invention is to for the deficiencies in the prior art, propose a kind of method of energy stability and high efficiency measuring workpieces circular 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, the invention provides a kind of measuring method of workpiece circular edge, obtain the marginal information of workpiece by the processing to workpiece image, it is characterized in that, the method comprises the steps:
The first step: choose region of interest ROI, utilize the edge of target in Canny operator extraction image, the edge obtaining is carried out to edge tracking, and numbering.
Second step: edge length threshold value is set, rejects disorderly edge and noise, again edge number consecutively.
The 3rd step: the sampling point to every the edge that meets second step condition carries out respectively least square fitting, obtains circle, the radius information of circular edge.
Circular expression formula is:
R
2=(x-A)
2+(y-B)
2
In formula, R represents radius, and (A, B) is the center of circle, and (x, y) is marginal point coordinate;
The 4th step: calculate each marginal point to the distance of obtaining the center of circle, utilize Tukey weighting function, reject large outlier;
Point is to distance d between the center of circle
ifor:
d
i 2=(x-A)
2+(y-B)
2
The 5th step: to remaining marginal point, repeat, after the three, four step n time, to obtain every final descriptive equation of circular edge;
The 6th step: by descriptive equation, we can know the information between every circular edge of workpiece or each circle;
In general, apparatus and method of the present invention, with respect to prior art, have following technique effect:
(1) for existing the sags and crests circular edge that even part is incomplete to have good robustness;
(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 circular 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:
Directional derivative: 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:
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 round expression formula 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:
(3.1.1) by the matched curve of justifying, obtain:
R
2=x
2-2Ax+A
2+y
2-2By+B
2
a=-2A
Make b=-2B
c=A
2+B
2-R
2
Can obtain the another one form of circular curve:
x
2+y
2+ax+by+c=0
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 the center of circle, point (x
i, y
i) to the distance in the center of circle square with radius square difference be:
σ
i=d
i 2-R
2
Making Q (a, b, c) is σ
iquadratic sum:
W
ifor additional weight, in first run fit procedure, can be set to 1, ask parameter a, b, c makes the value minimum of Q (a, b, c).
(3.1.2) difference of two squares Q (a, b, c) is greater than 0, and therefore function exists the minimal value that is more than or equal to 0, maximum value is infinitely great, to a, and b, c asks local derviation, make partial derivative equal 0, obtain extreme point, the functional value of more all extreme points can obtain minimum value.
(3.1.3) for solving above equation, preferably carry out following operation:
(1)
(2)
Preferably order:
(1), (2) formula obtains:
Ca+Db+E=0
Da+Gb+H=0
Solve:
So A, B, the evaluation fitting value of R is:
The 4th step: calculate each marginal point to the distance of obtaining the center of circle, utilize Tukey weighting function, reject large outlier.
(4.1) A being solved by the 3rd step, B, the evaluation fitting value of R: to the distance of circle be:
Getting robustness deviation is:
Make wave absorption factor be:
According to Tukey weighting function:
σ represents a little to arrive distance of round, and τ represents wave absorption function, 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 and the 4th step, until each remaining point stops in the time that the distance of obtaining the center of circle is all less than range difference threshold epsilon, obtain every final descriptive equation of circular edge;
R
2=(x-A)
2+(y-B)
2
Range difference threshold epsilon in the present invention can specifically be selected with precision according to the actual requirements.
The 6th step: by descriptive equation, we can know the information between every circular edge of workpiece or each circle.
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 circular 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 workpiece circular edge information, as the center of circle, radius length, radian etc., the information between simultaneously also can the multiple circles of acquisition of information based on single circle.
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 circular 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 circular edge equation expression formula that edge is corresponding;
(4) the each marginal point calculating on every edge compares to the distance in its corresponding center of circle the radius corresponding with this circle, utilize Tukey weighting function, reject the wherein large corresponding marginal point of outlier, thereby obtain 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 circular edge according to claim 1, wherein, the circular edge equation expression formula that described each edge is corresponding is:
R
2=(x-A)
2+(y-B)
2
In formula, R represents radius, and (A, B) is central coordinate of circle, and (x, y) is marginal point coordinate.
3. the method for measuring workpieces circular edge according to claim 2, wherein, Tukey weighting function is expressed as:
σ represents the some distance to the center of circle, and τ represents wave absorption function,
robustness deviation
for arbitrary marginal point is to the distance in the center of circle, 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 circular edge described in any one in claim 1-3, 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.
5. according to the detection method described in any one in claim 1-4, wherein, in described step (4), each marginal point compares and can adopt square value relatively to realize to the distance in its corresponding center of circle the radius corresponding with this circle, to simplify calculated amount.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410226307.3A CN104050660A (en) | 2014-05-26 | 2014-05-26 | Method for measuring workpiece round edges |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410226307.3A CN104050660A (en) | 2014-05-26 | 2014-05-26 | Method for measuring workpiece round edges |
Publications (1)
Publication Number | Publication Date |
---|---|
CN104050660A true CN104050660A (en) | 2014-09-17 |
Family
ID=51503443
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410226307.3A Pending CN104050660A (en) | 2014-05-26 | 2014-05-26 | Method for measuring workpiece round edges |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104050660A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106204540A (en) * | 2016-06-29 | 2016-12-07 | 上海晨兴希姆通电子科技有限公司 | Visible detection method |
WO2018209941A1 (en) * | 2017-05-17 | 2018-11-22 | 华南理工大学 | High-density circuit board circular hole sub-pixel detection method based on gaussian fitting |
CN110349203A (en) * | 2019-07-15 | 2019-10-18 | 深圳市威尔德医疗电子有限公司 | A kind of measurement method of ultrasonic device and its ultrasound image medium vessels diameter |
CN110349199A (en) * | 2019-06-25 | 2019-10-18 | 杭州汇萃智能科技有限公司 | A kind of object roundness measurement method |
CN111189399A (en) * | 2019-12-05 | 2020-05-22 | 西安大目智能设备研究所有限公司 | Image measurement algorithm for size of circular industrial part |
CN112381850A (en) * | 2020-12-04 | 2021-02-19 | 亿嘉和科技股份有限公司 | Cabinet surface circular target automatic segmentation method, system, device and storage medium |
CN112669360A (en) * | 2020-11-30 | 2021-04-16 | 西安电子科技大学 | Multi-source image registration method based on non-closed multi-dimensional contour feature sequence |
-
2014
- 2014-05-26 CN CN201410226307.3A patent/CN104050660A/en active Pending
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106204540A (en) * | 2016-06-29 | 2016-12-07 | 上海晨兴希姆通电子科技有限公司 | Visible detection method |
CN106204540B (en) * | 2016-06-29 | 2018-12-11 | 上海晨兴希姆通电子科技有限公司 | Visible detection method |
WO2018209941A1 (en) * | 2017-05-17 | 2018-11-22 | 华南理工大学 | High-density circuit board circular hole sub-pixel detection method based on gaussian fitting |
CN110349199A (en) * | 2019-06-25 | 2019-10-18 | 杭州汇萃智能科技有限公司 | A kind of object roundness measurement method |
CN110349199B (en) * | 2019-06-25 | 2021-07-30 | 杭州汇萃智能科技有限公司 | Object roundness measuring method |
CN110349203A (en) * | 2019-07-15 | 2019-10-18 | 深圳市威尔德医疗电子有限公司 | A kind of measurement method of ultrasonic device and its ultrasound image medium vessels diameter |
CN111189399A (en) * | 2019-12-05 | 2020-05-22 | 西安大目智能设备研究所有限公司 | Image measurement algorithm for size of circular industrial part |
CN111189399B (en) * | 2019-12-05 | 2022-03-04 | 西安大目智能设备研究所有限公司 | Image measurement algorithm for size of circular industrial part |
CN112669360A (en) * | 2020-11-30 | 2021-04-16 | 西安电子科技大学 | Multi-source image registration method based on non-closed multi-dimensional contour feature sequence |
CN112669360B (en) * | 2020-11-30 | 2023-03-10 | 西安电子科技大学 | Multi-source image registration method based on non-closed multi-dimensional contour feature sequence |
CN112381850A (en) * | 2020-12-04 | 2021-02-19 | 亿嘉和科技股份有限公司 | Cabinet surface circular target automatic segmentation method, system, device and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104050660A (en) | Method for measuring workpiece round edges | |
CN107063228B (en) | Target attitude calculation method based on binocular vision | |
CN109060836B (en) | Machine vision-based high-pressure oil pipe joint external thread detection method | |
CN103727930B (en) | A kind of laser range finder based on edge matching and camera relative pose scaling method | |
CN111062915A (en) | Real-time steel pipe defect detection method based on improved YOLOv3 model | |
CN102682286B (en) | Fruit identification method of picking robots based on laser vision systems | |
CN103236064A (en) | Point cloud automatic registration method based on normal vector | |
CN111126174A (en) | Visual detection method for robot to grab parts | |
CN102865859B (en) | Aviation sequence image position estimating method based on SURF (Speeded Up Robust Features) | |
CN107392929B (en) | Intelligent target detection and size measurement method based on human eye vision model | |
CN103292701A (en) | Machine-vision-based online dimensional measurement method of precise instrument | |
CN107292869B (en) | Image speckle detection method based on anisotropic Gaussian kernel and gradient search | |
CN103793712A (en) | Image recognition method and system based on edge geometric features | |
CN105865344A (en) | Workpiece dimension measuring method and device based on machine vision | |
CN104268602A (en) | Shielded workpiece identifying method and device based on binary system feature matching | |
CN105574527A (en) | Quick object detection method based on local feature learning | |
CN103295239A (en) | Laser-point cloud data automatic registration method based on plane base images | |
CN102494663B (en) | Measuring system of swing angle of swing nozzle and measuring method of swing angle | |
CN107742289A (en) | One kind is based on machine vision revolving body workpieces detection method | |
CN102169581A (en) | Feature vector-based fast and high-precision robustness matching method | |
CN107886539B (en) | High-precision gear visual detection method in industrial scene | |
CN103425988A (en) | Real-time positioning and matching method with arc geometric primitives | |
CN107369140A (en) | High-accuracy target ball center extraction method under unstructured moving grids | |
CN104299247A (en) | Video object tracking method based on self-adaptive measurement matrix | |
CN113628263A (en) | Point cloud registration method based on local curvature and neighbor characteristics thereof |
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: 20161212 Address after: 430074 Hubei Province, Wuhan city Hongshan District Luoyu Road No. 1037 Applicant after: Huazhong Science &. Technology Univ. Applicant after: GUANGDONG HUST INDUSTRIAL TECHNOLOGY RESEARCH INSTITUTE Address before: 430074 Hubei Province, Wuhan city Hongshan District Luoyu Road No. 1037 Applicant before: Huazhong Science &. Technology Univ. |
|
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20140917 |