Rubber ring contour burr detection method and system based on geometric transformation
By fitting the rubber ring profile to an ellipse and mapping it to a standard circle, and combining polar coordinate transformation and wavelet transform, the problems of low efficiency and distortion interference in rubber ring profile burr detection are solved, and accurate detection of tiny burrs is achieved.
Patent Information
- Application Number
- CN202511144646.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-15
- Publication Date
- 2025-12-09
AI Technical Summary
In existing technologies, the detection efficiency of rubber ring contour burrs is low and highly subjective, making it difficult to achieve accurate and efficient detection of tiny burrs (3-5 pixels), especially when the rubber ring is placed at an angle, there is interference from elliptical distortion.
By fitting the outer contour of the rubber ring to an ellipse using the least squares method and mapping it to a standard circle, and combining polar coordinate transformation and wavelet transform, the accuracy of burr feature detection is enhanced.
It enables precise detection of minute burrs, improves detection accuracy and robustness, effectively eliminates distortion interference caused by the tilt of the rubber ring, and significantly enhances the detection capability of minute burrs.
Smart Images

Figure CN121095153A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, in particular to a rubber ring contour burr detection method and system based on geometric transformation. BACKGROUND
[0002] In the production process of O-shaped rubber ring, the tiny burrs or flash (usually only a few pixels after imaging) on the surface of the rubber ring contour is an important defect affecting the sealing performance.
[0003] In the related art, manual rubber ring contour burr detection has low efficiency and strong subjectivity; traditional algorithm-based rubber ring contour burr detection is not sensitive to sub-pixel level burrs; related art cannot achieve accurate and efficient detection of tiny burrs (3-5 pixels). SUMMARY
[0004] The present application aims to provide a rubber ring contour burr detection method and system based on geometric transformation, which aims to enhance the accuracy and robustness of burr feature detection through geometric transformation.
[0005] In order to achieve the above-mentioned purpose, the present application provides the following technical solutions: In a first aspect, the present application provides a rubber ring contour burr detection method based on geometric transformation, which comprises the following steps: S100, obtaining a rubber ring image and extracting the outer contour of the rubber ring and the contour of each burr in the rubber ring image; S200, fitting the outer contour of the rubber ring to obtain an ellipse using the least squares method, and mapping the ellipse to a standard circle: S300, performing bilinear interpolation resampling on the rubber ring image, performing polar coordinate transformation on the rubber ring image with the center of the standard circle as the origin, and generating an unwinding image; S400, generating a reconstructed image with enhanced burr features by wavelet transform, determining the burr parameters of the reconstructed image, mapping the burr parameters back to the Cartesian coordinate system of the rubber ring image, and generating a detection result containing burr number, position and size information.
[0006] Optionally, in S100, the rubber ring image is obtained and the contour of each burr in the rubber ring image is extracted, comprising: S110, preprocessing the obtained rubber ring image to obtain a gray-scale image; the preprocessing includes grayscale processing and Gaussian filter denoising; S120, performing edge detection on the gray-scale image, and performing binaryzation processing on the edge detection result to obtain a binary image containing the rubber ring contour; S130, profile extraction is performed on the binary image, an 8-neighborhood connection-based contour tracking algorithm is adopted, isolated regions with an area less than a set pixel are filtered out, and an outer contour of the rubber ring and contours of each burr are obtained.
[0007] Optionally, in S200, the least square method is used to fit the outer contour of the rubber ring to obtain an ellipse, and the ellipse is mapped to a standard circle, including: S210, fitting the outer contour of the rubber ring to an ellipse, constructing an error function by the least square method to minimize the sum of squares of distances from the contour points of the rubber ring to the ellipse, and solving to obtain ellipse parameters; the ellipse parameters include an ellipse center coordinate, a long semi-axis, a short semi-axis, and a rotation angle; S220, constructing a geometric transformation matrix based on the ellipse parameters, and performing rotation transformation and scaling transformation on the ellipse based on the geometric transformation matrix to map the ellipse to a standard circle.
[0008] Optionally, in S300, the rubber ring image is bilinearly interpolated and resampled, and polar coordinate transformation is performed on the rubber ring image with the center of the standard circle as the origin to generate an unwound image, including: S310, bilinearly interpolating and resampling the rubber ring image, and adjusting the image resolution to a set pixel according to the radius of the standard circle and the pixel density; S320, converting the resampled image from a Cartesian coordinate system to a polar coordinate system with the center of the standard circle as the origin to generate an unwound image.
[0009] Optionally, in S310, the rubber ring image is bilinearly interpolated and resampled, and the image resolution is adjusted to a set pixel according to the radius of the standard circle and the pixel density, including: S311, calculating the proportional relationship between the radius of the standard circle and the resolution of the rubber ring image to determine the target resolution after resampling; S312, resampling the rubber ring image by using a bilinear interpolation algorithm, calculating the corresponding coordinates of each pixel point in the resampled image in the rubber ring image by inverse transformation, and performing weighted average on the gray values of the four adjacent pixels around the coordinates to obtain the gray values of each pixel in the resampled image.
[0010] Optionally, in S400, the unwound image is converted into a reconstructed image with enhanced burr features by wavelet transform, burr parameters are determined, the burr parameters are mapped back to the Cartesian coordinate system of the rubber ring image, a detection result containing burr number, position, and size information is generated, including: S410, performing multi-scale wavelet decomposition on the unwound image to obtain high-frequency subbands and low-frequency subbands, performing hard threshold denoising processing on the high-frequency subband coefficients, fusing the processed high-frequency subband coefficients and the low-frequency subband coefficients by wavelet reconstruction to generate a reconstructed image with enhanced burr features. S420, a burr region positioning is performed on the reconstructed image, a sliding window is used to traverse a polar angle direction of the reconstructed image, a variance value of a radial gray scale change in each window is calculated, and when the variance value exceeds a preset threshold value, a local maximum point in the window is extracted as a burr candidate region; S430, in combination with polar radial direction connected domain analysis, isolated noise points in the burr candidate region are filtered out, and a burr parameter is obtained, the burr parameter including a starting polar angle, a terminal polar angle and a radial offset of the burr; S440, the detected burr parameter is mapped back to a Cartesian coordinate system of the rubber ring image, actual position coordinates of the burr in the rubber ring image are calculated, and a detection result including a number, a position and a size of the burr is generated.
[0011] Optionally, in S430, in combination with the polar radial direction connected domain analysis, the isolated noise points in the burr candidate region are filtered out, and the burr parameter is obtained, including: S431, a polar radial direction connected domain labeling is performed on the burr candidate region, a region growing method is used to start from the local maximum point, adjacent pixel points in the polar radial direction and having a gray scale value greater than a threshold value are merged into a same connected domain, and a polar radial range and a polar angle range of each connected domain are recorded; S432, by calculating a length of the connected domain in the polar radial direction, a connected domain with a length not less than 3 pixels is selected as a potential burr region; S433, for the selected connected domain, a midpoint of the polar angle range is taken as a central angle of the burr, a radial offset is taken as a protruding height of the burr, and the starting polar angle, the terminal polar angle and the radial offset of the burr are determined.
[0012] In a second aspect, an embodiment of the present application provides a rubber ring contour burr detection system based on geometric transformation, the system comprising: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of the above.
[0013] The present application has the advantages that: the present application provides a rubber ring contour burr detection method and system based on geometric transformation, the present application maps an outer contour of a rubber ring to a standard circle by fitting the contour as an ellipse, expands the ring contour into a rectangular image by using polar coordinate transformation, enhances burr features by using wavelet transformation, and finally realizes accurate detection of a number, a position and a size of the burr, thereby providing reliable technical support for automatic quality detection in a rubber ring production process. BRIEF DESCRIPTION OF DRAWINGS
[0014] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings needed in the embodiments will be briefly introduced as follows. Obviously, the accompanying drawings in the following description only only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.
[0015] Figure 1 The flow chart of the rubber ring profile burr detection method based on geometric transformation in the embodiments of the present application;
[0016] Figure 2 The schematic diagram of the rubber ring outer profile standard circle in the embodiments of the present application;
[0017] Figure 3 The schematic diagram of the unwrapped image in the embodiments of the present application;
[0018] Figure 4 The structural schematic diagram of the rubber ring profile burr detection system based on geometric transformation in the embodiments of the present application. DETAILED DESCRIPTION
[0019] The concept, specific structure and generated technical effects of the present application will be described clearly and completely in the following embodiments and drawings, so as to fully understand the purpose, scheme and effect of the present application. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.
[0020] In the related art, the manual visual inspection method depends on experience, and is low in efficiency and easy to miss small defects. The edge detection algorithm, such as Canny operator combined with morphological processing, is sensitive to noise, and it is difficult to distinguish between real burrs and imaging noise.
[0021] In order to solve the problem of accurate detection of small burrs (3-5 pixels) and eliminate the interference of oval distortion caused by the inclination of the O-shaped rubber ring, the present application provides a rubber ring profile burr detection method and system based on geometric transformation, which enhances the detectability of burr features through geometric transformation.
[0022] Referring to Figure 1 The present application provides a rubber ring profile burr detection method based on geometric transformation, which comprises the following steps: S100, acquiring a rubber ring image, and extracting the outer profile of the rubber ring and the profile of each burr in the rubber ring image; S200, fitting the outer profile of the rubber ring to obtain an ellipse by using the least square method, and mapping the ellipse to a standard circle: S300, performing bilinear interpolation resampling on the rubber ring image, performing polar coordinate transformation on the rubber ring image with the center of the standard circle as the origin, and generating an unwrapped image; S400, the unwrapped image is generated into a reconstructed image enhancing the burr feature through wavelet transform, a burr parameter of the reconstructed image is determined, the burr parameter is mapped back to a Cartesian coordinate system of the rubber ring image, and a detection result containing burr quantity, position and size information is generated.
[0023] Specifically, after the outer contour of the rubber ring and the contour of each burr in the rubber ring image are extracted, a standard elliptical model of the rubber ring contour is fitted through the least square method, the major axis, the minor axis and the rotation angle of the ellipse are calculated, the original contour is subjected to affine transformation based on the elliptical parameters, the inclined elliptical contour is corrected to a regular circle, and the contour distortion caused by the deviation of the rubber ring placement angle is eliminated. In the correction process, the original contour points are mapped to a polar coordinate system with the center of the circle as the origin through a coordinate transformation formula, the contour is unwrapped into a one-dimensional sequence with the polar radius varying with the polar angle, so that the burr feature presents as a local polar radius mutation in the polar coordinate system, and the spatial distribution feature of the micro burr is enhanced.
[0024] In the embodiments provided in the application, the rubber ring image is sequentially subjected to contour extraction, elliptical fitting, coordinate transformation, polar coordinate unwrapping and wavelet transform detection, and the interference problem of elliptical distortion caused by the inclined placement of the rubber ring on the burr detection in the traditional method is effectively solved. By mapping the elliptical contour to a standard circle, the burr feature presents as a regular signal distributed along the angle axis after the polar coordinate unwrapping, and combined with the multi-scale analysis capability of the wavelet transform, the short-time high-frequency mutation feature of the 3-5 pixel level micro burr can be accurately captured. Specifically, in the polar coordinate unwrapped image, the normal contour corresponds to the smooth change of the radial distance p, and the burr presents as the abnormal jump of the p value at a specific angle f. By setting an adaptive threshold to screen the detail coefficients after the wavelet decomposition, the real burr and the imaging noise can be effectively distinguished, and the accuracy and robustness of the micro burr detection are significantly improved.
[0025] In some embodiments, in S100, the rubber ring image is acquired, and the contour of each burr in the rubber ring image is extracted, including: S110, the acquired rubber ring image is preprocessed to obtain a gray image; the preprocessing includes gray processing and Gaussian filter denoising; Specifically, the color image is converted into a gray image, and the pixel values of the three color channels are fused through the weighted average method, and the calculation formula is Gray=0.299R+0.587G+0.114B, wherein R, G and B are respectively the red, green and blue channel pixel values of the original image. Subsequently, a 5*5 Gaussian kernel is used for filtering, and the standard deviation is set to 1.2, so as to smooth the image and retain the burr edge information. The preprocessed image is used for the subsequent contour extraction step, and can effectively reduce the interference of uneven illumination and sensor noise on the contour detection.
[0026] S120, edge detection is performed on the grayscale image, and the edge detection result is binarized to obtain a binary image containing the rubber ring profile;
[0027] Specifically, the improved Canny operator is adopted, and the high and low threshold values are automatically set according to the local gradient distribution of the image through a dynamic threshold adjustment algorithm, wherein the high threshold value is 1.5 times the average value of the local region gradient, and the low threshold value is 0.4 times the high threshold value, so as to accurately capture the inner and outer profiles of the rubber ring and potential burr edges. The edge detection result is binarized to obtain a binary image containing the rubber ring profile. The binarization threshold value is determined by the maximum inter-class variance method (Otsu algorithm), so as to ensure the separation effect of the profile region and the background region.
[0028] S130, profile extraction is performed on the binary image, and an 8-neighborhood connection-based contour tracking algorithm is adopted to filter out isolated regions with an area less than a set pixel, so as to obtain the outer profile of the rubber ring and the profiles of each burr.
[0029] Specifically, profile extraction is performed on the binary image, and an 8-neighborhood connection-based contour tracking algorithm is adopted to scan from the top left corner of the image, and when a starting point of the profile (i.e. a position jumping from a background pixel to a foreground pixel) is detected, adjacent foreground pixels are tracked in a clockwise direction, and the pixel coordinate sequence of each profile is recorded. At the same time, isolated regions with an area less than 3 pixels are filtered out to exclude pseudo-profiles formed by tiny noise, so as to finally obtain the complete outer profile of the rubber ring and a set of burr profiles that may exist.
[0030] Reference Figure 2 In some embodiments, in S200, the fitting of the outer profile of the rubber ring to an ellipse by using the least square method comprises: S210, the outer profile of the rubber ring is fitted to an ellipse, and an error function is constructed by using the least square method to minimize the sum of squares of distances from the profile points of the rubber ring to the ellipse, so as to obtain ellipse parameters; the ellipse parameters include the center coordinates of the ellipse, the long semi-axis, the short semi-axis and the rotation angle; Specifically, the pixel coordinates of the outer profile of the rubber ring are fitted to ellipse parameters, and an error function is constructed by using the least square method to minimize the sum of squares of distances from the profile points to the ellipse, so as to obtain the center coordinates (x0, y0) of the ellipse, the long axis a, the short axis b and the rotation angle θ; The least square method is used to fit the outer profile of the rubber ring to an ellipse equation, and the expression is:
[0031] wherein (h, k) are the center coordinates of the ellipse, a and b are the long axis and the short axis of the ellipse respectively, the unit is pixel, and a>b is satisfied; θ is the rotation angle of the ellipse (in radian, representing the angle between the long axis of the ellipse and the X axis), and (h, k) are the center coordinates.
[0032] S220, constructing a geometric transformation matrix based on the elliptic parameters, performing rotation transformation and scaling transformation on the ellipse based on the geometric transformation matrix, and mapping the ellipse into a standard circle.
[0033] Specifically, the tilt angle θ of the ellipse is eliminated by rotation transformation, and the major axis a and the minor axis b are uniformly adjusted to the same length by scaling transformation, so that the rubber ring contour is converted into a standard circle with (x0, y0) as the center and the radius of (a+b) / 2, the geometric normalization of the contour is realized, and the interference of the elliptical distortion caused by the tilt on the burr detection is eliminated.
[0034] The standard circle equation is: ; wherein, is the target circle radius; The affine transformation matrix is established, and the formula derivation process of the affine transformation matrix for mapping the ellipse into a standard circle is as follows: Translate the coordinate system to the center of the ellipse:
[0035] Rotate the coordinate system to eliminate the tilt angle :
[0036] Scale the axis to convert the ellipse into a circle:
[0037] When , it is mapped into a circle with a radius .
[0038] Comprehensive of the above steps, the affine transformation matrix T can be represented as:
[0039] Referring to Figure 3 , in some embodiments, in S300, the rubber ring image is bilinearly interpolated and resampled, the rubber ring image is polar coordinate transformed with the center of the standard circle as the origin, and an unfolded image is generated, including: S310, bilinearly interpolating and resampling the rubber ring image, adjusting the image resolution to a set pixel according to the radius of the standard circle and the pixel density; Exemplarily, the image resolution is adjusted to 512x512 pixels to ensure the continuity of pixel information in the polar coordinate transformation. The pixel value at a non-integer coordinate is calculated by a bilinear interpolation algorithm, so that the resampled image reduces the calculation complexity of the subsequent polar coordinate transformation while maintaining the contour details. In the resampling process, the center of the ellipse fitting (x0, y0) is taken as the reference to translate the origin of the image coordinate system to the center position, thereby providing a unified reference origin for the polar coordinate transformation.
[0040] S320, taking the center of the standard circle as the origin, converts the resampled image from the Cartesian coordinate system to the polar coordinate system to generate the unwrapped image.
[0041] Specifically, the formula of the unwrapped image is: where I(p, f) is the unwrapped image, p is the radial distance, and f is the angle. The Cartesian coordinates of each pixel point are mapped to the polar radius and the polar angle , where the value range of the polar angle is 0 to 2p, and the value range of the polar radius is 0 to the radius R of the standard circle. The two-dimensional data in the polar coordinate system is rearranged according to the polar angle as the row and the polar radius as the column to generate an unwrapped image with a size of 2p x R, so that the circumferential profile of the rubber ring is presented as a continuous curve in the horizontal direction in the unwrapped image, and the burr is presented as a local vertical protrusion on the curve, realizing the mapping and conversion of the burr feature from a two-dimensional plane to a one-dimensional curve. In some embodiments, in S310, the bilinear interpolation resampling of the rubber ring image, according to the radius of the standard circle and the pixel density, adjusts the image resolution to a set of pixels, includes:
[0042] S311, calculating the proportional relationship between the radius of the standard circle and the resolution of the rubber ring image to determine the target resolution after resampling; S312, resampling the rubber ring image by using the bilinear interpolation algorithm, calculating the corresponding coordinates of each pixel point in the resampled image in the rubber ring image by inverse transformation, and using the gray values of the four adjacent pixels around the coordinates to obtain the gray values of each pixel in the resampled image.
[0043] Specifically, if the standard circle radius is 100 pixels and the original image resolution is 1024x1024, the target resolution can be set to 512x512 to balance the calculation efficiency and the contour detail retention. In the specific calculation, according to the formula target resolution = original resolution x (target radius / original radius), it is ensured that the standard circle contour occupies a reasonable pixel space in the resampled image, avoiding the calculation amount from increasing sharply due to too high resolution or the contour details from being lost due to too low resolution. Subsequently, the original image is resampled by using a bilinear interpolation algorithm. For each pixel point (x', y') in the target image, its corresponding coordinates (x, y) in the original image are calculated by inverse transformation, and the gray values of the four adjacent pixels around the coordinates are weighted and averaged to obtain the gray value of the target pixel. The bilinear interpolation formula is: f(x, y) = (1-u)(1-v)f(x0, y0) + u(1-v)f(x1, y0) + (1-u)vf(x0, y1) + uvf(x1, y1), where u = x-x0, v = y-y0, (x0, y0), (x1, y0), (x0, y1), (x1, y1) are the coordinates of the adjacent pixels in the original image. By this method, the edge information of the rubber ring contour and burr can be effectively retained, providing a clear image basis for subsequent polar coordinate transformation.
[0044] In some embodiments, in S400, the unfolded image is generated by wavelet transform to generate a reconstructed image enhancing burr features, the burr parameters of the reconstructed image are determined, the burr parameters are mapped back to the Cartesian coordinate system of the rubber ring image, and a detection result containing burr number, position and size information is generated, including: In S410, the unfolded image is subjected to multi-scale wavelet decomposition to obtain high-frequency subbands and low-frequency subbands, the high-frequency subband coefficients are subjected to hard threshold denoising processing, the processed high-frequency subband coefficients and the low-frequency subband coefficients are fused by wavelet reconstruction to generate a reconstructed image enhancing burr features; It should be noted that the high-frequency subband and the low-frequency subband are parts of a specific frequency range obtained by dividing the entire frequency domain in a certain way (such as filter bank, wavelet transform, etc.) in signal processing, especially frequency domain analysis, containing signal components in a specific frequency interval. The high-frequency subband coefficient and the low-frequency subband coefficient are numerical values used to represent the signal characteristics in the high-frequency subband.
[0045] Specifically, the unwrapped image is subjected to multi-scale wavelet decomposition, db4 wavelet basis function is selected, and wavelet coefficients of different frequency bands are obtained through three-layer decomposition; wherein, the high-frequency sub-band (HH3, HL3, LH3) mainly contains the edge detail information of the burr, and the low-frequency sub-band (LL3) retains the overall contour of the image. The high-frequency sub-band coefficients are subjected to hard threshold denoising processing, and the threshold is set to 1.2 times the standard deviation of the sub-band coefficients, so as to suppress noise interference and retain the significant coefficients corresponding to the burr. Subsequently, the processed high-frequency coefficients and the low-frequency coefficients are fused through wavelet reconstruction to generate a reconstructed image enhancing the burr features.
[0046] S420, burr region positioning is performed on the reconstructed image, the polar angle direction of the reconstructed image is traversed through a sliding window, the variance value of the radial gray scale change in each window is calculated, and when the variance value exceeds a preset threshold value, the local maximum point in the window is extracted as a burr candidate region;
[0047] The wavelet-reconstructed image is subjected to burr region positioning, the polar angle direction of the unwrapped image is traversed through a sliding window, the variance value of the radial gray scale change in each window is calculated, and when the variance value exceeds a preset threshold value (3 times the standard deviation based on the burr-free sample statistics), the local maximum point in the window is extracted as a burr candidate region.
[0048] S430, in combination with the connected domain analysis in the polar radial direction, isolated noise points in the burr candidate region are filtered out, and burr parameters are obtained, the burr parameters including the starting polar angle, the ending polar angle and the radial offset of the burr;
[0049] Specifically, in combination with the connected domain analysis in the polar radial direction, isolated noise points with a length less than 3 pixels are filtered out, and the starting polar angle, the ending polar angle and the radial offset of the burr are finally determined, so as to realize the quantitative detection and parameter extraction of the tiny burr.
[0050] S440, the detected burr parameters are mapped back to the Cartesian coordinate system of the rubber ring image, the actual position coordinates of the burr in the rubber ring image are calculated, and a detection result containing the number, position and size information of the burr is generated.
[0051] The detected burr parameters (starting polar angle, ending polar angle, radial offset) are mapped back to the Cartesian coordinate system of the original rubber ring image, the actual position coordinates of the burr in the original image are calculated, and a detection report containing the number, position and size information of the burr is generated. Specifically, through the inverse transformation formula of polar coordinates to Cartesian coordinates, the polar angle φ and the polar radius ρ of the burr in the polar coordinate system are converted into (x, y) coordinates in the original image, where x = x0 + ρ cos φ, y = y0 + ρ sin φ, (x0, y0) is the center coordinate of the rubber ring obtained by ellipse fitting. For each confirmed burr, record the maximum circumscribed rectangle parameters (top-left corner coordinates, width, height) of its contour pixels, and calculate the actual length (pixel number) of the burr according to the radial offset, and finally generate a structured detection result, including the total number of burrs, the angle distribution interval of each burr, and the size grade (micro burr: 3-5 pixels, medium burr: 6-10 pixels, large burr: >10 pixels).
[0052] In some embodiments, in S430, the connected component analysis in the radial direction of the polar radius is performed to filter out isolated noise points in the burr candidate region, and burr parameters are obtained, including: S431, polar radius direction connected component labeling is performed on the burr candidate region, and region growing method is used to combine the pixel points adjacent in the radial direction and having a gray value greater than a threshold value into the same connected component from the local maximum value point, and the polar radius range and the polar angle range of each connected component are recorded; S432, the length of the connected component in the radial direction is calculated, and the connected component with a length not less than 3 pixels is selected as a potential burr region; S433, for the selected connected component, the midpoint of the polar angle range is taken as the central angle of the burr, and the radial offset is taken as the protruding height of the burr, to determine the starting polar angle, the ending polar angle and the radial offset of the burr.
[0053] Specifically, after the polar radius range [ρ_min, ρ_max] and the polar angle range [φ_start, φ_end] are determined, the length L = ρ_max - ρ_min of the connected component in the radial direction is calculated, and the connected component with a length L ≥ 3 pixels is selected as a potential burr region, and short length false connected components caused by noise are excluded. For the selected connected component, the midpoint φ_mid of the polar angle range is taken as the central angle of the burr, and the radial offset Δρ = ρ_max - R (where R is the standard circle radius) is taken as the protruding height of the burr, to determine the starting polar angle φ_start, the ending polar angle φ_end and the radial offset Δρ and other core parameters of the burr.
[0054] A complete detection process is provided below: Firstly, the rubber ring image is preprocessed, and a moving average filter with a window size of 15-20 pixels is used for trend removal; the trend calculation formula is: ; the residual signal formula is: ; wherein r(θ) is a radial distance function about θ. The circle can be unfolded into several parts, such as 3600 parts, and θ takes values from 0 to 3600; movmean(r(θ), 15) represents the average value within 15 pixels. Through trend removal, low-frequency interference such as circular deformation is eliminated, and burrs are highlighted; Savitzky-Golay filter (window = 7, order = 2) is applied to suppress noise; edge characteristics are retained while random noise is smoothed.
[0055] Then wavelet decomposition is performed, and Haar wavelet or Db4 wavelet is selected as the wavelet basis. Haar wavelet is most sensitive to impulse mutation and is suitable for sharp burrs, and Db4 wavelet can better localize in frequency domain, and Db4 is suitable for slowly varying burrs; the decomposition level includes: Level1, detecting 1-2 pixel microstructure (may contain noise); Level2, focusing on 3-5 pixel target burr (optimal scale); Level3, verifying >5 pixel structure (excluding non-burr).
[0056] Detail coefficient analysis includes: burr feature extraction, which is represented as local extreme value in D2 detail coefficient. D2 detail coefficient refers to the high-frequency detail component of the second layer (Level2) in the wavelet transform decomposition process.
[0057] The wavelet decomposition principle is based on the contour residual signal after preprocessing. Through discrete wavelet transform (DWT), the signal is decomposed into approximation coefficients (A) and detail coefficients (D). Among them, the approximation coefficient represents the low-frequency component, which is used to describe the overall trend of the contour; while the detail coefficient (D) belongs to the high-frequency component, which mainly describes the local mutation situation, such as burr features.
[0058] In terms of hierarchical relationship, Level1 presents the highest frequency detail (D1), corresponding to 1-2 pixel microstructure, which may contain noise; Level2 focuses on medium-high frequency detail (D2), and its core detection scale is 3-5 pixel target burr; Level3 is low-frequency detail (D3), which is used to verify structures greater than 5 pixels. Positive burrs are represented as positive spikes, and negative burrs are represented as negative spikes.
[0059] In the threshold detection link, first calculate the standard deviation of D2 coefficient, i.e. σ = std(D2), then set the detection threshold T = k·σ, and the value of k ranges between 3.0-3.5. Mark the points that satisfy |D2(θ)|>T.
[0060] In the aspect of extreme value verification, the true burr needs to meet the following conditions simultaneously: it is a local maximum or minimum value; the full width at half maximum (FWHM) is not more than 5 pixels; and there are zero-crossing points on both sides.
[0061] In the multi-scale fusion, there is a correlation between levels. The verification method is that the true burr needs to meet |D1 (θ)|>2σ1 and |D2 (θ)|>3σ2, and the false burr usually does not produce a significant response in Level 1. In the position refining process, the zero-crossing points of different scale coefficients are verified by the wavelet modulus maximum principle, and the positioning accuracy can reach a sub-pixel level. The zero-crossing point here refers to the position point where the wavelet coefficient changes from positive to negative or from negative to positive; the cross verification is to confirm the true burr by comparing the position relationship of the zero-crossing points of different levels. The physical meaning is that the mutation characteristics of the true burr will produce position-aligned zero-crossing points at multiple scales, while the zero-crossing points of the noise have randomness.
[0062] There are also a series of methods for excluding false burrs. In the width verification, the response width W=argmax (θ)|D2 (θ)|>T / 2 is calculated, and only the detection points with 3≤W≤5 are retained. In the shape verification, the symmetry of the burr is calculated, that is, the value of (left slope) / (right slope) needs to be in the interval [0.7, 1.4], because the true burr is approximately symmetrical, while the scratch or defect is not symmetrical. In the energy verification, the wavelet energy E=∑|D2 (θ)|² (θ∈[θ0-2, θ0+2]) is calculated, and weak responses are excluded by setting an energy threshold.
[0063] The present application solves the geometric distortion caused by actual placement through the ellipse fitting correction technology; the adaptive polar coordinate development method can convert an O-shaped ring placed at any angle into a standard circular ring through coordinate transformation. The detection mechanism based on wavelet transform is designed for the local mutation characteristics of the developed profile. The entire detection process forms a complete method system from image acquisition, geometric correction, feature transformation to intelligent judgment. Compared with the prior art, the method has significant advantages, the detection sensitivity is greatly improved, 3-pixel-level burrs can be stably identified, and the anti-interference ability is strong, which can effectively overcome the influence of the arbitrary placement angle of the O-shaped ring.
[0064] Corresponding to the method of Figure 1 , with reference to Figure 4 , an embodiment of the present application provides a rubber ring profile burr detection system based on geometric transformation, which comprises: at least one processor; at least one memory for storing at least one program; when the at least one program is executed by the at least one processor, the at least one processor implements the above method.
[0065] It can be seen that the contents in the method embodiments are applicable to the system embodiments, the system embodiments specifically implement the same functions as the method embodiments, and achieve the same beneficial effects as the method embodiments.
[0066] In addition, the embodiments of the present application further disclose a computer program product or a computer program, which is stored in a computer readable storage medium. A processor of a computer device can read the computer program from the computer readable storage medium, and the processor executes the computer program, so that the computer device executes the method described above. Similarly, the contents in the method embodiments are applicable to the storage medium embodiments, the storage medium embodiments specifically implement the same functions as the method embodiments, and achieve the same beneficial effects as the method embodiments.
[0067] Those skilled in the art can understand that all or some of the methods disclosed above can be implemented as software, firmware, hardware, and appropriate combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software can be distributed on a computer readable medium, which can include computer storage media (or non-transitory media) and communication media (or transitory media). As known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules, or other data. Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage, or other magnetic storage devices, or any other medium that can be used to store the desired information and that can be accessed by a computer. In addition, it is known to those skilled in the art that communication media typically include computer readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transport mechanisms, and can include any information delivery medium.
[0068] The above is a specific description of the preferred embodiments of the present disclosure, but the present disclosure is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or replacements without departing from the spirit of the present disclosure, and these equivalent modifications or replacements are all included in the scope defined by the claims of the present disclosure.
Claims
1. A method for detecting burrs on the contour of a rubber ring based on geometric transformation, characterized in that, The method includes the following steps: S100, acquire the rubber ring image, and extract the outer contour of the rubber ring and the contour of each burr in the rubber ring image; S200, using the least squares method to fit the outer contour of the rubber ring to obtain an ellipse, and mapping the ellipse to a standard circle: S300 performs bilinear interpolation resampling on the rubber ring image, and performs polar coordinate transformation on the rubber ring image with the center of the standard circle as the origin to generate the unfolded image; S400 uses wavelet transform to generate a reconstructed image with enhanced burr features from the unfolded image, determines the burr parameters of the reconstructed image, maps the burr parameters back to the Cartesian coordinate system of the rubber ring image, and generates a detection result containing information on the number, location, and size of burrs.
2. The method according to claim 1, characterized in that, In S100, acquiring the rubber ring image and extracting the contours of each burr in the rubber ring image includes: S110, The acquired rubber ring image is preprocessed to obtain a grayscale image; the preprocessing includes grayscale conversion and Gaussian filtering for noise reduction; S120: Perform edge detection on the grayscale image, and binarize the edge detection results to obtain a binary image containing the rubber ring outline. S130: Contour extraction is performed on the binary image. An 8-neighborhood connected contour tracking algorithm is used to filter out isolated regions with an area smaller than a set number of pixels, thereby obtaining the outer contour of the rubber ring and the contours of each burr.
3. The method according to claim 1, characterized in that, In S200, the step of fitting an ellipse to the outer contour of the rubber ring using the least squares method and mapping the ellipse to a standard circle includes: S210, the outer contour of the rubber ring is fitted to an ellipse, and an error function is constructed using the least squares method to minimize the sum of squared distances from the contour points of the rubber ring to the ellipse, and the ellipse parameters are obtained by solving the problem; the ellipse parameters include the coordinates of the ellipse center, the major semi-axis, the minor semi-axis, and the rotation angle. S220 constructs a geometric transformation matrix based on the ellipse parameters, and performs rotation and scaling transformations on the ellipse based on the geometric transformation matrix to map the ellipse into a standard circle.
4. The method according to claim 1, characterized in that, In S300, the step of performing bilinear interpolation resampling on the rubber ring image, and performing polar coordinate transformation on the rubber ring image with the center of the standard circle as the origin to generate an unfolded image, includes: S310 performs bilinear interpolation resampling on the rubber ring image, adjusting the image resolution to the set pixels based on the radius and pixel density of the standard circle; S320 uses the center of a standard circle as the origin to convert the resampled image from the Cartesian coordinate system to the polar coordinate system, generating an unfolded image.
5. The method according to claim 4, characterized in that, In S310, the step of performing bilinear interpolation resampling on the rubber ring image and adjusting the image resolution to a set number of pixels based on the radius and pixel density of the standard circle includes: S311, calculate the ratio between the standard circle radius and the rubber ring image resolution to determine the target resolution after resampling; S312 uses a bilinear interpolation algorithm to resample the rubber band image. It calculates the corresponding coordinates of each pixel in the rubber band image in the resampled image through inverse transformation, and uses the gray values of the four neighboring pixels around the coordinate to perform a weighted average to obtain the gray value of each pixel in the resampled image.
6. The method according to claim 1, characterized in that, In S400, the process of generating a reconstructed image with enhanced burr features from the unfolded image using wavelet transform, determining the burr parameters of the reconstructed image, mapping the burr parameters back to the Cartesian coordinate system of the rubber band image, and generating a detection result containing information on the number, location, and size of burrs includes: S410 performs multi-scale wavelet decomposition on the unfolded image to obtain high-frequency subbands and low-frequency subbands. Hard thresholding is applied to the coefficients of the high-frequency subbands for noise reduction. The processed high-frequency subband coefficients are then fused with the low-frequency subband coefficients through wavelet reconstruction to generate a reconstructed image with enhanced spur features. S420, locate the spur region in the reconstructed image, traverse the polar angle direction of the reconstructed image through a sliding window, calculate the variance value of the radial gray level change in each window, and when the variance value exceeds the preset threshold, extract the local maxima points in the window as spur candidate regions. S430, combined with the connected domain analysis in the polar radius direction, isolated noise points in the burr candidate region are filtered out to obtain burr parameters, which include the burr's starting polar angle, ending polar angle and radial offset. S440 maps the detected burr parameters back to the Cartesian coordinate system of the rubber ring image, calculates the actual position coordinates of the burr in the rubber ring image, and generates a detection result containing information on the number, position, and size of the burrs.
7. The method according to claim 6, characterized in that, In S430, the connected component analysis along the polar radius direction filters out isolated noise points in the spur candidate region to obtain spur parameters, including: S431, the connected regions in the polar radius direction of the spur candidate region are marked. The region growing method is used to start from the local maximum point and merge adjacent pixels in the polar radius direction with gray values greater than the threshold into the same connected region. The polar radius range and polar angle range of each connected region are recorded. S432, by calculating the length of the connected region in the polar radius direction, connected regions with a length of not less than 3 pixels are selected as potential spur regions; S433, for the filtered connected domain, the midpoint of its polar angle range is taken as the center angle of the burr, and the radial offset is taken as the protrusion height of the burr, to determine the starting polar angle, ending polar angle and radial offset of the burr.
8. A rubber ring contour burr detection system based on geometric transformation, characterized in that, The system includes: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor performs the method as described in any one of claims 1 to 7.
Citation Information
Cited By
Sealing ring appearance detection method and detection equipment based on image processing
CN121558751A
Circular curve burr detection method and system based on multi-scale phase consistency and contour model, and medium
CN122066705A