Sealing ring appearance detection method and detection equipment based on image processing
By employing an image processing-based method for inspecting the appearance of rubber sealing rings, and utilizing adaptive weighted B-spline fitting and polar coordinate resampling techniques, the problems of misjudgment due to deformation and noise interference in the inspection of rubber sealing rings are solved, and reliable differentiation between parting lines and burrs and stable detection of defects are achieved.
Patent Information
- Application Number
- CN202610101554.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-26
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2046-01-26
AI Technical Summary
Existing technologies for detecting flexible rubber seals often result in false alarms due to the failure of rigid template fitting caused by nonlinear deformation of the workpiece under stress. Furthermore, it is difficult to distinguish between parting lines and burr defects, and the noise interference introduced by conveyor belt vibration makes it difficult to extract minute notch features.
An image processing-based method for inspecting the appearance of sealing rings is adopted. By acquiring the original image of the sealing ring, sub-pixel level outer contour point sets and inner contour point sets are extracted, mapped to the polar coordinate system for resampling, the difference of the chord width sequence is calculated and an adaptive weight matrix is constructed, and the ideal geometric benchmark is reconstructed by weighted B-spline fitting. Defect judgment is made by combining geometric residuals and orthogonality deviation.
It solves the problem of misjudgment caused by deformation of flexible rubber seals, reduces false alarms, can reliably distinguish between parting lines and burrs, and improves the detection stability of notches and tear-type through-hole defects.
Smart Images

Figure CN121558751A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of machine vision and industrial precision inspection technology, specifically to a method and equipment for inspecting the appearance of sealing rings based on image processing. Background Technology
[0002] Rubber seals are widely used in automotive manufacturing, hydraulics, pneumatics, and precision instruments, serving as core components for preventing fluid leakage and maintaining system pressure. The integrity of their edge contours directly affects the safety and lifespan of the entire mechanical system; even micron-sized notches or excess burrs can lead to serious seal failure during use. Therefore, in modern large-scale production, using machine vision technology for full visual inspection of seals has become a crucial step in ensuring factory quality and eliminating defective products.
[0003] Existing visual inspection technologies primarily rely on standard geometric template matching and measurement algorithms. These methods acquire workpiece images using industrial cameras, then use the least squares method to fit edge points into standard circles or ellipses, subsequently calculating dimensional data such as radius and roundness. For rigid metal gaskets or hard plastic parts, this inspection method based on ideal geometric models offers advantages such as fast computation speed and intuitive parameter configuration, efficiently filtering out defective products with out-of-tolerance dimensions or severe macroscopic shape deformation.
[0004] However, rubber has an extremely low Young's modulus, making it highly susceptible to random elastic deformation under the influence of gravity or minute friction during high-speed conveyor belt movement. The aforementioned rigid geometric template cannot dynamically adapt to this non-defective low-frequency distortion, often misjudging normal morphological fluctuations as dimensional defects, leading to frequent false alarms on the production line. Furthermore, the parting line left by the molding process appears as outward-pointing micro-protrusions in its geometric contour, which is very similar to the morphology of burr defects. It is difficult to distinguish between the two using a single geometric distance threshold, easily causing the parting line to be mistakenly detected or micro-burrs to be missed. At the same time, the mechanical vibration of the conveyor system introduces high-frequency noise. Measurement methods based on absolute radius will superimpose this vibration into the contour data, causing minute tear or gap features to be submerged in background noise and difficult to capture accurately. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention provides a sealing ring appearance inspection method and inspection equipment based on image processing. This addresses the technical problems in existing technologies when inspecting flexible rubber sealing rings, such as false alarms caused by nonlinear deformation of the workpiece under stress leading to failure of rigid template fitting, inaccurate differentiation between parting line and burr defects relying solely on geometric dimension features, and difficulty in extracting minute notch features due to noise interference introduced by conveyor belt vibration.
[0006] To achieve the above objectives, the present invention provides the following technical solution: The image processing-based method for inspecting the appearance of sealing rings includes the following steps: Obtain the original image of the sealing ring and extract the sub-pixel level outer contour point set and inner contour point set; Map the outer contour point set and the inner contour point set to the polar coordinate system, and resample to generate an angle-aligned standard outer diameter sequence and a standard inner diameter sequence; The difference between the standard outer diameter sequence and the standard inner diameter sequence is calculated to obtain the chord width sequence. The chord width trend line of the chord width sequence is extracted. The difference between the chord width sequence and the chord width trend line is calculated as the chord width deviation. An adaptive weight matrix is constructed using the chord width deviation. The standard outer diameter sequence is subjected to weighted B-spline fitting using the adaptive weight matrix to reconstruct the ideal geometric reference curve; Calculate the geometric residual sequence of the standard outer diameter sequence relative to the ideal geometric reference curve, and calculate the orthogonality deviation sequence between the local gray-level gradient vector at the edge of the original image and the ideal geometric tangent vector of the ideal geometric reference curve; By comprehensively analyzing the geometric residual sequence, the orthogonality deviation sequence, and the chord width deviation, defects are determined based on the multidimensional feature decision threshold.
[0007] This invention also provides an image processing-based sealing ring appearance inspection device, comprising: an imaging unit for acquiring a high-resolution grayscale image of the sealing ring to be inspected; an illumination unit for providing a light field environment for imaging; and a computation control unit connected to the imaging unit and the illumination unit, wherein the computation control unit comprises: an image preprocessing module for receiving the image and extracting sub-pixel contours; a coordinate transformation module for mapping the image data to a polar coordinate system and aligning it; a weight construction module for generating an adaptive weight matrix based on frequency domain separation; a dynamic benchmark reconstruction module for fitting and generating an ideal geometric benchmark curve using the adaptive weight matrix; a joint verification module for calculating the geometric residual sequence and the orthogonality deviation sequence; and a defect determination module for outputting the detection result based on a multi-dimensional feature space.
[0008] This invention provides a method and device for inspecting the appearance of sealing rings based on image processing. It has the following beneficial effects: 1. This invention employs an adaptive weighted B-spline fitting strategy based on chord width deviation to construct a dynamic geometric benchmark that changes with the workpiece shape. This strategy preserves the low-frequency physical deformation characteristics of the sealing ring while eliminating the interference of high-frequency defects on the fitting trajectory. Compared to the standard circle or elliptical template matching scheme commonly used in existing technologies, this scheme solves the problem of misjudgment caused by nonlinear deformation of flexible rubber sealing rings due to gravity compression or conveyor belt tension. It significantly reduces false alarms without reducing detection sensitivity.
[0009] 2. This invention introduces an orthogonality verification mechanism between macroscopic geometric tangent vectors and microscopic grayscale gradient vectors to quantify the smoothness of edge textures. Through joint analysis of geometric residuals and orthogonality deviations, it achieves multidimensional locking of defect features. Addressing the limitations of existing technologies that rely solely on a single geometric contour distance threshold for judgment, this solution overcomes the bottleneck of difficulty in distinguishing mold lines and microburrs in terms of geometric height. It utilizes the differences in light field scattering characteristics between regular process features and random material defects to achieve reliable separation.
[0010] 3. This invention implements a strategy of aligning the inner and outer contours with polar coordinates and separating the chord width in the frequency domain. It extracts the high-frequency residual components in the chord width sequence and establishes a relative thickness evaluation model independent of the absolute coordinate system. This enhances the ability to capture local abrupt change signals. Compared with the traditional technical solution of directly measuring the absolute radius value, this method solves the problem of measurement reference drift caused by the overall eccentricity of the workpiece or random jitter of the shooting position. It significantly improves the detection stability of notches and tear-type through-thickness defects by utilizing the inherent physical constraint relationship between the inner and outer diameters. Attached Figure Description
[0011] Figure 1 This is a schematic diagram of the system architecture of the image processing-based sealing ring appearance inspection method and inspection equipment according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the functional module structure of the detection system according to an embodiment of the present invention; Figure 3 This is a flowchart of the sealing ring appearance inspection method according to an embodiment of the present invention; Figure 4 This is a schematic diagram comparing the original contour and the reconstructed reference curve in an embodiment of the present invention; Figure 5 The diagram shows the multidimensional characteristic waveforms of geometric residuals, orthogonality deviations, and chord width deviations in an embodiment of the present invention; wherein, Figure (a) shows the geometric residual sequence, Figure (b) shows the orthogonality deviation sequence, and Figure (c) shows the chord width deviation sequence.
[0012] The components are as follows: 10. Imaging unit; 11. Large-area industrial camera; 12. Dual telecentric lens; 20. Illumination unit; 21. High-angle coaxial light source; 22. Low-angle shadowless ring light source; 30. Calculation and control unit; 101. Image preprocessing module; 102. Coordinate transformation module; 103. Weight construction module; 104. Dynamic benchmark reconstruction module; 105. Joint verification module; 106. Defect judgment module. Detailed Implementation
[0013] The present invention will now be described in further detail with reference to the accompanying drawings.
[0014] See attached document Figure 1This invention provides a sealing ring appearance inspection device based on image processing. The inspection device includes an imaging unit 10, an illumination unit 20, and a calculation and control unit 30. The imaging unit 10 and the illumination unit 20 are respectively connected to the calculation and control unit 30 to work together under the timing control of the calculation and control unit 30 to complete the acquisition and processing of sealing ring image data.
[0015] Imaging unit 10 is used to acquire high-resolution grayscale images of the sealing ring to be inspected. Imaging unit 10 includes a large-area industrial camera 11 and a dual telecentric lens 12. The optical axis of the large-area industrial camera 11 is perpendicular to the inspection plane where the sealing ring is located. The dual telecentric lens 12 is mounted at the front end of the large-area industrial camera 11. The dual telecentric lens 12 has the optical characteristic of constant magnification within the depth of field, which can eliminate perspective errors caused by the floating position of the sealing ring on the conveyor belt, ensuring that the inner and outer diameter dimensions of the sealing ring in the image acquired by imaging unit 10 maintain a linear mapping relationship with the actual physical dimensions.
[0016] The illumination unit 20 provides the light field environment for imaging. The illumination unit 20 includes a high-angle coaxial light source 21 and a low-angle shadowless ring light source 22. The optical path of the high-angle coaxial light source 21 is coaxially distributed with the optical axis of the large-area industrial camera 11, used to illuminate the background of the sealing ring to form a high-contrast silhouette. The low-angle shadowless ring light source 22 is arranged around the sealing ring to be inspected, used to illuminate the surface of the sealing ring at a grazing angle to highlight surface scratches or foreign object features. The illumination unit 20 is connected to the computation control unit 30, and receives trigger signals through a strobe controller to rapidly switch the illumination states of the high-angle coaxial light source 21 and the low-angle shadowless ring light source 22 between different image acquisition frames.
[0017] The arithmetic control unit 30 is the core processing center of the entire inspection equipment, typically employing an industrial control computer with high-performance floating-point arithmetic capabilities. The arithmetic control unit 30 is equipped with an image acquisition interface, a digital I / O control interface, and a central processing unit supporting AVX2 or higher instruction sets. The arithmetic control unit 30 internally stores and runs a computer program that, when executed, implements each step of the sealing ring appearance inspection method.
[0018] See attached document Figure 2 The detection system running in the operation control unit 30 is logically divided into: image preprocessing module 101, coordinate transformation module 102, weight construction module 103, dynamic benchmark reconstruction module 104, joint verification module 105, and defect judgment module 106.
[0019] The image preprocessing module 101 receives the grayscale image transmitted by the imaging unit 10 and performs region of interest extraction and subpixel edge localization operations. The image preprocessing module 101 locates the approximate position of the sealing ring using an edge detection operator, calculates the grayscale moment or performs quadratic curve interpolation in the edge normal direction, and outputs the coordinates of the outer contour point set and the inner contour point set with subpixel accuracy.
[0020] The coordinate transformation module 102 is connected to the image preprocessing module 101 and is used to map image data from the Cartesian coordinate system to the polar coordinate system. The coordinate transformation module 102 calculates the geometric centroid of the outer contour point set as the origin of the polar coordinates, converting the coordinates of the outer contour point set and the inner contour point set into polar angle and polar radius forms. The coordinate transformation module 102 also performs a linear interpolation resampling operation to ensure that the transformed outer diameter sequence and inner diameter sequence are strictly aligned in the angular dimension.
[0021] The weighting module 103 is connected to the coordinate transformation module 102 and is used to generate an adaptive weight matrix based on the frequency domain separation concept. The weighting module 103 calculates the radial chord width sequence of the sealing ring and extracts the chord width trend line using a low-pass filter. The weighting module 103 calculates the deviation between the original chord width sequence and the chord width trend line, and calculates the weight value of each contour point based on the deviation. When the weighting module 103 detects a sudden change in chord width, it reduces the weight value corresponding to that position; when the weighting module 103 detects that the chord width change conforms to a low-frequency trend, it retains the high weight value at that position.
[0022] The dynamic datum reconstruction module 104 is connected to the weight construction module 103 and is used to generate an ideal geometric datum without defect features. The dynamic datum reconstruction module 104 receives the contour sequence output by the coordinate transformation module 102 and the weight matrix output by the weight construction module 103. The dynamic datum reconstruction module 104 uses a robust weighted least squares method to construct a B-spline curve model, solves for the control point coefficients through an iterative optimization process, and outputs the fitted datum curve.
[0023] The joint verification module 105 is connected to the dynamic reference reconstruction module 104 and is used to perform secondary confirmation of suspected defects by combining geometric features and light field features. The joint verification module 105 calculates the geometric residual between the original contour sequence and the reference curve. Simultaneously, the joint verification module 105 calculates the geometric tangent vector of the reference curve in the image coordinate system and calculates the gray-level gradient vector at the corresponding position in the original image. The joint verification module 105 calculates the orthogonality deviation value between the geometric tangent vector and the gray-level gradient vector.
[0024] The defect determination module 106 is connected to the joint verification module 105 and is used to output the final inspection result. Based on the characteristic data of three dimensions—geometric residual, orthogonality deviation, and chord width deviation—the defect determination module 106 uses preset logical rules to determine whether there are burr defects or notch defects in the current area. The defect determination module 106 outputs the determination result to the external rejection mechanism.
[0025] See attached document Figure 3 This invention provides a method for inspecting the appearance of sealing rings based on image processing, comprising the following steps: S100, the operation and control unit 30 controls the imaging unit 10 to acquire the grayscale image of the sealing ring, and processes the acquired image through the image preprocessing module 101 to extract the outer contour point set and inner contour point set with sub-pixel precision; S200, through coordinate transformation module 102, converts the outer contour point set and inner contour point set in Cartesian coordinate system into radial sequence in polar coordinate system, and completes the angular alignment of inner and outer diameter data; S300, the radial chord width sequence is calculated through the weight construction module 103, the low-frequency trend term of the chord width is extracted by frequency domain separation, and an adaptive weight matrix for fitting is constructed based on the high-frequency residual term of the chord width. S400, through the dynamic benchmark reconstruction module 104, uses an adaptive weight matrix to perform weighted B-spline curve fitting on the radial sequence, and suppresses the influence of low weight points through iterative method to reconstruct an ideal benchmark curve that conforms to the current deformation state of the sealing ring. S500 calculates the geometric residual of the original contour relative to the ideal reference curve through the joint verification module 105, and calculates the orthogonality deviation between the gray gradient direction at the contour edge and the tangent direction of the ideal reference curve. S600 uses the defect judgment module 106 to comprehensively analyze geometric residuals, orthogonality deviations, and chord width deviations. When the geometric position is abnormal, the gradient orthogonality is poor, and the chord width changes abruptly, it determines that there is a defect at that position and records the defect type and location information.
[0026] In step S100, the computation control unit 30 first controls the imaging unit 10 and the illumination unit 20 to work together to acquire raw image data. Then, the image preprocessing module 101 performs noise reduction and region of interest extraction on the image. Finally, a high-precision contour point set is obtained using a sub-pixel edge localization algorithm. This step specifically includes the following sub-steps: S110, perform time-division stroboscopic imaging and image data acquisition. In this embodiment, the computation control unit 30 sends a timing trigger signal to the illumination unit 20 to control the high-angle coaxial light source 21 and the low-angle shadowless ring light source 22 to alternately illuminate at high speed. During this process, the present invention utilizes the optical characteristic that the principal ray of the dual telecentric lens 12 is parallel to the optical axis to ensure that within the preset depth of field, the imaging magnification does not change with the up-and-down jitter of the sealing ring on the conveyor belt, thereby providing a physical basis for high-precision dimensional measurement. Specifically, when the high-angle coaxial light source 21 is lit, the large target surface industrial camera 11 is simultaneously exposed to acquire a backlight image with a bright background and a dark workpiece. This backlight image has extremely high edge contrast and is suitable for contour extraction. When the low-angle shadowless ring light source 22 is lit, the large target surface industrial camera 11 is simultaneously exposed to acquire a grazing light image that presents the surface texture. In specific applications, the image preprocessing module 101 preferably selects the backlight image as the basis image for calculating the geometric contour. Alternatively, a weighted average method can be used to fuse the images under the two illuminations. In this embodiment, to ensure the signal-to-noise ratio of the edge gradient calculation, the backlit image acquired by the high-angle coaxial light source is preferably defined as the base image. This is used for gradient vector calculation in subsequent step S530. In addition, the exposure time parameter setting of imaging unit 10 must follow the histogram equalization principle, that is, ensure that the peak of the image grayscale histogram is within 50% to 85% of the sensor's dynamic range, usually controlled between 100 microseconds and 5000 microseconds, to avoid overexposure of highly reflective areas on the rubber surface or underexposure of black background areas, and to ensure that the grayscale gradient information at the edges is complete and not truncated.
[0027] S120, perform region of interest extraction and coarse edge localization. Image preprocessing module 101 first processes the grayscale image. Gaussian filtering is applied to suppress random thermal noise generated by the image sensor, utilizing the smoothing properties of the Gaussian kernel function to prevent noise signals from being misidentified as edge features. Subsequently, the entire image is scanned using either the Sobel or Canny edge detection operator to calculate the grayscale gradient magnitude of each pixel. During this process, a gradient magnitude threshold needs to be set. In this embodiment, the gradient magnitude threshold is... The value can be automatically calculated using the Otsu's algorithm (maximum inter-class variance method), or set to 30% to 50% of the maximum gradient magnitude across the entire image. The system will flag gradient magnitude values greater than a threshold. The pixels are marked as candidate edge points, thus determining the annular region of interest containing the sealing ring. For each candidate edge point within the region of interest, its pixel-level integer coordinates are recorded. and the gradient direction angle at that point .
[0028] S130, perform sub-pixel edge extraction based on the normal direction. Since digital images are discretely sampled, directly extracted edge positions are limited by pixel resolution and often cannot meet micrometer-level detection accuracy requirements. Therefore, this embodiment uses mathematical interpolation principles to reconstruct the discrete gradient distribution into a continuous function, thereby estimating the true edge peak position. Specifically, the image preprocessing module 101 establishes a local one-dimensional search line along the gradient direction (i.e., the edge normal direction) of the candidate edge points. On the search line, using the candidate edge points... Centered on a central point, three adjacent points (the center point, the previous point, and the next point) along the normal direction are selected to collect their gray-level gradient amplitudes, forming a discrete gray-level sequence. For this discrete gray-level sequence, a quadratic curve fitting interpolation method is used to determine the precise location of the maximum gray-level change rate. A quadratic polynomial model is established to fit the gradient amplitude distribution; the quadratic polynomial interpolation formula is as follows: ; in, This indicates the offset from the center point along the normal direction. The magnitude of the fitted gradient at that point; For local coordinate variables, the set of values is { 1,0,1}, corresponding to the previous point, center point, and next point in the normal direction, respectively; , , All of these are fitting coefficients calculated based on the discrete gray-level sequence using the least squares method or direct algebraic solution. The coefficient of the quadratic term, The coefficient of the linear term, This is a constant term.
[0029] According to the principle of extrema, the location where the gradient magnitude reaches its peak corresponds to the most precise location of the edge. Regarding the above equation with respect to the variable... Take the derivative and set it to zero to calculate the subpixel offset. : ; in, This indicates the sub-pixel edge point relative to the pixel-level center point. The distance offset in the normal direction typically ranges from [ Between 0.5 and 0.5. Based on offset. and gradient direction angle Calculate the final sub-pixel level edge point coordinates : ; ; in, The x-coordinate of the sub-pixel edge point. The ordinate of the sub-pixel edge point. These are integer pixel coordinates for coarse positioning. The gradient direction angle at that point.
[0030] S140, Construct an ordered contour point set. The image preprocessing module 101 repeats step S130 above, traversing all edge points within the region of interest. Based on the topology of the sealing ring, the extracted sub-pixel edge points are sorted and aggregated according to their adjacency relationships to form an outer contour point set. and inner contour point set : ; ; in, This represents the set of sub-pixel edge points representing the outer diameter of the sealing ring. This represents the set of sub-pixel edge points representing the inner diameter of the sealing ring. Indicates the outer contour. The coordinates of each sampling point Indicates the inner contour of the first The coordinates of each sampling point This represents the total number of contour sampling points. Through the above steps, this system completes the conversion from the original image to a high-precision mathematical point set, providing a precise data foundation for subsequent geometric transformations and physical constraint analysis.
[0031] In step S200, the coordinate transformation module 102 receives the sub-pixel-level Cartesian coordinate data output from step S100, maps it to a polar coordinate system with the centroid of the sealing ring as the origin, and achieves strict alignment of the inner and outer diameter data in the angular dimension through resampling technology. The core principle of this step lies in utilizing the topological characteristics of the sealing ring as a rotating part to transform the complex two-dimensional planar geometric contour into two one-dimensional time-domain signal sequences that vary with angle through coordinate mapping. This dimensionality reduction process allows subsequent steps to use one-dimensional signal processing techniques (such as frequency domain filtering) to analyze the contour's fluctuation characteristics, thereby simplifying the computational complexity of deformation analysis. This step specifically includes the following sub-steps: S210, calculate the geometric centroid and establish a polar coordinate system. Since the position and orientation of the sealing ring on the conveyor belt are random, directly using the image center as the origin will lead to eccentricity errors in subsequent analysis, thus introducing spurious low-frequency sinusoidal components. Therefore, this embodiment uses a centroid calculation method based on a contour point set to determine the physical center of the workpiece. In specific implementation, the coordinate transformation module 102 selects the outer contour point set extracted in step S100. As a reference datum, this is based on the characteristics of the rubber molding process. The outer diameter of the sealing ring is usually determined by the fixed cavity of the mold, and its roundness stability is better than that of the inner diameter, which is affected by the core-pulling process. Moreover, the outer diameter is not easily affected by internal flash, so it is more suitable as a geometric datum for establishing a coordinate system. The coordinate transformation module 102 calculates the arithmetic mean of all sampled points of the outer contour point set, and uses this as the origin of the polar coordinate transformation. The calculation formula is as follows: ; ; in, Let x be the x-coordinate of the fitted center. The ordinate of the fitting center is... For the outer contour point set, the first The x-coordinates of the points For the outer contour point set, the first The ordinates of the points This represents the total number of sampling points in the outer contour point set.
[0032] S220 performs a mapping transformation from Cartesian coordinates to polar coordinates. The origin is determined at... Then, coordinate transformation module 102 traverses the outer contour point set. and inner contour point set For each sub-pixel in the data, convert it into an expression for its polar angle and polar radius. For any data point on the contour... Its corresponding polar radius and polar angle The calculation is as follows: ; ; in, This indicates the distance from the contour point to the geometric center. Euclidean distance; This represents the azimuth angle of the contour point relative to the polar axis, with a value range of ( π,π], where 0 degrees corresponds to the positive X-axis direction of the image coordinate system; This is a two-parameter arctangent function used to determine the quadrant in which a point lies and return the correct angle value. Through this transformation, the system obtains two sets of original discrete sequences: the original outer diameter sequence... and inner diameter original sequence At this point, due to the discreteness of image raster sampling, the outer contour points and inner contour points differ in angle. The above is not a one-to-one correspondence, and the angular intervals between adjacent points are not fixed. It exhibits non-uniformity and cannot be directly used for radial chord width calculation.
[0033] S230, Perform angle alignment and linear resampling. To eliminate sampling non-uniformity and achieve full circumferential alignment of inner and outer diameter data, coordinate transformation module 102 constructs a standard, equally spaced angle vector. And the original sequence is resampled using a linear interpolation algorithm.
[0034] In this embodiment, the number of resampling points is set. The number of resampling points The value of must satisfy Shannon's sampling theorem, that is, the sampling frequency should be greater than twice the highest frequency of the contour frequency domain signal. In practical applications, it is usually set to . This represents the number of pixels corresponding to the outer contour perimeter, for example, a value between 2000 and 5000, to ensure that high-frequency defect features are not lost. Standard angle vector. Defined as a series of angle values uniformly distributed in the interval [0, 2π). , of which A standard angle The calculation is as follows: ; For each standard angle The coordinate transformation module 102 searches for the two adjacent points with the closest angles in the original outer diameter sequence. Specifically, it searches for points in the set of angles in the original sequence that satisfy... index Using two adjacent points and Perform linear interpolation to calculate the outer diameter value corresponding to that angle. The interpolation calculation formula is as follows: ; in, This is the radius value after resampling; , These are the original sequences and the standard angles, respectively. The polar radius of the adjacent previous and next sampling points; , These are the corresponding adjacent angles in the original sequence. Similarly, using the same standard angle vector... Using the interpolation logic described above, calculate the inner diameter value corresponding to that angle. After resampling, the system finally outputs two one-dimensional arrays that are strictly aligned in their indices: ; ; in, This is the standard outer diameter sequence after resampling. This is the standard inner diameter sequence after resampling. This represents the total length of the resampled sequences. Both sequences share the same angular indexing system, meaning that for any index... , outer diameter With inner diameter All located at the same physical angle The normalization of this data structure provides the necessary mathematical basis for calculating the radial chord width by direct algebraic subtraction in the subsequent step S300.
[0035] In step S300, the weight construction module 103 receives the aligned outer diameter sequence and inner diameter sequence output from step S200, calculates the full-circumference radial chord width, and utilizes the physical frequency domain characteristics of the sealing ring chord width variation to separate the low-frequency component reflecting physical tensile deformation from the high-frequency component reflecting local defects, thereby constructing an adaptive weight matrix for subsequent fitting. This step is based on the principles of elastomer mechanics and signal processing: as an elastomer, the sealing ring exhibits spatial continuity and smoothness in its geometric deformation when subjected to tooling tension or gravity, manifesting as a low-frequency signal in the radial chord width sequence; while appearance defects such as notches and burrs are local material deficiencies or excesses, and their geometric characteristics exhibit spatial abruptness, manifesting as a high-frequency signal in the radial chord width sequence. Based on this physical difference, a baseline reflecting only the physical deformation trend can be constructed using frequency domain filtering techniques, thereby accurately assessing the degree of local anomalies using residuals. This step specifically includes the following sub-steps: S310, Calculate the original radial chord width sequence. This is based on the standard outer diameter sequence that has already undergone angle alignment and resampling in step S200. and standard inner diameter sequence The weight construction module 103 calculates each standard angle. The radial chord width value is calculated below. Since the outer and inner diameters are unified to the same polar coordinate system and their indices are aligned, algebraic operations can be performed directly. The calculation formula is as follows: ; in, Indicates the first The original chord width value at each sampling point and These represent the corresponding outer and inner diameter values. By iterating through all sampling points, a raw chord width sequence covering the entire circumference is generated. .
[0036] S320, extract the chord width trend line (low-frequency component). Original chord width sequence The overall shape deviation (low-frequency signal caused by gravity or tension) and local defects (high-frequency signal caused by defects) are superimposed. In order to obtain a benchmark that can characterize the normal physical shape of the sealing ring, the weight construction module 103 uses a low-pass filter to convolve the original chord width sequence.
[0037] In this embodiment, a Gaussian smoothing filter is preferably used to extract the chord width trend line. Gaussian filters have the characteristic of being free of ringing effects in both the time and frequency domains, and can smoothly preserve the waveform contour. The trend line extraction formula is as follows: ; in, For the first The chord width trend value at each point; This is the offset index of the convolution kernel; The radius of the convolution kernel determines the size of the filtering window. To ensure sufficient energy coverage by the Gaussian kernel function, this embodiment sets... The value is That is, the smallest integer not less than 3 times the standard deviation.
[0038] Considering that the sealing ring is a closed ring structure, the original chord width sequence Logically, they are connected end-to-end. To avoid truncation errors at sequence boundaries during convolution operations, the indices in the formula... Calculated using circular indexing: ; Let be a one-dimensional Gaussian kernel function, defined as follows: ; in, This is the standard deviation parameter for trend extraction. The cutoff frequency of the filter is determined, and its value directly affects the smoothness of the trend line. In this embodiment, The value is determined based on the physical dimensions of the sealing ring and the allowable deformation span, and is usually set to the total number of sampling points. 1% to 5%. For example, when the number of sampling points hour, It can be set between 36 and 180. The physical meaning of this parameter setting is: the system will accommodate spaces with a span of less than... The chord width fluctuation is considered as high-frequency noise or a defect, while the spatial span is greater than The chord width fluctuation is considered a normal physical deformation trend.
[0039] S330, calculate the local anomaly degree (high-frequency component). This is done after obtaining the trend line reflecting normal physical deformation. Then, the weight construction module 103 calculates the deviation of the original chord width sequence from the trend line. This deviation is the high-frequency residual component, which directly corresponds to the significance of the suspected defect. The formula is as follows: ; in, Indicates the first The absolute deviation of the chord width at each sampling point. The larger the value, the more drastic the change in chord width at that point, the less it conforms to the continuous characteristics of physical deformation, and the higher the probability of it being a defect; the closer the value is to 0, the more gradual the change in chord width at that point, conforming to the overall trend, and the higher the probability of it being in the normal area.
[0040] S340, Construct an adaptive weight matrix. To suppress the influence of defective regions in subsequent baseline reconstruction steps, the weight construction module 103 calculates the weight matrix based on the chord width deviation. Map each sampling point to a weight value. This embodiment uses a Gaussian decay model as the weight mapping function to achieve non-linear weight allocation. The weight calculation formula is as follows: ; in, For the first The weight values of each sampling point range from (0,1]; This is the weight sensitivity parameter. Used to control the system's tolerance to changes in chord width. The value is typically set to 1 / 3 to 1 / 2 of the chord width tolerance zone allowed by the sealing ring manufacturing process. For example, if the process allows for a chord width fluctuation of ±0.1mm, then... It can be set from 0.03mm to 0.05mm. Under this parameter setting, when the chord width deviation at a certain point... When it significantly exceeds the allowable tolerance, its corresponding weight The weights will decay exponentially and approach zero; however, when the deviation is within the tolerance range, the weights... It remains at a high value close to 1.
[0041] Through the above calculations, the system generates a vector containing the weights of all sampling points. This weight vector plays a role in adjusting the data fidelity in the subsequent curve fitting algorithm. It can reduce the pulling force of high-frequency outliers on the fitted curve, while maintaining the dominance of normal contour points. Thus, even in the presence of severe defect interference, it can still reconstruct an ideal benchmark that fits the real physical shape.
[0042] In step S400, the dynamic datum reconstruction module 104 receives the polar coordinate contour sequence output in step S200 and the adaptive weight matrix generated in step S300, and uses the robust weighted least squares (RWLS) method to construct an ideal geometric datum that conforms to the current physical deformation state of the workpiece. This step is based on the flexible deformation mechanism of the sealing ring: due to the low Young's modulus of the rubber material, the sealing ring is affected by gravity or small external forces during transportation, and its macroscopic contour will undergo nonlinear low-frequency deformation (such as becoming an ellipse or an irregular smooth curve), and the standard circular template cannot fit this type of deformation. Therefore, this embodiment introduces a weight matrix and a smoothing regularization term to construct a "dynamic virtual datum" that can automatically adapt to the macroscopic deformation of the workpiece while remaining insensitive to local small defects (such as burrs and notches). This step specifically includes the following sub-steps: S410, Construct a periodic B-spline curve model. Given that the sealing ring is a closed annular geometry, the dynamic benchmark reconstruction module 104 uses a periodic cubic B-spline function as the mathematical expression model for the benchmark curve. Compared to ordinary polynomial fitting, B-splines have local support characteristics and can better adapt to the irregular elliptical deformation of the sealing ring.
[0043] In this embodiment, node vectors are defined. The nodes are uniformly distributed over the angle domain [0, 2π], and the node vectors are periodically extended, i.e. To ensure the geometric closure and second derivative continuity (C2 continuity) of the curve at the junction of 0 and 2π, the model adjusts the control point coefficient vector. Apply cyclic constraints, that is, specify Baseline curve The expression is defined as follows: ; in, Indicates the angle The reconstructed baseline radius value at the location; The number of control points is typically set to the number of resampling points. The number of degrees of freedom is 1 / 10 to 1 / 20 to ensure that the model has enough degrees of freedom to fit low-frequency deformations; For the first The coefficients of the control points to be solved; The specific form of the cubic B-spline basis function defined on the node vector can be determined by the de Boer-Cox recurrence formula.
[0044] S420, construct the weighted regularization objective function. This is to solve for the optimal control point coefficient vector. The dynamic benchmark reconstruction module 104 establishes a hybrid objective function that includes a data fidelity term and a smoothing regularization term. This objective function aims to find a curve that closely approximates the high-weight regions (i.e., regions with a high probability of being defect-free) in the original measurement data while maintaining the overall smoothness of the curve. Objective function The expression is as follows: ; in, This represents the total number of sampling points for the contour data. The part generated in step S300 corresponding to the first Adaptive weight values for each point; This is the original outer diameter measurement; This represents the calculated value of the fitted curve at the corresponding angle; The second derivative of the fitted curve is used to characterize the rate of change of the curve's curvature. The smoothing parameter. In this formula, the smoothing parameter... It is a non-negative real number used to balance data fitting accuracy and curve smoothness. In this embodiment, The value range is set to 10. -5 Up to 10 -2 .when When the value is large, the reconstructed reference curve tends to be a rigid circle; when When the values are smaller, the baseline curve follows the original data more closely. This is achieved through weighting. Modulation, when there is a defect at a certain position (i.e. When the value approaches 0, the error contribution of that point in the data fidelity term is reduced. At this time, the curve shape is mainly controlled by the smoothing regularization term and the neighborhood data, thereby achieving reasonable interpolation of the trajectory at the defect.
[0045] S430, Solve the least squares matrix equation. To minimize the objective function... The system transforms it into matrix operation form in linear algebra. The objective function is then processed with respect to the coefficient vector. Taking the derivative and setting it to zero, we obtain a system of linear equations: ; in, for A basis function observation matrix of dimension, where elements ; for A diagonal weight matrix of dimension , whose diagonal elements are ; for The original outer diameter measurement vector of the dimension. for A regularized matrix of dimension, whose elements It is obtained by integrating the second derivatives of the basis functions: ; Due to the matrix It is a sparse symmetric positive definite matrix mainly composed of non-zero elements with small bandwidth. In this embodiment, the Cholesky decomposition method is used for efficient solution to obtain the optimal control point coefficient vector. Thus, a unique baseline curve is determined. .
[0046] S440, perform iterative optimization and benchmark update. Although step S300 provides initial weights based on the chord width, this embodiment employs an iterative reweighting strategy to further improve the robustness of the benchmark curve. After completing the initial fitting, the dynamic benchmark reconstruction module 104 calculates the residual between the original profile and the current benchmark curve. Based on this residual, the weight matrix is updated using the bisquare weight function. The specific update formula is as follows: ; in, For the first Weights at the next iteration; This is an optimization constant, typically set to 4.685 to achieve 95% asymptotic efficiency; The robust estimate of the residual scale is calculated using the median absolute deviation (MAD), i.e. .
[0047] The matrix solution in step S430 is performed again using the updated weight matrix. This process is repeated until the change in the control point coefficients obtained from the two calculations is less than a preset convergence threshold (e.g., 10). -6 (or reaches the maximum number of iterations (e.g., 5). The final convergence curve This refers to the ideal geometric datum that eliminates defect interference and accurately reflects the true deformation state of the sealing ring. This datum will serve as the standard reference line for calculating the geometric residuals in the subsequent step S500.
[0048] In step S500, the joint verification module 105 receives the ideal geometric reference curve output in step S400. The original contour data output from step S200 is used to perform dual feature extraction based on both geometric and light field dimensions. This step is based on the consistency verification principle of "macro-geometry-micro-texture": for normal sealing ring edges (including mold parting lines), the direction of their macro-geometric tangents should maintain a strict orthogonal relationship with the direction of the gray-level gradient of the micro-image (i.e., the direction of the most drastic change in the light field). When defects such as burrs or tears exist, although their geometric height may be similar to that of the mold parting line, the rough and chaotic micro-structure of their edges will cause the light scattering direction to deflect randomly, thus destroying the above orthogonality. The system utilizes this physical characteristic to construct a multi-dimensional feature vector by calculating the geometric residual and orthogonality deviation, thereby effectively distinguishing between true and false defects. This step specifically includes the following sub-steps: S510, Calculate the geometric residual sequence. The joint verification module 105 first calculates the algebraic difference between the original measured profile and the ideal geometric datum. This difference directly characterizes the degree of abrupt change in the radial direction of the sealing ring edge. Based on the aligned angle index, the calculation formula is as follows: ; in, For the first Geometric residual values of each sampling point; The original outer diameter measurement has been resampled; The B-spline reference curve at the standard angle The function value at that location.
[0049] Under this definition, if A positive value indicates that the edge bulges outwards; if... A negative value indicates that the edge is concave inward. In this embodiment, a preliminary screening threshold for the geometric residual is typically set. This threshold is set based on the tolerance grade of the sealing ring, for example, set to 0.05mm to 0.1mm. Only when... Only when this happens will the system initiate subsequent orthogonality checks to reduce computational overhead.
[0050] S520, Analytical calculation of the ideal geometric tangent vector. To analyze the smoothness of the edges, it is necessary to obtain the tangent direction at each point on the reference curve. Since the reference curve constructed in step S400 is an analytical B-spline function, this embodiment calculates the tangent vector by... Take the derivative and calculate the tangent vector in the Cartesian coordinate system.
[0051] For any standard angle Coordinates of points on the baseline curve Satisfy polar coordinate transformation relationship: ; ; Regarding the above coordinates with respect to the angle variable Find the first derivative to obtain the... Ideal geometric tangent vector at each sampling point The specific calculation components are as follows: ; ; in, For cubic B-spline curves at angles The first derivative value at [location]. To avoid errors introduced by the difference approximation, this embodiment utilizes the derivative properties of the B-spline basis functions for accurate calculation: ; in, Let be the first derivative of the cubic B-spline basis functions, whose value can be obtained by a linear combination of lower-order B-spline basis functions: ; The above analytical calculations ensured the tangent vector. It accurately reflects the macroscopic trend of the baseline curve at this point.
[0052] S530, calculate the local gray-level gradient vector. Simultaneously, the joint verification module 105 calls the original gray-level image obtained in step S100. The actual light field gradient at the contour edge is calculated. To overcome the pixel grid effect and obtain gradient information at sub-pixel coordinates, this embodiment adopts a strategy of "global calculation first, local interpolation later". First, the Sobel operator is used to calculate the gradient of the entire image. Perform convolution to generate horizontal gradient maps. and vertical gradient plot The Sobel operator uses the following convolution kernel: ; Subsequently, according to the Subpixel coordinates of each contour point ,exist and The bilinear interpolation algorithm is used to calculate the horizontal gradient components at the given coordinates. and vertical gradient components .
[0053] Finally, construct the gray-level gradient vector at that point. The physical meaning of this vector is that it points in the direction of the most dramatic change in image grayscale (i.e., from the dark background to the interior of the bright target). At an ideal smooth edge, this direction should be strictly perpendicular to the geometric tangent of the edge.
[0054] S540, construct an orthogonality deviation model. This is achieved after obtaining the tangent vector representing the macroscopic geometric trend. and the gradient vector representing the microscopic field characteristics Subsequently, this embodiment evaluates the smoothness of the edge by calculating the normalized value of the dot product of the two. An orthogonality deviation index is defined. The calculation formula is as follows: ; in," " indicates the vector dot product operation; The L2 norm represents the magnitude of a vector. This indicates taking the absolute value; it should be noted that in actual calculations, if an absolute value is detected... If the value is close to zero (i.e., the point is in a flat region rather than an edge), then directly... Set to 0 to avoid calculation errors.
[0055] The physical meaning of this formula utilizes the geometric properties of the vector dot product, that is... ,in Let be the angle between the two vectors. Ideally, the geometric tangent is perpendicular to the grayscale gradient normal, and the angle is... Approaching 90 degrees The grayscale gradient approaches zero; however, at burrs or tears, due to the chaotic microstructure at the edges, the direction of the grayscale gradient will randomly deflect, leading to... Deviating from 90 degrees, at this time It will be significantly greater than 0. In this embodiment, the orthogonality deviation ranges from [0,1], and this index is related to the geometric residual. Together, they constitute the two-dimensional feature space for the subsequent defect classification decision in step S600.
[0056] In step S600, the defect determination module 106 receives the geometric residual sequence output in step S500. Orthogonality deviation sequence And combined with the chord width deviation sequence output in step S300 This step involves joint decision-making based on a multi-dimensional feature space. It is based on the principle of physical completeness of defect features: genuine material defects (such as notches or burrs) physically necessarily cause simultaneous abrupt changes in macroscopic contours (geometric dimension), scattering of edge microscopic textures (light field dimension), and changes in local material quantity (mass dimension). In contrast, the parting line only has macroscopic geometric protrusions but regular texture, and elastic deformation only has macroscopic geometric offsets but continuous material quantity. Based on this difference, this embodiment constructs a multi-dimensional logical threshold. Only when the abnormal features of the above three dimensions "spatiotemporally coincide" at the same coordinate index is it confirmed as a substantial defect, thereby eliminating systematic false alarms caused by single-dimensional detection from the root. This step specifically includes the following sub-steps: S610, Set multi-dimensional feature decision thresholds. To achieve quantitative classification and judgment, the defect judgment module 106 defines three key decision thresholds based on the tolerance standards of the sealing rings and sample statistical data during the system initialization or offline calibration phase: 1. Geometric residual threshold. This threshold is used to characterize the allowable upper limit of edge deviation from the reference. In this embodiment, this threshold is directly related to the dimensional tolerance zone of the product and is set as follows: ,in The coefficient is the single-sided profile tolerance specified in the drawing. The value range is 0.6-0.8. 2. Orthogonality deviation threshold The critical point used to characterize the micro-roughness of the edge. In this embodiment, several qualified sealing rings (including the parting line area) are selected as calibration samples, and the distribution histogram of their full-circumference orthogonality deviation values is calculated. The 99.7% quantile of the distribution curve is taken as the threshold. Based on empirical data, this threshold is typically set between 0.35 and 0.55. 3. Chord width deviation threshold This threshold is used to characterize the degree of abrupt change in radial width. It is adaptively correlated with the statistical characteristics of the trend extraction in step S300 and set to... ,in The statistical standard deviation and coefficient of the chord width trend line calculated in step S320. The value is usually taken as 3.0, which is in line with... Criteria for identifying outliers.
[0057] S620 performs a joint determination of burr defects. For common burr or flash defects in rubber seals, the defect determination module 106 iterates through each sampling point. Calculate the glitch decision logic value A burr is defined as a feature that spatially overlaps with three characteristics: geometric protrusion, texture disorder, and increased chord width. The logical formula is as follows: ; in, This is an indicator function; it takes the value 1 when the condition within the parentheses is met, and 0 otherwise. Represents the logical AND operation.
[0058] Specifically, this judgment logic excludes the following two typical types of interference: 1. Mold parting line interference: Although the mold parting line satisfies the condition... However, because its edges are smooth and the direction of the light field gradient is orthogonal to the tangent, therefore The logical result is 0. 2. Eccentricity interference: Overall eccentricity or ellipticization of the workpiece will cause some areas to satisfy the condition. However, because its changes are low-frequency and continuous, The logical result is 0.
[0059] S630 performs a joint determination of void defects. For voids, underfill, or tear defects, the defect determination module 106 employs reverse logic, symmetrical to that used for burr determination. A void is determined only if all three characteristics—geometric indentation, texture irregularity, and reduced chord width—are present simultaneously. The logic formula is as follows: ; in, This indicates that the depth of the inward indentation at the edge exceeds the allowable tolerance; This indicates that the abrupt change in chord width (whether it increases or decreases) exceeds the limits of physical continuity. When At that time, the system records the current angle index. As the central location of the notch defect.
[0060] S640 performs classification output and rejection control. For the logic function... or For sampling points marked as 1, the defect determination module 106 maps their positions in the image coordinate system back to physical space coordinates. If the number of consecutively marked sampling points exceeds a preset minimum defect length threshold (e.g., corresponding to a physical length of 0.2 mm), a defect alarm signal is generated.
[0061] For regions that only meet the single-dimensional anomaly criteria, the system performs the following false alarm prevention classification: (1) If only and (2) If only the parting line area is marked as "parting line area", no alarm will be triggered; and The area marked as "elastic deformation zone" will not trigger an alarm.
[0062] Finally, the system outputs a detection data packet containing the defect type (burr / notch), defect coordinates, and maximum deviation value, and sends a rejection instruction to the sorting mechanism.
[0063] Based on the above embodiments, in order to more intuitively illustrate the application effect of the present invention in actual industrial scenarios and the collaborative mechanism between modules, a specific detection embodiment will be described in detail below.
[0064] Taking the online inspection of a certain type of nitrile rubber sealing ring as an example, the standard outer diameter of this sealing ring is 20mm, and the wire diameter is 2mm. In the actual production process, affected by conveyor belt vibration and gravity, the sealing ring under inspection exhibits a slightly elliptical shape (low-frequency deformation) with a major axis of 20.15mm and a minor axis of 19.85mm in the field of view. In addition, there is a mold line residue with a height of 0.12mm at the 0-degree position of the sealing ring (non-defect feature), a flash burr with a height of 0.15mm at the 90-degree position (defect feature), and a material shortage notch with a depth of 0.1mm at the 180-degree position (defect feature).
[0065] At the start of the detection, the computation control unit 30 controls the imaging unit 10 to acquire an image under strobe illumination, and the image preprocessing module 101 extracts the full-circumference sub-pixel contour. The coordinate transformation module 102 maps this contour to a polar coordinate system. At this time, if a standard circle is directly used as the reference (i.e., the radius is fixed at 10mm), the above-mentioned elliptical deformation will cause the geometric residual in most areas to exceed the tolerance threshold of 0.1mm, thereby generating a large number of false alarms.
[0066] The present invention first calculates the radial chord width sequence through the weight construction module 103. At the 0-degree parting line, 90-degree burr, and 180-degree notch positions, the weight construction module 103 detects significant high-frequency fluctuation components of the chord width. Therefore, the weight values corresponding to these three regions are significantly reduced to below 0.1 using a Gaussian attenuation model. In most other regions, the weight values remain above 0.9 because the chord width changes gradually.
[0067] Subsequently, the dynamic benchmark reconstruction module 104 uses this adaptive weight matrix to perform B-spline curve fitting. (See attached diagram) Figure 4 In the figure, the solid line represents the original measured outer diameter profile data, and the dashed line represents the ideal reference curve reconstructed by the algorithm. It can be seen that, due to the suppression effect of low weights, the reference curve output by the dynamic reference reconstruction module 104 does not follow the 90-degree burr protrusion or the 180-degree notch depression, but rather smoothly fits the overall elliptical trend of the sealing ring (i.e., the dashed line closely follows the solid line in the overall trend, but maintains a smooth trajectory at abrupt changes). This means that the reference curve successfully isolates local defects and restores the ideal profile of the workpiece under its current deformation state.
[0068] Next, the joint verification module 105 calculates multidimensional features based on this dynamic benchmark. (See attached diagram.) Figure 5 The figure shows the geometric residual sequence of the full-circle expansion from top to bottom. Orthogonality biased sequence and chord width deviation sequence .
[0069] For the parting line area at the 0-degree position ( Figure 5 (Region A), although the geometric residual sequence shows that its height exceeds the set geometric residual threshold ( However, because the parting line edge is smooth and neat, its corresponding orthogonality deviation sequence is in a low position ( This indicates that the edge tangent and the light field gradient are well orthogonal. Based on preset logic rules, the defect determination module 106 determines that this is a normal process residue and does not trigger an alarm.
[0070] For the burr area at the 90-degree position ( Figure 5 In region B, the geometric residual sequence shows a significant bulge, and due to the rough edges of the burrs, the orthogonality deviation sequence exhibits a sharp peak. ), and the chord width deviation sequence shows a local positive abrupt change ( When features in all three dimensions exceed limits simultaneously at the same location, the joint judgment logic is triggered, and the defect judgment module 106 identifies it as a "burr defect".
[0071] For the gap area at the 180-degree position ( Figure 5 In the middle C region), the geometric residual sequence shows a significant concavity ( Orthogonality bias sequences also exhibit high-frequency disorder characteristics. Furthermore, the chord width deviation sequence shows a negative abrupt change. The defect determination module 106 identifies it as a "notch defect" based on logic.
[0072] Finally, the defect determination module 106 outputs the detection results, including the position coordinates and quantified values of 90-degree burrs and 180-degree notches. Based on this, the calculation control unit 30 controls the external rejection mechanism to blow the defective product off the production line at the corresponding position. Through the above process, this invention accurately distinguishes between appearance defects and normal mold parting lines while being compatible with the macroscopic flexible deformation of the workpiece, effectively solving the problems of false detection and missed detection caused by deformation and interference features in traditional visual inspection.
[0073] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A sealing ring appearance inspection method based on image processing, characterized in that, Includes the following steps: Obtain the original image of the sealing ring and extract the subpixel-level outer contour point set and inner contour point set; Map the outer contour point set and the inner contour point set to the polar coordinate system, and resample to generate an angle-aligned standard outer diameter sequence and a standard inner diameter sequence; The difference between the standard outer diameter sequence and the standard inner diameter sequence is calculated to obtain the chord width sequence. The chord width trend line of the chord width sequence is extracted. The difference between the chord width sequence and the chord width trend line is calculated as the chord width deviation. An adaptive weight matrix is constructed using the chord width deviation. The standard outer diameter sequence is subjected to weighted B-spline fitting using the adaptive weight matrix to reconstruct the ideal geometric reference curve; Calculate the geometric residual sequence of the standard outer diameter sequence relative to the ideal geometric reference curve, and calculate the orthogonality deviation sequence between the local gray-level gradient vector at the edge of the original image and the ideal geometric tangent vector of the ideal geometric reference curve; By comprehensively analyzing the geometric residual sequence, the orthogonality deviation sequence, and the chord width deviation, defects are determined based on the multidimensional feature decision threshold.
2. The image processing-based sealing ring appearance inspection method according to claim 1, characterized in that, The step of obtaining the original image of the sealing ring and extracting the sub-pixel level outer contour point set and inner contour point set includes: The high-angle coaxial light source and the low-angle shadowless ring light source are alternately lit to control the industrial camera to expose synchronously and obtain the basic image. The gray-level gradient magnitude of the base image is calculated using an edge detection operator, and pixels with gray-level gradient magnitudes greater than a preset threshold are marked as candidate edge points. A local one-dimensional search line is established along the gradient direction of the candidate edge points to obtain a discrete gray-level sequence, and a quadratic polynomial model is established to fit the discrete gray-level sequence. The subpixel offset is calculated by taking the derivative of the quadratic polynomial model. The subpixel-level edge point coordinates are then calculated by combining the integer pixel coordinates of the candidate edge points with the gradient direction angle and aggregated into the outer contour point set and the inner contour point set.
3. The image processing-based sealing ring appearance inspection method according to claim 1, characterized in that, The step of mapping the outer contour point set and the inner contour point set to a polar coordinate system and resampling to generate an angle-aligned standard outer diameter sequence and a standard inner diameter sequence includes: The arithmetic mean of the set of points on the outer contour is calculated as the origin of the polar coordinate transformation; Calculate the Euclidean distance from each data point to the origin as the polar radius, and calculate the azimuth angle of each data point relative to the polar axis as the polar angle. Construct a standard angle vector containing uniformly distributed angle values; For each standard angle in the standard angle vector, two adjacent points in the original sequence are found and linear interpolation is performed to generate the standard outer diameter sequence and the standard inner diameter sequence, which share the same angle indexing system.
4. The image processing-based sealing ring appearance inspection method according to claim 1, characterized in that, The process of calculating the difference between the standard outer diameter sequence and the standard inner diameter sequence to obtain a chord width sequence, extracting the chord width trend line from the chord width sequence, calculating the difference between the chord width sequence and the chord width trend line as the chord width deviation, and constructing an adaptive weight matrix using the chord width deviation includes: Calculate the algebraic difference between the standard outer diameter sequence and the standard inner diameter sequence to generate the chord width sequence; The chord width sequence is convolved using a Gaussian smoothing filter to extract the chord width trend line; The absolute value of the difference between the chord width sequence and the chord width trend line is calculated to obtain the chord width deviation; The chord width deviation is mapped to a weight value using a Gaussian decay model. The weight value is negatively correlated with the magnitude of the chord width deviation, thereby generating the adaptive weight matrix.
5. The image processing-based sealing ring appearance inspection method according to claim 1, characterized in that, The step of using the adaptive weight matrix to perform weighted B-spline fitting on the standard outer diameter sequence to reconstruct the ideal geometric reference curve includes: A baseline curve model is constructed using a periodic cubic B-spline function, and the node vectors are periodically extended. A hybrid objective function is established, which includes a data fidelity term and a smoothing regularization term. The data fidelity term is weighted using the adaptive weight matrix, and the smoothing regularization term is characterized by the integral of the second derivative of the baseline curve. Construct a system of linear equations and solve for the control point coefficient vector to obtain the initial baseline curve; The residuals are calculated and the adaptive weight matrix is updated using a bisquared weight function. The solution is iteratively solved until the control point coefficients converge to obtain the ideal geometric reference curve.
6. The image processing-based sealing ring appearance inspection method according to claim 1, characterized in that, The calculation of the geometric residual sequence of the standard outer diameter sequence relative to the ideal geometric reference curve, and the calculation of the orthogonality deviation sequence between the local gray-level gradient vector at the edge of the original image and the ideal geometric tangent vector of the ideal geometric reference curve, include: The algebraic difference between the standard outer diameter sequence and the function value of the ideal geometric reference curve at the corresponding angle is calculated to obtain the geometric residual sequence; Calculate the ideal geometric tangent vector by taking the first derivative of the ideal geometric reference curve with respect to the angle variable; The horizontal and vertical gradient components at the contour edge are calculated using operator convolution and subpixel interpolation to construct the local gray-level gradient vector. The magnitude of the dot product of the ideal geometric tangent vector and the local gray-level gradient vector is calculated and normalized to obtain the orthogonality deviation sequence.
7. The image processing-based sealing ring appearance inspection method according to claim 6, characterized in that, The step of calculating the magnitude of the dot product of the ideal geometric tangent vector and the local gray-level gradient vector and then normalizing it to obtain the orthogonality deviation sequence includes: Calculate the dot product of the ideal geometric tangent vector and the local gray-level gradient vector; Calculate the product of the magnitude of the ideal geometric tangent vector and the magnitude of the local gray-level gradient vector; Divide the product by the product and take the absolute value to obtain the orthogonality deviation value in the orthogonality deviation sequence.
8. The image processing-based sealing ring appearance inspection method according to claim 1, characterized in that, The comprehensive analysis of the geometric residual sequence, the orthogonality deviation sequence, and the chord width deviation, and the determination of defects based on multidimensional feature decision thresholds, includes: When a certain position simultaneously satisfies the following conditions: the value of the geometric residual sequence is greater than the geometric residual threshold, the value of the orthogonality deviation sequence is greater than the orthogonality deviation threshold, and the chord width deviation is greater than the chord width deviation threshold, a burr defect is determined to exist. A notch defect is determined to exist when a certain position simultaneously satisfies the following conditions: the value of the geometric residual sequence is less than the negative geometric residual threshold, the value of the orthogonality deviation sequence is greater than the orthogonality deviation threshold, and the chord width deviation is greater than the chord width deviation threshold.
9. The image processing-based sealing ring appearance inspection method according to claim 8, characterized in that, The comprehensive analysis of the geometric residual sequence, the orthogonality deviation sequence, and the chord width deviation, and the determination of defects based on the multidimensional feature decision threshold, also includes: If a certain position satisfies only the condition that the value of the geometric residual sequence is greater than the geometric residual threshold and the value of the orthogonality deviation sequence is less than or equal to the orthogonality deviation threshold, it is marked as a mold line region; If a certain position satisfies only the condition that the value of the geometric residual sequence is greater than the geometric residual threshold and the chord width deviation is less than or equal to the chord width deviation threshold, it is marked as an elastic deformation region; The number of consecutive sampling points identified as defects is counted, and an alarm signal is output when the physical length corresponding to the number of consecutive sampling points exceeds a preset length threshold.
10. A sealing ring appearance inspection device based on image processing, applied to the sealing ring appearance inspection method based on image processing according to any one of claims 1-9, characterized in that, include: An imaging unit is used to acquire a high-resolution grayscale image of the sealing ring to be inspected; An illumination unit is used to provide the light field environment for imaging; The computation and control unit is connected to both the imaging unit and the illumination unit. The computation and control unit includes: an image preprocessing module for receiving images and extracting sub-pixel contours; a coordinate transformation module for mapping image data to a polar coordinate system and aligning it; a weight construction module for generating an adaptive weight matrix based on frequency domain separation; a dynamic benchmark reconstruction module for fitting an ideal geometric benchmark curve using the adaptive weight matrix; a joint verification module for calculating the geometric residual sequence and the orthogonality deviation sequence; and a defect determination module for outputting detection results based on a multi-dimensional feature space.
Citation Information
Patent Citations
Non-contact detection method for rubber sealing ring
CN112050737A
Method for size measurement and appearance detection of O-shaped ring
CN119919410A
Intelligent dispensing control method based on self-adaptive track and dynamic fault-tolerant control
CN120587085A
Curve tunnel deformation monitoring data fusion processing method based on multi-station robot
CN120832641A
Machine vision-based precise part size automatic detection method and system
CN120833369A
Cited By
Automatic detection and classification system for surface defects of optical element
CN121830720A
An automatic detection and classification system for surface defects of optical elements
CN121830720B
Sealing ring detection method and system based on image processing
CN121982031A
A bearing deformation measurement method and device based on image recognition
CN122305959A