Inner ring defect detection method
By acquiring 3D images of internal hole components using an industrial camera, constructing the internal hole contour line and fitting the inner circle, and calculating the vertical distance between sampling points, the problem of low efficiency in internal hole defect detection in existing technologies is solved, achieving efficient and accurate internal hole defect detection.
Patent Information
- Application Number
- CN202511737850.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-25
- Publication Date
- 2026-02-17
AI Technical Summary
Existing technologies are insufficient for efficiently detecting internal defects in components with internal holes (such as bushings, gaskets, and heat dissipation components), such as broken bushings, metal burrs on the inner surface of gaskets, and deformation of the inner wall of heat dissipation components.
3D images of components are acquired using an industrial camera, the inner hole contour is constructed, the inner circle is fitted using the least squares method, the vertical distance of sampling points or the difference between the sampling points and the center of the inner circle is calculated, and a threshold is set to judge defects.
It improves the efficiency of internal hole defect detection, can accurately identify internal hole defects, and ensures the continuity and accuracy of detection.
Smart Images

Figure CN121544571A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of measurement, in particular to a method for detecting inner ring defects. BACKGROUND
[0002] In the field of industrial applications, it is common to use industrial cameras for defect detection. For elements with inner holes (such as shaft sleeves, gaskets, heat dissipation elements, etc.), the inner holes also need to be detected to determine whether there are some serious defects (such as shaft sleeve fracture, metal burrs on the inner surface of the gasket, deformation on the inner wall of the heat dissipation element, etc.). How to use industrial cameras to detect defects in the inner holes of elements with inner holes is a direction worth exploring in the industry. SUMMARY
[0003] The purpose of the present application is to provide a method for detecting inner ring defects to solve the problems in the prior art.
[0004] To achieve the above purpose, the inner hole defect detection method of the present application comprises the following steps: Step 1: Use an industrial camera to obtain a 3D image of an element with an inner hole; Step 2: Extract the inner hole contour line of the element; Step 3: Construct an inner circle according to the sampling points on the contour line; Step 4: Obtain N sampling points on the inner hole contour line obtained in step 2 at equal intervals, calculate the perpendicular distance of each sampling point from the inner circle, and determine whether the absolute value of the perpendicular distance exceeds a set threshold value. If there is one that exceeds, it is considered to have a defect.
[0005] According to the above main features, step 2 specifically includes: First, construct a caliper tool selection area and set the caliper position, caliper number, caliper length and caliper width. The caliper position is determined according to the approximate position of the inner hole to define the detection area, ensuring that the caliper covers the range where the inner hole edge may appear. The number of calipers is evenly distributed along the circumferential direction of the inner hole, and the number should be sufficient to ensure the continuity of the contour line. The caliper length should cover the gray scale variation range of the inner hole edge. The caliper width is the size of the caliper perpendicular to the scanning direction, which is used to calculate the average gray scale of the local area. The width should match the roughness of the inner hole edge; Second, generate a contour according to the average gray scale value in the scanning direction and the projection direction. In the scanning direction, the gray scale value at each position is calculated by scanning point by point along the caliper length direction, and the edge is identified by the gray scale gradient change. In the projection direction, the edge points detected by the caliper are projected onto the same coordinate system along the preset direction to form a preliminary contour line. Then, the average gray scale value within the caliper width range in the projection direction is calculated, which can be used as the contour data in the caliper area. Third: Apply Gaussian filtering to the contour; Fourth: Calculate the contour gradient. Obtain the edge intensity distribution by calculating the gray-level gradient change. On each caliper, the pixel with the largest gradient value can be selected as the edge point. Fifth: Extract edge points to form the inner hole contour line according to the preset parameters. The preset parameters include detection direction, gradient threshold and position filtering parameters. The detection direction is the expected gradient direction of the inner hole edge from the inside to the outside. The gradient threshold is the lower limit of the set gradient value. Only points with gradients exceeding the threshold are retained as candidate edge points, and noise points with low gradients are filtered out. The position filtering is combined with the expected position of the inner hole to remove edge points that are obviously deviated from the range.
[0006] Based on the above main characteristics, step three specifically includes: First: Use the least squares method to fit all sampling points to an initial circle, and then apply this method to the sampling points on the contour line. Minimize the sum of squared errors to find the center of the circle. and radius : ; Second: Based on the current center position and radius, calculate the distance error of each sampling point from the edge of the initial circle in the radial direction. ; Third: Set the number of outliers to be removed, K, and remove the K sampling points with the largest distance error. The setting of K is based on the actual image quality and engineering experience. Fourth: Use the remaining sampling points to refit the circle to form the inner circle.
[0007] To achieve the above objectives, the internal hole defect detection method of the present invention includes the following steps: Step 1: Use an industrial camera to obtain a 3D image of the component with an internal hole; Step 2: Extract the inner hole contour line of the above components; Step 3: Construct the inner circle based on the sampling points sampled on the contour line; Step 4: Obtain N sampling points on the inner hole contour line obtained in Step 2 at equal intervals. Calculate the distance between each sampling point and the center of the reconstructed inner circle after removing abnormal points in Step 3. Then compare it with the radius of the inner circle. If the absolute value of at least one difference exceeds the set threshold, it is considered that there is a defect.
[0008] Based on the above main characteristics, step two specifically includes: First: Construct the caliper tool selection area and set the caliper position, number of calipers, caliper length, and caliper width. The caliper position is determined by roughly defining the detection area based on the inner hole's approximate location, ensuring the calipers cover the possible range of the inner hole's edge. The number of calipers should be evenly distributed along the circumference of the inner hole, and sufficient to ensure the continuity of the contour line. The caliper length should cover the grayscale variation range of the inner hole's edge. The caliper width is the dimension of the caliper perpendicular to the scanning direction, used to calculate the average grayscale of the local area; the width must match the roughness of the inner hole's edge. Second: Generate a contour based on the average gray value according to the scanning direction and the projection direction. In the scanning direction, the gray value is calculated point by point along the length of the caliper, and the edge is identified by the gray gradient change. In the projection direction, the edge points detected by the caliper are projected onto the same coordinate system along a preset direction to form a preliminary contour line. Then, the gray value of the gray value within the width range of the caliper is averaged along the projection direction, and the value can be used as the contour data of the caliper area. Third: Apply Gaussian filtering to the contour; Fourth: Calculate the contour gradient. Obtain the edge intensity distribution by calculating the gray-level gradient change. On each caliper, the pixel with the largest gradient value can be selected as the edge point. Fifth: Extract edge points to form the inner hole contour line according to the preset parameters. The preset parameters include detection direction, gradient threshold and position filtering parameters. The detection direction is the expected gradient direction of the inner hole edge from the inside to the outside. The gradient threshold is the lower limit of the set gradient value. Only points with gradients exceeding the threshold are retained as candidate edge points, and noise points with low gradients are filtered out. The position filtering is combined with the expected position of the inner hole to remove edge points that are obviously deviated from the range.
[0009] Based on the above main characteristics, step three specifically includes: First, using the least squares method to fit all sampling points into an initial circle; Second, calculating the distance error of each sampling point from the edge point of the initial circle in the radial direction according to the current center position and radius; Third, setting the number of outlier points to be removed, K, and removing the K sampling points with the largest distance error, wherein the setting of K is based on the actual image quality and engineering experience; Fourth, using the remaining sampling points to refit the circle to form the inner circle.
[0010] Compared with existing technologies, this invention uses an industrial camera to obtain a 3D image of a component with an inner hole, then constructs the outline of the inner hole, and constructs an inner circle based on the sampling points sampled on the outline. It then determines whether the vertical distance between the sampling points on the outline and the inner circle or the distance between the sampling points and the center of the inner circle exceeds a set threshold, thereby judging defects in the inner circle. This can improve the efficiency of detection. Attached Figure Description
[0011] Figure 1A schematic flowchart illustrating the internal hole defect detection method of the present invention.
[0012] Figure 2 This is a schematic diagram illustrating the process of extracting the inner hole contour line of a component with an inner hole in order to implement the inner hole defect detection method of the present invention.
[0013] Figure 3 This is a flowchart illustrating a second embodiment of the internal hole defect detection method of the present invention.
[0014] Figure 4 To obtain 3D images of components with internal holes using industrial cameras.
[0015] Figure 5 This is a diagram showing the results of extracting sampling points from the inner borehole. Detailed Implementation
[0016] Please see Figure 1 , Figure 4 and Figure 5 As shown, where Figure 1 A schematic flowchart illustrating the internal hole defect detection method of the present invention. Figure 4 To obtain 3D images of components with internal holes using industrial cameras. Figure 5 This is an image showing the results of extracting sampling points from the inner bore. (Example:) Figure 1 As shown, the internal hole defect detection method of the present invention includes the following steps: Step 1: Use an industrial camera to obtain a 3D image of the component with internal holes, such as... Figure 4 As shown; Step 2: Extract the inner hole contour line of the above components; such as... Figure 2 As shown, it specifically includes: First: Construct the caliper tool selection area and set the caliper position, number of calipers, caliper length, and caliper width. The caliper position is determined by roughly defining the detection area based on the inner hole's approximate location, ensuring the calipers cover the possible range of the inner hole's edge. The number of calipers should be evenly distributed along the circumference of the inner hole, and sufficient to ensure the continuity of the contour line. The caliper length should cover the grayscale variation range of the inner hole's edge. The caliper width is the dimension of the caliper perpendicular to the scanning direction, used to calculate the average grayscale of the local area; the width must match the roughness of the inner hole's edge. Second: Generate a contour based on the average gray value according to the scanning direction and the projection direction. In the scanning direction, the gray value is calculated point by point along the length of the caliper, and the edge is identified by the gray gradient change. In the projection direction, the edge points detected by the caliper are projected onto the same coordinate system along a preset direction to form a preliminary contour line. Then, the gray value of the gray value within the width range of the caliper is averaged along the projection direction, and the value can be used as the contour data of the caliper area. Third: Apply Gaussian filtering to the contour; Fourth: Calculate the contour gradient. Obtain the edge intensity distribution by calculating the gray-level gradient change. On each caliper, the pixel with the largest gradient value can be selected as the edge point. Fifth: Extract edge points to form the inner hole contour line according to the preset parameters. The preset parameters include detection direction, gradient threshold and position filtering parameters. The detection direction is the expected gradient direction of the inner hole edge from the inside to the outside. The gradient threshold is the lower limit of the set gradient value. Only points with gradients exceeding the threshold are retained as candidate edge points, and noise points with low gradients are filtered out. The position filtering is combined with the expected position of the inner hole to remove edge points that are obviously deviated from the range.
[0017] Step 3: Construct the inner circle based on the sampling points sampled from the contour line; specifically including: First: Use the least squares method to fit all sampling points to an initial circle, and then apply this method to the sampling points on the contour line. Minimize the sum of squared errors to find the center of the circle. and radius : ; Second: Based on the current center position and radius, calculate the distance error of each sampling point from the edge of the initial circle in the radial direction. ; Third: Set the number of outliers to be removed, K, and remove the K sampling points with the largest distance error. The setting of K is based on the actual image quality and engineering experience. Fourth: Use the remaining sampling points to refit the circle to form the inner circle.
[0018] Step 4: Obtain N sampling points on the inner hole contour line obtained in Step 2 at equal intervals, and calculate the vertical distance of each sampling point from the inner circle (i.e., the distance in the radial direction between the sampling point and the edge point of the reconstructed inner circle after removing outliers in Step 3). This distance directly reflects the radial deviation of the sampling point relative to the ideal inner circle. It is determined whether the absolute value of the above vertical distance exceeds the set threshold. If one of them exceeds the threshold, it is considered that there is a defect.
[0019] Please see Figure 3 The diagram shown is a flowchart illustrating a second embodiment of the internal hole defect detection method of the present invention. The internal hole defect detection method disclosed in the second embodiment includes the following steps: Step 1: Use an industrial camera to obtain a 3D image of the component with an internal hole; Step 2: Extract the inner hole contour line of the above components; such as... Figure 2As shown, the specific steps include: First, constructing a caliper tool selection area and setting the caliper position, number of calipers, caliper length, and caliper width; Second, generating a contour according to the average gray value based on the scanning direction and projection direction; Third, applying Gaussian filtering to the contour; Fourth, calculating the contour gradient; Fifth, extracting edge points to form the inner hole contour line according to pre-set parameters, wherein the pre-set parameters include detection direction, gradient threshold, and position filtering parameters.
[0020] Step 3: Construct an inner circle based on the sampling points sampled on the contour line; specifically including: First: Use the least squares method to fit all sampling points to an initial circle; Second: Calculate the distance error of each sampling point from the edge point of the initial circle in the radial direction based on the current center position and radius; Third: Set the number of outlier points to be removed, K, and remove the K sampling points with the largest distance error, where K is set according to the actual image quality and engineering experience; Fourth: Use the remaining sampling points to refit the circle to form the inner circle.
[0021] Step 4: Obtain N sampling points on the inner hole contour line obtained in Step 2 at equal intervals. Calculate the distance between each sampling point and the center of the reconstructed inner circle after removing abnormal points in Step 3. Then compare it with the radius of the inner circle. If the absolute value of at least one difference exceeds the set threshold, it is considered that there is a defect.
[0022] Compared with existing technologies, this invention uses an industrial camera to obtain a 3D image of a component with an inner hole, then constructs the outline of the inner hole, and constructs an inner circle based on the sampling points sampled on the outline. It then determines whether the vertical distance between the sampling points on the outline and the inner circle or the distance between the sampling points and the center of the inner circle exceeds a set threshold, thereby judging defects in the inner circle. This can improve the efficiency of detection.
[0023] It is understood that those skilled in the art can make equivalent substitutions or modifications to the technical solution and inventive concept of the present invention, and all such substitutions or modifications should fall within the protection scope of the appended claims.
Claims
1. A method for detecting inner ring defects, characterized in that... The method includes the following steps: Step 1: Use an industrial camera to obtain a 3D image of the component with an internal hole; Step 2: Extract the inner hole contour line of the above components; Step 3: Construct the inner circle based on the sampling points sampled from the contour line; Step 4: Obtain N sampling points on the inner hole contour line obtained in Step 2 at equal intervals, calculate the vertical distance of each sampling point from the inner circle, and determine whether the absolute value of the above vertical distance exceeds the set threshold. If any one of them exceeds the threshold, it is considered that there is a defect.
2. The inner ring defect detection method as described in claim 1, characterized in that: Step two specifically includes: First: Construct the caliper tool selection area and set the caliper position, number of calipers, caliper length, and caliper width. The caliper position is determined by roughly defining the detection area based on the inner hole's approximate location, ensuring the calipers cover the possible range of the inner hole's edge. The number of calipers should be evenly distributed along the circumference of the inner hole, and sufficient to ensure the continuity of the contour line. The caliper length should cover the grayscale variation range of the inner hole's edge. The caliper width is the dimension of the caliper perpendicular to the scanning direction, used to calculate the average grayscale of the local area; the width must match the roughness of the inner hole's edge. Second: Generate a contour based on the average gray value according to the scanning direction and the projection direction. In the scanning direction, the gray value is calculated point by point along the length of the caliper, and the edge is identified by the gray gradient change. In the projection direction, the edge points detected by the caliper are projected onto the same coordinate system along a preset direction to form a preliminary contour line. Then, the gray value of the gray value within the width range of the caliper is averaged along the projection direction, and the value can be used as the contour data of the caliper area. Third: Apply Gaussian filtering to the contour; Fourth: Calculate the contour gradient. Obtain the edge intensity distribution by calculating the gray-level gradient change. On each caliper, the pixel with the largest gradient value can be selected as the edge point. Fifth: Extract edge points to form the inner hole contour line according to the preset parameters. The preset parameters include detection direction, gradient threshold and position filtering parameters. The detection direction is the expected gradient direction of the inner hole edge from the inside to the outside. The gradient threshold is the lower limit of the set gradient value. Only points with gradients exceeding the threshold are retained as candidate edge points, and noise points with low gradients are filtered out. The position filtering is combined with the expected position of the inner hole to remove edge points that are obviously deviated from the range.
3. The inner ring defect detection method as described in claim 1, characterized in that: Step three specifically includes: First: Use the least squares method to fit all sampling points to an initial circle, and then apply this method to the sampling points on the contour line. Minimize the sum of squared errors to find the center of the circle. and radius : ; Second: Based on the current center position and radius, calculate the distance error of each sampling point from the edge of the initial circle in the radial direction. ; Third: Set the number of outliers to be removed, K, and remove the K sampling points with the largest distance error. The setting of K is based on the actual image quality and engineering experience. Fourth: Use the remaining sampling points to refit the circle to form the inner circle.
4. A method for detecting inner ring defects, characterized in that... The method includes the following steps: Step 1: Use an industrial camera to obtain a 3D image of the component with an internal hole; Step 2: Extract the inner hole contour line of the above components; Step 3: Construct the inner circle based on the sampling points sampled from the contour line; Step 4: Obtain N sampling points on the inner hole contour line obtained in Step 2 at equal intervals. Calculate the distance between each sampling point and the center of the reconstructed inner circle after removing abnormal points in Step 3. Then compare it with the radius of the inner circle. If the absolute value of at least one difference exceeds the set threshold, it is considered that there is a defect.
5. The inner ring defect detection method as described in claim 4, characterized in that: Step two specifically includes: First: Construct the caliper tool selection area and set the caliper position, number of calipers, caliper length, and caliper width. The caliper position is determined by roughly defining the detection area based on the inner hole's approximate location, ensuring the calipers cover the possible range of the inner hole's edge. The number of calipers should be evenly distributed along the circumference of the inner hole, and sufficient to ensure the continuity of the contour line. The caliper length should cover the grayscale variation range of the inner hole's edge. The caliper width is the dimension of the caliper perpendicular to the scanning direction, used to calculate the average grayscale of the local area; the width must match the roughness of the inner hole's edge. Second: Generate a contour based on the average gray value according to the scanning direction and the projection direction. In the scanning direction, the gray value is calculated point by point along the length of the caliper, and the edge is identified by the gray gradient change. In the projection direction, the edge points detected by the caliper are projected onto the same coordinate system along a preset direction to form a preliminary contour line. Then, the gray value of the gray value within the width range of the caliper is averaged along the projection direction, and the value can be used as the contour data of the caliper area. Third: Apply Gaussian filtering to the contour; Fourth: Calculate the contour gradient. Obtain the edge intensity distribution by calculating the gray-level gradient change. On each caliper, the pixel with the largest gradient value can be selected as the edge point. Fifth: Extract edge points to form the inner hole contour line according to the preset parameters. The preset parameters include detection direction, gradient threshold and position filtering parameters. The detection direction is the expected gradient direction of the inner hole edge from the inside to the outside. The gradient threshold is the lower limit of the set gradient value. Only points with gradients exceeding the threshold are retained as candidate edge points, and noise points with low gradients are filtered out. The position filtering is combined with the expected position of the inner hole to remove edge points that are obviously deviated from the range.
6. The inner ring defect detection method as described in claim 4, characterized in that: Step 3 specifically includes: First, using the least squares method to fit all sampling points to an initial circle; Second, based on the current center position and radius, calculating the distance error of each sampling point from the edge point of the initial circle in the radial direction; Third, setting the number of outlier points to be removed, K, and removing the K sampling points with the largest distance error, wherein the setting of K is based on the actual image quality and engineering experience; Fourth, using the remaining sampling points to refit the circle to form the inner circle.