Image processing-based seal ring appearance detection method and detection device

By using image processing technology and adaptive weighted B-spline fitting with chord width deviation and orthogonality deviation, the problem of difficulty in distinguishing the parting line from the burr and noise interference in the detection of rubber sealing rings is solved, and efficient and accurate defect detection is achieved.

CN121558751BActive Publication Date: 2026-04-10JIANGSU RUNTAIYIN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JIANGSU RUNTAIYIN TECH CO LTD
Filing Date
2026-01-26
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing visual inspection technologies cannot effectively distinguish between the parting line and burr defects of rubber seals, and the noise interference introduced by the vibration of the conveyor belt makes it difficult to capture the features of tiny gaps, resulting in frequent false alarms.

Method used

An image processing-based method is adopted to obtain the sub-pixel level outer contour point set and inner contour point set of the sealing ring, map them to the polar coordinate system for resampling, calculate the difference of the chord width sequence and the adaptive weight matrix, construct a dynamic geometric benchmark by using weighted B-spline fitting, and combine geometric residuals and orthogonality deviation to determine defects.

Benefits of technology

It enables accurate defect detection of flexible rubber seals, reduces false alarms, improves the ability to capture local abrupt change signals, solves the problem of difficulty in distinguishing parting lines from burrs, and enhances detection stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121558751B_ABST
    Figure CN121558751B_ABST
Patent Text Reader

Abstract

The application relates to the fields of machine vision and industrial precision detection technology, and discloses a sealing ring appearance detection method and detection equipment based on image processing, which comprises the following steps: acquiring an image and extracting a sub-pixel level outer contour point set and an inner contour point set, mapping to a polar coordinate system to resample to generate a standard outer diameter sequence and a standard inner diameter sequence; calculating a chord width deviation and constructing an adaptive weight matrix, performing weighted B-spline fitting reconstruction on the standard outer diameter sequence to obtain an ideal geometric reference curve; calculating a geometric residual sequence and an orthogonality deviation sequence between a local gray gradient vector and an ideal geometric tangent vector; and comprehensively analyzing the geometric residual sequence, the orthogonality deviation sequence and the chord width deviation to determine defects. The adaptive weight B-spline fitting strategy based on the chord width deviation is adopted, a dynamic geometric reference changing with a workpiece shape is constructed, low-frequency physical deformation characteristics of the sealing ring can be reserved, and the interference of high-frequency defects on a fitted track can be removed.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of machine vision and industrial precision detection, in particular to a sealing ring appearance detection method and detection equipment based on image processing. BACKGROUND

[0002] Rubber sealing rings are widely used in the fields of automobile manufacturing, hydraulic and pneumatic, and precision instruments, and are the core components for preventing fluid leakage and maintaining system pressure. The integrity of the edge profile directly affects the safety and service life of the entire mechanical system. Even a micron-level gap or excess burr can cause severe sealing failure in use. Therefore, in modern mass production, using machine vision technology to detect the appearance of sealing rings has become a key link to ensure the quality of products and to remove defective products.

[0003] Existing visual detection technology mainly relies on standard geometric template matching and measurement algorithms. This type of scheme collects workpiece images through an industrial camera, uses the least squares method to fit the edge points into a standard circle or ellipse, and then calculates the radius, roundness, and other size data. For rigid metal gaskets or hard plastic parts, this detection method based on ideal geometric models has the advantages of fast operation speed and intuitive parameter configuration, and can efficiently screen out unqualified products with size out-of-tolerance or severe macro-shape deformation.

[0004] However, rubber materials have a very low Young's modulus and are easily affected by gravity or slight friction during high-speed motion on a conveyor belt, causing random elastic deformation. The aforementioned rigid geometric template cannot dynamically adapt to this non-defect low-frequency distortion, often misjudging normal shape fluctuations as size defects, leading to frequent false alarms on the production line. In addition, the mold line left by the mold pressing process appears as a small outward protrusion on the geometric profile, which is very similar to the shape of burr defects. It is difficult to distinguish between the two with only a single geometric distance threshold, which can easily result in the misidentification of mold lines or the missed detection of small burrs. At the same time, mechanical vibrations of the conveying system can introduce high-frequency noise, and the measurement method based on absolute radius can superimpose this vibration on the profile data, making it difficult to accurately capture subtle tears or gaps. SUMMARY

[0005] To overcome the shortcomings of the prior art, the present application provides a sealing ring appearance detection method and detection equipment based on image processing, which solves the technical problems of false positives caused by the nonlinear deformation of the workpiece under stress, the inability to accurately distinguish between mold lines and burr defects relying only on geometric dimension features, and the difficulty in extracting small gap features due to noise interference caused by conveyor belt vibration.

[0006] To achieve the above purposes, the present application is implemented by the following technical solutions:

[0007] The image processing-based sealing ring appearance detection method comprises the following steps:

[0008] An original image of the sealing ring is acquired, and a sub-pixel level outer contour point set and an inner contour point set are extracted;

[0009] The outer contour point set and the inner contour point set are mapped to a polar coordinate system, and resampling is performed to generate an angle-aligned standard outer diameter sequence and a standard inner diameter sequence;

[0010] A difference value of the standard outer diameter sequence and the standard inner diameter sequence is calculated to obtain a chord width sequence, a chord width trend line of the chord width sequence is extracted, a difference value between the chord width sequence and the chord width trend line is calculated as a chord width deviation, and an adaptive weight matrix is constructed by using the chord width deviation;

[0011] Weighted B-spline fitting is performed on the standard outer diameter sequence by using the adaptive weight matrix, and an ideal geometric reference curve is reconstructed;

[0012] A geometric residual sequence of the standard outer diameter sequence relative to the ideal geometric reference curve is calculated, and an orthogonality deviation sequence between a local gray gradient vector at an edge of the original image and an ideal geometric tangent vector of the ideal geometric reference curve is calculated;

[0013] The geometric residual sequence, the orthogonality deviation sequence and the chord width deviation are comprehensively analyzed, and defects are determined according to a multi-dimensional feature decision threshold.

[0014] The application also provides an image processing-based sealing ring appearance detection device, comprising: an imaging unit for acquiring a high-resolution gray image of a sealing ring to be detected; an illumination unit for providing a light field environment for imaging; and an operation control unit connected with the imaging unit and the illumination unit, respectively, wherein the operation control unit comprises: an image preprocessing module for receiving an image and extracting a sub-pixel contour; a coordinate transformation module for mapping image data to a polar coordinate system and completing alignment; a weight construction module for generating an adaptive weight matrix based on frequency domain separation; a dynamic reference reconstruction module for fitting and generating an ideal geometric reference curve by using the adaptive weight matrix; a joint verification module for calculating a geometric residual sequence and an orthogonality deviation sequence; and a defect determination module for outputting a detection result based on a multi-dimensional feature space.

[0015] The application provides an image processing-based sealing ring appearance detection method and detection device, which has the following beneficial effects:

[0016] 1. The application adopts an adaptive weight B-spline fitting strategy based on chord width deviation, constructs a dynamic geometric reference that changes with the shape of the workpiece, can retain the low-frequency physical deformation characteristics of the sealing ring, and at the same time eliminate the interference of high-frequency defects on the fitted trajectory, compared with the standard circle or ellipse template matching scheme commonly used in the prior art, the present scheme solves the misjudgment problem caused by the nonlinear deformation of flexible rubber sealing ring due to gravity extrusion or conveyor belt tension traction, greatly reduces false alarms without reducing detection sensitivity.

[0017] 2. The application introduces an orthogonal checking mechanism of macroscopic geometric tangent vector and microscopic gray gradient vector, quantizes the smoothness of edge texture, realizes multi-dimensional locking of defect characteristics through joint analysis of geometric residual and orthogonality deviation, and breaks through the bottleneck that it is difficult to distinguish between the parting line and the small burr in geometric height, and realizes reliable separation by using the difference in light field scattering characteristics between regular process features and chaotic material defects.

[0018] 3. The application implements an inner and outer contour polar coordinate alignment and chord width frequency domain separation strategy, extracts high-frequency residual components in the chord width sequence, establishes a relative thickness evaluation model independent of the absolute coordinate system, and enhances the ability to capture local mutation signals. Compared with the traditional technical scheme of directly measuring absolute radius values, the present method solves the problem of measurement reference drift caused by overall eccentricity of the workpiece or random shaking of the shooting position, and significantly improves the detection stability of the through defects such as notches and tears by using the inherent physical constraint relationship of the inner and outer diameters. BRIEF DESCRIPTION OF DRAWINGS

[0019] Figure 1 The system architecture schematic diagram of the sealing ring appearance detection method and detection equipment based on image processing of the embodiments of the application;

[0020] Figure 2 The functional module structure schematic diagram of the detection system of the embodiments of the application;

[0021] Figure 3 The flowchart of the sealing ring appearance detection method of the embodiments of the application;

[0022] Figure 4 The comparison schematic diagram of the original contour and the reconstructed reference curve of the embodiments of the application;

[0023] Figure 5 The multi-dimensional feature waveform schematic diagram of the geometric residual, orthogonality deviation and chord width deviation of the embodiments of the application; wherein, figure (a) shows the geometric residual sequence, figure (b) shows the orthogonality deviation sequence, and figure (c) shows the chord width deviation sequence.

[0024] Wherein: 10, imaging unit; 11, large target surface industrial camera; 12, double telecentric lens; 20, illumination unit; 21, high-angle coaxial light source; 22, low-angle shadowless ring light source; 30, operation control unit; 101, image preprocessing module; 102, coordinate transformation module; 103, weight construction module; 104, dynamic reference reconstruction module; 105, joint verification module; 106, defect judgment module. DETAILED DESCRIPTION

[0025] The application will be further described in detail below with reference to the accompanying drawings of the application.

[0026] Referring to the accompanying drawings Figure 1 , the application provides a sealing ring appearance detection equipment based on image processing. The detection equipment comprises an imaging unit 10, an illumination unit 20 and an operation control unit 30. The imaging unit 10 and the illumination unit 20 are respectively connected to the operation control unit 30 to work cooperatively under the timing control of the operation control unit 30, so as to complete the collection and processing of sealing ring image data.

[0027] The imaging unit 10 is used to acquire a high-resolution gray-scale image of a sealing ring to be detected. The imaging unit 10 comprises a large target surface industrial camera 11 and a double telecentric lens 12. The optical axis of the large target surface industrial camera 11 is perpendicular to the detection plane where the sealing ring is located. The double telecentric lens 12 is installed at the front end of the large target surface industrial camera 11. The double telecentric lens 12 has an optical property of constant magnification in the depth of field range, which can eliminate the perspective error caused by the position floating of the sealing ring on the conveying belt, and ensure that the inner and outer diameter sizes of the sealing ring in the image collected by the imaging unit 10 maintain a linear mapping relationship with the actual physical sizes.

[0028] The illumination unit 20 is used to provide a light field environment for imaging. The illumination unit 20 comprises a high-angle coaxial light source 21 and a low-angle shadowless ring light source 22. The light path of the high-angle coaxial light source 21 is coaxially distributed with the optical axis of the large target surface industrial camera 11, which is used to illuminate the background of the sealing ring to form a high-contrast profile silhouette. The low-angle shadowless ring light source 22 is arranged around the four sides of the sealing ring to be detected, which is used to illuminate the surface of the sealing ring at a grazing angle to highlight the features of surface scratches or foreign matters. The illumination unit 20 is connected with the operation control unit 30, and receives a trigger signal through a stroboscopic controller to quickly switch the lighting state of the high-angle coaxial light source 21 and the low-angle shadowless ring light source 22 between different image collection frames.

[0029] The operation control unit 30 is the core processing center of the entire detection device, and is usually an industrial control computer with high-performance floating-point operation capability. The operation control unit 30 is configured with an image acquisition interface, a digital I / O control interface, and a central processor supporting the AVX2 or higher version instruction set. The operation control unit 30 internally stores and runs a set of computer programs, and when the computer programs are executed, each step of the sealing ring appearance detection method is realized.

[0030] Referring to the accompanying drawings Figure 2 The detection system running in the operation control unit 30 is logically divided into: an image preprocessing module 101, a coordinate transformation module 102, a weight construction module 103, a dynamic reference reconstruction module 104, a joint verification module 105, and a defect judgment module 106.

[0031] The image preprocessing module 101 is used to receive the gray-scale image transmitted by the imaging unit 10, and performs region of interest extraction and sub-pixel edge positioning operations. The image preprocessing module 101 locates the rough position of the sealing ring through an edge detection operator, and calculates the gray-scale moment in the edge normal direction or performs quadratic curve interpolation, and outputs the outer contour point set coordinates and the inner contour point set coordinates with sub-pixel accuracy.

[0032] The coordinate transformation module 102 is connected with the image preprocessing module 101, and is used to map the 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 polar coordinate origin, and converts the outer contour point set coordinates and the inner contour point set coordinates into polar angle and polar radius forms. The coordinate transformation module 102 also performs a linear interpolation resampling operation to ensure that the converted outer diameter sequence and inner diameter sequence are strictly aligned in the angle dimension.

[0033] The weight construction module 103 is connected with the coordinate transformation module 102, and is used to generate an adaptive weight matrix based on the frequency domain separation idea. The weight construction module 103 calculates the radial chord width sequence of the sealing ring, and uses a low-pass filter to extract the chord width trend line. The weight construction 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 according to the deviation. When the weight construction module 103 detects that the chord width suddenly changes, the weight value corresponding to the position is reduced; when the weight construction module 103 detects that the chord width change conforms to the low-frequency trend, the high weight value of the position is retained.

[0034] The dynamic reference reconstruction module 104 is connected with the weight construction module 103, and is used for generating an ideal geometric reference without defect features. The dynamic reference 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 reference reconstruction module 104 constructs a B-spline curve model by using a robust weighted least square method, solves a control point coefficient through an iterative optimization process, and outputs a fitted reference curve.

[0035] The joint verification module 105 is connected with the dynamic reference reconstruction module 104, and is used for combining geometric features and light field features to perform secondary confirmation on suspected defects. The joint verification module 105 calculates geometric residual errors between the original contour sequence and the reference curve. Meanwhile, the joint verification module 105 calculates geometric tangent vectors of the reference curve in an image coordinate system, and calculates gray gradient vectors of corresponding positions of the original image. The joint verification module 105 calculates an orthogonality deviation value between the geometric tangent vectors and the gray gradient vectors.

[0036] The defect judgment module 106 is connected with the joint verification module 105, and is used for outputting a final detection result. The defect judgment module 106 judges whether a burr defect or a gap defect exists in a current region according to feature data in three dimensions of geometric residual errors, orthogonality deviations and chord width deviations, by using a preset logical rule. The defect judgment module 106 outputs a judgment result to an external rejection mechanism.

[0037] Referring to the drawings Figure 3 The application provides a sealing ring appearance detection method based on image processing, which comprises the following steps:

[0038] S100, the operation control unit 30 controls the imaging unit 10 to collect a sealing ring gray scale image, processes the collected image through an image preprocessing module 101, and extracts a sub-pixel precision outer contour point set and an inner contour point set;

[0039] S200, the coordinate transformation module 102 converts the outer contour point set and the inner contour point set in the Cartesian coordinate system into a radial sequence in the polar coordinate system, and completes angle alignment of the inner and outer diameter data;

[0040] S300, the weight construction module 103 calculates a radial chord width sequence, extracts a low-frequency trend item of the chord width by using frequency domain separation, and constructs an adaptive weight matrix used for fitting according to a high-frequency residual item of the chord width;

[0041] S400, the dynamic reference reconstruction module 104 performs weighted B-spline curve fitting on the radial sequence by using the adaptive weight matrix, suppresses the influence of low-weight points through an iterative mode, and reconstructs an ideal reference curve conforming to the deformation state of the current sealing ring;

[0042] S500, calculate the geometric residual of the original profile relative to the ideal reference curve by the joint verification module 105, and calculate the orthogonality deviation of the gray scale gradient direction at the profile edge and the tangent direction of the ideal reference curve;

[0043] S600, the defect determination module 106 comprehensively analyzes the geometric residual, the orthogonality deviation and the chord width deviation, and when the geometric position is abnormal, the gradient orthogonality is poor and the chord width is suddenly changed, it is determined that there is a defect at this position, and the defect type and position information are recorded.

[0044] In step S100, the operation control unit 30 first controls the imaging unit 10 and the illumination unit 20 to work together to obtain original image data, then performs noise reduction and interested region extraction on the image by the image preprocessing module 101, and finally obtains a high-precision profile point set by using a sub-pixel edge positioning algorithm. This step specifically includes the following sub-steps:

[0045] S110, perform time-sharing frequency flash imaging and image data acquisition. In this embodiment, the operation control unit 30 sends a time sequence trigger signal to the illumination unit 20 to control the high-angle coaxial light source 21 and the low-angle shadow-free ring light source 22 to alternately light up at high speed. In this process, the present application uses the optical characteristic that the main light ray of the double-telecentric lens 12 is parallel to the optical axis to ensure that the imaging magnification does not change with the up-and-down jitter of the sealing ring on the conveying belt within a preset depth of field, thereby providing a physical basis for high-precision size measurement. Specifically, when the high-angle coaxial light source 21 is lit, the large-format industrial camera 11 is synchronously exposed to collect a backlight image with a bright background and a dark workpiece. This backlight image has extremely high edge contrast and is suitable for profile extraction; when the low-angle shadow-free ring light source 22 is lit, the large-format industrial camera 11 is synchronously exposed to collect a grazing light image showing surface texture. In specific applications, the image preprocessing module 101 preferably selects the backlight image as the basis image for calculating the geometric profile , or fuses the images under the two illuminations by using a weighted average method. In this embodiment, in order to ensure the signal-to-noise ratio of the edge gradient calculation, the backlight image collected by the high-angle coaxial light source is preferably defined as the basis image , which is used for gradient vector calculation in subsequent step S530. In addition, the exposure time parameter of the imaging unit 10 needs to follow the histogram equalization principle, that is, to ensure that the peak value of the image gray histogram is located within the 50% to 85% interval of the sensor dynamic range, and is usually controlled between 100 microseconds and 5000 microseconds, so as to avoid overexposure in the high-reflectivity area of the rubber surface or underexposure in the black background area, and ensure that the gray scale gradient information at the edge is complete and not truncated.

[0046] S120, perform interested region extraction and coarse edge positioning. The image preprocessing module 101 first performs image segmentation on the gray scale image Gaussian filtering is performed to suppress random thermal noise generated by the image sensor by using the smoothing property of the Gaussian kernel function, so as to prevent the noise signal from being misjudged as an edge feature. Subsequently, the full image is scanned by using a Sobel edge detection operator or a Canny edge detection operator to calculate the gray gradient amplitude of each pixel point. In this process, the gradient amplitude threshold value In this embodiment, the gradient amplitude threshold value The value of the gradient amplitude threshold value The pixel points with a gradient amplitude greater than the gradient amplitude threshold value are marked as candidate edge points, so as to determine the annular region of interest containing the sealing ring. For the candidate edge points in the region of interest, the pixel-level integer coordinates and the gradient direction angle of the point are recorded.

[0047] S130, sub-pixel edge extraction based on the normal direction is performed. Since a digital image is discretely sampled, the directly extracted edge position is limited by the pixel resolution, and often cannot meet the detection accuracy requirement of microns. Therefore, according to the mathematical interpolation principle, the discrete gradient distribution is reconstructed into a continuous function, so as to estimate the real edge peak position. Specifically, the image preprocessing module 101 establishes a local one-dimensional search line along the gradient direction of the candidate edge point (i.e., the edge normal direction). On the search line, the gray gradient amplitudes of three adjacent points (i.e., the center point, the previous point and the next point) are selected along the normal direction to form a discrete gray sequence, with the candidate edge point as the center. For the discrete gray sequence, a quadratic curve fitting interpolation method is used to solve the accurate position of the maximum gray change rate. A quadratic polynomial model is established to fit the gradient amplitude distribution, and the quadratic polynomial interpolation formula is as follows:

[0048] ;

[0049] wherein, represents the fitted gradient amplitude at the offset distance from the center point along the normal direction; is a local coordinate variable, and the value set is { 1, 0, 1}, respectively corresponding to the previous point, the center point and the next point in the normal direction; , , are fitting coefficients calculated from the discrete gray sequence by using the least square method or direct algebraic solution, wherein is the quadratic term coefficient, is the linear term coefficient, and is the constant term.

[0050] 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. :

[0051] ;

[0052] 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 :

[0053] ; ;

[0054] 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.

[0055] 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 :

[0056] ; ;

[0057] 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 of the first 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.

[0058] In step S200, the coordinate transformation module 102 receives the sub-pixel level Cartesian coordinate data output by step S100, maps it into a polar coordinate system with the sealing ring center as the origin, and realizes the strict alignment of the inner and outer diameter data in the angle dimension through resampling technology. The core principle of this step is to use the sealing ring as a topological feature of the revolving part, and convert the complex two-dimensional plane geometric profile into two one-dimensional time domain signal sequences varying with angle through coordinate mapping. This dimension reduction process enables the subsequent steps to analyze the fluctuation characteristics of the profile using one-dimensional signal processing methods (such as frequency domain filtering), thereby simplifying the computational complexity of the deformation analysis. This step specifically includes the following sub-steps:

[0059] S210, calculate the geometric center and establish the polar coordinate system. Since the position and posture of the sealing ring on the conveyor belt are random, directly using the image center as the origin will cause eccentricity error in subsequent analysis, thereby introducing false low-frequency sinusoidal components. Therefore, the centroid calculation method based on the profile point set is used in this embodiment to determine the physical center of the workpiece. In specific implementation, the coordinate transformation module 102 selects the outer profile point set extracted in step S100 As a reference, this is based on the characteristics of the rubber mold pressing 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 the inner diameter affected by the core-pulling process, and the outer diameter is not easily affected by the internal flash, so it is more suitable as a geometric reference for establishing the coordinate system. The coordinate transformation module 102 calculates the arithmetic mean of all sampling points in the outer profile point set as the origin of the polar coordinate transformation . The calculation formula is as follows:

[0060] ; ;

[0061] wherein, is the horizontal coordinate of the fitting center, is the vertical coordinate of the fitting center, is the horizontal coordinate of the th point in the outer profile point set, is the vertical coordinate of the th point in the outer profile point set, is the total number of sampling points in the outer profile point set.

[0062] S220, perform mapping transformation from Cartesian coordinates to polar coordinates. After determining the origin , the coordinate transformation module 102 traverses each sub-pixel point in the outer profile point set and the inner profile point set , and converts it into the expression form of polar angle and polar radius. For any data point on the profile, its corresponding polar radius and polar angle The calculation is as follows:

[0063] ; ;

[0064] 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.

[0065] 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.

[0066] 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:

[0067] ;

[0068] 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 Linear interpolation is performed to calculate the outer diameter value corresponding to the angle The interpolation formula is as follows:

[0069] ;

[0070] Wherein, is the radius value after resampling; , are the polar radii of the previous sampling point and the next sampling point adjacent to the standard angle in the original sequence, respectively; , are the corresponding adjacent angles in the original sequence. Similarly, the inner diameter value corresponding to the angle is calculated using the same standard angle vector and the above interpolation logic. After resampling, the system finally outputs two one-dimensional arrays that are strictly aligned in the index:

[0071] ; ;

[0072] Wherein, is the resampled standard outer diameter sequence, is the resampled standard inner diameter sequence, is the total length of the resampled sequence. The two sequences share the same angle index system, that is, for any index , the outer diameter and the inner diameter are located at the same physical angle . The regularization of this data structure provides the necessary mathematical prerequisites for calculating the radial chord width by direct algebraic subtraction in the subsequent step S300.

[0073] In step S300, the weight construction module 103 receives the aligned outer diameter sequence and inner diameter sequence output by step S200, calculates the full-circle radial chord width, and uses the physical frequency domain characteristics of the seal ring chord width variation to separate the low-frequency component reflecting the physical tensile deformation from the high-frequency component reflecting the local defects, and then construct an adaptive weight matrix for subsequent fitting. This step is based on the principles of elastomer mechanics and signal processing: the seal ring, as an elastomer, has continuity and smoothness in space when subjected to tool stretching or gravity, which is manifested as a low-frequency signal in the radial chord width sequence; while gaps, burrs and other appearance defects belong to local material loss or excess, which have mutation in space, which is manifested 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 through frequency domain filtering technology, so as to accurately evaluate the degree of local anomaly using the residual. This step specifically includes the following sub-steps:

[0074] 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:

[0075] ;

[0076] 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. .

[0077] 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.

[0078] 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:

[0079] ;

[0080] 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.

[0081] 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:

[0082] ;

[0083] is a one-dimensional Gaussian kernel function, which is defined as follows:

[0084] ;

[0085] wherein, is a standard deviation parameter for trend extraction. The parameter determines the cut-off frequency of the filter, and its value directly affects the smoothness of the trend line. In this embodiment, is determined according to the physical size of the sealing ring and the allowed deformation span, and is usually set to 1% to 5% of the total number of sampling points . For example, when the number of sampling points is 1000, can be set between 36 and 180. The physical meaning of this parameter setting is that the system regards the chord width fluctuation with a spatial span less than as high-frequency noise or defects, and regards the chord width fluctuation with a spatial span greater than as normal physical deformation trend.

[0086] S330, calculate the local anomaly degree (high-frequency component). After obtaining the trend line reflecting the normal physical deformation, the weight construction module 103 calculates the deviation degree of the original chord width sequence relative to the trend line. This deviation degree is the high-frequency residual component, which directly corresponds to the significance of suspected defects. The formula is as follows:

[0087] ;

[0088] wherein, represents the absolute deviation value of the chord width of the th sampling point. The larger this value, the more intense the chord width change at this point, which does not conform to the continuity feature of physical deformation, and the higher the possibility of defects; the closer this value to 0, the more gentle the chord width change at this point, which conforms to the overall trend, and the higher the possibility of normal region.

[0089] S340, construct an adaptive weight matrix. In order to suppress the influence of the defect region in the subsequent reference reconstruction step, the weight construction module 103 maps each sampling point to a weight value according to the chord width deviation . This embodiment adopts a Gaussian decay model as the weight mapping function to realize nonlinear weight allocation. The weight calculation formula is as follows:

[0090] ;

[0091] in, For the first The weight values ​​of each sampling point are in the range of (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.

[0092] 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.

[0093] 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:

[0094] 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.

[0095] In this embodiment, node vectors are defined. The nodes are uniformly distributed in the angle domain [0, 2π] and are periodically extended, that is, To ensure the geometric closure and the C2 continuity of the curve at the 0-2π joint, the model imposes a cyclic constraint on the control point coefficient vector , that is, it is specified that The expression of the reference curve is defined as follows:

[0096] ;

[0097] wherein represents the reconstructed reference radius value at the angle ; is the number of control points, which is usually set to 1 / 10 to 1 / 20 of the resampling point number to ensure that the model has sufficient degrees of freedom to fit the low-frequency deformation; is the i-th control point coefficient to be solved; is a cubic B-spline basis function defined on the node vector, the specific form of which can be determined by the de Boor-Cox recurrence formula.

[0098] S420, a weighted regularization objective function is constructed. To solve the optimal control point coefficient vector , the dynamic reference reconstruction module 104 establishes a hybrid objective function containing a data fidelity term and a smoothing regularization term. The objective function aims to find a curve that can be as close as possible to the high-weight area (i.e., the area with high probability of no defects) in the original measurement data, and also maintain the smoothness of the curve as a whole. The objective function is expressed as follows:

[0099] ;

[0100] wherein is the total number of sampling points of the profile data; is the adaptive weight value corresponding to the i-th point generated in step S300; is the original outer diameter measurement value; is the calculated value of the fitted curve at the corresponding angle; is the second derivative of the fitted curve, used to represent the rate of change of the curvature of the curve; is a smoothing parameter. In this formula, the smoothing parameter is a non-negative real number, used to balance the data fitting accuracy and the smoothness of the curve. In this embodiment, the value range of is set to 10 -5 to 10 -2 . When is less than 10 -5 , the data fitting accuracy is too high, and the curve is too smooth, which cannot reflect the actual profile data; when The reconstructed reference curve tends to be a rigid circle when The reference curve follows the original data more closely when the weight is small. By modulating the weight , when there is a defect at a certain position (i.e.

[0101] tends to 0), the error contribution of this point in the data fidelity term is reduced, and at this time the curve shape is mainly controlled by the smoothness regularization term and the neighborhood data, so as to achieve reasonable interpolation of the track at the defect. S430, solve the least square matrix equation. In order to minimize the objective function , the system converts it into a matrix operation form in linear algebra. The derivative of the objective function with respect to the coefficient vector

[0102] is taken and set to zero to obtain a linear equation group:

[0103] where is a basis function observation matrix of dimension , and the element ; is a diagonal weight matrix of dimension , and the diagonal element is ; is a raw outer diameter measurement vector of dimension . is a regularization matrix of dimension , and the element is calculated by the integral of the second derivative of the basis function:

[0104] ;

[0105] Since the matrix is a sparse symmetric positive definite matrix mainly composed of non-zero elements with small bandwidth, the Cholesky decomposition method is used for efficient solution to obtain the optimal control point coefficient vector , and then determine the unique reference curve .

[0106] S440, perform iterative optimization and reference update. Although step S300 provides an initial weight based on the chord width, in order to further improve the robustness of the reference curve, the embodiment adopts an iterative reweighting strategy. After completing the initial fitting, the dynamic reference reconstruction module 104 calculates the residual error between the original profile and the current reference curve. Based on the residual error, the weight matrix is updated using the Bisquare weight function, and the specific update formula is as follows:

[0107] ;

[0108] wherein, is the weight at the i-th iteration; is a tuning constant, typically taking the value of 4.685 to achieve 95% asymptotic efficiency; is the robust estimate of the residual scale, calculated using the median absolute deviation (MAD), i.e. . The matrix solution in step S430 is performed again using the updated weight matrix. This process is repeated until the control point coefficient variation between two consecutive calculations is less than a pre-set convergence threshold (e.g. 10 -6 ) or the maximum number of iterations (e.g. 5) is reached. The final converged curve

[0109] is the ideal geometric reference that removes the defect interference and accurately reflects the real deformation state of the sealing ring. This reference will serve as the standard reference line for calculating the geometric residual in the subsequent step S500. In step S500, the joint verification module 105 receives the ideal geometric reference curve

[0110] output by step S400 and the original profile data output by step S200, and performs double feature extraction based on geometric dimensions and light field dimensions. This step is based on the consistency verification principle of “macro-geometry-micro-texture”: for a normal sealing ring edge (including the parting line), the macro-geometric tangent direction should be strictly orthogonal to the micro-image gray gradient direction (i.e. the direction of the most severe light field change). When there are defects such as burrs and tears, although their geometric height may be similar to the parting line, due to the rough and chaotic microstructure of their edges, the direction of light scattering will be randomly deflected, thereby destroying the above-mentioned orthogonality. The system utilizes this physical feature to calculate the geometric residual and the orthogonality deviation, thereby constructing a multi-dimensional feature vector to effectively distinguish 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 of the original measurement profile relative to the ideal geometric reference, which directly represents the degree of mutation of the sealing ring edge in the radial direction. Based on the aligned angle index, the calculation formula is as follows:

[0111]

[0112] ;

[0113] wherein, is the weight at the i-th iteration; is the weight at the i-th iteration; is the weight at the i-th iteration; is the weight at the i-th iteration; is the geometric residual value of the i-th sampling point;is the resampled original outer diameter measurement value; is the function value of the B-spline reference curve at the standard angle

[0114] Under this definition, if is positive, it indicates that the edge at this point is convex outward; if is negative, it indicates that the edge at this point is concave inward. In this embodiment, the initial screening threshold of the geometric residual is usually set to , which is set according to the tolerance level of the sealing ring, for example, 0.05mm to 0.1mm. Only when , the system starts the subsequent orthogonality check to reduce the computational overhead.

[0115] S520, analyze the calculation of the ideal geometric tangent vector. In order to analyze the smoothness of the edge, the tangent direction of each point on the reference curve needs to be obtained. Since the reference curve constructed in step S400 is an analytical B-spline function, this embodiment calculates the tangent vector in the Cartesian coordinate system by taking the derivative of .

[0116] For any standard angle , the coordinates of the point on the reference curve satisfy the polar coordinate conversion relationship:

[0117] ; ;

[0118] Taking the first-order derivative of the above coordinates with respect to the angle variable , the ideal geometric tangent vector at the th sampling point is obtained . The specific calculation components are as follows:

[0119] ; ;

[0120] where is the first-order derivative value of the cubic B-spline curve at the angle . In order to avoid errors caused by difference approximation, this embodiment uses the derivative property of the B-spline basis function for accurate calculation:

[0121] ;

[0122] where is the first-order derivative of the cubic B-spline basis function, the value of which can be obtained by linear combination of low-order B-spline basis functions:

[0123] ;

[0124] Through the above analytical calculation, it is ensured that the tangent vector accurately reflects the macroscopic trend of the reference curve at this point.

[0125] ​S530, calculate the local gray scale gradient vector. At the same time, the joint verification module 105 calls the original gray scale image obtained in step S100 , calculate the actual light field gradient at the contour edge. In order to overcome the pixel grid effect and obtain gradient information at sub-pixel coordinates, the embodiment adopts the strategy of "first global calculation and then local interpolation". First, the Sobel operator is used to convolve the entire image , respectively generating horizontal gradient map and vertical gradient map . The Sobel operator uses the following convolution kernel:

[0126] ;

[0127] Subsequently, according to the sub-pixel coordinates of the th contour point and , the horizontal gradient component and the vertical gradient component at the coordinates are calculated respectively using the bilinear interpolation algorithm.

[0128] Finally, the gray scale gradient vector at the point is constructed. The physical meaning of the vector is the direction of the most dramatic change in image gray scale (i.e. the direction from dark background to bright target interior), which should be strictly perpendicular to the geometric tangent of the edge at the ideal smooth edge.

[0129] S540, construct the orthogonality deviation model. After obtaining the tangent vector representing the macroscopic geometric trend and the gradient vector representing the microscopic light field characteristics, the embodiment evaluates the smoothness of the edge by calculating the point product normalization value of the two. Define the orthogonality deviation index , the calculation formula is as follows:

[0130] ;

[0131] Where, denotes the vector dot product operation; denotes the modulus (L2 norm) of the vector; denotes the absolute value; it should be noted that in actual calculation, if is close to zero (i.e. the point is in a flat area rather than an edge), then is directly set to 0 to avoid calculation anomalies.

[0132] The physical meaning of the formula uses the geometric properties of vector dot product, i.e. , where is the angle between two vectors. In ideal case, the geometric tangent is perpendicular to the gray gradient normal, and the angle is close to 90 degrees, tends to 0; while at the defect of burr or tear, due to the disordered microstructure of the edge, the direction of the gray gradient will be randomly deflected, resulting in deviation from 90 degrees, at this time will be significantly greater than 0. In this embodiment, the value of the orthogonality deviation is in the range of [0, 1], and the index and the geometric residual together constitute a two-dimensional feature space for defect classification decision in the subsequent step S600.

[0133] In step S600, the defect determination module 106 receives the geometric residual sequence and the orthogonality deviation sequence output by step S500, and combines the chord width deviation sequence output by step S300, to perform a joint decision based on a multi-dimensional feature space. This step is based on the physical completeness principle of defect features: a real material defect (such as a notch or burr) will inevitably cause a mutation in the macroscopic profile (geometric dimension), scattering of the edge microtexture (optical field dimension), and change in the local material quantity (mass dimension) in physics. In contrast, the parting line only has a macroscopic geometric protrusion but regular texture, and the elastic deformation only has a macroscopic geometric shift but continuous material quantity. Based on this difference, this embodiment constructs a multi-dimensional logic threshold, and only when the abnormal features of the above three dimensions occur at the same coordinate index, it is confirmed as a substantial defect, thereby eliminating the systematic false positives generated by single-dimensional detection from the root. This step specifically includes the following sub-steps:

[0134] S610, set multi-dimensional feature decision threshold. In order to realize quantitative classification and decision, the defect determination module 106 defines the key decision thresholds of the three dimensions in the system initialization stage or offline calibration stage according to the tolerance standard of the sealing ring and the sample statistical data: 1. Geometric residual threshold : used to represent the allowed upper limit of the edge deviation from the reference. In this embodiment, the threshold is directly related to the size tolerance band of the product, and is set to , where is the single-side profile tolerance specified in the drawing, and the coefficient is in the range of 0.6-0.8. 2. Orthogonality deviation threshold : used to represent the critical point of the edge micro-roughness. In this embodiment, a number of qualified sealing rings (including parting line area) are selected as calibration samples, and the distribution histogram of the full-circle orthogonality deviation values is calculated, and the 99.7% percentile point of the distribution curve is taken as the threshold . According to empirical data, the threshold is usually set between 0.35-0.55. 3. Chord width deviation threshold : threshold for characterizing the degree of abrupt change in radial width. This threshold is adaptive to the statistical property of trend extraction in step S300, set as , where is the statistical standard deviation of chord width trend line calculated in step S320, and the coefficient is usually set as 3.0, consistent with abnormal point determination criterion.

[0135] S620, joint determination of flash defects is performed. For the flash or burr defects commonly seen in rubber sealing rings, the defect determination module 106 traverses each sampling point , and calculates the flash decision logic value . It is determined as a flash only when the three features of geometric protrusion, texture disorder, and chord width increase overlap in space. The logic formula is as follows:

[0136] ;

[0137] where, is an indicator function, taking the value of 1 when the condition in the parentheses is met, otherwise 0; denotes logical AND operation.

[0138] Specifically, this determination logic excludes the following two types of typical interference: 1. Mold line interference: although is met at the mold line, since its edge is smooth, the gradient direction of the light field is orthogonal to the tangent, so , and the logic result is 0. 2. Eccentricity interference: overall eccentricity or ovalization of the workpiece will cause part of the area to meet , but since its change is low-frequency continuous, so , and the logic result is 0.

[0139] S630, joint determination of void defects is performed. For the defects of void, underfill or tearing, the defect determination module 106 adopts the reverse logic symmetrical to the flash determination. It is determined as a void only when the three features of geometric depression, texture disorder, and chord width decrease exist simultaneously. The logic formula is as follows:

[0140] ;

[0141] where, denotes that the depth of the edge inward depression exceeds the allowable tolerance; here denotes that the abruptness of chord width (whether it increases or decreases) exceeds the limit of physical continuity. When , the system records the current angle index as the center position of the void defect.

[0142] S640, a classification output and rejection control is performed. For the sampling points marked as 1, the defect determination module 106 maps their positions in the image coordinate system back to the physical space coordinates. If the number of the sampling points marked consecutively exceeds a preset minimum defect length threshold (for example, corresponding to a physical length of 0.2 mm), a defect alarm signal is generated. or For the sampling points marked as 1, the defect determination module 106 maps their positions in the image coordinate system back to the physical space coordinates. If the number of the sampling points marked consecutively exceeds a preset minimum defect length threshold (for example, corresponding to a physical length of 0.2 mm), a defect alarm signal is generated.

[0143] For the regions satisfying the single-dimension anomaly only, the system performs the following false alarm prevention classification: (1) if only and , the region is marked as a "mold line region" and no alarm is triggered; (2) if only and , the region is marked as an "elastic deformation region" and no alarm is triggered.

[0144] Finally, the system outputs a detection data packet containing the defect type (burr / gap), defect coordinates and maximum deviation value, and sends a rejection instruction to the sorting mechanism.

[0145] Based on the above embodiments, in order to more intuitively illustrate the application effect of the present application in actual industrial scenarios and the cooperative mechanism among the modules, a specific detection example is described below.

[0146] Taking the online detection of a certain type of nitrile rubber seal ring as an example, the standard outer diameter of the seal ring is 20 mm and the wire diameter is 2 mm. In the actual production process, due to the influence of the vibration of the conveying belt and gravity, the seal ring to be detected presents a micro-elliptical shape (low-frequency deformation) with a major axis of 20.15 mm and a minor axis of 19.85 mm in the field of view. In addition, there is a mold line residue (non-defect feature) with a height of 0.12 mm at the 0-degree position of the seal ring, a burr (defect feature) with a height of 0.15 mm at the 90-degree position, and a material shortage gap (defect feature) with a depth of 0.1 mm at the 180-degree position.

[0147] At the beginning of detection, the operation control unit 30 controls the imaging unit 10 to acquire an image under stroboscopic illumination, and the image preprocessing module 101 extracts a full-circle sub-pixel contour. The coordinate transformation module 102 maps the contour to the polar coordinate system. At this time, if a standard circle is directly used as a reference (i.e., the radius is fixed at 10 mm), the above-mentioned elliptical deformation will cause the geometric residual of most regions to exceed the tolerance threshold of 0.1 mm, thereby generating a large number of false alarms.

[0148] The present application firstly calculates the radial chord width sequence by 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 that the high-frequency fluctuation component of the chord width is significant, so the weight values corresponding to these three regions are greatly reduced to below 0.1 by the Gaussian attenuation model; while in the remaining most regions, since the chord width changes gently, the weight values remain above 0.9.

[0149] Subsequently, the dynamic reference reconstruction module 104 performs B-spline curve fitting using the adaptive weight matrix. Referring to FIG. 4, the solid line in the figure represents the original outer diameter profile data measured, and the dashed line represents the ideal reference curve after algorithm reconstruction. It can be seen that, due to the inhibitory effect of low weight, the reference curve output by the dynamic reference reconstruction module 104 does not follow the 90-degree burr protrusion or 180-degree notch depression, but 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 the mutation). This means that the reference curve successfully strips the local defects and restores the ideal profile of the workpiece in the current deformation state. Figure 4

[0150] Next, the joint verification module 105 calculates multi-dimensional features based on the dynamic reference. Referring to FIG. 5, the figure sequentially shows the geometric residual sequence Figure 5 , the orthogonality deviation sequence and the chord width deviation sequence from top to bottom.

[0151] For the 0-degree parting line area (A area in Figure 5 ), although the geometric residual sequence shows that its height exceeds the set geometric residual threshold ( ), but since the parting line edge is smooth and neat, its corresponding orthogonality deviation sequence is low ( ), indicating that the edge tangent is orthogonal to the light field gradient. According to the preset logic rule, the defect judgment module 106 judges that this place is a normal process residue and does not alarm.

[0152] For the 90-degree burr area (B area in Figure 5 ), the geometric residual sequence shows significant protrusion, and at the same time, due to the roughness of the burr edge, the orthogonality deviation sequence appears a sharp peak ( ), and the chord width deviation sequence shows local positive mutation ( ). The features in three dimensions simultaneously exceed the limit at the same position, triggering the joint judgment logic, and the defect judgment module 106 identifies it as a "burr defect".

[0153] For the 180-degree notch area (C area in Figure 5 ​​The geometric residual sequence shows a significant concave down (in the middle C region) The orthogonality deviation sequence also shows a high-frequency chaotic feature (in the middle C region) and the chord width deviation sequence shows a negative mutation. The defect determination module 106 identifies it as a "notch defect" according to the logic.

[0154] Finally, the defect determination module 106 outputs the detection results containing the position coordinates and quantitative values of the 90-degree burr and 180-degree notch, and the operation control unit 30 controls the external rejection mechanism to blow the unqualified product away from the production line at the corresponding position according to the detection results. Through the above process, the present application accurately distinguishes the appearance defects from the normal joint lines while being compatible with the macroscopic flexible deformation of the workpiece, effectively solving the false detection and missed detection problems caused by deformation and interference features in traditional visual detection.

[0155] Although embodiments of the present application have been shown and described, it is to be understood that various modifications, substitutions, replacements and changes can be made to these embodiments without departing from the principles and spirit of the present application, and the scope of the present application is defined by the appended claims and their equivalents.

Claims

1. A method for detecting the appearance of a seal ring based on image processing, characterized in that, The method comprises the following steps: obtaining an original image of a sealing ring, extracting an outer contour point set and an inner contour point set at a sub-pixel level; mapping the outer contour point set and the inner contour point set to a polar coordinate system, and resampling to generate a standard outer diameter sequence and a standard inner diameter sequence aligned in angle; calculating a difference value of the standard outer diameter sequence and the standard inner diameter sequence to obtain a chord width sequence, extracting a chord width trend line of the chord width sequence, calculating a difference value between the chord width sequence and the chord width trend line as a chord width deviation, and constructing an adaptive weight matrix using the chord width deviation; wherein, an algebraic difference value of the standard outer diameter sequence and the standard inner diameter sequence is calculated to generate the chord width sequence; a Gaussian smoothing filter is used for convolution processing of the chord width sequence to extract the chord width trend line; an absolute value of a difference value 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, and the weight value is negatively correlated with the size of the chord width deviation, thereby generating the adaptive weight matrix; performing weighted B-spline fitting on the standard outer diameter sequence using the adaptive weight matrix to reconstruct an ideal geometric reference curve; wherein, a periodic cubic B-spline function is used to construct a reference curve model, and a node vector is periodically extended; a mixed objective function including a data fidelity term and a smoothing regularization term is established, the data fidelity term is weighted using the adaptive weight matrix, and the smoothing regularization term represents smoothness using an integral of a second derivative of the reference curve; a linear equation set is constructed and a control point coefficient vector is solved to obtain an initial reference curve; a residual error is calculated and the adaptive weight matrix is updated using a double square weight function, and iterative solving is performed until the control point coefficient converges to obtain the ideal geometric reference curve; calculating a geometric residual sequence of the standard outer diameter sequence relative to the ideal geometric reference curve, and calculating an orthogonality deviation sequence between a local gray gradient vector at an edge of the original image and an ideal geometric tangent vector of the ideal geometric reference curve; comprehensively analyzing the geometric residual sequence, the orthogonality deviation sequence and the chord width deviation, and determining defects according to a multi-dimensional feature decision threshold.

2. The image processing-based seal ring appearance inspection method according to claim 1, characterized by, The method comprises the following steps: controlling a high-angle coaxial light source and a low-angle shadowless annular light source to be lit alternately, and controlling an industrial camera to be exposed synchronously to obtain a basic image; calculating a gray gradient amplitude of the basic image using an edge detection operator, and marking pixel points with a gray gradient amplitude greater than a preset threshold as candidate edge points; establishing a local one-dimensional search line along a gradient direction of the candidate edge points and obtaining a discrete gray sequence, and establishing a quadratic polynomial model to fit the discrete gray sequence; deriving the quadratic polynomial model to calculate a sub-pixel offset, combining an integer pixel coordinate of the candidate edge point with a gradient direction angle to calculate a sub-pixel level edge point coordinate, and aggregating the sub-pixel level edge point coordinate into the outer contour point set and the inner contour point set.

3. The image processing-based seal ring appearance inspection method according to claim 1, characterized by, The method comprises the following steps: calculating an arithmetic mean of the outer contour point set as a polar coordinate transformation origin; calculating a Euclidean distance of each data point to the origin as a polar radius and a azimuth angle of each data point relative to a polar axis as a polar angle; constructing a standard angle vector containing uniformly distributed angle values; for each standard angle in the standard angle vector, linearly interpolating two points adjacent in angle in the original sequence to generate the standard outer radius sequence and the standard inner radius sequence sharing the same angle index system.

4. The image processing-based seal ring appearance inspection method according to claim 1, characterized by, the calculating of the geometric residual sequence of the standard outer radius sequence relative to the ideal geometric reference curve and the calculating of the orthogonality deviation sequence between the local gray gradient vector at the edge of the original image and the ideal geometric tangent vector of the ideal geometric reference curve include: calculating an algebraic difference between the standard outer radius sequence and a function value of the ideal geometric reference curve at a corresponding angle to obtain the geometric residual sequence; calculating a first order derivative of the ideal geometric reference curve with respect to an angle variable to calculate the ideal geometric tangent vector; calculating a horizontal gradient component and a vertical gradient component at the contour edge by operator convolution and sub-pixel interpolation to construct the local gray gradient vector; calculating a modulus of a dot product of the ideal geometric tangent vector and the local gray gradient vector and performing normalization processing to obtain the orthogonality deviation sequence.

5. The image processing-based seal ring appearance inspection method according to claim 4, characterized by, the calculating of the modulus of the dot product of the ideal geometric tangent vector and the local gray gradient vector and the normalization processing to obtain the orthogonality deviation sequence include: calculating a scalar product of the ideal geometric tangent vector and the local gray gradient vector; calculating a product of a modulus of the ideal geometric tangent vector and a modulus of the local gray gradient vector; dividing the scalar product by the product and taking an absolute value to obtain an orthogonality deviation value in the orthogonality deviation sequence.

6. The image processing-based seal ring appearance inspection method according to claim 1, characterized by, the comprehensive analysis of the geometric residual sequence, the orthogonality deviation sequence and the chord width deviation, and the defect judgment according to the multi-dimensional feature judgment threshold value include: when a position simultaneously satisfies a value of the geometric residual sequence being greater than a geometric residual threshold value, a value of the orthogonality deviation sequence being greater than an orthogonality deviation threshold value and the chord width deviation being greater than a chord width deviation threshold value, it is determined that there is a burr defect; when a position simultaneously satisfies a value of the geometric residual sequence being less than a negative geometric residual threshold value, a value of the orthogonality deviation sequence being greater than the orthogonality deviation threshold value and the chord width deviation being greater than the chord width deviation threshold value, it is determined that there is a notch defect.

7. The image processing-based seal ring appearance inspection method according to claim 6, characterized by, the comprehensive analysis of the geometric residual sequence, the orthogonality deviation sequence and the chord width deviation, and the defect judgment according to the multi-dimensional feature judgment threshold value further include: if a position only satisfies a value of the geometric residual sequence being greater than the geometric residual threshold value and a value of the orthogonality deviation sequence being less than or equal to the orthogonality deviation threshold value, it is marked as a mold closing line region; if a position only satisfies a value of the geometric residual sequence being greater than the geometric residual threshold value and the chord width deviation being less than or equal to the chord width deviation threshold value, it is marked as an elastic deformation region; counting a number of continuous sampling points determined as defects, and outputting an alarm signal when a physical length corresponding to the number of continuous sampling points exceeds a preset length threshold value.

8. The image processing-based sealing ring appearance detection device is applied to the image processing-based sealing ring appearance detection method in any one of claims 1-7, characterized in that, include: An imaging unit is configured to acquire a high-resolution gray-scale image of the seal ring to be detected; An illumination unit is configured to provide a light field environment for imaging; An operation control unit is connected with the imaging unit and the illumination unit, respectively, and includes an image preprocessing module configured to receive an image and extract a sub-pixel profile, a coordinate transformation module configured to map image data to a polar coordinate system and complete alignment, a weight construction module configured to generate an adaptive weight matrix based on frequency domain separation, a dynamic reference reconstruction module configured to fit an ideal geometric reference curve using the adaptive weight matrix, a joint verification module configured to calculate a geometric residual sequence and an orthogonality deviation sequence, and a defect judgment module configured to output a detection result based on a multi-dimensional feature space.

Citation Information

Patent Citations

  • Machine vision-based precise part size automatic detection method and system

    CN120833369A

  • Method for metal artifact avoidance in x-ray imaging

    US20210174502A1