CN105913415B - A kind of image sub-pixel edge extracting method with extensive adaptability - Google Patents

A kind of image sub-pixel edge extracting method with extensive adaptability Download PDF

Info

Publication number
CN105913415B
CN105913415B CN201610209158.9A CN201610209158A CN105913415B CN 105913415 B CN105913415 B CN 105913415B CN 201610209158 A CN201610209158 A CN 201610209158A CN 105913415 B CN105913415 B CN 105913415B
Authority
CN
China
Prior art keywords
point
image
pixel
edge
gradient
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610209158.9A
Other languages
Chinese (zh)
Other versions
CN105913415A (en
Inventor
吴晓军
王鑫欢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bozhong Suzhou Precision Industry Technology Co Ltd
Original Assignee
Bozhon Precision Industry Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bozhon Precision Industry Technology Co Ltd filed Critical Bozhon Precision Industry Technology Co Ltd
Priority to CN201610209158.9A priority Critical patent/CN105913415B/en
Publication of CN105913415A publication Critical patent/CN105913415A/en
Application granted granted Critical
Publication of CN105913415B publication Critical patent/CN105913415B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The image sub-pixel edge extracting method with extensive adaptability that the invention proposes a kind of, using adaptive high-low threshold value calculation method, after obtaining gradient image, local maximum central value selection operation is executed to gradient image in conjunction with the Gradient direction information of pixel, using any location of pixels as origin, establish relative coordinate, taking eight neighborhood pixel around the point is that local maximum central value selects data sample, the comparison result of neighborhood is obtained according to gradient direction, determines whether current pixel position is boundary point position candidate.Whether the extreme value of partial gradient amplitude is marginal point, needs to judge in conjunction with specific threshold, and the label of big Mr. Yu's given threshold value is that small Mr. Yu's given threshold value is determined as noise spot or background dot;The sub-pixel location of marginal point is sought using the Hessian matrix method based on Steger curved surface fitting method;Marginal point will finally be connected into curve, constitute the set of one group of oriented continuity point.The method of the present invention has fabulous real-time.

Description

A kind of image sub-pixel edge extracting method with extensive adaptability
Technical field
The present invention relates to image identification technical field more particularly to a kind of image sub-pixel edge extracting methods.
Background technique
In machine vision, require to carry out target to carry out target positioning, measurement, detection or Extraction of Geometrical Features etc. The edge extracting of sub-pixel precision.Such as it is needed using the template matching method of geometrical characteristic to template and mesh in target positioning Mark carries out the edge extracting of sub-pixel precision;The edge for needing to be accurately detected object in measurement application just can be carried out accurately Measurement;In detection application, such as optical character verifying OCV, edge defect detection require the Asia for steadily detecting object Pixel edge.
Common Boundary extracting algorithm have Roberts operator, Sobel operator, Prewitt operator, Laplace operator and Canny operator etc..The Boundary extracting algorithm of sub-pixel precision has space moments method, gray scale moments method, Zernike moments method and digital correlation Method etc..The Boundary extracting algorithm of other sub-pixel precisions further includes polynomial fitting method, ellipse fitting method, Gauss curved fitting Method, Sigmoid curve-fitting method etc., Li Shuai etc. propose a kind of sub-pix detection algorithm based on Gauss curved fitting, Sun Cheng Autumn etc. exists《A kind of edge detection method of sub-pixel precision》It is middle to propose that carrying out sub-pixel edge using Bezier edge model mentions It takes, dance outstanding person etc. proposes a kind of method of sub-pixel edge detection based on Sigmoid Function Fitting.(the China of patent document 1 Patent publication No. CN10465002A) disclose a kind of ellipse target sub-pixel edge positioning side based on Sobel edge extracting Method calculates elliptic geometry parameter by pixel edge, calculates sub-pixel edge by pixel edge.
Patent document 2 (China Patent Publication No. CN102737377A) discloses a kind of improved sub-pixel edge extraction calculation Method first carries out the coarse positioning of pixel precision, cuts target image using edge image and reduces seeking scope, then after diminution Sub-pixel edge is extracted in range.Patent document 3 (China Patent Publication No. CN103530878A) discloses a kind of based on fusion The edge extracting method of strategy obtains reflection using the result of three kinds of traditional Boundary extracting algorithms and belongs to the possible degree in edge Then ballot weight analyzes the difference of maximum difference in luminance and the minimum brightness difference of pixel and neighborhood, obtain description jump in brightness The difference weight of degree;Statistics goes center neighborhood variance to be distributed, and obtains the edge distribution weight of all pixels point, carries out edge and determines Plan exports edge image.Patent document 4 (China Patent Publication No. CN103886589A) discloses a kind of object-oriented automatic Change high-precision edge extracting method, including model training stage and edge extracting stage.5 (China Patent Publication No. of patent document CN103955911A it) discloses a kind of edge detection method based on opposite variation, including image preprocessing and is based on nerve net The edge detection of network method.Patent document 6 (China Patent Publication No. CN104268857A) discloses a kind of fast sub-picture element side Edge detection and localization method, basic ideas are to obtain pixel edge position first, then calculate sub- picture using cosine look-up table Plain marginal point.Patent document 7 (China Patent Publication No. CN104268872A) discloses a kind of edge detection based on consistency Method.Patent document 8 (China Patent Publication No. CN104732536A) discloses a kind of based on the morphologic sub-pix side of improvement Edge detection method is utilized in object edge profile using improved morphological edge detector smoothed image marginal information Canny operator obtains the edge of Pixel-level, then pixel edge is fitted to the sub-pixel edge of product.Patent document 9 (in State patent publication No. CN105005981A is public) a kind of opened sub-pixel precision laser striation center extraction method, by Initial optical losses are positioned in smoothed out image, then obtain striation width using Gaussian function fitting, recycle fitting high The parameters such as the variance of this function and Gaussian convolution core calculate Hessian matrix, calculate laser striation according to Hessian matrix Sub-pix center.It is identical as the present invention in the use of Hessian matrix method, but in terms of pixel accuracy positions calculating In the presence of the difference of essence, also cause the applicability of two methods entirely different.
However in industrial environment application, image is caused picture quality to reduce by the interference of all kinds of factors, including makes an uproar by force Sound, edge blurry etc., the edge feature of sub-pixel precision how is steadily detected in low-quality image, and there is no fine Ground solves.The Boundary extracting algorithm of traditional pixel precision applies such as 3C automated arm, electronic manufacture, work in industrial automation Required precision is not able to satisfy in the application such as industry robot vision.Space moments method, gray scale moments method, Zernike moments method and digital phase There is respective deficiency in terms of detection accuracy, calculating speed and noise resisting ability in the sub-pixel edges such as pass method extraction algorithm, It is difficult to adapt to detection operating condition harsh in industrial environment.
Patent document 1 can only extract the sub-pixel location of ellipse target, and versatility is insufficient, and cannot handle fuzzy object Edge extracting problem.Distribution is utilized Sobel, Canny and LoG operator and carries out edge detection in method disclosed in patent document 3, Then the result that three kinds of operators detect is weighted ballot statistics, subpixel coordinates is obtained according to the weight matrix of ballot, it should Method the problem is that speed is slow, precision dependent on weight matrix, not can solve the edge extractings of the images such as very noisy, fuzzy Problem.Method disclosed in patent document 4 and patent document 5 using Canny and opposite variation as a result, using machine learning side Method carries out edge extracting, and method speed is relatively slow, stable edge extracting cannot be carried out in low-quality image.Patent document 6 Disclosed method carries out sub-pixel edge detection, this method tool on the basis of pixel coordinate coarse positioning on 8 gradient directions There is good calculating speed, but does not account for the processing of very noisy and blurred picture.Patent document 7 and patent document 8 there is also Computational efficiency is not high, cannot handle the edge extracting problem of very noisy, blurred picture.Method disclosed in patent document 9 is using more Grade Gaussian convolution operation, algorithm complexity is high, and the non-linear shade variation of different zones formed to reasons such as illumination variations can not Realize the optical losses line drawing of robust, this method is only applicable to laser striation central line pick-up, cannot achieve general image Edge Gradient Feature.
Summary of the invention
The purpose of the present invention is to provide a kind of high speeds based on image edge information, high-precision template matching positioning side Method, this method can simultaneously output template image in the target image the position of sub-pixel precision, rotation angle and scaling because There is displacement, rotation, scaling, partial occlusion, the variation of illumination light and shade for target image in son, and uneven illumination is even, mixed and disorderly background etc. It can realize quick, stable, high-precision positioning and identification.Present invention could apply to need to carry out target by machine vision The occasion of positioning and identification:Such as robot guidance, semiconductor packages, electronic manufacture, Automated assembly, Product Visual detection, view Feel the fields such as measurement, video tracking.
Method disclosed by the invention can steadily detect the local edge of sub-pixel precision in low-quality image.
In order to achieve the above object, the invention is realized by the following technical scheme:
A kind of image sub-pixel edge extracting method with extensive adaptability, includes the following steps:Step 1:Using can Mutative scale image Fuzzy smooth is filtered to image preprocessing;Step 2:First derivative is calculated to pretreated image, first really It protects obtained gradient magnitude and meets the error rate less than setting value αp, image first derivative pass through target nuclear convolution image space It obtains;The edge line of image is at the crestal line of image first derivative, wherein crestal line is the local pole of adjacent continuous in gradient image The set being worth greatly;Step 3:The edge extracting and choosing principles of chain type threshold value are applied in edge candidate point screening process, it is real Existing Pixel-level boundary position extracts, and high-low threshold value is obtained using two ways:External parameter input or adaptive threshold calculate; Step 4:After obtaining gradient image, for convenience of and be quickly found out the single pixel wide position of crestal line, in conjunction with the gradient side of pixel Local maximum central value selection operation is executed to gradient image to information;Step 5:Whether the extreme value of partial gradient amplitude is edge Point needs to judge in conjunction with specific threshold, and the label of big Mr. Yu's given threshold value is that small Mr. Yu's given threshold value is judged to making an uproar Sound point or background dot;Step 6:Calculate the marginal position of sub-pixel precision;Step 7:Marginal point is connected into curve, constitutes one group The set of oriented continuity point.
As a further improvement of the present invention in the step 2, if image I (x, y) is obtained after being performed edge extraction operation It is α to boundary point error rateI, image size is n=w × h, then the probability of single-point detection mistake is αp=1- (1- αI)1/n, wherein αIRange is between 0 to 1.0, and image I (x, y) only has Gaussian noise and noise variance signal is sn;Using the substep characteristic of convolution, There is following equation:
The gradient magnitude for obtaining each point isIt is set so that the error rate of each point gradient magnitude is lower than Definite value αp, that is, meet equation:M (x, y, σ) >=c (σ), wherein
Variable in above formula is scale variable σ, and other variables are global setup parameter.
As a further improvement of the present invention, high-low threshold value is calculated in the step 3 is specially:Histogram song is found first Peak point (i, the H of linei), non-zero accumulated value coordinate points are (j, H in the last one histogramj), j≤255 0≤i < and 0≤Hj < Hj < 1.0, above-mentioned two o'clock is connected, and obtains straight line ax+by+c=0;Histogram curve is searched between i to j to sit Maximum distance position d of the punctuate to straight linemax, that is, meet dmax=arg maxk|ak+bHk+ c |, this coordinate (k, Hk) horizontal seat Mark is first threshold value Tlow=k;Then from this point, until linear end point (j, Hj) reconnect α x+ β y in alignment + λ=0, on section k to the j of histogram curve, the maximum distance position D of lookup curve to straight line (α, β, λ)max, same full Sufficient Dmax=arg maxtt+βHt+ λ |, this coordinate (t, Ht) abscissa be labeled as second threshold value Thigh=t.
As a further improvement of the present invention, the step 4 is specially:The gradient direction of any location of pixels be θ= tan-1(fy/fx), the tangent tendency direction with crestal line;Using any location of pixels as origin, a relative coordinate is established, takes the point Surrounding eight neighborhood pixel is that local maximum central value selects data sample, obtains the comparison result of neighborhood according to gradient direction, really Determine whether current pixel position is boundary point position candidate.
As a further improvement of the present invention, the step 5 sets (T using the dual threshold of Cannylow, Thigh);Authorities Portion extreme value G0Higher than ThighWhen, point p0It is marginal point;G0Lower than threshold value TlowExpression current point is non-boundary point attribute;Work as G0Between When between high-low threshold value, chain effect is had an effect, i.e. p0There are boundary points in the eight neighborhood of point, then side is confirmed as in current location Boundary's point.
As a further improvement of the present invention, the step 6 uses the Hessian square based on Steger curved surface fitting method The tactical deployment of troops seeks the sub-pixel location of marginal point, and the interpolation algorithm f of surface fitting is executed in the zonule of pixel edge point (r, c)=k0+k1r+k2c+k3r2+k4rc+k5c2;Single order and second dervative are sought to each unknown number of surface equation, are combined into Hessian matrix;The characteristic value and respective feature vector of Hessian matrix are solved, wherein corresponding to maximum absolute feature value Feature vector be marginal point normal direction (nx,ny);Using normal direction and the Taylor expansion of surface equation, side is calculated The sub-pixel location of edge point.
As a further improvement of the present invention, the contour connection needed to pay attention in the edge connection procedure of the step 7 is wanted The principle kept is the tendency that selection forms straight line or smooth curve recently and as far as possible, while also to be avoided the formation of mutually Connection two curves, have for Wave curved and can only existence anduniquess a curve.
Detailed description of the invention
Fig. 1 is flow chart of the method for the present invention;
Fig. 2 is the schematic diagram in one dimensional image data and corresponding derivative results;
Fig. 3 is the schematic diagram of fixed size gaussian filtering cooperation Canny algorithm edge extracting result;
Fig. 4 is image-region fitting and crestal line trend graph;
Fig. 5 is Threshold segmentation schematic diagram;
Fig. 6 (a) is that central point pixel and eight neighborhood indicate schematic diagram;
Fig. 6 (b) is eight neighborhood coordinate representation schematic diagram;
Fig. 7 is that current point subsequent point is the direction of search and order schematic diagram;
Fig. 8 is that the image sub-pixel edge with very noisy extracts example schematic;
Fig. 9 is image mutative scale blurred picture testing result schematic diagram;
Figure 10 is the testing result contrast schematic diagram that method and commercial software of the invention obtain.
Specific embodiment
Below by specific embodiment combination attached drawing, invention is further described in detail.
Edge detection is the algorithm being widely used in image procossing, and very multi-operator requires base in machine vision technique In good edge extracting as a result, as geometric templates matching, straight-line detection, loop truss, character recognition, defects detection, size are surveyed Amount etc..The present invention provides a kind of methods that energy stable detection very noisy image or Blur scale change strong image border, should Method can provide the length information of the marginal position of sub-pixel precision, the connection relationship of marginal point, marginal point.Edge detection efficiency Extremely efficiently, it is very suitable for applying in machine vision real-time system.The present invention can be the positioning in machine vision, measuring technique Important foundation is provided.
Flow chart of the method for the present invention is as shown in Fig. 1, includes the following steps:Step 1:Image preprocessing is flat to image Sliding filtering;Step 2:Nanoscale regime single order discrete kernel convolved image;Step 3:Adaptive high-low threshold value calculates;Step 4:Approximate ladder Spend direction calculating and the selection of local maximum central value;Step 5:Pixel boundary point determines selection;Step 6:Calculate sub-pixel precision Marginal position;Step 7:The connection of same alike result boundary point order.
Each step is specifically described below.
1. image preprocessing
Before searching marginal point, the edge model for meeting specified conditions need to be established.Most edge detections are calculated Method, such as Marr, Hildreth, Poggio, Canny, the marginal position of definition in the position that image grayscale is mutated, i.e. lead by single order Number amplitude data is higher than the position of certain threshold value or second dervative is equal to zero while not being flat inflection point (flat Inflection point), meet condition g ' (x, y) gm(x, y) < 0.G (s) is one-dimensional intensity profile, g ' in figure in attached drawing 2 It (s) is the first derivative curve of one-dimensional intensity profile, g " (s) is the Second derivative curves of one-dimensional intensity profile.Single order, second order are led Number can indicate picture edge characteristic, but first derivative has the advantages that calculating speed is fast, anti-noise ability is strong, use in the present invention First derivative is as the foundation for judging edge.
The curve g (s) that attached drawing 2 is shown indicates initial data, can be assumed that step edge model is ku (x)+h by the figure, Wherein k is unknown gradient magnitude, and h indicates the gray values of background image, and u (x) is intensity profile curvilinear equation.It is mentioned at edge Taking using pretreated purpose is edge model g (s) after all handling all possible marginal position close to attached drawing 2, It is the processing requirement of step 1. in method flow.Image preprocessing is completed by gaussian filtering, and the object handled includes:Not really Determine blurred picture, the non-step edge model of types noise interference image, different reasons and degree.The Gaussian Blur of two dimensional image Core is defined as follows:
Unknown variable dimension information therein is curve variances sigma parameter.To be adapted to different types of image, guarantee can be with It solves the problems, such as to encounter in attached drawing 3, the filtering of variable dimension image Fuzzy smooth is used to do the preprocessing means of image.It needs to solve Certainly be when meeting partial region marginal point performance, other part marginal point is detected non-single pixel wide boundary point.
2. single order scale Gaussian kernel derivation Image edge gradient
After image pretreatment operation, the definition at image grayscale value mutation, while edge line are present according to marginal point It is also at the crestal line (ridge) of image first derivative, as shown in Fig. 4.Crestal line is the part of adjacent continuous in gradient image The set of maximum, while being also the place of boundary curve.
When generating, will cause obscurity boundary due to various reasons, (such as stationary lens reflect the difference of light, are non-flat image Row light is fuzzy etc. in boundary formation shade, edge itself transition) or noise signal (such as Gaussian noise) is introduced, the present invention The above problem can be overcome to obtain single pixel wide marginal point.Setting image I (x, y) obtains boundary point after being performed edge extraction operation Error rate is αI, image size is n=w × h, then the probability of single-point detection mistake is αp=1- (1- αI)1/n;Wherein αIRange exists Between 0 to 1.0.When calculating image first derivative, the gradient magnitude first ensured that meets the error rate less than setting value αp.Image first derivative is obtained by target nuclear convolution image space, using the substep characteristic of convolution, there is following equation:
The gradient magnitude of each point is
If image I (x, y) only has Gaussian noise and noise variance signal is sn, the positive section of function U expression Gaussian function Semi-function, partial derivative expression formula are:
Wherein the relationship of picture signal variance and filtering signal variance is s=| | G ' (x, y, σ) | |2sn, function f is differential Homeomorphic Maps (diffeomorphism), and have V=f (U), then the partial derivative of function V is:
Constructed fuction f (u)=u2, combine (2) formula and (3) formula, obtain following formula:
The gradient of each axis in convolution (1), and function (4) are substituted into, there is following expression:
(5) formula of solution, obtainsV ∈ [0, ∞).Guarantee that mistake occurs for the marginal position of each point Probability be no more than αp, Integral Processing is done to probability density function (5) formula and obtains probability value.Key parameter variable is set as c, is had Following expression:
The L of Gaussian function first derivative2Distance is:In conjunction with above-mentioned associated expression, The expression formula of parameter c is:
Wherein the variable of formula (7) is σ, is scale variable, other variables are global setup parameters.It can by (5) (6) two formula , variable metric algorithm key is so that the error rate of each point gradient magnitude is lower than setting value αp, that is, meet equation:M(x,y,σ) ≥c(σ)。
3. adaptive high-low threshold value calculates
The present invention is applied to the edge extracting and choosing principles of chain type threshold value in edge candidate point screening process, realizes picture Plain grade boundary position extracts, i.e., step is 3. in process.The present invention sets high-low threshold value using two ways:External parameter input and Adaptive threshold calculates.Image gradient information synthesis histogram curve there are an apparent peak points, and peak point it The numerical value of histogram is sharply reduced until dropping to zero afterwards.
The invention discloses a kind of simple and quick lookup high-low threshold value methods.The peak point of histogram curve is found first (i, Hi), it is in addition that non-zero accumulated value coordinate points are (j, H in the last one histogramj) (j≤255 0≤i <) and 0≤Hj< Hi < 1.0), above-mentioned two o'clock is connected, straight line ax+by+c=0 is obtained.Histogram curve coordinate points are searched between i to j To the maximum distance position of straight line, that is, meet dmax=arg maxk|ak+bHk+c|.This coordinate (k, Hk) abscissa be First threshold value Tlow=k.Then from this point, until linear end point (j, Hj) λ=0 α x+ β y+ in alignment is reconnected, On section k to the j of histogram curve, curve is searched to the maximum distance position of straight line (α, β, λ), equally meets Dmax=arg maxt|αt+βHt+λ|.This coordinate (t, Ht) abscissa be labeled as second threshold value Thigh=t.The simple table of calculation Now as shown in Fig. 5.
4. approximate gradient direction calculating and the selection of local maximum central value
After obtaining gradient image, for convenience of and be quickly found out the single pixel wide position of crestal line, in conjunction with the gradient of pixel 4. directional information executes local maximum central value selection operation, as flow chart step to gradient image.Any location of pixels Gradient direction is θ=tan-1(fy/fx), the tangent tendency direction with crestal line.Using any location of pixels as origin, a phase is established To coordinate, taking eight neighborhood pixel around the point is that local maximum central value selects data sample, obtains neighborhood according to gradient direction Comparison result, determine whether current pixel position is boundary point position candidate.
During edge extracting, non-maxima suppression is the effective means of fast selecting local maximum.Be first by Gradient direction (0 °~180 °), for step-length, is divided into several regions, as shown in Fig. 6 (a) with 22.5 °.Wherein A and A ' the two angle Complementation is considered as same group.The present invention provides a kind of Fast Field direction estimation algorithms, succinctly easily judge current point ladder Spend direction of the direction in eight neighborhood direction.If current point p0Gradient direction θ beWherein variable is as respective Gradient derivative numerical value, and angular range is set between 0 ° to 90 °, i.e., only considers that parameter is the state of positive value.When θ is less than 22.5 ° When, ny< nxTan (22.5 °), gradient direction are located at the A range of Fig. 6 (a), then p0Eight neighborhood direction be Fig. 6 (b) in GR;When θ is greater than 67.5 °, ny> nxTan (67.5 °), gradient direction are located at the C range of Fig. 6 (a), then p0Eight neighborhood side To for the G in Fig. 6 (b)T;When θ range is between 22.5 ° and 67.5 °, ny≥nxTan (22.5 °) and ny≤nxTan (67.5 °), Gradient direction is located at the D range of Fig. 6 (a), then p0Eight neighborhood direction be Fig. 6 (b) in GTR.If p0The gradient direction G of point0 It falls within the scope of the A of Fig. 6 (a), then by the G in eight neighborhood directionRWith GLTwo complementary directions are respectively labeled as G+And G-.Part The judgment criteria of maximum is:G0> G+And G0≥G-Either G0≥G+And G0> G-, i.e. current point p0It is a partial gradient width It is worth maximum value position.In multilevel iudge, if two comparison symbols be all ">" number, then at equal gradient magnitude, it may appear that do not have There is the case where extreme value;If be all " >=" number, the equal position of all amplitudes can all be confirmed to be extreme value.
5. pixel boundary point determines selection
Whether the extreme value of partial gradient amplitude is marginal point, needs to judge in conjunction with specific threshold, big Mr. Yu's given threshold value Label be 5. small Mr. Yu's given threshold value is determined as noise spot or background dot, i.e. flow chart step.The dual threashold of Canny Value setting (Tlow, Thigh) be used in the present invention.As local extremum G0Higher than ThighWhen, point p0It is marginal point;G0Lower than threshold value TlowExpression current point is non-boundary point attribute;Work as G0When between high-low threshold value, chain effect is had an effect, i.e. p0The eight of point There are boundary points in neighborhood, then boundary point is confirmed as in current location.
6. calculating the marginal position of sub-pixel precision
In being normally applied, the boundary point position precision of Pixel-level is able to satisfy demand, but needs in some applications higher Edge definition position, i.e. the step of sub-pixel edge position, flow chart 6..Using based on Steger curved surface fitting method Hessian matrix method seeks the sub-pixel location of marginal point, executes in surface fitting in the zonule of pixel edge point Interpolation algorithm f (r, c)=k0+k1r+k2c+k3r2+k4rc+k5c2;Single order is sought to each unknown number of surface equation and second order is led Number, is combined into Hessian matrix;The characteristic value and respective feature vector of Hessian matrix are solved, wherein maximum absolute feature The corresponding feature vector of value is the normal direction (n of marginal pointx,ny);Utilize Taylor's exhibition of normal direction and surface equation It opens, calculates the sub-pixel location of marginal point.The matrix expression of surface equation coefficient is as follows.
7. same alike result boundary point is linked in sequence
Until now, the marginal information detected is discrete, unordered, isolated point, but many later period applications need Be to have successional boundary point set (curve), flow chart step is 7..Marginal point is connected into curve, constitutes one group of oriented company The set of continuous point.It should be noted that the contour connection principle to be kept is selection recently and to the greatest extent may be used in edge connection procedure The tendency of straight line or smooth curve can be formed.Two curves that also avoid the formation of interconnection simultaneously, there is Wave curved And can only existence anduniquess a curve.
The available condition of edge connection is the edge point position and this eight neighborhood boundary point presence or absence of image space.It is bent Line starting point is searched for since the upper left corner, detects that first marginal point is defined as starting position.The order in the point search direction Preferentially to search positive direction (i.e. such as the G of attached drawing 7R, GB, GL, GT) on whether have the boundary point of the condition of satisfaction, otherwise search folk prescription To (other directions in attached drawing 7).In similar direction (positive direction, folk prescription to), candidate point select according to time counterclockwise Sequence.If P0It is current point, { Pi}I=R, B, T, BR, RTIt is candidate point, the subpixel coordinates of each pointAnd gradient directionFor known conditions.Give an evaluation functionSelect score value minimum Neighborhood point be considered as next consecutive points.Current point is changed and replaced to circulation, until encountering non-edge point or other edges song Marginal point on line just terminates the search of current curves.Opposite direction is looked into after the completion of front direction search, then since the origin of curve It looks for, until terminal.
In order to verify the validity of published method of the present invention, distribution uses very noisy (referring to 8 left part of attached drawing) and mould The middle section of paste image (referring to 9 left part of attached drawing) progress edge extracting test, attached drawing 8 and attached drawing 9 is traditional edge Detection as a result, right part be testing result of the present invention, it can be seen that method disclosed by the invention can be in very noisy and mould Edge feature is steadily detected in paste image.Attached drawing 10 is that the edge detection results that method of the invention obtains and Germany are commercialized The contrast effect for the edge detection results that machine vision software obtains, "+" is the edge that detects of the present invention as a result, " ο " is in figure External business software testing result, as can be seen from the figure the method in the present invention can detect the edge letter of image more than enoughly Breath.
The invention proposes a kind of methods for steadily extracting image sub-pixel edge feature in harsh environment, using certainly Adapt to high-low threshold value calculation method, after obtaining gradient image, for convenience of and be quickly found out the single pixel wide position of crestal line, in conjunction with The Gradient direction information of pixel executes local maximum central value selection operation to gradient image, is original with any location of pixels Point, establishes relative coordinate, and taking eight neighborhood pixel around the point is that local maximum central value selects data sample, according to gradient direction The comparison result of neighborhood is obtained, determines whether current pixel position is boundary point position candidate.The extreme value of partial gradient amplitude is No is marginal point, needs to judge in conjunction with specific threshold, the label of big Mr. Yu's given threshold value is small Mr. Yu's given threshold value It is determined as noise spot or background dot.The Asia of marginal point is sought using the Hessian matrix method based on Steger curved surface fitting method Location of pixels.Marginal point will finally be connected into curve, constitute the set of one group of oriented continuity point.It realizes in very noisy and mould Paste the orderly edge feature information that sub-pixel precision is extracted in image.The method of the present invention has fabulous real-time, can apply Into the real-time application of NI Vision Builder for Automated Inspection.
The above content is a further detailed description of the present invention in conjunction with specific preferred embodiments, and it cannot be said that Specific implementation of the invention is only limited to these instructions.For those of ordinary skill in the art to which the present invention belongs, exist Under the premise of not departing from present inventive concept, a number of simple deductions or replacements can also be made, all shall be regarded as belonging to of the invention Protection scope.

Claims (7)

1. a kind of image sub-pixel edge extracting method with extensive adaptability, it is characterised in that:The method includes following Step:
Step 1:It is filtered using variable dimension image Fuzzy smooth to image preprocessing;
Step 2:First derivative is calculated to pretreated image, it is small that the gradient magnitude first ensured that meets the error rate In setting value αp, image first derivative obtained by target nuclear convolution image space;The edge line of image is in image first derivative Crestal line at, wherein crestal line is the set of the local maximum of adjacent continuous in gradient image;
Step 3:It is applied to the edge extracting and choosing principles of high-low threshold value in edge candidate point screening process, realizes Pixel-level Boundary position extracts, and high-low threshold value is obtained using two ways:External parameter input or adaptive threshold calculate;
Step 4:After obtaining gradient image, for convenience of and be quickly found out the single pixel wide position of crestal line, in conjunction with the ladder of pixel It spends directional information and local maximum central value selection operation is executed to gradient image;
Step 5:Whether the extreme value of partial gradient amplitude is marginal point, needs to judge in conjunction with specific threshold, and big Mr. Yu gives threshold The label of value is that small Mr. Yu's given threshold value is determined as noise spot or background dot;
Step 6:Calculate the marginal position of sub-pixel precision;
Step 7:Marginal point is connected into curve, constitutes the set of one group of oriented continuity point.
2. according to the method described in claim 1, it is characterized in that:In the step 2, mentioned if image I (x, y) is performed edge It is α that boundary point error rate is obtained after extract operationI, image size is n=w × h, then the probability of single-point detection mistake is αp=1- (1- αI)1/n, wherein αIRange is between 0 to 1.0, and image I (x, y) only has Gaussian noise and noise variance signal is sn;Utilize convolution Substep characteristic has following equation:
The gradient magnitude for obtaining each point isSo that the error rate of each point gradient magnitude is lower than setting value αp, that is, meet equation:M (x, y, σ) >=c (σ), wherein
Variable in above formula is scale variable σ, and other variables are global setup parameter.
3. according to the method described in claim 1, it is characterized in that:High-low threshold value is calculated in the step 3 is specially:It looks for first To peak point (i, the H of histogram curvei), non-zero accumulated value coordinate points are (j, H in the last one histogramj), 0≤i < j≤ 255 and 0≤Hj< Hi< 1.0 connects above-mentioned two o'clock, obtains straight line ax+by+c=0;Histogram is searched between i to j Maximum distance position d of the figure curvilinear coordinate point to straight linemax, that is, meet dmax=arg maxk|ak+bHk+ c |, the coordinate (k, Hk) abscissa be first threshold value Tlow=k;Then from this point, until linear end point (j, Hj) reconnect into one λ=0 straight line α x+ β y+, on section k to the j of histogram curve, the maximum distance position of lookup curve to straight line (α, β, λ) Dmax, equally meet Dmax=arg maxt|αt+βHt+ λ |, this coordinate (t, Ht) abscissa be labeled as second threshold value Thigh =t.
4. according to the method described in claim 1, it is characterized in that:The step 4 is specially:The gradient side of any location of pixels To for θ=tan-1(fy/fx), it is tangential on the tendency direction of crestal line;Using any location of pixels as origin, an opposite seat is established Mark, taking eight neighborhood pixel around the point is that local maximum central value selects data sample, obtains the ratio of neighborhood according to gradient direction Compared with as a result, determining whether current pixel position is boundary point position candidate.
5. according to the method described in claim 4, it is characterized in that:The step 5 sets (T using the dual threshold of Cannylow, Thigh);As local extremum G0Higher than ThighWhen, current point p0It is marginal point;G0Lower than threshold value TlowExpression current point is non-boundary point Attribute;Work as G0When between high-low threshold value, chain effect is had an effect, i.e. point p0Eight neighborhood in there are boundary points, then currently Location confirmation is boundary point.
6. according to the method described in claim 1, it is characterized in that:The step 6 is using based on Steger curved surface fitting method Hessian matrix method seek the sub-pixel location of marginal point, surface fitting is executed in the zonule of pixel edge point Interpolation algorithm f (r, c)=k0+k1r+k2c+k3r2+k4rc+k5c2;Single order is sought to each unknown number of surface equation and second order is led Number, is combined into Hessian matrix;The characteristic value and respective feature vector of Hessian matrix are solved, wherein maximum absolute feature The corresponding feature vector of value is the normal direction (n of marginal pointx,ny);Utilize Taylor's exhibition of normal direction and surface equation It opens, calculates the sub-pixel location of marginal point.
7. according to the method described in claim 1, it is characterized in that:It is needed to pay attention in the edge connection procedure of the step 7 The contour connection principle to be kept is the tendency that selection forms straight line or smooth curve recently and as far as possible, while also to be kept away Two curves for exempting to be formed interconnection, have for Wave curved and can only existence anduniquess a curve.
CN201610209158.9A 2016-04-06 2016-04-06 A kind of image sub-pixel edge extracting method with extensive adaptability Active CN105913415B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610209158.9A CN105913415B (en) 2016-04-06 2016-04-06 A kind of image sub-pixel edge extracting method with extensive adaptability

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610209158.9A CN105913415B (en) 2016-04-06 2016-04-06 A kind of image sub-pixel edge extracting method with extensive adaptability

Publications (2)

Publication Number Publication Date
CN105913415A CN105913415A (en) 2016-08-31
CN105913415B true CN105913415B (en) 2018-11-30

Family

ID=56744630

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610209158.9A Active CN105913415B (en) 2016-04-06 2016-04-06 A kind of image sub-pixel edge extracting method with extensive adaptability

Country Status (1)

Country Link
CN (1) CN105913415B (en)

Families Citing this family (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107967690B (en) * 2016-10-19 2020-06-09 中国石油天然气股份有限公司 Self-adaptive ferrographic abrasive particle image binarization processing method
JP6842329B2 (en) * 2017-03-24 2021-03-17 株式会社Screenホールディングス Image processing method and image processing equipment
CN109102516A (en) * 2017-06-20 2018-12-28 成都飞机工业(集团)有限责任公司 A kind of bend pipe center line extraction method of robust
CN107507208B (en) * 2017-07-12 2020-04-10 天津大学 Image feature point extraction method based on curvature estimation on contour
CN108389215B (en) * 2018-03-15 2021-04-23 京东方科技集团股份有限公司 Edge detection method and device, computer storage medium and terminal
CN109325930B (en) * 2018-09-12 2021-09-28 苏州优纳科技有限公司 Boundary defect detection method, device and detection equipment
CN109741356B (en) * 2019-01-10 2020-08-21 哈尔滨工业大学(深圳) Sub-pixel edge detection method and system
CN110147716B (en) * 2019-04-02 2021-02-19 北京理工雷科电子信息技术有限公司 SAR image internal wave region detection method based on combination of frequency domain and airspace
CN111539907B (en) * 2019-07-25 2023-09-12 毫末智行科技有限公司 Image processing method and device for target detection
CN111640154B (en) * 2020-05-24 2022-04-05 西安交通大学 Vertical needle micro-plane sub-pixel level positioning method based on micro-vision
CN111685788B (en) * 2020-06-09 2022-07-29 广东明峰医疗科技有限公司 Method for improving signal-to-noise ratio of PET
CN112816120B (en) * 2021-01-08 2022-11-18 中铁大桥科学研究院有限公司 Cable force measuring method
CN112792450B (en) * 2021-02-01 2021-12-07 深圳大学 Optical fiber automatic focusing method and automatic focusing system for laser processing
CN113658153B (en) * 2021-08-24 2024-01-26 凌云光技术股份有限公司 Contour data feature point detection method and device
CN113643272A (en) * 2021-08-24 2021-11-12 凌云光技术股份有限公司 Target positioning modeling method
CN114187267B (en) * 2021-12-13 2023-07-21 沭阳县苏鑫冲压件有限公司 Stamping part defect detection method based on machine vision
CN114677303B (en) * 2022-03-28 2024-02-02 中国人民解放军国防科技大学 Sub-pixel edge detection method based on integrated edge data enhancement
CN116385448B (en) * 2023-06-07 2023-08-25 深圳市华伟精密陶瓷有限公司 Alumina ceramic surface machining defect detection method based on machine vision
CN117078678B (en) * 2023-10-16 2024-01-26 厘壮信息科技(苏州)有限公司 Waste silicon wafer shape detection method based on image recognition
CN117455800B (en) * 2023-12-22 2024-03-15 肥城新查庄地质勘查有限公司 Coal mine drilling positioning method based on computer vision

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6408109B1 (en) * 1996-10-07 2002-06-18 Cognex Corporation Apparatus and method for detecting and sub-pixel location of edges in a digital image
US7430303B2 (en) * 2002-03-29 2008-09-30 Lockheed Martin Corporation Target detection method and system
CN104268857A (en) * 2014-09-16 2015-01-07 湖南大学 Rapid sub pixel edge detection and locating method based on machine vision
CN104680506A (en) * 2013-11-28 2015-06-03 方正国际软件(北京)有限公司 Method and system for detecting boundary line along different directions
CN105354843A (en) * 2015-10-30 2016-02-24 北京奇艺世纪科技有限公司 Image boundary extraction method and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100886611B1 (en) * 2007-08-14 2009-03-05 한국전자통신연구원 Method and apparatus for detecting line segment by incremental pixel extension in an image

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6408109B1 (en) * 1996-10-07 2002-06-18 Cognex Corporation Apparatus and method for detecting and sub-pixel location of edges in a digital image
US7430303B2 (en) * 2002-03-29 2008-09-30 Lockheed Martin Corporation Target detection method and system
CN104680506A (en) * 2013-11-28 2015-06-03 方正国际软件(北京)有限公司 Method and system for detecting boundary line along different directions
CN104268857A (en) * 2014-09-16 2015-01-07 湖南大学 Rapid sub pixel edge detection and locating method based on machine vision
CN105354843A (en) * 2015-10-30 2016-02-24 北京奇艺世纪科技有限公司 Image boundary extraction method and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
图像的模糊边缘检测算法;孙根云 等;《光电工程》;20070731;第34卷(第7期);全文 *

Also Published As

Publication number Publication date
CN105913415A (en) 2016-08-31

Similar Documents

Publication Publication Date Title
CN105913415B (en) A kind of image sub-pixel edge extracting method with extensive adaptability
CN107808378B (en) Method for detecting potential defects of complex-structure casting based on vertical longitudinal and transverse line profile features
CN110223296B (en) Deformed steel bar surface defect detection method and system based on machine vision
CN102496161B (en) Method for extracting contour of image of printed circuit board (PCB)
CN111696107B (en) Molten pool contour image extraction method for realizing closed connected domain
CN103345755B (en) A kind of Chessboard angular point sub-pixel extraction based on Harris operator
JP5699788B2 (en) Screen area detection method and system
CN110930390B (en) Chip pin missing detection method based on semi-supervised deep learning
JP6899189B2 (en) Systems and methods for efficiently scoring probes in images with a vision system
CN108007388A (en) A kind of turntable angle high precision online measuring method based on machine vision
CN112734761B (en) Industrial product image boundary contour extraction method
CN105741281B (en) Method for detecting image edge based on neighborhood dispersion
CN111539927B (en) Detection method of automobile plastic assembly fastening buckle missing detection device
CN115100191A (en) Metal casting defect identification method based on industrial detection
CN109030502A (en) A kind of welding point defect detection system based on machine vision
CN110866915A (en) Circular inkstone quality detection method based on metric learning
CN110298344A (en) A kind of positioning of instrument knob and detection method based on machine vision
CN115096206A (en) Part size high-precision measurement method based on machine vision
CN115018846A (en) AI intelligent camera-based multi-target crack defect detection method and device
CN109389165A (en) Oil level gauge for transformer recognition methods based on crusing robot
CN114331879A (en) Visible light and infrared image registration method for equalized second-order gradient histogram descriptor
CN114140416A (en) Glass edge detection method and system based on machine vision
CN109544513A (en) A kind of steel pipe end surface defect extraction knowledge method for distinguishing
CN115689995A (en) Circular hole edge sub-pixel level extraction method under complex illumination background condition
CN114170202A (en) Weld segmentation and milling discrimination method and device based on area array structured light 3D vision

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20160819

Address after: The 215200 West Jiangsu city of Suzhou province Wujiang economic and Technological Development Zone No. 666

Applicant after: Suzhou Bozhong Precision Industry Technology Co., Ltd.

Address before: 518000 building C, Innovation Research Institute, Nanshan District hi tech Zone, Guangdong, Shenzhen 1-6

Applicant before: Wu Xiaojun

C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 215200 No. 666 Hu Xin Road, Wujiang economic and Technological Development Zone, Suzhou, Jiangsu

Applicant after: Bo Seiko Polytron Technologies Inc

Address before: 215200 No. 666 Hu Xin Road, Wujiang economic and Technological Development Zone, Suzhou, Jiangsu

Applicant before: Suzhou Bozhong Precision Industry Technology Co., Ltd.

GR01 Patent grant
GR01 Patent grant