A one-way valve component missing detection system and method

CN122453755APending Publication Date: 2026-07-24SHANGHAI YIDA ELECTRIC CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610580511.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-29
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Existing technologies cannot accurately and quickly identify missing parts of check valve components, are easily affected by subjective factors of the inspectors, resulting in low inspection efficiency, poor quality stability, and difficulty in adapting to online switching inspection of different product models.

Method used

A combined system consisting of an image acquisition and positioning end, an angle and attitude correction end, and a graded comparison and detection end is adopted. Through multi-angle photography, template matching, and affine transformation technology, high-quality images are acquired and attitudes are corrected. Feature differences are calculated region by region to determine whether any parts are missing.

Benefits of technology

It enables accurate detection of missing parts in one-way valve components, improves the robustness and repeatability of the detection system, enhances detection efficiency and intelligence, and supports online switching between different product models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122453755A_ABST
    Figure CN122453755A_ABST
Patent Text Reader

Abstract

The application discloses a one-way valve component missing loading detection system and method, and relates to the technical field of visual detection.The system comprises an image acquisition and positioning end, an angle and posture correction end and a hierarchical comparison and detection end.The image acquisition and positioning end acquires a component area image of a to-be-detected one-way valve, and preliminarily positions the image with a pre-stored qualified product image.The angle and posture correction end corrects the to-be-detected image to the same detection posture as the template image by calculating the rotational deviation of the to-be-detected image and the template image and the affine transformation technology.The hierarchical comparison and detection end divides the corrected image into a plurality of component corresponding areas, calculates the feature difference of each area, and judges whether there is missing loading.The application can eliminate light interference through image quality adaptive enhancement, overcome position deviation through posture correction, realize multi-component parallel detection through hierarchical comparison and detection, improve the precision and robustness of missing loading detection, and support online switching detection of different models of products.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of visual inspection technology, and in particular to a system and method for detecting missing parts in a one-way valve. Background Technology

[0002] A check valve is a key hydraulic component that allows fluid to flow in one direction and prevents reverse leakage. It is widely used in automobiles, aerospace, medical devices and home appliances. It is usually equipped with multiple components such as rubber rings, gaskets, steel balls, cages and snap rings. The absence of any of these components will cause the check valve to fail to seal or lose its function, which may lead to equipment failure or even safety accidents in severe cases.

[0003] Currently, in the assembly and testing process of one-way valve components, the reliance on manual visual inspection or simple photoelectric sensor triggering cannot accurately and quickly identify the omissions of various components such as rubber rings, gaskets, steel balls, cages, and snap rings. It is easily affected by factors such as subjective fatigue of the testing personnel, deviation of product placement angle, and uneven lighting, resulting in a high rate of missed and false detections. Furthermore, it is difficult to adapt to online switching testing of different product models simultaneously, leading to low testing efficiency and poor quality stability.

[0004] Therefore, a system and method for detecting missing parts in one-way valves are proposed to solve the above problems. Summary of the Invention

[0005] The main objective of this invention is to provide a system and method for detecting missing parts in one-way valves, in order to solve the problems mentioned in the background above.

[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows: a one-way valve component missing component detection system, the system comprising an image acquisition and positioning end, an angle and attitude correction end, and a graded comparison detection end; The image acquisition and positioning terminal uses multi-angle photography and template matching technology to acquire images of the component areas of the one-way valve under test, and performs preliminary positioning with pre-stored images of qualified products. The angle and posture correction end corrects the image under test to the same detection posture as the template image by calculating the rotation deviation between the image under test and the template image and using affine transformation technology. The graded comparison detection end divides the corrected image into multiple regions corresponding to the components and calculates the feature differences for each region to determine whether there are any missing parts such as rubber rings, gaskets, steel balls, cages, and snap rings.

[0007] Preferably, the image acquisition and positioning terminal includes an image acquisition module, an image quality adaptive enhancement module, and a template storage module; The image acquisition module includes a multi-angle triggering unit and a light source synchronization unit; The multi-angle triggering unit uses an industrial camera to sequentially acquire images of the one-way valve under test from two positions: a top vertical angle and a side tilt of 45°, obtaining multi-view contour information of the rubber ring, gasket, steel ball, cage, and snap ring. The light source synchronization unit synchronously turns on the ring light source at the moment the camera is triggered and maintains stable illumination for 20ms to ensure the consistency of light intensity at different angles and reduce ambient light interference.

[0008] Preferably, the image quality adaptive enhancement module includes an illumination correction unit and a noise suppression unit; The illumination correction unit separates the incident component and the reflected component using the Retinex algorithm, performs illumination homogenization processing on the acquired image, and eliminates local overexposure and shadows caused by the angle deviation of the ambient light source. The noise suppression unit preserves the edge details of components through multi-scale guided filtering, while suppressing Gaussian noise and salt-and-pepper noise under high ISO conditions, and outputs an enhanced standard grayscale image.

[0009] Preferably, the template storage module includes a template pre-storage unit and a type matching unit; The template pre-storage unit acquires complete images of qualified products by taking photos from multiple angles, and marks the position coordinates and edge gradient features of rubber rings, gaskets, steel balls, cages, and snap rings one by one to form a pre-storage feature library; The type matching unit automatically calls up the template image and feature data of the corresponding model by recognizing the model QR code and character area on the housing of the current one-way valve under test, supporting online switching detection of different models of products.

[0010] Preferably, the angle and attitude correction end includes an angle detection module and a position correction module; The angle detection module includes a vertical angle unit and a deviation warning unit; The vertical angle unit determines the rotational deviation of the product under test by calculating the angle between the central axis of the one-way valve in the image under test and the central axis of the template image. The deviation warning unit is used when the included angle When the angle exceeds the preset threshold by 3°, an alarm signal is issued and the detection stops, prompting a manual check of the material placement posture.

[0011] Preferably, the position correction module includes a coordinate transformation unit and a correction verification unit; The coordinate transformation unit transforms the coordinates of each pixel in the image under test using a standard affine transformation matrix. Map to new coordinates The formula is: ,in This is the rotational deviation angle. It is a translation vector; The correction and verification unit is used to calculate the structural similarity (SSIM) between the corrected image and the template image. If the SSIM value is less than 0.95, the correction is repeated once; otherwise, the system is reported to prompt manual processing.

[0012] Preferably, the graded comparison and detection terminal includes a region graded module, a feature comparison module, and a result output module; The region segmentation module includes an image segmentation unit and a region labeling unit; The image segmentation unit automatically locates the bounding boxes of five components—rubber ring, gasket, steel ball, cage, and snap ring—in the image under test using a shape-based template matching algorithm, and segments them into independent sub-images. The area marking unit uses Arabic numerals 1 to 5 to mark the sub-areas corresponding to the rubber ring, gasket, steel ball, cage, and snap ring, and numbers them in stages according to the assembly order from the outside to the inside.

[0013] Preferably, the feature comparison module includes a feature extraction unit and a missing part judgment unit; The feature extraction unit is used to calculate the mean gray level, gray level variance, and edge pixel ratio of each sub-region, forming a feature vector of length 3; The missing component determination unit is used to calculate the cosine similarity between the feature vector of the sub-region to be tested and the feature vector of the template sub-region. If the similarity is less than the preset threshold of 0.85, the component in the region is determined to be missing, and the missing component type is recorded.

[0014] Preferably, the result output module includes an audible and visual alarm unit and a detection log unit; The sound and light alarm unit is used to issue a graded alarm signal by flashing a red LED and broadcasting a voice message when any sub-area is determined to be missing. The detection log unit is used to save the product model, timestamp, name of missing parts, and corrected image of each detection to a local database, supporting quality traceability.

[0015] A method for detecting missing components in a one-way valve includes the following steps: S1. The one-way valve under test is photographed from multiple angles, including the top and side, using an industrial camera. After adaptive image quality enhancement, the image is initially matched with multiple pre-stored template images to locate the main area of ​​the one-way valve in the image under test. S2. Calculate the rotational deviation angle between the main axis of the one-way valve in the image to be tested and the main axis of the template image. Rotate and translate the image to be tested through standard affine transformation so that its posture is consistent with the template image. S3. Divide the corrected image into five sub-regions according to the rubber ring, gasket, steel ball, cage, and snap ring. Extract the gray mean, variance, and edge ratio of each sub-region. Compare the cosine similarity with the feature vector of the corresponding sub-region of the template. If the similarity of any region is lower than the threshold of 0.85, output the detection result of the missing part and alarm through voice and display screen.

[0016] The present invention has the following beneficial effects: 1. In this invention, when performing the detection of missing parts in a one-way valve by setting up an image acquisition and positioning end, multi-angle photography and template matching technology are used to acquire images from two stations, one vertical from the top and one tilted from the side, to obtain multi-view contour information of the rubber ring, gasket, steel ball, cage, and snap ring. The Retinex algorithm and guided filtering are used to perform illumination correction and noise suppression on the images, effectively eliminating the interference caused by ambient light deviation and high ISO noise. This results in clear images with stable features, providing a high-quality image foundation for subsequent accurate comparison and improving the adaptability of the detection system to different lighting conditions and product surface differences.

[0017] 2. In this invention, by setting an angle and posture correction end to detect missing parts of a one-way valve, the rotational deviation angle between the central axis of the one-way valve in the image to be tested and the central axis of the template image is calculated. Then, affine transformation is used to correct the image to be tested to the same detection posture as the template image. At the same time, the correction effect is verified by structural similarity. This effectively overcomes the problems of position offset and angle deflection of the product during the transmission process, avoids misjudgment caused by inconsistent posture, ensures the accuracy of subsequent region segmentation and feature comparison, and improves the robustness and repeatability of the detection system.

[0018] 3. In this invention, by setting up a tiered comparison detection end, when detecting missing parts of a one-way valve, the corrected image is divided into five independent sub-regions according to the assembly positions of the rubber ring, gasket, steel ball, cage, and snap ring. These sub-regions are then numbered in order from the outside to the inside. The grayscale mean, grayscale variance, and edge pixel ratio of each sub-region are extracted to form a feature vector. Cosine similarity is used to compare each sub-region with the corresponding region of the template, achieving parallel and refined detection of multiple parts. This not only accurately identifies the type of missing part but also enables quality traceability through tiered alarms and log recording, improving detection efficiency and intelligence. Attached Figure Description

[0019] Figure 1 This is a schematic diagram of the system architecture and process of a one-way valve component missing detection system and method according to the present invention; Figure 2 This is a schematic diagram of the image acquisition and positioning end of a one-way valve component missing detection system according to the present invention; Figure 3 This is a schematic diagram of the angle and attitude correction end of a one-way valve component missing detection system according to the present invention; Figure 4 This is a schematic diagram of the stepped comparison detection end of a one-way valve component missing part detection system of the present invention. Detailed Implementation

[0020] To make the technical means, creative features, objectives and effects of this invention easier to understand, the invention will be further described below in conjunction with specific embodiments.

[0021] Example 1, please refer to Figures 1-2 As shown: A one-way valve component missing detection system, the system includes an image acquisition and positioning end, an angle and attitude correction end, and a graded comparison detection end; The image acquisition and positioning end uses multi-angle photography and template matching technology to acquire images of the component areas of the one-way valve under test, and performs preliminary positioning with pre-stored images of qualified products; The angle and posture correction end calculates the rotation deviation between the image under test and the template image and uses affine transformation technology to correct the image under test to the same detection posture as the template image. The graded comparison detection end divides the corrected image into multiple regions corresponding to the components and calculates the feature differences for each region to determine whether there are any missing parts such as rubber rings, gaskets, steel balls, cages, and snap rings.

[0022] The image acquisition and positioning terminal includes an image acquisition module, an image quality adaptive enhancement module, and a template storage module; The image acquisition module includes a multi-angle triggering unit and a light source synchronization unit; The multi-angle triggering unit sequentially acquires images of the one-way valve under test from two positions—a top vertical angle and a side tilt of 45°—using an industrial camera. This obtains multi-view contour information of the rubber ring, gasket, steel ball, cage, and snap ring. In specific implementation: The system is equipped with two independent 5-megapixel monochrome CMOS industrial cameras (CMOS stands for Complementary Metal-Oxide-Semiconductor Image Sensor, used to convert light signals into digital images), mounted at a top vertical station and a side-tilted 45° station respectively. The optical axis of the camera lens at the top vertical station is perpendicular to the upper surface of the one-way valve, used to capture the top-view profile of the rubber ring (annular elastic seal) and gasket (flat annular gasket); the optical axis of the camera lens at the side-tilted 45° station forms a 45° angle with the horizontal plane and points towards the center of the side of the one-way valve, used to capture the steel ball (spherical opening and closing element) and cage. The lateral contours of the cage-like limiting structure and the retaining ring (open elastic retaining ring) are obtained. The two stations are triggered in a set delay sequence: the top camera is triggered first, and the side camera is triggered after an interval of 50ms, so as to avoid mutual interference between the light sources of the two stations. The focal length of each camera lens is 12mm, the exposure time is 10ms, and the output image resolution is 2592×1944 pixels. Through the above multi-angle acquisition, the circular edge of the rubber ring, the annular area of ​​the gasket, the spherical highlight of the steel ball, the toothed structure of the cage and the opening features of the retaining ring can be obtained, thereby effectively overcoming the problem of mutual occlusion of parts under a single view.

[0023] The light source synchronization unit synchronously activates the ring light source at the moment of camera triggering and maintains stable illumination for 20ms to ensure consistency of light intensity at different angles and reduce ambient light interference. Specifically, in implementation: The top workstation is equipped with a white LED ring light source (LEDs are light-emitting diodes; a ring light source refers to an LED lighting device arranged in a ring shape, with an inner diameter of 60mm, an outer diameter of 90mm, and a beam angle of 30°), coaxially mounted around the top camera lens to provide vertical downward illumination; the side workstation is equipped with an independent strip-shaped white LED light source (a strip light source refers to an LED lighting device arranged in a long strip shape, with a length of 80mm and a beam angle of 60°), mounted on both sides of the side camera lens, illuminating the side of the one-way valve at a 45° angle downward; the two light sources are each controlled by their own constant current drive circuit (a power supply module that maintains a constant output current). At the moment the top camera is triggered, the control circuit outputs a 20ms DC drive current to the top ring light source to stabilize its illuminance (luminous flux received per unit area, in Lux) within the range of 2000Lux±5%. At the moment the side camera is triggered, a drive current of the same duration is output to the side strip light source, maintaining the same illuminance. The light source duration of 20ms is greater than the camera exposure time of 10ms, ensuring constant illumination within the exposure window. The relationship between the output current of the constant current drive circuit and the set illuminance is as follows: Where I is the output current (in A), E is the set illuminance (in Lux), and k is the photoelectric conversion coefficient of the LED (0.02A / Lux in this embodiment). Through the above synchronous control, the brightness jump caused by ambient light fluctuations and light source switching between workstations is effectively suppressed, ensuring that the two acquired images have a consistent grayscale distribution benchmark.

[0024] The image quality adaptive enhancement module includes an illumination correction unit and a noise suppression unit; The illumination correction unit separates the incident and reflected components using the Retinex algorithm, performs illumination homogenization processing on the acquired image, and eliminates local overexposure and shadows caused by deviations in the angle of the ambient light source. Specifically, in implementation: The acquired raw image is denoted as Where x and y are pixel coordinates, the Retinex algorithm processes the image Decomposed into incident components With reflection component The product of, i.e. The incident component Characterizing the non-uniformity of ambient lighting, the reflected component Characterizing the inherent reflectivity of an object's surface; the goal of illumination correction is to remove... The influence, extraction First of all Taking the natural logarithm transforms the multiplication relation into an addition relation: Then use the standard deviation A Gaussian filter (a type of linear smoothing filter whose weights follow a Gaussian distribution) is used for... Perform convolution operation to estimate ;Will Subtract the estimated ,get Finally, an exponential transformation is performed to recover the reflection component. This is the homogenized image; this processing can effectively compensate for the phenomenon of bright center and dark edge in the image caused by the installation angle deviation of the ambient light source, while eliminating the overexposed area and shadow area formed by local reflection of the one-way valve housing, and outputting an image with uniform illumination distribution.

[0025] The noise suppression unit preserves the edge details of components through multi-scale guided filtering, while suppressing Gaussian noise and salt-and-pepper noise under high ISO conditions, outputting an enhanced standard grayscale image. In specific implementation: The illumination-corrected image is used as the input image p, and this image itself is used as the guide image I. The guided filter assumes that the output image q and the guide image I have a linear relationship within a local window: , where i is the pixel index within the window. , The linear coefficients within window k are obtained by minimizing the reconstruction error between the input image p and the output image q, specifically through regularized linear regression. To suppress Gaussian noise (random brightness noise following a normal distribution) and salt-and-pepper noise (randomly occurring black and white pixel noise), guided filtering is performed using window radii of 3, 5, and 7 pixels, with corresponding regularization parameters. The coefficients controlling the smoothing intensity are all set to 0.01. The filtering results at the three scales are then analyzed. , , Perform a weighted average, with weight coefficients of 0.2, 0.3, and 0.5 (the sum of the weights is 1), and output the image. Multi-scale guided filtering, while smoothing noise, can preserve details such as the circular edge of the rubber ring, the annular boundary of the gasket, the highlight spots of the steel ball, and the toothed contour of the cage, and output an enhanced standard grayscale image (a single-channel brightness image with a pixel value range of 0-255), providing clear and low-noise input data for subsequent template matching and feature comparison.

[0026] The template storage module includes a template pre-storage unit and a type matching unit; The template pre-storage unit acquires complete images of qualified products through multi-angle photography, and marks the position coordinates and edge gradient features of rubber rings, gaskets, steel balls, cages, and snap rings one by one to form a pre-stored feature library. In specific implementation: A qualified one-way valve, whose assembly of all components has been manually verified, was selected as the standard sample. The standard sample was placed on the testing station. First, following the angle and posture correction method, the sample image was affinely transformed to the standard posture. Then, following the aforementioned multi-angle photography procedure, one corrected image was acquired from each of two stations: one vertically from the top and one tilted at 45° from the side. These were recorded as template images. and A shape-based template matching algorithm was used to manually select the regions of interest for five components in the template image, and the coordinates of the top-left corner of each region were recorded. and the coordinates of the bottom right corner For each region of interest, calculate the edge gradient features: use the Sobel operator to calculate the gradient magnitude G and direction. The formula is , ,in , To generate gradients in the horizontal and vertical directions, the region of interest is divided into 8×8 cells. A gradient direction histogram is plotted in each cell (direction range 0°-180°, with each interval being 22.5°, for a total of 8 intervals). The statistical values ​​of each interval are concatenated to form a feature vector of length 128. For the same model of check valve, images of 3 different qualified samples can be collected. After attitude correction, the feature vectors are extracted and the average value is stored in the feature library (if there are slight differences between samples, averaging improves representativeness). The feature library can optionally store standard dimension information of each component (such as rubber ring radius, gasket thickness, etc.) for use in expanding detection functions. For different models of check valves, the above library construction process is executed separately to form a pre-stored feature library covering all production models.

[0027] The type matching unit automatically calls up the corresponding model template image and feature data by recognizing the model QR code and character area on the housing of the one-way valve under test. This supports online switching detection of different product models. In specific implementation: An auxiliary barcode reader camera is installed at the entrance of the testing station. Its triggering sequence takes precedence over the main camera. Once the one-way valve under test enters the station and stabilizes, the auxiliary barcode reader camera is triggered first to acquire the QR code image on the housing. A QR code decoding algorithm is used to extract the model code string (e.g., V-102A). If no QR code is found, an optical character recognition algorithm is used to read the character area and identify the model string. The identified string is used as an index for precise matching in a pre-stored feature library. If a match is successful, the corresponding template image is... , The system loads data such as the positioning coordinates and feature vectors of the five components into memory, and then triggers the main camera to perform subsequent detection. If the matching fails, the system immediately issues an audible and visual alarm for the unregistered model and stops the detection process, waiting for manual handling. Through automatic identification and parameter loading, the system can achieve rapid online model changeover without manual intervention when different models of products are produced on mixed production lines.

[0028] Example 2, please refer to Figure 3 As shown: The angle and attitude correction end includes an angle detection module and a position correction module; The angle detection module includes a vertical angle unit and a deviation warning unit; The vertical angle unit determines the rotational deviation of the product under test by calculating the angle between the central axis of the one-way valve in the image under test and the central axis of the template image. Specifically, in implementation: Retrieves the coordinates of the center points of the two end faces of the current model template image from the template pre-stored feature library. and The line connecting these points forms the central axis of the template. For the image to be tested, the Canny edge detection operator is first used to extract the contour of the one-way valve housing. Then, the least squares method is used to fit the arcs of the left and right end faces of the housing to obtain the coordinates of the center points of the two end faces. and To ensure correct point correspondence, the points are sorted according to their horizontal position in the image: the center of the left end face is the first point, and the right end face is the second point. The template axis vector is then calculated. The vector of the axis to be measured Rotational deviation angle Calculated by the following formula: ; in This is the arctangent function for the four quadrants, and its return value is in radians. It is a two-dimensional cross product (signed area). To convert radians to degrees using the dot product: , The sign indicates the direction of rotation: a positive value indicates that the image under test rotates counterclockwise relative to the template, and a negative value indicates clockwise rotation.

[0029] The deviation warning unit is used when the included angle When the angle exceeds a preset threshold of 3°, an alarm signal is issued and detection stops, prompting manual inspection of the material's placement posture. In practice: Calculate the rotational deviation angle Then take its absolute value Compared with the preset threshold of 3°, if This indicates that the deviation in the placement posture of the one-way valve under test is within the allowable range, and the system continues to execute the subsequent testing process; if Upon detection, the deviation warning unit immediately sends a stop signal to the programmable logic controller (PLC) to stop the conveyor belt. Simultaneously, it triggers a flashing red warning light and displays a message on the host computer interface indicating abnormal material posture and an angle deviation of XX degrees, requiring manual repositioning of the one-way valve under test. After manual adjustment, the system re-triggers image acquisition and angle detection until the deviation meets the requirements. This warning mechanism avoids the failure of subsequent area segmentation and feature comparison due to excessive product placement angle, thus improving detection reliability.

[0030] The position correction module includes a coordinate transformation unit and a correction verification unit; The coordinate transformation unit transforms the coordinates of each pixel in the image under test using a standard affine transformation matrix. Map to new coordinates The formula is: ,in This is the rotational deviation angle. As a translation vector, in specific implementation: First, the rotational deviation angle is calculated based on the vertical angle unit. (Unit: radians) Construct the affine transformation matrix, which is in 3×3 form and represented using homogeneous coordinates. The transformation formula is as follows: ; in The rotational deviation angle (in radians); and They are respectively The cosine and sine values; The horizontal translation amount (in pixels). The vertical translation amount (in pixels) is determined by the coordinate difference between the template image and the image under test (e.g., the center of the left end face of a one-way valve). , Each pixel in the image to be tested Substitute into the formula to calculate the new coordinates The original pixel grayscale value is assigned to the new position. For non-integer coordinates that appear after the transformation, bilinear interpolation (weighted average of the grayscale values ​​of the surrounding four integer pixels) is used for grayscale filling. After affine transformation, the image under test is rotated to the same angle direction as the template image and translated to the aligned position, eliminating the pose deviation caused by conveyor belt vibration or random product placement.

[0031] The correction verification unit is used to calculate the structural similarity (SSIM) between the corrected image and the template image. If the SSIM value is less than 0.95, the correction is repeated once; otherwise, the system is notified to prompt manual processing. In practice: The corrected image to be tested is denoted as... The template image is denoted as SSIM is an index that evaluates image similarity from three dimensions: brightness, contrast, and structure. For each local window in the image (an 11×11 pixel sliding window is used in this embodiment), the SSIM calculation formula is: ; in, and These are the average values ​​of the pixels within the two image windows (reflecting brightness); and These are the standard deviations of the pixels within the window (reflecting contrast); It represents the covariance of pixels within two image windows (reflecting structural similarity); , It is the stability constant. (Gray levels of an 8-bit grayscale image); The entire image is divided into multiple windows, and the SSIM value of each window is calculated and averaged to obtain the global SSIM value, which ranges from 0 to 1. The closer the value is to 1, the more similar the two images are. In this embodiment, the SSIM threshold is set to 0.95; if the global SSIM value is... If the correction is effective, the system will continue with subsequent hierarchical comparison and detection; if If the error is not satisfactory (possibly due to excessive initial angle deviation or feature point extraction error), the system will automatically repeat the correction operation (re-extract the end face center point, calculate the rotation deviation angle, and perform the affine transformation again). If the SSIM is still less than 0.95 after repeated correction, the system will be notified to prompt manual handling and the detection process will be stopped. This verification mechanism ensures the reliability of attitude correction and avoids false detections or missed detections caused by incomplete correction.

[0032] Example 3, please refer to Figure 4 As shown: The hierarchical comparison and detection end includes a region hierarchical module, a feature comparison module, and a result output module; The region segmentation module includes an image segmentation unit and a region labeling unit; The image segmentation unit automatically locates the bounding boxes of five components—rubber ring, gasket, steel ball, cage, and snap ring—in the test image using a shape-based template matching algorithm, segmenting them into independent sub-images. Specifically, in implementation: First, the template images (pre-stored standard sample cutouts, with dimensions varying depending on the model) and their initial position coordinates of the five components corresponding to the current model are read from the template storage module. Taking a rubber ring as an example, its template image is a circular rubber ring area, and the actual size is determined by the pre-stored feature library (e.g., 80×80 pixels for a certain model). The image to be tested is then corrected. A shape-based template matching algorithm is employed: edge point sets are extracted from the template image, and the gradient direction of each edge point is calculated; a search window slides across the image to be tested, and the average of the sum of the absolute values ​​of the cosines of the angles between the edge gradient directions and the template gradient directions within the window is used as a similarity measure. ; Where N is the total number of edge points. and Let S be the gradient direction of the i-th edge point of the template and the corresponding position point of the image to be tested, respectively. The value of S ranges from 0 to 1, with a closer value to 1 indicating a better match. A matching threshold of 0.75 is set. If the location is successful, record the coordinates of the top-left corner of the matched bounding box. and the coordinates of the bottom right corner ;like If the component is missing or severely misaligned, the missing area is directly marked and the missing type is recorded. No further feature comparison is performed on the sub-region (the subsequent output module will report the missing component). The above matching operation is performed on the five components in sequence to obtain five bounding boxes (or missing component markers). Based on the coordinates of each successfully matched bounding box, the corresponding sub-image is cropped from the image to be tested and used as the input for subsequent feature extraction.

[0033] The area marking units use Arabic numerals 1 to 5 to mark the sub-areas corresponding to the rubber ring, gasket, steel ball, cage, and snap ring, respectively, and are numbered sequentially from the outside to the inside. In practice: According to the assembly sequence of the one-way valve (from outside to inside: rubber ring, gasket, steel ball, cage, snap ring), the outermost rubber ring is numbered 1, the innermost gasket is numbered 2, the steel ball inside the valve cavity is numbered 3, the cage surrounding the steel ball is numbered 4, and the innermost snap ring is numbered 5. The region marking unit establishes an array of length 5 in memory, with array indices 1-5 corresponding to the aforementioned components. For each successfully segmented sub-image, it is associated with the corresponding component type and stored in the corresponding position of the array (e.g., index 1 stores the pixel data and bounding box coordinates of the rubber ring image). For components that fail to match (missing components), an empty marker is stored in the corresponding position of the array. At the same time, each successfully located sub-region is drawn on the display interface using rectangles of different colors, and the corresponding numerical number is marked in the upper left corner of the rectangle. Missing regions are indicated by a red dashed box. This hierarchical numbering method allows subsequent feature comparisons to be performed region by region in a fixed order and supports skipping of missing regions, avoiding comparison errors caused by disordered component recognition order.

[0034] The feature comparison module includes a feature extraction unit and a missing component detection unit; The feature extraction unit is used to calculate the mean gray level, gray level variance, and edge pixel ratio of each sub-region, forming a feature vector of length 3. Specifically, in implementation: For each sub-image (M×N pixels) output by the region segmentation module, record the position. The pixel grayscale value at that location is First, calculate the grayscale mean. : ; The overall brightness of the sub-region is reflected (rubber rings and gaskets are usually of medium grayscale, steel balls have higher grayscale due to reflection, and metal cages and retainers have lower grayscale), and then the grayscale variance is calculated. : ; Characterize the degree of pixel grayscale dispersion (the rubber ring texture has poor uniformity, scratches on the pad will increase the variance, and the highlight area of ​​the steel ball has a large variance), and then calculate the edge pixel ratio p: use the Sobel operator to extract the sub-image edges. The Sobel operator contains horizontal convolution kernels. and vertical convolution kernel The gradient magnitude of each pixel is Set edge threshold ,like If a pixel is identified as an edge pixel, the total number of edge pixels, E, is counted. The rubber ring has a continuous outer edge with a moderate proportion, the washer edge is thinner and has a slightly lower proportion, the steel ball spherical edge is arc-shaped and uniform, the cage tooth structure has a dense edge with a high proportion, and the circlip opening edge is discontinuous and has a lower proportion. , Arrange p in order to obtain the feature vector of the sub-region to be tested. .

[0035] The missing component detection unit calculates the cosine similarity between the feature vector of the sub-region to be tested and the feature vector of the template sub-region. If the similarity is less than a preset threshold of 0.85, the component in that region is determined to be missing, and the type of missing component is recorded. In specific implementation: Read the feature vector of the corresponding sub-region of the same component from the template storage module. Where the subscript t represents the template, and cosine similarity measures the degree of similarity between two vectors in a direction, and the calculation formula is: ; Among them, dot product ; Let be the magnitude of the vector to be measured. Let be the magnitude of the template vector. The cosine similarity value ranges from -1 to 1, with values ​​closer to 1 indicating greater similarity between the two vectors. This embodiment sets a threshold for determining missing parts. ,like This indicates that the features of the sub-region under test are highly consistent with those of the template sub-region, indicating that the component assembly is normal; if This indicates a significant difference in characteristics, suggesting that the component is missing; for example, when the rubber ring is missing, the sub-region will show a black background of the valve body groove, with a grayscale average value. Significantly reduced variance As the size decreases, the proportion of edge pixels p drops significantly due to the lack of a circular outline, resulting in a cosine similarity far below 0.85. The missing part judgment unit records the judgment result (missing part or normal) along with the part number (1-5) and name (rubber ring, gasket, steel ball, cage, snap ring) and transmits it to the result output module. This analysis and comparison method effectively avoids misjudgment caused by fluctuations in a single feature by comprehensively judging three complementary features, thus improving the accuracy of missing part detection.

[0036] The result output module includes an audible and visual alarm unit and a detection log unit; The audible and visual alarm unit is used to issue a tiered alarm signal by flashing red LEDs and broadcasting a voice announcement when any sub-area is found to be missing an installation. Specifically, in implementation: An alarm status register is set in the host computer software with an initial value of 0. When the missing part judgment unit determines that a certain part is missing, the alarm flag of the corresponding part number is set to 1. The audible and visual alarm unit scans the alarm flag bits of each part number in a loop. Once a flag bit is found to be 1, the following operations are performed immediately: a 2Hz pulse signal is sent to the red LED light through the digital output port of the programmable logic controller, causing the red LED light to flash twice per second to emit a warning light; at the same time, the voice synthesis module is called to play a pre-recorded voice prompt according to the name of the missing part. For example, when the rubber ring is missing, the prompt "rubber ring missing" is played; when the gasket is missing, the prompt "gasket missing" is played, and so on. If multiple missing parts are detected simultaneously, alarms will be broadcast sequentially in ascending order of their tiered numbers (i.e., assembly order from the outside to the inside). For example, a missing rubber ring will be broadcast first, followed by a 1-second interval to broadcast a missing gasket. The alarm signal will continue to be output until the operator presses the reset button or the system manually clears the alarm flag. In addition, to differentiate the severity of the missing parts, a tiered alarm rule is set: a single missing part constitutes a Level 1 alarm, with the LED flashing at a frequency of 1Hz; two or more missing parts constitute a Level 2 alarm, with the LED flashing at a frequency of 3Hz and the name of the missing part being broadcast continuously in a loop. This tiered alarm mechanism allows on-site operators to quickly determine the severity of the missing parts and take timely measures to reinstall or rework them.

[0037] The inspection log unit is used to save the product model, timestamp, name of missing parts, and corrected image for each inspection to a local database, supporting quality traceability.

[0038] A method for detecting missing components in a one-way valve includes the following steps: S1. The one-way valve under test is photographed from multiple angles, including the top and side, using an industrial camera. After adaptive image quality enhancement, the image is initially matched with multiple pre-stored template images to locate the main area of ​​the one-way valve in the image under test. S2. Calculate the rotational deviation angle between the main axis of the one-way valve in the image to be tested and the main axis of the template image. Rotate and translate the image to be tested through standard affine transformation so that its posture is consistent with the template image. S3. Divide the corrected image into five sub-regions according to the rubber ring, gasket, steel ball, cage, and snap ring. Extract the gray mean, variance, and edge ratio of each sub-region. Compare the cosine similarity with the feature vector of the corresponding sub-region of the template. If the similarity of any region is lower than the threshold of 0.85, output the detection result of the missing part and alarm through voice and display screen.

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

Claims

1. A system for detecting missing components in a one-way valve, characterized in that, The system includes an image acquisition and positioning end, an angle and attitude correction end, and a graded comparison and detection end; The image acquisition and positioning terminal uses multi-angle photography and template matching technology to acquire images of the component areas of the one-way valve under test, and performs preliminary positioning with pre-stored images of qualified products. The angle and posture correction end corrects the image under test to the same detection posture as the template image by calculating the rotation deviation between the image under test and the template image and using affine transformation technology. The graded comparison detection end divides the corrected image into multiple regions corresponding to the components and calculates the feature differences for each region to determine whether there are any missing parts such as rubber rings, gaskets, steel balls, cages, and snap rings.

2. The one-way valve component missing detection system according to claim 1, characterized in that, The image acquisition and positioning terminal includes an image acquisition module, an image quality adaptive enhancement module, and a template storage module; The image acquisition module includes a multi-angle triggering unit and a light source synchronization unit; The multi-angle triggering unit uses an industrial camera to sequentially acquire images of the one-way valve under test from two positions: a top vertical angle and a side tilt of 45°, obtaining multi-view contour information of the rubber ring, gasket, steel ball, cage, and snap ring. The light source synchronization unit synchronously turns on the ring light source at the moment the camera is triggered and maintains stable illumination for 20ms to ensure the consistency of light intensity at different angles and reduce ambient light interference.

3. The one-way valve component missing detection system according to claim 2, characterized in that, The image quality adaptive enhancement module includes an illumination correction unit and a noise suppression unit; The illumination correction unit separates the incident component and the reflected component using the Retinex algorithm, performs illumination homogenization processing on the acquired image, and eliminates local overexposure and shadows caused by the angle deviation of the ambient light source. The noise suppression unit preserves the edge details of components through multi-scale guided filtering, while suppressing Gaussian noise and salt-and-pepper noise under high ISO conditions, and outputs an enhanced standard grayscale image.

4. The one-way valve component missing detection system according to claim 2, characterized in that, The template storage module includes a template pre-storage unit and a type matching unit; The template pre-storage unit acquires complete images of qualified products by taking photos from multiple angles, and marks the position coordinates and edge gradient features of rubber rings, gaskets, steel balls, cages, and snap rings one by one to form a pre-storage feature library; The type matching unit automatically calls up the template image and feature data of the corresponding model by recognizing the model QR code and character area on the housing of the current one-way valve under test, supporting online switching detection of different models of products.

5. The one-way valve component missing detection system according to claim 1, characterized in that, The angle and attitude correction terminal includes an angle detection module and a position correction module; The angle detection module includes a vertical angle unit and a deviation warning unit; The vertical angle unit determines the rotational deviation of the product under test by calculating the angle between the central axis of the one-way valve in the image under test and the central axis of the template image. The deviation warning unit is used when the included angle When the angle exceeds the preset threshold by 3°, an alarm signal is issued and the detection stops, prompting a manual check of the material placement posture.

6. The one-way valve component missing detection system according to claim 5, characterized in that, The position correction module includes a coordinate transformation unit and a correction verification unit; The coordinate transformation unit transforms the coordinates of each pixel in the image under test using a standard affine transformation matrix. Map to new coordinates The formula is: ,in This is the rotational deviation angle. It is a translation vector; The correction and verification unit is used to calculate the structural similarity (SSIM) between the corrected image and the template image. If the SSIM value is less than 0.95, the correction is repeated once; otherwise, the system is reported to prompt manual processing.

7. The one-way valve component missing detection system according to claim 1, characterized in that, The hierarchical comparison and detection terminal includes a region hierarchical module, a feature comparison module, and a result output module; The region segmentation module includes an image segmentation unit and a region labeling unit; The image segmentation unit automatically locates the bounding boxes of five components—rubber ring, gasket, steel ball, cage, and snap ring—in the image under test using a shape-based template matching algorithm, and segments them into independent sub-images. The area marking unit uses Arabic numerals 1 to 5 to mark the sub-areas corresponding to the rubber ring, gasket, steel ball, cage, and snap ring, and numbers them in stages according to the assembly order from the outside to the inside.

8. The one-way valve component missing detection system according to claim 7, characterized in that, The feature comparison module includes a feature extraction unit and a missing component detection unit; The feature extraction unit is used to calculate the mean gray level, gray level variance, and edge pixel ratio of each sub-region, forming a feature vector of length 3; The missing component determination unit is used to calculate the cosine similarity between the feature vector of the sub-region to be tested and the feature vector of the template sub-region. If the similarity is less than the preset threshold of 0.85, the component in the region is determined to be missing, and the missing component type is recorded.

9. A one-way valve component missing detection system according to claim 7, characterized in that, The result output module includes an audible and visual alarm unit and a detection log unit; The sound and light alarm unit is used to issue a graded alarm signal by flashing a red LED and broadcasting a voice message when any sub-area is determined to be missing. The detection log unit is used to save the product model, timestamp, name of missing parts, and corrected image of each detection to a local database, supporting quality traceability.

10. A method for detecting missing parts in a one-way valve, referring to the one-way valve component missing part detection system according to any one of claims 1-9, characterized in that, Includes the following steps: S1. The one-way valve under test is photographed from multiple angles, including the top and side, using an industrial camera. After adaptive image quality enhancement, the image is initially matched with multiple pre-stored template images to locate the main area of ​​the one-way valve in the image under test. S2. Calculate the rotational deviation angle between the main axis of the one-way valve in the image to be tested and the main axis of the template image. Rotate and translate the image to be tested through standard affine transformation so that its posture is consistent with the template image. S3. Divide the corrected image into five sub-regions according to the rubber ring, gasket, steel ball, cage, and snap ring. Extract the gray mean, variance, and edge ratio of each sub-region. Compare the cosine similarity with the feature vector of the corresponding sub-region of the template. If the similarity of any region is lower than the threshold of 0.85, output the detection result of the missing part and alarm through voice and display screen.