A method for detecting the rotation angle of holes in the sidewall of a column

By using a color laser emitter and machine vision technology, combined with ROI region processing and affine transformation, the problem of low accuracy in detecting the rotation angle of holes on the sidewall of a column was solved, achieving efficient and accurate angle detection.

CN116542935BActive Publication Date: 2025-12-02SHANGHAI ZHIYIN AUTOMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310515682.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-09
Publication Date
2025-12-02
Estimated Expiration
2043-05-09

AI Technical Summary

Technical Problem

In existing technologies, the detection accuracy and effectiveness of rotation angle of holes in the sidewalls of columns are low, which is difficult to meet the needs of industrial production.

Method used

Using a colored laser emitter as the light source, combined with machine vision technology, the rotation angle of the cylinder is calculated through ROI region processing, light stripe centerline extraction, breakpoint filling and smoothing, key point detection, and least squares method and affine transformation.

Benefits of technology

It enables rapid and accurate detection of the rotation angle of holes on the side wall of a column, improving detection efficiency and accuracy, and meeting the requirements of industrial production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116542935B_ABST
    Figure CN116542935B_ABST
Patent Text Reader

Abstract

This invention provides a method for detecting the rotation angle of holes in the sidewall of a column, characterized by the following steps: Step 1: image acquisition; Step 2: extraction of the laser center line; Step 3: supplementation of breakpoints and smoothing of curves; Step 4: detection of key points; Step 5: calculation of the rotation angle. This positioning method can quickly and accurately detect the rotation angle of holes in the sidewall of a column, with high detection accuracy, meeting the requirements of industrial production, and is simple to operate and highly practical.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine vision technology, and in particular to a method for detecting the rotation angle of holes in the sidewall of a column. Background Technology

[0002] Machine vision technology is an interdisciplinary field involving many areas such as artificial intelligence, neurobiology, psychophysics, image processing, and pattern recognition. Machine vision mainly uses computers to simulate human visual functions, extract information from images of objective things, process and understand it, and finally use it for actual detection, measurement and control.

[0003] In the field of machine vision technology, it is often necessary to detect and identify the rotation angle of holes on the side wall of a cylinder. However, since the side wall of the cylinder is curved, problems such as poor hole recognition effect and low accuracy of rotation angle detection occur. Summary of the Invention

[0004] In view of the above technical problems, the present invention provides a method for detecting the rotation angle of holes in the side wall of a column, which can improve detection efficiency and detection accuracy.

[0005] This invention provides a method for detecting the rotation angle of holes in the sidewall of a column, characterized by the following steps:

[0006] Step 1: Image acquisition. Use a color laser emitter as the light source for the hole in the side wall of the column. Position the laser emitter directly above the hole in the side wall of the column so that the laser beam shines perpendicularly into the hole. The camera, the column, and the laser emitter are on the same plane.

[0007] Step 2: Extract the laser center line. By setting the Region of Interest (ROI), a common method in machine vision, the detection range is narrowed. The image within the ROI is preprocessed to eliminate interference points, and the center line of the light stripe is extracted from the preprocessed image.

[0008] Step 3: Add breakpoints and smooth the curve. Detect the center line of the light stripe within the ROI region from left to right and from top to bottom, and determine if any breaks occur. If breaks are found, add breakpoints. If no breaks are found, no breakpoints need to be added. This will ultimately result in a relatively complete curve.

[0009] Step 4: Detection of key points. Based on the fluctuation characteristics of the light stripe curve, the location where the curve breaks or inflection point appears is the edge of the hole. Therefore, the rotation direction and angle of the column can be calculated based on the edge position of the hole.

[0010] Step 5: Calculate the rotation angle. The image presented by the laser irradiating the cylinder is an approximate ellipse. The laser bright bar image is fitted into an ellipse using the least squares method, with the following formula: Let the equation of the ellipse be: Ax 2 +Bxy+Cy 2 +Dx+Ey+F=0, according to the principle of least squares, the fitted objective function is: To minimize the value of F(A,B,C,D,E), we need to make Solving the equation yields the values ​​of coefficients A, B, C, D, and E. Based on the rotation of the cylinder, the coordinates of the point where the laser intersects the edge of the hole are determined. Then, the ellipse is fitted to a unit circle using an affine transformation. The calculation formula is as follows: Let the standard equation of the ellipse be: The standard equation of the unit circle is: x' 2 +y' 2 =1, let This allows us to radially transform the ellipse into a unit circle. We then convert the coordinates on the ellipse before and after rotation to coordinates on the circle, thus calculating the direction and angle of the cylinder's rotation. The formula for calculating the angle is as follows: Let P1'(x1,y1) and P3'(x2,y2) be two points on the unit circle, the angle between P1' and the x-axis be β, the angle between P3' and the x-axis be α, and the rotation angle of the cylinder be θ.

[0011] In step one, the angle between the laser beam and the long axis of the cylinder is 90°. In step one, the camera and the laser emitter should have a certain angle, preferably between 30° and 60°.

[0012] In step two, the preferred regions of interest (ROIs) are rectangles, circles, annulus, and polygons. The preferred methods for extracting the center line of the light stripe in step two are the extreme value method, the gray-scale centroid method, the geometric center method, the parabolic fitting method, and the Hessian matrix method.

[0013] In step three, the preferred methods for smoothing the curve are moving average algorithm, locally weighted smoothing plotting technique, locally weighted multinomial regression fitting, and Savitzky-Golay.

[0014] The specific operation for calculating the inflection point position in step four is as follows: draw a straight line between two non-adjacent points, let the distance between the two points be step, and the distance from the midpoint of the two points to the straight line be dis. That is, the larger the value of dis, the greater the possibility that the point is an inflection point or a break point. The key point position of the edge of the hole is determined by adjusting the values ​​of step and dis.

[0015] The specific operation of step five is as follows: when the column is not rotating, the opening direction of the hole is perpendicular to the horizontal plane and upward, the laser intersects the edge of the hole at two coordinate points p1 and p2. Assuming that the column rotates counterclockwise, the laser intersects the edge of the hole at two other coordinate points p3 and p4. The ellipse is fitted to a unit circle through affine transformation, and the coordinates of the four points (p1, p2, p3, p4) on the ellipse before and after the rotation are converted into the coordinates of four points (p1', p2', p3', p4') on the circle. Knowing the coordinates of the edge of the hole before the column rotates and the coordinates of the edge of the hole after the rotation, the direction and angle of the column rotation can be calculated.

[0016] The beneficial effects of this invention are as follows: This invention is a method for detecting the rotation angle of holes in the sidewall of a column. Through five specific steps combined with the calculation of corresponding formulas and image processing, the rotation angle of holes in the sidewall of a column can be detected quickly and accurately, improving detection efficiency and accuracy. It can meet the requirements of industrial production, is easy to operate, and has strong practicality. Attached Figure Description

[0017] Figure 1 This is a schematic diagram of the hole angle detection system of the present invention;

[0018] Figure 2 This is a schematic diagram of the assembly of the laser irradiation column of the present invention;

[0019] Figure 3 This is an image of a light stripe produced when the red laser of the present invention illuminates the side wall of a column;

[0020] Figure 4 This is a schematic diagram of an image showing the extraction of the center line of the light stripe according to the present invention;

[0021] Figure 5 This is a schematic diagram illustrating the process of filling in breakpoints and smoothing curves in the centerline image according to the present invention.

[0022] Figure 6 This is a diagram showing the detection of the edge position of the hole in the cylindrical sidewall of the present invention;

[0023] Figure 7 This is a simplified diagram for calculating the rotation angle of this invention;

[0024] Figure 8 This is a simplified diagram for calculating the rotation angle of this invention;

[0025] Figure 9 This is a diagram illustrating the affine transformation in this invention.

[0026] Reference numerals: 1-Laser emitter; 2-Camera; 3-Column; 4-Hole. Detailed Implementation

[0027] Example 1

[0028] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings.

[0029] First, image acquisition is performed. Specifically, a color laser emitter 1 is used as the light source to illuminate the hole 4 on the side wall of the column 3. The laser emitter 1 is positioned directly above the hole 4, ensuring the laser beam is perpendicular to the hole 4. The angle between the laser beam and the long axis of the column 3 is 90°. Figure 2 As shown.

[0030] Camera 2, column 3, and laser emitter 1 should be on the same plane. Camera 2 should be used to shoot at an angle, that is, the camera and the light source should have a certain angle. However, the angle is not limited to a specific degree and can be set to a value between 30° and 60°. It can be adjusted to a suitable value according to actual needs. The laser color is not limited to a specific color and can be selected according to the actual image effect.

[0031] Then, the laser centerline is extracted. Specifically, a Region of Interest (ROI) is defined using common machine vision methods to narrow the detection range and improve speed. This ROI can be rectangular, circular, annular, polygonal, etc. Next, the image within the ROI is preprocessed to eliminate interference points, facilitating subsequent angle detection. The preprocessed image can then be extracted using methods such as extreme value methods, gray-level centroid methods, geometric center methods, parabolic fitting methods, and Hessian matrix methods to extract the centerline of the light stripe. The extraction results are shown below. Figure 4 As shown.

[0032] The next step is to add breakpoints and smooth the curve. Adding breakpoints helps in the later detection of key points. Specifically, the center line of the light stripe within the ROI region is checked from left to right and from top to bottom to determine if a breakpoint occurs. If a breakpoint is found, it is added; otherwise, no breakpoint is added, resulting in a more complete curve. To reduce or eliminate curve oscillations, algorithms such as moving average, locally weighted smoothing, locally weighted multinomial regression fitting, and Savitzky-Golay can be used to smooth the curve. The smoothed curve is shown below. Figure 5 As shown.

[0033] Following this, key point detection is performed, specifically as follows: based on Figure 5 The curve fluctuation characteristics show that the location where the curve breaks or inflects is the edge of the hole. Therefore, the rotation direction and angle of the column can be calculated based on the location of the hole.

[0034] To calculate the location of an inflection point, a straight line can be drawn between two non-adjacent points. Let the distance between these two points be 'step', and the distance from the midpoint of these two points to the line be 'dis'. The larger the value of 'dis', the greater the likelihood that the point is an inflection point or a breakpoint. By adjusting the values ​​of 'step' and 'dis', the location of key points on the edge of the hole can be determined. The detection effect of the edge location of the hole on the sidewall of the cylinder is as follows: Figure 6 As shown.

[0035] Finally, the rotation angle is calculated. The specific steps are as follows: Figure 7 As shown, because camera 2 is shooting from an oblique angle, the image of the laser-irradiated column is an approximate elliptical image. The laser bright stripe image is fitted into an ellipse using the least squares method, with the following formula: Let the equation of the ellipse be: Ax 2 +Bxy+Cy 2 +Dx+Ey+F=0, according to the principle of least squares, the fitted objective function is: To minimize the value of F(A,B,C,D,E), we need to make Solving the equation yields the values ​​of coefficients A, B, C, D, and E.

[0036] When the column 3 is not rotating, and the opening direction of the hole 4 is perpendicular to the horizontal plane and upwards, the intersection points of the laser and the edge of the hole 4 are p1 and p2. Assuming the column 3 rotates counterclockwise, the coordinates of the intersection points of the laser and the edge of the hole 4 are p3 and p4. To easily calculate the angle of rotation of the column, we use... Figure 9 The affine transformation in calculus fits an ellipse to a unit circle. The calculation formula is as follows: Let the standard equation of the ellipse be: The standard equation of the unit circle is: x' 2 +y' 2 =1, let This allows the ellipse to be radially transformed into a unit circle. For example... Figure 8 As shown, points p1', p2', p3', and p4' are the points on the ellipse that correspond to the circles formed by affine transformations of p1, p2, p3, and p4, respectively.

[0037] Given the coordinates of the edge of the hole 4 before and after rotation of the cylinder 3, the direction and angle of rotation of the cylinder can be determined using trigonometric and inverse trigonometric formulas. For example... Figure 8 As shown, the formula for calculating the angle is as follows: Let P1'(x1,y1) and P3'(x2,y2) be two points on the unit circle, the angle between P1' and the x-axis is β, the angle between P3' and the x-axis is α, and the rotation angle of the cylinder is θ.

[0038]

[0039] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. The various components mentioned in this invention are common technologies in the existing field. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of this invention is defined by the appended claims and their equivalents.

Claims

1. A method for detecting the rotation angle of holes in the sidewall of a column, characterized in that... Includes the following steps: Step 1: Image acquisition. Use the color laser emitter as the light source for the hole in the side wall of the column. Position the laser emitter directly above the hole in the side wall of the column so that the laser beam shines perpendicularly into the hole in the side wall of the column. The camera, the column, and the laser emitter are on the same plane. Step 2: Extract the laser center line. By setting the Region of Interest (ROI), a common method in machine vision, the detection range is narrowed. The image within the ROI is preprocessed to eliminate interference points, and the center line of the light stripe is extracted from the preprocessed image. Step 3: Add breakpoints and smooth the curve. Detect the center line of the light stripe within the ROI area from left to right and from top to bottom, and determine if there is a break. If there is a break, add breakpoints; if there is no break, do not add breakpoints. Finally, obtain a relatively complete curve. Step 4: Detection of key points. Based on the fluctuation characteristics of the light stripe curve, the location where the curve breaks or inflection point appears is the edge of the hole. Therefore, the rotation direction and angle of the column can be calculated based on the edge position of the hole. Step 5: Calculate the rotation angle. The image presented by the laser irradiating the cylinder is an approximate ellipse. The laser bright bar image is fitted into an ellipse using the least squares method, with the following formula: Let the equation of the ellipse be: Ax 2 +Bxy+Cy 2 +Dx+Ey+F=0, according to the principle of least squares, the fitted objective function is: To minimize the value of F(A,B,C,D,E), we need to make Solving the equation yields the values ​​of coefficients A, B, C, D, and E. Based on the rotation of the cylinder, the coordinates of the point where the laser intersects the edge of the hole are determined. Then, an affine transformation is used to fit the ellipse to a unit circle. The calculation formula is as follows: Let the standard equation of the ellipse be: The standard equation of the unit circle is: x' 2 +y' 2 =1, let The ellipse can be radially transformed into a unit circle, and the coordinates on the ellipse before and after rotation can be converted to coordinates on the circle. This allows us to calculate the direction and angle of the cylinder's rotation. The formula for calculating the angle is as follows: Let P1'(x1,y1) and P3'(x2,y2) be two points on the unit circle, with β forming the angle between P1' and the x-axis, α forming the angle between P3' and the x-axis, and θ representing the angle of rotation of the cylinder. θ = β - α.

2. The method for detecting the rotation angle of a hole in the side wall of a column according to claim 1, characterized in that... In step one, the angle between the laser beam and the major axis of the cylinder is 90°. In step one, the camera and the laser emitter should have a certain angle between them, which is between 30° and 60°.

3. The method for detecting the rotation angle of a hole in the side wall of a column according to claim 1, characterized in that... In step two, the preferred regions of interest (ROIs) are rectangles, circles, annulus, and polygons. The preferred methods for extracting the center line of the light stripe in step two are the extreme value method, the gray-scale centroid method, the geometric center method, the parabolic fitting method, and the Hessian matrix method.

4. The method for detecting the rotation angle of a hole in the side wall of a column according to claim 1, characterized in that... The specific operation for calculating the inflection point position in step four is as follows: draw a straight line between two non-adjacent points, let the distance between the two points be step, and the distance from the midpoint of the two points to the straight line be dis. That is, the larger the value of dis, the greater the possibility that the point is an inflection point or a break point. The key point position of the edge of the hole is determined by adjusting the values ​​of step and dis.

5. The method for detecting the rotation angle of a hole in the side wall of a column according to claim 1, characterized in that... The specific operation of step five is as follows: when the column is not rotating, the opening direction of the hole is perpendicular to the horizontal plane and upward, the laser intersects the edge of the hole at two coordinate points p1 and p2. Assuming that the column rotates counterclockwise, the laser intersects the edge of the hole at two other coordinate points p3 and p4. Then, the ellipse is fitted to a unit circle through affine transformation, and the coordinates of the four points (p1, p2, p3, p4) on the ellipse before and after the rotation are converted into the coordinates of four points (p1', p2', p3', p4') on the circle. Knowing the coordinates of the edge of the hole before the column rotates and the coordinates of the edge of the hole after the rotation, the direction and angle of the column rotation can be calculated.

Citation Information

Patent Citations

  • Cylindrical surface longitudinal weld seam feature area extraction and weld seam tracking method and system based on structured light

    CN110064819A

  • Rotary inner cavity size detection method based on line laser

    CN114894090A