CN114170259A - Combined hole contour point detection and segmentation method based on Hough transform - Google Patents

Combined hole contour point detection and segmentation method based on Hough transform Download PDF

Info

Publication number
CN114170259A
CN114170259A CN202111511667.4A CN202111511667A CN114170259A CN 114170259 A CN114170259 A CN 114170259A CN 202111511667 A CN202111511667 A CN 202111511667A CN 114170259 A CN114170259 A CN 114170259A
Authority
CN
China
Prior art keywords
hole
contour
point
circle
points
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111511667.4A
Other languages
Chinese (zh)
Inventor
习俊通
杨肖
于润泽
朱帅臣
叶帆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Platform For Smart Manufacturing Co Ltd
Original Assignee
Shanghai Platform For Smart Manufacturing 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 Shanghai Platform For Smart Manufacturing Co Ltd filed Critical Shanghai Platform For Smart Manufacturing Co Ltd
Priority to CN202111511667.4A priority Critical patent/CN114170259A/en
Publication of CN114170259A publication Critical patent/CN114170259A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/66Analysis of geometric attributes of image moments or centre of gravity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10028Range image; Depth image; 3D point clouds

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Geometry (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a combined hole contour point detection and segmentation method based on Hough transform, which comprises the following steps of: s1, extracting point cloud data of the combined hole smooth tool curve to obtain a plurality of end points; s2, distinguishing each end point, judging whether the end point is a contour point or an interference point, and establishing a corresponding relation between the contour point and a hole; and S3, performing plane fitting on the plane where the hole is located, and fitting relevant parameters of the hole. According to the invention, aiming at the condition that a plurality of circular hole features exist in a view field, the detection and segmentation method of the combined hole contour points is researched, after the contour points of all the circular holes are obtained, the points which are segmented wrongly are eliminated by using a circle fitting iteration method, and the feature parameters of all the circular holes are obtained, so that the simultaneous extraction of the plurality of hole feature parameters is realized, the problem of mutual interference of the combined holes in the view field is solved, and the detection efficiency is improved.

Description

Combined hole contour point detection and segmentation method based on Hough transform
Technical Field
The invention belongs to the technical field of target detection, and particularly relates to a combined hole contour point detection and segmentation method based on Hough transform.
Background
On the vehicle body, there are some combination holes with similar profiles. When the combined hole is measured, the position and the posture of the measuring sensor can be adjusted, and only interested holes are reserved in a view field, so that the holes can be measured one by one. However, in an actual measurement environment, there are situations in which the pose of the sensor is inconvenient to adjust, and a plurality of holes always appear in the field of view of the sensor regardless of the adjustment caused by the arrangement of the combined holes.
As shown in fig. 1, compared with other features, the combination hole has a larger proportion of features in the field of view, and the light knife lines are cut off by the plurality of holes, so that the corresponding light knife image has the characteristics of a larger number of light knife lines, a relatively shorter length and the like. The points in the combined hole feature light tool point cloud that can be used for feature fitting (i.e., the contour points of each hole) are generally more numerous than the light tool point cloud of single hole features. The contour points of each hole in the smooth tool point cloud can correspond to the end points of the smooth tool lines in the smooth tool image. However, the measured feature surface may have optical non-uniformity problems, and the optical knife line may have discontinuities at the defect, forming an interference endpoint. The characteristics of the combined hole smooth tool image determine that a method used by simple hole characteristics cannot be adopted, namely whether the end point is an interference point is judged according to the length of a smooth tool line where the end point is located, the distance from the end point to the left end and the right end of the ROI and other information; further, the correspondence between the end points and the holes cannot be determined from these pieces of information. Therefore, this section provides a set of light knife image point cloud extraction and segmentation methods for the combined hole features, which can extract the contour points corresponding to each hole quickly and effectively. Therefore, there is an urgent need for a method for extracting and segmenting a point cloud of a smooth-cut image aiming at the characteristics of a combined hole, which can quickly and effectively extract contour points corresponding to each hole.
Disclosure of Invention
The invention aims to solve the technical problem of how to provide a light knife image point cloud extraction and segmentation method aiming at combined hole features, and the contour points corresponding to all holes can be extracted quickly and effectively.
The invention provides a combined hole contour point detection and segmentation method based on Hough transform, which comprises the following steps of:
s1, extracting point cloud data of the combined hole smooth tool curve to obtain a plurality of end points;
s2, distinguishing each end point, judging whether the end point is a contour point or an interference point, and establishing a corresponding relation between the contour point and a hole based on the contour point to obtain the shape and the position of the hole;
and S3, based on the contour points of the holes, eliminating the points which are wrongly segmented by using a circle fitting iteration method, and obtaining the characteristic parameters of the holes.
Optionally, the S1 includes:
acquiring a light knife image in an interested region, preprocessing the light knife image, detecting the outline of the preprocessed light knife image, and sequencing the outline according to the size;
setting a contour perimeter threshold, removing all contours with contour perimeters smaller than the contour perimeter threshold, calculating a central point set for the contours which are not removed by using a gray centroid method, and sequentially storing the calculation results in an array;
and judging whether the center point is an end point according to the continuity of the center point and the position relation with the ROI boundary.
Optionally, the S2 includes:
and sequentially connecting contour points corresponding to the holes in the preprocessed image to form a contour point track, and detecting the geometric shape of the contour point track by using a Hough transform method.
Optionally, the S2 further includes:
aiming at the small number and sparse distribution of contour points, the initial position and the initial aperture of the hole center of each hole in the image are obtained by setting the initial parameters of Hough circle transformation;
and taking the initial hole center position as a center, adjusting on the basis of the initial hole diameter, drawing a circle by taking the adjusted parameters as a radius, wherein the end point in the circle is the contour point of the hole, and the end point which is not detected as the contour point is the interference point.
Optionally, the detecting the geometry of the contour point trajectory using hough transform comprises:
end points (a) in image space using Hough circle transformi,bi) Accumulator mapping into Hough space (x)j,yj,rj) In the middle, the mapping relation is as follows:
Figure BDA0003395051090000031
in the formula, (x, y) is a circle center coordinate, r is a radius, theta is an angle between an end point and a circle center connecting line, and the range is 0-360 degrees;
discretizing the parameter space, limiting the range of r, traversing theta and r by a certain step length, completing one-to-many mapping of end points, and adding 1 to the value in the corresponding accumulator;
after all end points are mapped, the parameters corresponding to the local peak values of the accumulator in the Hough space are detected circular parameters; and taking the first n peak values when a plurality of peak values exist, wherein n is the number of circles in the preset image.
Optionally, adjusting the calculated circle parameter to compensate for possible parameter errors includes:
and if the discrete intervals of three parameters of the accumulator are respectively delta x, delta y and delta R, the circle center position error delta D and the radius error delta R obtained by Hough transform respectively satisfy the following conditions:
Figure BDA0003395051090000041
Figure BDA0003395051090000042
adjusting the radius R of the circle obtained by original Hough transform as:
Figure BDA0003395051090000043
namely ensuring that the adjusted circle is internally tangent or contained with the actual circle, and the maximum distance between the adjusted circle and the actual circle center and the actual circle radius RrThe difference of (d) is:
Figure BDA0003395051090000044
i.e. an end point independent of the hole from the edge of the hole
Figure BDA0003395051090000045
In the above, the division is not mistaken.
Optionally, the S3 includes:
fitting parameters of a plane where the holes are located;
and projecting the contour points in the data set to the plane where the holes are located, and performing geometric fitting of a circle on the projection points, namely fitting relevant parameters of the holes.
Optionally, the S3 further includes adopting: and (5) eliminating gross errors through circle fitting iteration according to a Grubbs criterion gross error judgment criterion.
The invention has the technical effects that: the invention first studies the measured characteristics of an ideal combined hole, i.e. the situation that all can appear in the form of a complete profile in the field of view. According to the actual situation of the combined hole point cloud, determining the search step length and the voting interval of the Hough transform method, and calculating the initial hole centers and the radii of the holes. And establishing contour point dividing parameters on the basis of the contour point dividing parameters, and establishing the corresponding relation between the contour points and the holes. Due to the establishment of the corresponding relation, the influence of the gross errors in the point cloud to be fitted on the fitting result is relatively low, and the proportion is low, so the gross errors are iteratively removed by adopting the Grabbs criterion and combining geometric fitting. In most cases, the point cloud to be fitted does not contain gross errors, and stable and accurate fitting parameters without truncation errors can be directly obtained by using the method. In addition, when the incomplete contour is detected, the effect is unchanged in the case of half of the incomplete contour; when more than half of the holes are detected, the effective contour points are too few, so that an incorrect initial hole center and radius can be obtained, and the detection result is incorrect. However, the method proves that incomplete holes are unlikely to appear in a view field when the characteristic pose of the combined hole fluctuates within an acceptable range (5mm) according to the white automobile body design specification, so that the robustness of the algorithm is proved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this application, illustrate embodiments of the application and, together with the description, serve to explain the application and are not intended to limit the application. In the drawings:
FIG. 1 is a composite drawing of a combined aperture finishing tool;
FIG. 2 is a flow chart of a combined hole feature light tool point cloud extraction according to an embodiment of the present invention;
FIG. 3 is an end point diagram obtained by extracting point clouds of combined holes according to an embodiment of the invention;
fig. 4 is a schematic diagram of a static test fitting result of the remaining contour points after coarse differences are removed by using a random hough transform method and a circle fitting iterative method, respectively, in the first embodiment of the present invention;
FIG. 5 is a schematic diagram illustrating an unstable initial fitting result by using a stochastic Hough transform according to a first embodiment of the present invention;
fig. 6 is a schematic diagram of a robustness result of a verification combination hole feature parameter extraction algorithm in a second embodiment of the present invention, in which (a) is a schematic diagram of a combination hole structure, (b) is a schematic diagram of a incomplete hole with a half-contour defect, and (c) is a schematic diagram of a incomplete hole with a two-thirds contour defect;
FIG. 7 is a diagram illustrating the results of a three-hole static test according to a second embodiment of the present invention;
FIG. 8 is a schematic diagram illustrating a detection result of a defective hole (two-thirds of contour defects) according to a second embodiment of the present invention;
Detailed Description
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowcharts, in some cases, the steps illustrated or described may be performed in an order different than presented herein.
Example one
According to the structural parameters of the line laser vision sensor, the field of view of the sensor at the working distance is about 37mm multiplied by 27 mm; according to the design convention of a white automobile body, the aperture of a single hole is about 6-12mm, the design standard of the minimum hole distance D between two holes is D is larger than or equal to 7t (t is the thickness of a punched part), generally about 10mm, at most 3 holes with complete outlines can be calculated in the view field along the long side direction, and at most 2 holes can be calculated in the short side direction. Under the ideal condition of not considering body-in-white manufacturing deviation and repeated robot positioning error, the number of holes actually presented in a view field can be reduced by one compared with the theoretical maximum value by adjusting the pose of the sensor, properly limiting the ROI (region of interest) and the like, namely the number of holes with complete outlines in the view field can be stabilized at two no matter what the value of the aperture of the combined hole is in the range of the design convention. Taking a white car body as an example, as shown in fig. 2, on the premise that a field of view contains two complete holes, the embodiment provides a combined hole contour point detection and segmentation method based on hough transform, which includes the following steps
The combined aperture feature is relatively large in the field of view, requiring a larger ROI area than other features, which can equate to the entire field of view. However, the farther from the ROI center, the more likely the surface optical non-uniformity or defocus occurs, and the image quality at the edge of the optical knife image is unstable, so that the appropriate adjustment can be made, and the purpose of improving the detection efficiency and stability without affecting the combined hole detection can be achieved.
S1, extracting point cloud data of the combined hole smooth tool curve, comprising the following steps:
s11, extracting the combined hole point cloud by referring to the flow of FIGS. 1-8. The image is preprocessed within the ROI, then contours in the image are detected and sorted by perimeter size.
S12, since some noise with an insignificant contour exists in the image except the optical knife line, it is necessary to set a contour perimeter threshold and eliminate all contours with perimeters less than the threshold. In this embodiment, the perimeter threshold is set to 100 pixels, and the corresponding actual physical maximum length is about 1mm, so that noise can be effectively filtered while the effective information of the optical knife line is retained. And (4) calculating a central point set by using a gray level centroid method for the contour which is not removed, and sequentially storing the calculation results.
And S13, judging whether the center point is an end point according to the continuity of the center point and the position relation with the ROI boundary. This end point may be a target contour point or an interference point, and needs to be further detected.
S2, a series of end points can be obtained through point cloud extraction, then each end point needs to be distinguished, whether the end point is a contour point or an interference point is judged, the corresponding relation between the contour point and a hole is established, the contour point is segmented, contour points corresponding to holes in an image are connected in sequence, a track similar to a circular arc can be formed, and the geometric shape in the image is detected by using a Hough transform method.
Aiming at the characteristics of small number and sparse distribution of contour points, the initial position and the initial aperture of each hole center in the image are obtained by firstly setting initial parameters of Hough circle transformation under the condition of ensuring the detection and segmentation efficiency and effect of the contour points.
And taking the initial hole center position as a center, adjusting the initial hole diameter on the basis, drawing a circle by taking the adjusted parameter as a radius, and taking the inner end point of the circle as a contour point of the hole. The end points not detected as contour points are interference points.
Further optimizing the scheme, the setting of the initial parameters of Hough circle transformation comprises the following steps:
first, the endpoint (a) in the image space is transformed using the Hough circlei,bi) Accumulator mapping into Hough space (x)j,yj,rj) In the middle, the mapping relation is as follows:
Figure BDA0003395051090000081
in the formula, (x, y) is the coordinate of the circle center, r is the radius, theta is the angle of the connecting line of the end point and the circle center, and the range is 0-360 degrees.
And then discretizing the parameter space, limiting the range of r, traversing theta and r by a certain step length, completing one-to-many mapping of end points, and adding 1 to the value in the corresponding accumulator. And after all the end points are mapped, the parameters corresponding to the local peak values of the accumulator in the Hough space are the detected circular parameters. And taking the first n peak values when a plurality of peak values exist, wherein n is the number of circles in the preset image.
Further optimizing the scheme, the process of setting a reasonable Hough circle transformation parameter is as follows: to obtain accurate results, the step size is often short and the discrete intervals of the accumulator parameters are also small, resulting in large memory space and computation time. However, in the case of a small number of samples, too short discrete intervals can scatter the accumulator values; meanwhile, in order to meet the production line beat, the efficiency of circle detection must be improved, and the step length and the discrete interval are increased as much as possible. This may reduce the accuracy of the circle parameter calculation result, and may cause the situation that the calculated circle center position deviates from the actual position, or the calculated radius is smaller than the actual value, etc., and further cause the circle obtained through hough transform to intersect with the actual circle, that is, the corresponding contour point cannot be completely covered, and the uncovered part will be misjudged as an interference point. This misjudgment can greatly reduce the number of contour points available at the hole center fitting stage, thereby reducing the stability and accuracy of the hole center fitting result.
Therefore, it is necessary to compensate for possible parameter errors by adjusting the calculated circle parameters, and ensure that the adjusted circle and the actual circle form an inscribed or inclusive relationship, covering all corresponding contour points as much as possible. And if the discrete intervals of three parameters of the accumulator are respectively delta x, delta y and delta R, the circle center position error delta D and the radius error delta R obtained by Hough transform respectively satisfy the following conditions:
Figure BDA0003395051090000091
Figure BDA0003395051090000096
it can be seen that the radius R of the circle obtained by the original Hough transform is adjusted to
Figure BDA0003395051090000092
The adjusted circle can be ensured to be internally tangent or contained with the actual circle. The maximum distance between the adjusted circle and the actual circle center and the actual circle radius RrThe difference of (d) is:
Figure BDA0003395051090000093
from the foregoing, it will be appreciated that only one end point, which is independent of the hole, is spaced from the edge of the hole
Figure BDA0003395051090000094
In the above, the division is not mistaken. According to the design convention for body-in-white, the shortest distance between the two hole edges is typically around 10mm, and in particular up to 5mm, so Δ x, Δ y and Δ r can be set to 1mm, in which case
Figure BDA0003395051090000095
It is ensured that the profile points of one hole are prevented from being misdrawn into another hole and that interference points which are very close to the hole may be misdrawn into profile points.
In the embodiment, according to the common value range of the aperture of the body-in-white and the sparsity of the end points, the range of r can be set to be 2.5-9 mm, the step length is 0.1mm, and the step length of theta is 0.1 rad. Can calculate the total completion when N endpoints exist in the image
Figure BDA0003395051090000101
For the second traversal, N is typically around 60.
S3, the image plane of the camera is not completely parallel to the plane of the hole, and the hole is at a certain distance from the central axis of the image plane, so that the line laser is likely to irradiate the inner wall of the hole and be shot by the camera. In this case, the end point of the optical knife irradiated on the inner wall is regarded as a contour point of the hole, and the contour point is not in the same plane as the true contour line of the hole, which causes a deviation of the parameter fitting result from the actual value. And recording three-dimensional coordinates of the end points and 10 central points adjacent to the end points, and calculating plane parameters of the surface where the hole is located according to the contour points and adjacent point information corresponding to the hole after finishing accurate segmentation of the contour points. The method comprises the following steps:
s31, fitting parameters of the plane where the holes are located, projecting contour points in the feature fitting point cloud data set of each hole to the plane where the holes are located, and performing geometric fitting of circles on the projection points to fit relevant parameters of the holes.
S32, the feature fitting point cloud data set of the combined hole has two differences relative to the common single hole. Firstly, the interference points in the point cloud set of the combined hole are close to the edge of the hole, and the fitting result cannot be influenced excessively by the interference points; secondly, the fluctuation of the assembly characteristic pose of the body-in-white on the production line is 5mm under the normal condition, which means that in the process of online detection, the combined hole characteristic has the possibility of deviating from the field of view of the sensor under the normal condition, so that the holes in the field of view are incomplete. The combined hole characteristic parameter extraction algorithm takes the two problems into consideration, and the efficiency and the robustness of the algorithm are ensured. Since a small number of interference points are mixed in the contour points, the influence of the small number of interference points on the fitting result is further reduced by performing rough difference elimination on the contour points of each hole as follows.
Optical non-uniformity and shading problems may exist on the surface of the measuring point, so that the optical knife line is broken, and interference points are mixed in the feature fitting point cloud data. The mixed interference points are very different from the contour points, and the fitting precision is inevitably reduced if the rough differences are not eliminated and the fitting is directly carried out. However, through contour point detection and segmentation, only the interference points which are very close (less than 2.41mm) to the edge of the hole, such as the two points in the first box in fig. 3, are likely to be mixed into the feature fitting point cloud data, while the interference points in the second box do not affect the fitting, and the influence of the gross error on the fitting result is relatively low. And because of adopting different point cloud extraction methods, the number of contour points can not be reduced due to the occurrence of interference points. The two points reduce the difficulty of gross error rejection to a certain extent. Under the condition, a proper gross error judgment criterion is selected, and the gross error is removed through circle fitting iteration, so that the effect is the same as or better than that of other common methods such as random Hough transform, data density clustering and the like, and the efficiency is higher.
Common gross error criteria include the 3 σ criterion, the romanofsky criterion, the grassblocs criterion, and the dirac criterion. Among them, the 3 σ criterion is applicable to a large sample case, and the number of contour points of a single combined hole is about 30, which is not applicable to the criterion. Of the remaining three criteria, the grubbs criterion is the highest power for checking when the gross error is small, so this criterion is used in this embodiment, and its standard algorithm is as follows:
for n quantities x to be examined1,x2,...,xnCalculating their mean value
Figure BDA0003395051090000111
Deviation of
Figure BDA0003395051090000112
And standard deviation sigma under the bessel formula. Selecting | viThe maximum value of | is the suspicious amount when
Figure BDA0003395051090000113
I.e. discriminating x under the condition that the degree of significance is alphaiFor gross errors, they should be removed. After elimination, is paired with x1,x2,...,xn-1Repeating the steps until no gross error exists. g0(n, α) is a critical value and can be obtained by table lookup.
Specifically, rough error elimination is carried out on contour points of the combined hole, point cloud is fitted to obtain initial fitting parameters, xiThe shortest distance from the point cloud i to the fitting circle is obtained; after one gross error is removed, fitting the residual point cloud again to obtain iterationAnd recalculating the quantity to be checked after fitting the parameters. Although the calculation time of the algorithm depends on the number of gross errors in the data set, the gross error ratio of the point cloud data is low due to combination hole fitting, and the efficiency of single geometric fitting of the point cloud is far higher than that required by methods such as random Hough transform, data density clustering and the like
Figure BDA0003395051090000121
The order (n is generally 30) algebraic fitting, so the comprehensive efficiency of the algorithm is better than that of other common algorithms.
Truncation errors exist in the fitting result of the random Hough transform, and deviation may exist between the circle obtained through fitting and the actual contour point, so that errors occur in rough error judgment of the point cloud. And the fitting result fluctuates randomly in the process of randomly extracting the point cloud, so that the gross error judgment result is easy to be unstable. And for geometric fitting, when the noise in the fitting point cloud data conforms to the normal distribution rule, the parameters obtained by the geometric fitting are the same as the actual parameters. The initial fitting point cloud data of the combined hole has high quality, geometric fitting is directly carried out, the fitting result is not greatly influenced by the gross error, the accuracy of the gross error discrimination is improved, and the discrimination result is stable. Therefore, when the method is applied to combination hole characteristics, the gross error elimination effect of the circle fitting iterative method is superior to that of a random Hough transform method.
Fig. 4 is a static test fitting result of the remaining contour points after coarse differences of the initial point cloud data of the left hole in fig. 5 are removed by using a random hough transform method and a circle fitting iterative method respectively. It can be seen that the final fitting result corresponding to the circle fitting iterative method has small fluctuation, and the random hough transform method brings fluctuation in the Y direction.
And analyzing the reason of different final effects of the two gross error rejection methods by recording the values of key parameters during the operation of the algorithm. Although an interference point is located at the lower left of the left hole of the image and is close to the hole edge, the interference point is not wrongly drawn as a contour point, i.e., the initial point cloud data of the hole does not include the interference point. Therefore, the accurate and stable result can be obtained by only one-time geometric fitting without iteration. The circle in fig. 5 is an initial fitting result obtained by the random hough transform, and it can be seen that there is a deviation from the actual hole profile, and a point in the square frame is misjudged as a gross error. The misjudged points are not necessarily the same each time, and are the reason for fluctuation of the final fitting result.
Example two
In the manufacturing process of a body-in-white, the welding size of parts has deviation, so that the assembly characteristic position fluctuates around a design value, and the robustness of the combined hole characteristic parameter extraction algorithm can be influenced in two aspects. First, unlike a single hole, where the combined hole features are relatively large in the field of view, fluctuations within the acceptable range can also cause the features to deviate from the field of view, i.e., the hole is incomplete in the field of view. Therefore, the algorithm should be able to calculate the characteristic parameters of the incomplete contour hole or display the relevant error information. In addition, the one-to-one correspondence difficulty of each hole of the combined hole and the preset measuring point is increased due to the welding size deviation, and the algorithm is considered for solving the problem.
The typical aperture on a body-in-white is 6-12mm, while the assembly feature pose fluctuation within an acceptable range for a body-in-white is 5mm, knowing that within the acceptable range, the aperture profile does not completely leave the field of view. In fact, at least half of the profile remains in the field of view for combined hole pose fluctuations within an acceptable range. This conclusion is demonstrated below:
1) if the tested combination holes are uniformly arranged along the connecting line of the hole centers, the following characteristics should be obtained: the sensor is finely adjusted along the connecting line of the hole centers, and when any hole is positioned at the center of the visual field, the outlines of other holes are ensured to exist in the visual field. The tested combined holes which do not meet the characteristics can be measured one by adjusting the pose of the sensor, and the problem of single-hole parameter extraction is solved.
2) If a combined hole in the visual field satisfies 1), the radii are r respectively1And r2The shortest distance between the two hole profiles is D. The centers of the two holes are positioned on the center line of the short side of the visual field, and the shortest distances from the two holes to the short side of the visual field are equal and are both t'. The distances from the holes to the center of the field of view are respectively Δ m1And Δ m2. The length of the long side of the field of view is L. Then there is
2(r1+r2+t′)+D=L (3-7)
Figure BDA0003395051090000141
According to 1) have
Δm2>D-t′ (3-9)
Can be pushed to
Figure BDA0003395051090000142
In the same way
Figure BDA0003395051090000143
Since D is typically at least 10mm, the sum of the hole radii r and t' is at least greater than 5 mm. At the moment, the fluctuation of the characteristic pose of the combined hole in an acceptable range (5mm) can ensure that the complete contour of one hole and at least half of the contour of the other hole exist in a view field, otherwise, the tested combined hole can be converted into a single hole for parameter extraction, the problem that the hole deviates from the view field does not exist, and the verification is finished.
It can be known that, considering robustness, when a hole has a half contour in a field of view, the algorithm should be able to accurately fit hole parameters deviating from the field of view; when the profile in the field of view is less than half, if the algorithm cannot correctly fit the parameters due to the small number of effective profile points, the measurement point names of the holes with the deviated field of view should be output.
The combination hole of fig. 6(a) was characterized as tested, illustrating that the algorithm meets the above requirements. The light knife composite image of fig. 6(B) contains a defective hole profile and two complete hole profiles, which are hole a, hole B and hole C from left to right, and the number of effective profile points is 14, 28 and 27, respectively, and it can be seen that at least half of the defective holes have profiles appearing in the field of view. The characteristic parameters of the three holes are calculated by only slightly modifying the contour point detection and segmentation stages, properly expanding the Hough space and taking the first three peak values of the accumulator in the Hough space. The results of the static test are shown in fig. 7, where (a) is a defective hole a, (B) is a full hole B, and (C) is a full hole C, and when the hole has more than half the contour in the field of view, the algorithm can obtain stable results without affecting the fitting of other holes. Table 3 lists the average of the measurements of the respective hole radii, hole center-to-center distances under static test, and their actual values. It can be seen that the accuracy of the fit results also meets the requirements when the hole has more than half the contour in the field of view.
TABLE 3
Figure BDA0003395051090000151
The sensor pose is finely adjusted, so that the incomplete holes in the photo-knife image appear in fewer contour points in the field of view, as shown in (c) of fig. 6, the number of effective contour points of the three holes is 9, 28 and 28 respectively. At this time, the stability and accuracy of the measurement results of two complete holes are substantially the same as before, while the defective hole can obtain stable and accurate results in most cases, but there is still a case that the partial measurement results are completely wrong, and the static test result of the defective hole is shown in fig. 8 (a). This is because the number of effective contour points of the incomplete hole is small, and the initial position of the hole center obtained by hough circle transformation in the contour point segmentation stage may be a virtual peak, such as the point in the initial hole center black circle of three holes obtained by hough transformation in the point cloud segmentation stage of fig. 8(b), which causes the point cloud unrelated to the hole to be wrongly drawn into the fitting data set of the hole, and directly affects the subsequent fitting.
In order to correctly output the measuring point number of the hole in the visual field no matter how many holes are and whether the holes are complete or not. Firstly, according to the obtained preset number of fitting parameters of each hole, the aperture, the hole center distance and the direction vector of the hole center connecting line of each hole are calculated and matched with the preset value. When the measurement parameters of all the holes are in accordance with the actual measurement parameters, the correct measuring point numbers of all the holes can be obtained through matching. If the misfitting parameters exist, the misfitting parameters cannot be matched with the preset values, which indicates that the size deviation of the measured characteristic exceeds 5mm at the moment, and the outline of the hole deviates from the field of view by more than half. It is difficult to infer to which hole the erroneous measurement belongs, and this degree of deviation is an abnormally large manufacturing error, so that an exception is reported for all the measurement points in the field of view.
The invention first studies the measured characteristics of an ideal combined hole, i.e. the situation that all can appear in the form of a complete profile in the field of view. According to the actual situation of the combined hole point cloud, determining the search step length and the voting interval of the Hough transform method, and calculating the initial hole centers and the radii of the holes. And establishing contour point dividing parameters on the basis of the contour point dividing parameters, and establishing the corresponding relation between the contour points and the holes. Due to the establishment of the corresponding relation, the influence of the gross errors in the point cloud to be fitted on the fitting result is relatively low, and the proportion is low, so the gross errors are iteratively removed by adopting the Grabbs criterion and combining geometric fitting. In most cases, the point cloud to be fitted does not contain gross errors, and stable and accurate fitting parameters without truncation errors can be directly obtained by using the method. The point cloud segmentation and fitting method has the advantages that when the incomplete contour is detected, the effect is unchanged when the incomplete contour of a half of the contour is detected; when more than half of the holes are detected, the effective contour points are too few, so that an incorrect initial hole center and radius can be obtained, and the detection result is incorrect. However, the chapter proves that incomplete holes can not appear in a view field when the characteristic pose of the combined hole fluctuates within an acceptable range (5mm) according to the white automobile body design specification, and therefore the robustness of the algorithm is proved.
The above description is only for the preferred embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present application should be covered within the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (8)

1. A combined hole contour point detection and segmentation method based on Hough transform is characterized by comprising the following steps:
s1, extracting point cloud data of the combined hole smooth tool curve to obtain a plurality of end points;
s2, distinguishing each end point, judging whether the end point is a contour point or an interference point, and establishing a corresponding relation between the contour point and a hole based on the contour point to obtain the shape and the position of the hole;
and S3, based on the contour points of the holes, eliminating the points which are wrongly segmented by using a circle fitting iteration method, and obtaining the characteristic parameters of the holes.
2. The hough transform-based combined hole contour point detection and segmentation method of claim 1, wherein the S1 comprises:
acquiring a light knife image in an interested region, preprocessing the light knife image, detecting the outline of the preprocessed light knife image, and sequencing the outline according to the size;
setting a contour perimeter threshold, removing all contours with contour perimeters smaller than the contour perimeter threshold, calculating a central point set for the contours which are not removed by using a gray centroid method, and sequentially storing the calculation results in an array;
and judging whether the center point is an end point according to the continuity of the center point and the position relation with the ROI boundary.
3. The hough transform-based combined hole contour point detection and segmentation method of claim 1, wherein the S2 comprises:
and sequentially connecting contour points corresponding to the holes in the preprocessed image to form a contour point track, and detecting the geometric shape of the contour point track by using a Hough transform method.
4. The hough transform-based combined hole contour point detection and segmentation method of claim 3, wherein the S2 further comprises:
aiming at the small number and sparse distribution of contour points, the initial position and the initial aperture of the hole center of each hole in the image are obtained by setting the initial parameters of Hough circle transformation;
and taking the initial hole center position as a center, adjusting on the basis of the initial hole diameter, drawing a circle by taking the adjusted parameters as a radius, wherein the end point in the circle is the contour point of the hole, and the end point which is not detected as the contour point is the interference point.
5. The hough transform-based combined hole contour point detection and segmentation method of claim 3, wherein detecting the geometry of the contour point trajectories using hough transform comprises:
end points (a) in image space using Hough circle transformi,bi) Accumulator mapping into Hough space (x)j,yj,rj) In the middle, the mapping relation is as follows:
Figure FDA0003395051080000021
in the formula, (x, y) is a circle center coordinate, r is a radius, theta is an angle between an end point and a circle center connecting line, and the range is 0-360 degrees;
discretizing the parameter space, limiting the range of r, traversing theta and r by step length, completing one-to-many mapping of end points, and adding 1 to the value in the corresponding accumulator;
after all end points are mapped, the parameters corresponding to the local peak values of the accumulator in the Hough space are detected circular parameters; and taking the first n peak values when a plurality of peak values exist, wherein n is the number of circles in the preset image.
6. The Hough transform-based combined hole contour point detection and segmentation method of claim 5, wherein adjusting the calculated circle parameter to compensate for possible parameter errors comprises:
and if the discrete intervals of three parameters of the accumulator are respectively delta x, delta y and delta R, the circle center position error delta D and the radius error delta R obtained by Hough transform respectively satisfy the following conditions:
Figure FDA0003395051080000031
Figure FDA0003395051080000032
adjusting the radius R of the circle obtained by original Hough transform as:
Figure FDA0003395051080000033
namely ensuring that the adjusted circle is internally tangent or contained with the actual circle, and the maximum distance between the adjusted circle and the actual circle center and the actual circle radius RrThe difference of (d) is:
Figure FDA0003395051080000034
i.e. an end point independent of the hole from the edge of the hole
Figure FDA0003395051080000035
In the above, the division is not mistaken.
7. The Hough transform-based combined hole contour point detection and segmentation method of claim 5, wherein the S3 comprises:
fitting parameters of a plane where the holes are located;
and projecting the contour points in the data set to the plane where the holes are located, and performing geometric fitting of a circle on the projection points, namely fitting relevant parameters of the holes.
8. The hough transform-based combined hole contour point detection and segmentation method of claim 7, wherein the S3 further comprises employing: and (5) eliminating gross errors through circle fitting iteration according to a Grubbs criterion gross error judgment criterion.
CN202111511667.4A 2021-12-06 2021-12-06 Combined hole contour point detection and segmentation method based on Hough transform Pending CN114170259A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111511667.4A CN114170259A (en) 2021-12-06 2021-12-06 Combined hole contour point detection and segmentation method based on Hough transform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111511667.4A CN114170259A (en) 2021-12-06 2021-12-06 Combined hole contour point detection and segmentation method based on Hough transform

Publications (1)

Publication Number Publication Date
CN114170259A true CN114170259A (en) 2022-03-11

Family

ID=80485627

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111511667.4A Pending CN114170259A (en) 2021-12-06 2021-12-06 Combined hole contour point detection and segmentation method based on Hough transform

Country Status (1)

Country Link
CN (1) CN114170259A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118229679A (en) * 2024-05-22 2024-06-21 西安交通工程学院 Method for detecting surface flatness of clamp for mechanical production

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118229679A (en) * 2024-05-22 2024-06-21 西安交通工程学院 Method for detecting surface flatness of clamp for mechanical production

Similar Documents

Publication Publication Date Title
CN110349252B (en) Method for constructing actual machining curve of small-curvature part based on point cloud boundary
CN102589435B (en) Efficient and accurate detection method of laser beam center under noise environment
US11900634B2 (en) Method for adaptively detecting chessboard sub-pixel level corner points
CN110349199B (en) Object roundness measuring method
CN109690237B (en) Method for controlling the contour consistency of curved surfaces of turbine components
CN113034485A (en) Circle detection method integrating Hough transformation and caliper clustering
JP2005538473A (en) A method for minimizing the influence of interference signals in the calculation of shape elements from coordinate points.
CN113074656B (en) Workpiece hole measuring method
CN113838054A (en) Mechanical part surface damage detection method based on artificial intelligence
CN115082472B (en) Quality detection method and system for hub mold casting molding product
CN109993758A (en) Dividing method, segmenting device, computer equipment and storage medium
CN116740060B (en) Method for detecting size of prefabricated part based on point cloud geometric feature extraction
CN114170259A (en) Combined hole contour point detection and segmentation method based on Hough transform
CN116740072A (en) Road surface defect detection method and system based on machine vision
CN107610174B (en) Robust depth information-based plane detection method and system
CN107274446B (en) Method for identifying sharp geometric edge points by using normal consistency
CN117808799B (en) Chamfering equipment processing quality detection method based on artificial intelligence
CN115235375A (en) Multi-circle characteristic parameter measuring method, detecting method and device for cover plate type workpiece
CN117058411B (en) Method, device, medium and equipment for identifying edge appearance flaws of battery
CN116883446B (en) Real-time monitoring system for grinding degree of vehicle-mounted camera lens
CN114419140A (en) Positioning algorithm for light spot center of track laser measuring device
CN108827197B (en) Linear array industrial CT homogeneous material size measurement method capable of reducing edge degradation influence
CN113432585A (en) Non-contact hub position accurate measurement method based on machine vision technology
CN112729157A (en) Sheet metal part measuring method based on four-step phase shift and binocular stereoscopic vision fusion
CN110490865A (en) Stud point cloud segmentation method based on the high light-reflecting property of stud

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