CN109658391A - A kind of radius of circle measurement method being fitted based on contour mergence and convex closure - Google Patents
A kind of radius of circle measurement method being fitted based on contour mergence and convex closure Download PDFInfo
- Publication number
- CN109658391A CN109658391A CN201811472707.7A CN201811472707A CN109658391A CN 109658391 A CN109658391 A CN 109658391A CN 201811472707 A CN201811472707 A CN 201811472707A CN 109658391 A CN109658391 A CN 109658391A
- Authority
- CN
- China
- Prior art keywords
- circle
- image
- radius
- point
- contour
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01B—MEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
- G01B11/00—Measuring arrangements characterised by the use of optical techniques
- G01B11/08—Measuring arrangements characterised by the use of optical techniques for measuring diameters
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/136—Segmentation; Edge detection involving thresholding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/187—Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/60—Analysis of geometric attributes
- G06T7/66—Analysis of geometric attributes of image moments or centre of gravity
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10024—Color image
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30108—Industrial image inspection
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Theoretical Computer Science (AREA)
- Geometry (AREA)
- Quality & Reliability (AREA)
- Image Analysis (AREA)
Abstract
A kind of radius of circle measurement method being fitted based on contour mergence and convex closure of the invention, has robustness for middle part division, partially visible endless full-circle spray pattern.This method is capable of detecting when one or more round pools in physical material surface.The pixel radius for the round pool being detected can be accurately calculated.The alternative traditional artificial physical material surface round pool detection method of this method, can improve efficiency and save labour cost.
Description
Technical field
The invention belongs to technical field of machine vision, are related to a kind of radius of circle measurement being fitted based on contour mergence and convex closure
Method.
Background technique
In physical material field, one or more round pools, foundation are pounded out with metal ball often through on physical material surface
The radius size of round pool can effectively test out the performances such as the hardness of material.Currently, for physical material surface round pool radius
Measurement has relied on manual measurement.Circular radius can be measured really by traditional manual measurement method, but in section
Today of skill development, machine can be allowed to replace manual measurement completely.Its method general idea is pounded out on physical material surface
After round pool, the round pool image of amplification is obtained under the illumination of setting and geometrical condition, is positioned and is divided by image processing techniques
Cyclotomy hole, obtains the round pool radius as unit of pixel, by the calibration to imaging system, round pool submillimeter level is calculated
Radius.The method of machine measurement is higher compared to manual measurement accuracy, and speed is faster, more stable, and can be with 24 hours not
It operates intermittently.Therefore, the round pool of physics material surface is detected using the method for machine vision and measures its radius seems outstanding
It is important.
There are following four difficult points when being divided using the method for machine vision and measuring the radius of physical material surface circular:
First, physical material surface will usually do purified treatment before measuring, cause its surface to have complex texture, these textures are to circle
Detection bring very big interference, if these textures are not segmented correctly, it is easy to be taken as round marginal point and detect
One false circle.Second, when physical material surface there are multiple bowlders, needs all to detected all circles and calculate its radius.The
Three, since image-forming condition is limited, if some circle is imperfect, half round block divided by two is formed, and existing method is generally difficult to
It is classified as the same circle processing, and the two semicircles circle different as two can generally be handled, it is clear that will cause mistake
Measurement.4th, if only some circle is in the picture, existing method is split and measures to the circle.
Common circle detection method mainly has improved Hough transform method.1991, because of one of DanaH.Ballard
Journal article " Generalizing the Hough transform to detect arbitrary shapes ", Hough become
It changes and is introduced in computer vision community, the method for Hough transform is increasingly becoming the circular main stream approach of detection.Hereafter it also emerges
It is many classical based on the improved loop truss algorithm of Hough transform.Hough transform has the excellent of robustness to imperfect edge
Point, however this advantage, in the wrong identification that sometimes but will lead to target, during practical loop truss, false detection rate is obtained not
To control, and Hough transform calculation amount is often too big, feasible for the detection of single picture, to batch detection, detection effect
Rate cannot be guaranteed.In addition, the circle detection method generated there are many more different according to application scenarios, Chinese patent
201310159686.4 disclose a kind of circle detection method based on gradient direction segmentation, although this method can detect multiple circles
Situation, but method is for that right-on can not detect round pool containing textured physical material image.Chinese patent
201410111415.6 disclose a kind of circle detection method based on edge detection and matched curve cluster, and this method can be fine
Round position is oriented, but this method cannot accurately measure round radius.Chinese patent 201510478231.8 discloses one
The circle detection method kind to be developed based on adaptability difference of Gaussian, this method suitable for detect physics material surface contain one it is round
Situation, containing multiple circles but for physical material surface cannot be detected simultaneously by.
Summary of the invention
The object of the present invention is to provide a kind of radius of circle measurement method being fitted based on contour mergence and convex closure, alternative biographies
The artificial physical material surface round pool detection method of system, can improve efficiency and save labour cost.
The present invention provides a kind of radius of circle measurement method being fitted based on contour mergence and convex closure, includes the following steps:
Step 1: the image of round pool is contained on acquisition physical material surface, and is converted into gray level image;
Step 2: gray level image is subjected to texture in conjunction with local variance, gradient intensity and comentropy by Gabor transformation
Enhancing, high intensity region are background, and hypo-intense region is possible target;
Step 3: the image that step 2 is obtained carries out Threshold segmentation, removes background texture in gray level image;
Step 4: the image that step 3 is obtained carries out closing operation of mathematical morphology operation, obtains multiple connection target areas;
Step 5: profile is extracted to each connection target area that step 4 obtains;
Step 6: each of image that traversal step 5 obtains profile, tentatively exclusion non-circular profile;
Step 7: whether each circle that judgment step 6 obtains intersects with other circles, merges if intersecting and belongs to the same circle
Profile;
Step 8: extraction step 6 obtains the convex closure for the border circular areas that each merging or individual circular contour surrounds;
Step 9: obtaining the convex closure in the merger region of step 8 extraction, seek the common point of convex closure point and region contour;
Step 10: using fitting circle is put obtained in step 9, round pool and its radius are marked on original image;
Step 11: repetition step 7,8,9,10, until all profiles of traversal step 7;
Step 12: output final result.
In the radius of circle measurement method of the invention being fitted based on contour mergence and convex closure, the step 1 includes:
Step 1.1: containing the digital picture of round pool with industrial camera shooting physics material surface;
Step 1.2: picture is transmitted in computer;
Step 1.3: gray level image is converted by color image, color image switchs to gray level image and meets following equation:
Gray=R × 0.299+G × 0.587+B × 0.114
Wherein, R, G, B are respectively the red of pixel in color image, green, blue component, and Gary is to be transformed into gray scale sky
Between pixel value.
In the radius of circle measurement method of the invention being fitted based on contour mergence and convex closure, the step 2 includes:
Step 2.1: with 45 ° of directions, 5 × 5 template size does Gabor transformation to the image that step 1 obtains, wherein filtering
Device is determined by following formula:
Wherein, x '=xcos θ+ysin θ, y '=- xsin θ+ycos θ, λ indicates sinusoidal wavelength, its value is with pixel
It is specified for unit;The discovery angle direction of θ expression parallel stripes;Indicate phase difference;The variance parameter of σ expression Gauss;γ is empty
Between aspect rate;
Step 2.2: taking absolute value to the image that step 2.1 obtains;
Step 2.3: in conjunction with local variance, gradient intensity and comentropy, carrying out texture enhancing, enhance transformation for mula are as follows:
Ie=λ1IGabor+λ2IVar+λ3IEntropy+λ4IEdge
λ1,λ2,λ3,λ4It for coefficient, rule of thumb sets, IGabor、IVar、IEntropy、IEdgeRespectively Gabor filtering image,
Variance image, the equal gradient image of entropy image peace.
In the radius of circle measurement method of the invention being fitted based on contour mergence and convex closure, the step 3 includes:
Step 3.1: calculating step 2 and obtain the histogram of image;
Step 3.2: 0 is being calculated in histogram to the peak value between threshold value as adaptive threshold;
Step 3.3: on adaptive threshold plus an offset is as new threshold value;
Step 3.4: the new threshold value of application carries out Threshold segmentation to the image that step 2 obtains.
In the radius of circle measurement method of the invention being fitted based on contour mergence and convex closure, the step 4 specifically:
After Threshold segmentation, in the background area of high gray scale with the presence of some low ash degree zonule, white back is shown as
Black holes hole in scape, since target is black, so removing these black holes holes using the closed operation in mathematical morphology.
In the radius of circle measurement method of the invention being fitted based on contour mergence and convex closure, the step 5 specifically:
After step 4 processing, multiple point region i.e. connected regions to communicate with each other are formd, the region that black color dots are constituted is
Round pool region, inside round pool region, pixel value is black, and eight neighborhood point is also black, on region contour point, neighborhood
Point, which has black color dots also, white point, extracts the profile of target area accordingly.
In the radius of circle measurement method of the invention being fitted based on contour mergence and convex closure, the step 6 includes:
Step 6.1: calculating the area S of profile;
Step 6.2: calculating the length-width ratio K of profile minimum circumscribed rectangle;
Step 6.3: if meeting condition 1, condition 2, one of condition 3 then excludes the profile;Condition 1 is that S is less than minimum
The elemental area of round pool, condition 2 are the elemental area that S is greater than maximum round pool, and condition 3 is less than for K
In the radius of circle measurement method of the invention being fitted based on contour mergence and convex closure, the step 7 includes:
Step 7.1: making a boundary rectangle in each region in the image obtained to step 6;
Step 7.2: judging the midpoint of boundary rectangle longer sidesIt whether is point of contact, if meeting 1 He of condition simultaneously
Condition 2 is recorded as point of contact;
Condition 1 isWherein:
I (x, y) is pixel value of the obtained image of step 3 at (x, y);
Condition 2 is Indicate midpointWith profile center of gravityDistance:
M-th point on i-th of profile in image is obtained for step 6, n is profile point number;
Indicate midpointWith profile minimum circumscribed rectangle centerDistance,
Step 7.3: obtaining a circle from point of contact along the direction moving distance L at point of contact to minimum circumscribed rectangle center
The heartRadius R is seti=L, L are the 1/2 of long side length;
Step 7.4: in a series of circles obtained in step 7.3, judging whether each circle intersects with other circles;
The condition for judging whether two circles intersect is: setting round Cp,CqThe center of circle be respectively P (xp,yp),Q(xq,yq), radius
Respectively Rp,Rq, circle Cp,CqThe distance between the center of circle be PQ,If Rp+Rq
> | PQ |, then justify CpWith circle CqIt crosses one another;
Step 7.5: the circle for being associated with cross section is a circle, and merging round method is:
If Cp,Cq,CoThe center of circle be respectively P (xp,yp),Q(xq,yq),O(xo,yo), radius is respectively Rp,Rq,Ro, then it
Triadic relation may be expressed as:
Wherein| OP |=R0-Rp, respectively indicate the distance between center of circle;
Step 7.6: after two circles merge, corresponding image-region is then labeled as the same area, even if two regions not phase
Even.To all subregions obtained in step 6, step 7.1 is carried out to the operation of step 7.6 with other subregions, is obtained multiple
Merger or independent border circular areas;
In the radius of circle measurement method of the invention being fitted based on contour mergence and convex closure, the step 9 includes:
Step 9.1: finding out in merger profile at a distance of maximum two points;
Step 9.2: with the two points for starting point, finding out convex closure point according to volume pack or Graham-Scan algorithm;
Step 9.3: obtaining the common point of convex closure profile and region contour, the as point on the circular arc of merger.
In the radius of circle measurement method of the invention being fitted based on contour mergence and convex closure, the step 10 specifically:
3 points determine a circle in plane, the multiple merger arc points obtained using step 9, quasi- by least square method
It closes, central coordinate of circle and radius after finally being merged.
A kind of radius of circle measurement method being fitted based on contour mergence and convex closure of the invention, for middle part division, part
Visible endless full-circle spray pattern has robustness.This method is capable of detecting when one or more round pools in physical material surface.Energy
Enough accurately calculate the pixel radius for the round pool being detected.The alternative traditional artificial physical material surface round pool of this method
Detection method can improve efficiency and save labour cost.
Detailed description of the invention
Fig. 1 is a kind of flow chart of radius of circle measurement method being fitted based on contour mergence and convex closure of the invention;
Fig. 2 a is image to be detected that round pool is contained on the physical material surface of the present embodiment;
Fig. 2 b is through Gabor transformation and the enhanced image of texture;
Fig. 2 c is through Threshold segmentation treated image;
Fig. 2 d is the image after closing operation of mathematical morphology operates;
Fig. 2 e is the figure for screening the point of contact of circular arc portion of rear region minimum circumscribed rectangle and its long side and region contour
Picture;
Fig. 2 f is the image for screening the envelope circle of rear region;
Fig. 2 g shows the image for merging into the connected contour curve of same round pool;
After the merger that Fig. 2 h is, the image of the convex closure point of profile diagram 2g institute enclosing region;
Fig. 2 i is the circle according to made of convex closure point and the fitting of the common point of profile point, the image being superimposed upon on Fig. 2 d;
Fig. 2 j is circle made of final fitting, the image being superimposed upon on original image;
Fig. 3 is the flow chart for extracting circle point of contact in the present invention from round pool profile.
Specific embodiment
Below in conjunction with drawings and examples, the present invention is described further, input picture such as Fig. 2 a in the present embodiment
It is shown the image that physical material surface contains three round pools, a part of one of round pool is except image, and there are one circles
Existing defects on the circumference in hole.The method of the present embodiment executes process as shown in Figure 1, Fig. 2 a to Fig. 2 j is that this method handles image
Effect picture.
A kind of radius of circle measurement method being fitted based on contour mergence and convex closure of the invention, is included the following steps:
Step 1: the image of round pool is contained on acquisition physical material surface, and is converted into gray level image, and Fig. 2 a is physical material
Contain image to be detected of round pool in surface;Step 1 specifically includes:
Step 1.1: containing the digital picture of round pool with industrial camera shooting physics material surface;
Step 1.2: picture is transmitted in computer;
Step 1.3: gray level image is converted by color image, color image switchs to gray level image and meets following equation:
Gray=R × 0.299+G × 0.587+B × 0.114
Wherein, R, G, B are respectively the red of pixel in color image, green, blue component, and Gary is to be transformed into gray scale sky
Between pixel value.
Step 2: gray level image is subjected to texture in conjunction with local variance, gradient intensity and comentropy by Gabor transformation
Enhancing, high intensity region are background, and hypo-intense region is possible target;
For physical material in inspection or measurement, surface generally comprises more texture.The round pool table pounded out with metal ball
The typically no texture in face or its texture is too tiny to ignore.Round pool image also reflects identical situation.Typical round pool
Image is shown in Fig. 2 a.As seen from the figure, round pool outer portion has stronger oblique texture, and inside round pool, in addition to middle part caused by illumination
Outside bright wisp, gray scale is essentially identical.
In order to filter off background, round pool target is left, using Gabor transformation.Gabor transformation, also known as Short Time Fourier Transform,
Function can extract different scale, correlated characteristic on different directions.The biological effect of Gabor function and human eye is similar, so through
It is commonly used in texture analysis, and achieves preferable effect.
But due in image grain direction and scale it is unknown, it is possible to using other pixel local features.Such as side
Difference, comentropy, average gradient intensity etc..Wherein variance describes the size of grey scale change around pixel, it is clear that in round pool
Portion's variance is small, and variance is big outside round pool.Local entropy reflects intensity profile around pixel.Entropy is bigger, shows that distribution more disperses,
Entropy is smaller, shows that intensity profile is more single.Entropy inside round pool is small, and the entropy outside round pool is big.Gradient intensity reflects phase
Grey scale change size between adjoint point.Obviously, the average gradient intensity around round pool interior pixels point is small, round pool external pixels point week
The average gradient intensity enclosed is big.Through step 2, treated that image is as shown in Figure 2 b.
Step 2 specifically includes:
Step 2.1: with 45 ° of directions, 5 × 5 template size does Gabor transformation to the image that step 1 obtains, wherein filtering
Device is determined by following formula:
Wherein, x '=xcos θ+ysin θ, y '=- xsin θ+ycos θ, λ indicates sinusoidal wavelength, its value is with pixel
It is specified for unit;The discovery angle direction of θ expression parallel stripes;Indicate phase difference;The variance parameter of σ expression Gauss;γ is empty
Between aspect rate;
Step 2.2: taking absolute value to the image that step 2.1 obtains;
Step 2.3: in conjunction with local variance, gradient intensity and comentropy, carrying out texture enhancing, enhance transformation for mula are as follows:
Ie=λ1IGabor+λ2IVar+λ3IEntropy+λ4IEdge
λ1,λ2,λ3,λ4It for coefficient, rule of thumb sets, IGabor、IVar、IEntropy、IEdgeRespectively Gabor filtering image,
Variance image, the equal gradient image of entropy image peace.
Step 3: the image that step 2 is obtained carries out Threshold segmentation, removes background texture in gray level image;
It is handled in enhancing image by step 2, the gray scale in round pool region is low and concentrates, the gray scale Gao Erfen of background area
It dissipates, Threshold segmentation can be carried out.Pixel grey scale by grey scale pixel value lower than some threshold value T is set to 0, and the pixel higher than T is grey
Degree is set to 1.Then it is formed the bianry image of only 0 and 1 two kind of gray scale.
Wherein, the selection of threshold value is most important, carries out threshold value selection referring generally to grey level histogram.It is got in the value of histogram
Greatly, show have the pixel of corresponding gray scale more.Since the pixel Distribution value inside round pool is concentrated, in IeHistogram in, value
The corresponding gray scale of biggish point is usually round pool interior pixels gray scale.In consideration of it, Research on threshold selection of the invention is to look for first
Image I after to enhancingeGrey level histogram maximum value, on the basis of its corresponding gray value plus a positive offset amount as threshold
Value.The offset is related with round pool region average gray standard deviation, and offset is typically about equal to 1.25 times of standard deviation.Fig. 2 c is
Through Threshold segmentation treated image.
The step 3 includes:
Step 3.1: calculating step 2 and obtain the histogram of image;
Step 3.2: 0 is being calculated in histogram to the peak value between threshold value as adaptive threshold;
Step 3.3: on adaptive threshold plus 25 as new threshold value;
Step 3.4: the new threshold value of application carries out Threshold segmentation to the image that step 2 obtains.
Step 4: the image that step 3 is obtained carries out closing operation of mathematical morphology operation, obtains multiple connection target areas, described
Step 4 specifically:
Morphology, i.e. mathematical morphology (mathematical Morphology), are most widely used in image procossing
One of technology, be mainly used for extracting the picture content significant to expression and description region shape from image, make subsequent
Identification work can catch the shape feature of target object essence or most separating capacity the most, such as boundary and connected region.
Simultaneously as refinement, pixelation and the trimming technologies such as burr are also commonly applied in the pretreatment and post-processing of image, become image increasing
The strong supplement of strong technology.
After Threshold segmentation, in the background area of high gray scale with the presence of some low ash degree zonule, white back is shown as
Black holes hole in scape removes these black holes holes using the closed operation in mathematical morphology, and what setting closing operation of mathematical morphology operated covers
The size of template is 5, and shape is circle.Fig. 2 d is the image after closing operation of mathematical morphology operates.
Step 5: profile, the step 5 are extracted to each connection target area that step 4 obtains specifically:
After step 4 processing, multiple point region i.e. connected regions to communicate with each other are formd, the region that black color dots are constituted is
Round pool region, inside round pool region, pixel value is black, and eight neighborhood point is also black, on region contour point, neighborhood
Point, which has black color dots also, white point, extracts the profile of target area accordingly.The boundary rectangle in the region in Fig. 2 e is obtained to Fig. 2 d
The most compact boundary rectangle in the qualified region arrived, the center of circle of small circle are cutting for the circular arc portion of boundary rectangle long side and region contour
Point;
Step 6: each of image that traversal step 5 obtains profile, tentatively exclusion non-circular profile;
According to the target area profile of closure, its available boundary rectangle.Wherein the smallest boundary rectangle of area is known as
Most compact boundary rectangle.The area of the most compact boundary rectangle in target area cannot it is too small can not be too big.Its length-width ratio can not
Too small, otherwise subsequent thus obtained radius of circle will be unreasonable.According to these conditions, non-circular region is excluded.
The step 6 includes:
Step 6.1: calculating the area S of profile;
Step 6.2: calculating the length-width ratio K of profile minimum circumscribed rectangle;
Step 6.3: if meeting condition 1, condition 2, one of condition 3 then excludes the profile;Condition 1 is that S is less than minimum
The elemental area of round pool, condition 2 are the elemental area that S is greater than maximum round pool, and condition 3 is less than for K
Step 7: whether each circle that judgment step 6 obtains intersects with other circles, merges if intersecting and belongs to the same circle
Profile;
Either part is round or entire round, when be tangential on this midpoint of the circular arc all with its most compact boundary rectangle, and
Non- circular arc will not.If it is not a half partial arc, then the long side of circular arc and most compact boundary rectangle is tangential on side midpoint.But it is straight
It connects and judges tangent more complicated, we use according to whether the midpoint on side judges for the method for profile point.
According to the above observation, if as follows for the judgment method of arc profile: to first determine whether the most compact boundary rectangle of profile
Length-width ratio, if length-width ratio is close to 1, which is likely to be entire circle, then judge four sides of rectangle midpoint whether
For profile point.If being all, which is likely to be entire circle;Otherwise, judge whether long side midpoint is profile point, if
It is that then the corresponding contour segment of the long side is circular arc.
Point of contact coordinate is available by the above method.Be directed toward rectangular centre, according to the point of contact be long side half length and with
The vertical point in the point of contact, as centre point.
After connected region contours extract, the same round region is possible to be divided into difference due to Image Acquisition
Part, or only take round a part.Current existing circle detection method cannot automatically process these types of situation.Wheel
It is exactly in order to which the different piece merger that will belong to the same circle is a circle that exterior feature, which merges,.Its principle is two part circles, it is necessary to
There is cross section could merger.Fig. 2 f show the qualified region obtained according to step 6 most compact boundary rectangle and long side with
The point of contact of the circular arc portion of region contour, the envelope circle in the obtained qualification region.And belong to the different zones of same round pool,
Its envelope circle has cross section, needs further merger.
The step 7 specifically includes:
Step 7.1: making a boundary rectangle in each region in the image obtained to step 6;
Step 7.2: judging the midpoint of boundary rectangle longer sidesIt whether is point of contact, if meeting 1 He of condition simultaneously
Condition 2 is recorded as point of contact, as shown in Figure 3 to the flow chart at the contours extract point of contact in each region;
Condition 1 isWherein:
I (x, y) is pixel value of the obtained image of step 3 at (x, y);
Condition 2 is Indicate midpointWith profile center of gravityDistance:
M-th point on i-th of profile in image is obtained for step 6, n is profile point number;
Indicate midpointWith profile minimum circumscribed rectangle centerDistance,
Step 7.3: obtaining a circle from point of contact along the direction moving distance L at point of contact to minimum circumscribed rectangle center
The heartRadius R is seti=L, L are the 1/2 of long side length.Fig. 2 f shows the qualified region obtained according to step 6
The point of contact of the circular arc portion of most compact boundary rectangle and long side and region contour, the envelope circle in the obtained qualification region.
Step 7.4: in a series of circles obtained in step 7.3, judging whether each circle intersects with other circles;
The condition for judging whether two circles intersect is: setting round Cp,CqThe center of circle be respectively P (xp,yp),Q(xq,yq), radius
Respectively Rp,Rq, circle Cp,CqThe distance between the center of circle be PQ,Then if Rp
+Rq> | PQ |, then justify CpWith circle CqIt crosses one another;Fig. 2 f shows the different zones for belonging to same round pool, and envelope circle has friendship
Fork point, needs further merger.
Step 7.5: the circle for being associated with cross section is a circle, and merging round method is:
If Cp,Cq, the center of circle of Co is respectively P (xp,yp),Q(xq,yq), O (xo, yo), radius is respectively Rp,Rq, Ro, then it
Triadic relation may be expressed as:
Wherein| OP |=R0-Rp, respectively indicate the distance between center of circle;
Step 7.6: after two circles merge, corresponding image-region is then labeled as the same area, even if two regions not phase
Even.Fig. 2 g shows the different zones for merging into same round pool, is the contour curve that is connected by its respective profile point merger;
Step 8: extraction step 6 obtains the convex closure for the border circular areas that each merging or individual circular contour surrounds;
Step 9: obtaining the convex closure in the merger region of step 8 extraction, seek the common point of convex closure point and region contour, Fig. 2 h is
After obtained merger, the convex closure point of profile diagram 2g institute enclosing region;
Convex closure refers to that combined region all pixels point is included by a convex polygon, this convex polygon.Due to
It is convex closure, so the circular arc portion of prior partial circle includes in the profile point of convex closure, rather than circular arc portion is not included in convex closure
Profile point in.But also includes non-merged region point in convex closure profile point, arc point can be merged by seeking common ground to obtain.
The step 9 specifically includes:
Step 9.1: finding out in merger profile at a distance of maximum two points;
Step 9.2: with the two points for starting point, finding out convex closure point according to volume pack or Graham-Scan algorithm;
Step 9.3: obtaining the common point of convex closure profile and region contour, the as point on the circular arc of merger.
Step 10: using fitting circle is put obtained in step 9, round pool and its radius are marked on original image;Fig. 2 i is root
According to circle made of convex closure point and the fitting of the common point of profile point, the image being superimposed upon on Fig. 2 d;Fig. 2 j is made of final fitting
Circle, the image being superimposed upon on original image.
The step 10 specifically:
3 points determine a circle in plane, the multiple merger arc points obtained using step 9, quasi- by least square method
It closes, central coordinate of circle and radius after finally being merged.
Least square method (least squares analysis) is a kind of mathematical optimization techniques, it is by minimizing error
Quadratic sum find one group of data optimal function matching.Least square method be with most simple method acquire it is some absolutely not known to
True value, and enable the sum of square-error for minimum.Given data is circular arc convex closure point in the present invention, and solving data is the vertical of the center of circle
Abscissa and radius.
Step 11: repetition step 7,8,9,10, until all profiles of traversal step 7;
Step 12: output final result.
The foregoing is merely presently preferred embodiments of the present invention, the thought being not intended to limit the invention, all of the invention
Within spirit and principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.
Claims (10)
1. a kind of radius of circle measurement method being fitted based on contour mergence and convex closure, which comprises the steps of:
Step 1: the image of round pool is contained on acquisition physical material surface, and is converted into gray level image;
Step 2: gray level image is subjected to texture enhancing in conjunction with local variance, gradient intensity and comentropy by Gabor transformation,
High intensity region is background, and hypo-intense region is possible target;
Step 3: the image that step 2 is obtained carries out Threshold segmentation, removes background texture in gray level image;
Step 4: the image that step 3 is obtained carries out closing operation of mathematical morphology operation, obtains multiple connection target areas;
Step 5: profile is extracted to each connection target area that step 4 obtains;
Step 6: each of image that traversal step 5 obtains profile, tentatively exclusion non-circular profile;
Step 7: whether each circle that judgment step 6 obtains intersects with other circles, and the wheel for belonging to the same circle is merged if intersecting
It is wide;
Step 8: extraction step 6 obtains the convex closure for the border circular areas that each merging or individual circular contour surrounds;
Step 9: obtaining the convex closure in the merger region of step 8 extraction, seek the common point of convex closure point and region contour;
Step 10: using fitting circle is put obtained in step 9, round pool and its radius are marked on original image;
Step 11: repetition step 7,8,9,10, until all profiles of traversal step 7;
Step 12: output final result.
2. the radius of circle measurement method being fitted as described in claim 1 based on contour mergence and convex closure, which is characterized in that described
Step 1 includes:
Step 1.1: containing the digital picture of round pool with industrial camera shooting physics material surface;
Step 1.2: picture is transmitted in computer;
Step 1.3: gray level image is converted by color image, color image switchs to gray level image and meets following equation:
Gray=R × 0.299+G × 0.587+B × 0.114
Wherein, R, G, B are respectively the red of pixel in color image, and green, blue component, Gary is to be transformed into gray space
Pixel value.
3. the radius of circle measurement method being fitted as described in claim 1 based on contour mergence and convex closure, which is characterized in that described
Step 2 includes:
Step 2.1: with 45 ° of directions, 5 × 5 template size does Gabor transformation to the image that step 1 obtains, wherein filter by
Following formula determines:
Wherein, x '=xcos θ+ysin θ, y '=- xsin θ+ycos θ, λ indicates sinusoidal wavelength, its value is single with pixel
Position is specified;The discovery angle direction of θ expression parallel stripes;Indicate phase difference;The variance parameter of σ expression Gauss;Gamma space is vertical
Horizontal ratio;
Step 2.2: taking absolute value to the image that step 2.1 obtains;
Step 2.3: in conjunction with local variance, gradient intensity and comentropy, carrying out texture enhancing, enhance transformation for mula are as follows:
Ie=λ1IGabor+λ2IVar+λ3IEntropy+λ4IEdge
λ1,λ2,λ3,λ4It for coefficient, rule of thumb sets, IGabor、IVar、IEntropy、IEdgeRespectively Gabor filtering image, variance
Image, the equal gradient image of entropy image peace.
4. the radius of circle measurement method being fitted as described in claim 1 based on contour mergence and convex closure, which is characterized in that described
Step 3 includes:
Step 3.1: calculating step 2 and obtain the histogram of image;
Step 3.2: 0 is being calculated in histogram to the peak value between threshold value as adaptive threshold;
Step 3.3: on adaptive threshold plus an offset is as new threshold value;
Step 3.4: the new threshold value of application carries out Threshold segmentation to the image that step 2 obtains.
5. the radius of circle measurement method being fitted as described in claim 1 based on contour mergence and convex closure, which is characterized in that described
Step 4 specifically:
After Threshold segmentation, in the background area of high gray scale with the presence of some low ash degree zonule, show as in white background
Black holes hole, due to target be black, so removing these black holes holes using the closed operation in mathematical morphology.
6. the radius of circle measurement method being fitted as described in claim 1 based on contour mergence and convex closure, which is characterized in that described
Step 5 specifically:
After step 4 processing, multiple point region i.e. connected regions to communicate with each other are formd, the region that black color dots are constituted is round pool
Region, inside round pool region, pixel value is black, and eight neighborhood point is also black, and on region contour point, neighborhood point has
Black color dots also have white point, extract the profile of target area accordingly.
7. the radius of circle measurement method being fitted as described in claim 1 based on contour mergence and convex closure, which is characterized in that described
Step 6 includes:
Step 6.1: calculating the area S of profile;
Step 6.2: calculating the length-width ratio K of profile minimum circumscribed rectangle;
Step 6.3: if meeting condition 1, condition 2, one of condition 3 then excludes the profile;Condition 1 is that S is less than minimum round pool
Elemental area, condition 2 is the elemental area that S is greater than maximum round pool, and condition 3 is less than for K
8. the radius of circle measurement method being fitted as described in claim 1 based on contour mergence and convex closure, which is characterized in that described
Step 7 includes:
Step 7.1: making a boundary rectangle in each region in the image obtained to step 6;
Step 7.2: judging the midpoint of boundary rectangle longer sidesIt whether is point of contact, if meeting condition 1 and condition 2 simultaneously
It is recorded as point of contact;
Condition 1 isWherein:
I (x, y) is pixel value of the obtained image of step 3 at (x, y);
Condition 2 is Indicate midpointWith profile center of gravityDistance:
M-th point on i-th of profile in image is obtained for step 6, n is profile point number;
Indicate midpointWith profile minimum circumscribed rectangle centerDistance,
Step 7.3: obtaining a center of circle from point of contact along the direction moving distance L at point of contact to minimum circumscribed rectangle centerRadius R is seti=L, L are the 1/2 of long side length;
Step 7.4: in a series of circles obtained in step 7.3, judging whether each circle intersects with other circles;
The condition for judging whether two circles intersect is: setting round Cp,CqThe center of circle be respectively P (xp,yp),Q(xq,yq), radius difference
For Rp,Rq, circle Cp,CqThe distance between the center of circle be PQ,If Rp+Rq> |
PQ |, then justify CpWith circle CqIt crosses one another;
Step 7.5: the circle for being associated with cross section is a circle, and merging round method is:
If Cp,Cq, the center of circle of Co is respectively P (xp,yp),Q(xq,yq), O (xo, yo), radius is respectively Rp,Rq, Ro, then they three
Person's relationship may be expressed as:
Wherein| OP |=R0-Rp, respectively indicate the distance between center of circle;
Step 7.6: after two circles merge, corresponding image-region is then labeled as the same area, right even if two regions and being not attached to
All subregions obtained in step 6 carry out step 7.1 to the operation of step 7.6 with other subregions, obtain multiple merger
Or independent border circular areas.
9. the radius of circle measurement method being fitted as described in claim 1 based on contour mergence and convex closure, which is characterized in that described
Step 9 includes:
Step 9.1: finding out in merger profile at a distance of maximum two points;
Step 9.2: with the two points for starting point, finding out convex closure point according to volume pack or Graham-Scan algorithm;
Step 9.3: obtaining the common point of convex closure profile and region contour, the as point on the circular arc of merger.
10. the radius of circle measurement method being fitted as described in claim 1 based on contour mergence and convex closure, which is characterized in that institute
State step 10 specifically:
3 points determine a circle in plane, and the multiple merger arc points obtained using step 9 are fitted by least square method, are obtained
Central coordinate of circle and radius to after final merge.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811472707.7A CN109658391B (en) | 2018-12-04 | 2018-12-04 | Circle radius measuring method based on contour merging and convex hull fitting |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811472707.7A CN109658391B (en) | 2018-12-04 | 2018-12-04 | Circle radius measuring method based on contour merging and convex hull fitting |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109658391A true CN109658391A (en) | 2019-04-19 |
CN109658391B CN109658391B (en) | 2023-03-17 |
Family
ID=66112764
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811472707.7A Active CN109658391B (en) | 2018-12-04 | 2018-12-04 | Circle radius measuring method based on contour merging and convex hull fitting |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109658391B (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109990711A (en) * | 2019-04-25 | 2019-07-09 | 湘潭大学 | A kind of appearance quality detection method of punched nickel-plated steel band |
CN110567381A (en) * | 2019-10-09 | 2019-12-13 | 上海中车瑞伯德智能系统股份有限公司 | method for measuring outer circumference and maximum and minimum diameter of cylindrical workpiece |
CN111445511A (en) * | 2020-03-24 | 2020-07-24 | 杭州东信北邮信息技术有限公司 | Method for detecting circle in image |
CN111639539A (en) * | 2020-04-30 | 2020-09-08 | 南京理工大学 | Casting positioning method based on MaskRCNN network |
CN114004981A (en) * | 2021-11-10 | 2022-02-01 | 柳州沪信汽车科技有限公司 | Vehicle body R angle visual detection method and system under incomplete point cloud condition |
CN115760782A (en) * | 2022-11-16 | 2023-03-07 | 华南理工大学 | In-mold labeling offset defect identification method based on machine vision |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6792684B1 (en) * | 1999-10-28 | 2004-09-21 | Diware Oy | Method for determination of stand attributes and a computer program to perform the method |
EP1536246A1 (en) * | 2003-11-27 | 2005-06-01 | Giat Industries | Method for the detection of the entry of a target into a zone, detection device and protection device using the method |
CN103218618A (en) * | 2013-01-09 | 2013-07-24 | 重庆交通大学 | Highway route automatic extraction method based on remote-sensing digital image |
CN108398103A (en) * | 2018-04-28 | 2018-08-14 | 北京大学 | A kind of high speed high throughput biological sample Morphology observation system |
CN108711158A (en) * | 2018-03-14 | 2018-10-26 | 武汉科技大学 | The image of gauge with pointer recognition methods based on contour fitting and radially divided |
-
2018
- 2018-12-04 CN CN201811472707.7A patent/CN109658391B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6792684B1 (en) * | 1999-10-28 | 2004-09-21 | Diware Oy | Method for determination of stand attributes and a computer program to perform the method |
EP1536246A1 (en) * | 2003-11-27 | 2005-06-01 | Giat Industries | Method for the detection of the entry of a target into a zone, detection device and protection device using the method |
CN103218618A (en) * | 2013-01-09 | 2013-07-24 | 重庆交通大学 | Highway route automatic extraction method based on remote-sensing digital image |
CN108711158A (en) * | 2018-03-14 | 2018-10-26 | 武汉科技大学 | The image of gauge with pointer recognition methods based on contour fitting and radially divided |
CN108398103A (en) * | 2018-04-28 | 2018-08-14 | 北京大学 | A kind of high speed high throughput biological sample Morphology observation system |
Non-Patent Citations (1)
Title |
---|
邵勇 等: "基于最小凸包的直齿圆柱齿轮检测方法研究", 《电子测量与仪器学报》 * |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109990711A (en) * | 2019-04-25 | 2019-07-09 | 湘潭大学 | A kind of appearance quality detection method of punched nickel-plated steel band |
CN109990711B (en) * | 2019-04-25 | 2021-08-31 | 湘潭大学 | Appearance quality detection method for punched nickel-plated steel strip |
CN110567381A (en) * | 2019-10-09 | 2019-12-13 | 上海中车瑞伯德智能系统股份有限公司 | method for measuring outer circumference and maximum and minimum diameter of cylindrical workpiece |
CN111445511A (en) * | 2020-03-24 | 2020-07-24 | 杭州东信北邮信息技术有限公司 | Method for detecting circle in image |
CN111639539A (en) * | 2020-04-30 | 2020-09-08 | 南京理工大学 | Casting positioning method based on MaskRCNN network |
CN111639539B (en) * | 2020-04-30 | 2023-03-31 | 南京理工大学 | Casting positioning method based on MaskRCNN network |
CN114004981A (en) * | 2021-11-10 | 2022-02-01 | 柳州沪信汽车科技有限公司 | Vehicle body R angle visual detection method and system under incomplete point cloud condition |
CN115760782A (en) * | 2022-11-16 | 2023-03-07 | 华南理工大学 | In-mold labeling offset defect identification method based on machine vision |
CN115760782B (en) * | 2022-11-16 | 2023-06-16 | 华南理工大学 | Machine vision-based in-mold labeling offset defect identification method |
Also Published As
Publication number | Publication date |
---|---|
CN109658391B (en) | 2023-03-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109658391A (en) | A kind of radius of circle measurement method being fitted based on contour mergence and convex closure | |
WO2021138995A1 (en) | Fully automatic detection method for checkerboard corners | |
CN104318548B (en) | Rapid image registration implementation method based on space sparsity and SIFT feature extraction | |
CN101281600B (en) | Method for acquiring palm print characteristics as well as corresponding personal identification method based on palm print | |
CN106845408A (en) | A kind of street refuse recognition methods under complex environment | |
CN107578418A (en) | A kind of indoor scene profile testing method of confluent colours and depth information | |
CN105260710B (en) | Water meter calibration method, apparatus based on image procossing and system | |
CN104951940B (en) | A kind of mobile payment verification method based on personal recognition | |
CN110148162A (en) | A kind of heterologous image matching method based on composition operators | |
CN108229458A (en) | A kind of intelligent flame recognition methods based on motion detection and multi-feature extraction | |
CN108319973A (en) | Citrusfruit detection method on a kind of tree | |
Guan et al. | Accurate segmentation of partially overlapping cervical cells based on dynamic sparse contour searching and GVF snake model | |
CN108121985A (en) | A kind of double pointer meters number reading methods based on machine vision | |
CN107392885A (en) | A kind of method for detecting infrared puniness target of view-based access control model contrast mechanism | |
Frucci et al. | WIRE: Watershed based iris recognition | |
CN104167003A (en) | Method for fast registering remote-sensing image | |
CN101359365A (en) | Iris positioning method based on Maximum between-Cluster Variance and gray scale information | |
CN103034838A (en) | Special vehicle instrument type identification and calibration method based on image characteristics | |
CN101317183A (en) | Method for localizing pixels representing an iris in an image acquired of an eye | |
CN101317184A (en) | Method for extracting features of an iris in images | |
CN110232389A (en) | A kind of stereoscopic vision air navigation aid based on green crop feature extraction invariance | |
CN110322522A (en) | A kind of vehicle color identification method based on the interception of target identification region | |
CN106780465A (en) | Retinal images aneurysms automatic detection and recognition methods based on gradient vector analysis | |
CN109978848A (en) | Method based on hard exudate in multiple light courcess color constancy model inspection eye fundus image | |
CN106650663B (en) | The determination method of building true and false variation and pseudo- containing the method change minimizing technology |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |