Automatic optical detection method and system based on gasket surface defects
Through multi-channel optical imaging processing, deep learning and multi-angle imaging technology, the difficulty of distinguishing defects and false alarms in traditional detection methods are solved, and high-precision detection and accurate evaluation of gasket surface defects are achieved.
Patent Information
- Application Number
- CN202411890036.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-03-18
AI Technical Summary
The traditional automatic optical detection method based on gasket surface defects has character false alarm problems and the difficulty in distinguishing different categories of defects, which affects the accuracy of product quality evaluation.
Multi-channel optical imaging processing combined with high dynamic range technology is used to compensate light unevenly, defect mask recognition is performed through the combination of multi-scale Top-Hat transformation and Hessian matrix feature values, defect classification and region positioning are used using convolutional neural networks, and deep fusion judgment is performed through multi-angle imaging and signal-to-noise ratio optimization analysis.
It improves the accuracy and comprehensiveness of the inspection, reduces misjudgment and misjudgment, and ensures the accuracy and reliability of product quality evaluation.
Smart Images

Figure CN119643448A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of optical detection technology, and in particular to an automatic optical detection method and system based on gasket surface defects. Background Art
[0002] Gaskets may have a variety of surface defects during production and use, which can affect the performance and service life of gaskets. The following are some common gasket surface defects and their detailed explanations: pits and pits: These are small pits or depressions formed due to uneven material surfaces or impacts during production. These defects may reduce the sealing performance of gaskets; scratches: During production, processing or installation, the surface of gaskets may be scratched, forming linear scratches. These scratches may cause stress concentration, affecting the strength and sealing of gaskets. In order to detect these defects, machine vision inspection equipment is often used in modern industry. These equipment use high-resolution cameras and image processing algorithms to automatically identify and classify surface defects of gaskets, improving detection efficiency and accuracy. Automated Optical Inspection (AOI) is an inspection technology based on optical principles that uses machine vision technology to replace manual visual inspection. The basic principle of AOI inspection is to use camera technology to output the reflected light intensity of the inspected object in a quantitative grayscale value, and analyze and determine the defects and classify them by comparing with the grayscale value of the standard image.
[0003] However, the traditional automatic optical inspection method based on gasket surface defects often has the following problems: Automatic optical inspection (AOI) may encounter the problem of character false alarm in electronic manufacturing, which is usually caused by component character differences and environmental factors. This can be solved by optimizing component library parameters and reducing key interference. The appearance characteristics of different types of defects have certain similarities, making it difficult to distinguish the types of defects, accurately determine the causes of defects and accurately grade products, affecting the accurate assessment and subsequent processing of product quality issues. Summary of the invention
[0004] Based on this, it is necessary for the present invention to provide a method and system for automatic optical detection of gasket surface defects to solve at least one of the above-mentioned technical problems.
[0005] To achieve the above object, a gasket surface defect automatic optical detection method is provided, comprising the following steps:
[0006] Step S1: extract parameters of the gasket to be tested, obtain the inner and outer diameters, thickness and tolerance range information of the gasket, and obtain gasket structural parameter data; match, calibrate and store the gasket structural parameter data according to a preset component parameter library to obtain a gasket component parameter library;
[0007] Step S2: Use a visual sensor to scan the surface of the gasket to be inspected to generate raw image data; perform multi-channel optical imaging processing on the raw image data, and use high dynamic range technology to compensate for uneven illumination to obtain enhanced surface image data; perform image preprocessing on the enhanced surface image data to obtain gasket surface inspection image data;
[0008] Step S3: performing defect mask recognition based on multi-scale Top-Hat transformation and Hessian matrix eigenvalues on the gasket surface detection image data to obtain a defect mask enhanced image, wherein the defect mask enhanced image includes a gasket front detection image and a gasket back detection image; performing morphological processing on the defect mask enhanced image, extracting defect areas, and generating defect feature vector data; performing defect classification processing based on a convolutional neural network on the defect feature vector data, and performing regional positioning to obtain gasket defect classification data;
[0009] Step S4: Perform multi-angle imaging processing on the defect area according to the defect mask enhanced image, and perform signal-to-noise ratio optimization analysis to obtain deep fusion data of the defect area; perform qualification determination according to the deep fusion data of the defect area and the gasket defect classification data and the preset gasket quality standard to obtain gasket detection determination result data;
[0010] Step S5: sort products according to the gasket detection result data, put unqualified products into the NG channel, and store qualified products in the OK channel to obtain product sorting data; store the gasket defect classification data and product sorting data into the gasket component parameter library to achieve traceability of the detection and judgment results.
[0011] The present invention measures the key dimensional parameters such as the inner diameter, outer diameter, thickness and tolerance range of the gasket to be detected by a detection device, and matches and calibrates them with the standard parameters in the preset component parameter library. The calibration process can eliminate the errors that may exist in the detection process, such as the deviation caused by different measuring equipment, so as to ensure the accuracy of the data. Finally, the calibrated gasket structure parameter data is stored in the gasket component parameter library to provide high-quality basic data for subsequent detection and analysis. This step ensures that the geometric dimension data of the gasket is consistent with the standard parameters, improves the accuracy of the detection process, and realizes the standardized management of parameters through data storage, providing a basis for subsequent traceability. The gasket surface is scanned by a visual sensor to generate raw image data, and the uneven illumination is compensated by multi-channel optical imaging combined with high dynamic range (HDR) technology, thereby improving the image brightness and contrast, and obtaining enhanced surface image data. Then, the image data is pre-processed such as denoising, grayscale equalization, edge enhancement, etc. to generate gasket surface detection image data suitable for subsequent analysis. The use of multi-channel imaging and HDR technology greatly improves the imaging quality of gasket surface detection and reduces the detection error caused by uneven illumination. The image preprocessing step further optimizes the data quality and ensures the accuracy of subsequent defect identification. The combination of multi-scale Top-Hat transform and Hessian matrix eigenvalues is used to accurately identify the defect area of the enhanced surface image data. These methods can highlight the concave and convex features or scratches on the gasket surface. The defect area is extracted through morphological processing to generate defect feature vector data with spatial positioning attributes. Then, the convolutional neural network (CNN) is used to classify the defect features, achieve accurate regional positioning, and generate gasket defect classification data. The combination of Top-Hat transform and Hessian matrix eigenvalues can effectively detect complex defect types. At the same time, the CNN classification model greatly improves the efficiency and accuracy of defect identification and classification, and can quickly adapt to the detection needs of various defects. According to the defect mask image, multi-angle imaging technology is used to analyze the defect area more carefully, and the image quality is improved by signal-to-noise ratio optimization to obtain deep fusion data of the defect area. Then, the fusion data is compared with the preset quality standard, combined with the defect classification data, and the qualification judgment is made, and finally the gasket detection judgment result data is generated. Multi-angle imaging and deep fusion analysis effectively overcome the possible misjudgment of defects caused by a single imaging angle, and signal-to-noise ratio optimization further improves the availability of data, thereby ensuring the reliability and authority of the detection results. According to the judgment results, unqualified gaskets are sorted to the NG channel, and qualified gaskets are stored in the OK channel. At the same time, the sorting data and defect classification data are updated to the gasket component parameter library, forming a complete detection record chain and realizing the traceability of the detection results.Product sorting and data updating realize intelligent production processes, improve sorting efficiency, and provide strong data support for subsequent production quality analysis through complete parameter library records, further improving the traceability and maintainability of the detection system. This method realizes all-round detection and management of gasket quality through the collaborative work of structural parameter extraction, surface image enhancement, accurate defect identification and classification, deep analysis and fusion judgment, and intelligent sorting and traceability, which not only improves detection efficiency and accuracy, but also provides a solid technical foundation for subsequent process optimization.
[0012] Preferably, step S36 includes the following steps:
[0013] Step S361: using a pre-trained deep convolutional neural network to perform multi-classification training on the normalized feature data, and setting classification labels for multiple defect types including surface scratches, holes, burrs, and bubbles, thereby obtaining neural network classification result data;
[0014] Step S362: performing defect classification accuracy screening based on confidence threshold on the neural network classification result data, thereby obtaining optimized classification result data;
[0015] Step S363: using a region growing algorithm to accurately calibrate the defect position at the pixel level on the optimized classification result data, thereby obtaining thermal mapping data of the defect position;
[0016] Step S364: Integrate the defect location thermal mapping data and the optimization classification result data to obtain gasket defect classification data.
[0017] The present invention uses a pre-trained deep convolutional neural network to perform multi-classification training on the normalized feature data, and sets classification labels for multiple defect types, thereby obtaining neural network classification result data. By applying deep learning technology, especially convolutional neural network (CNN), it is possible to process complex image features and match them with preset defect types (such as surface scratches, holes, burrs, and bubbles, etc.). CNN can automatically extract and learn high-order features in the image, thereby achieving accurate classification of different defect types, providing a solid foundation for subsequent defect identification. The neural network classification result data is subjected to defect classification accuracy based on confidence threshold screening, thereby obtaining optimized classification result data. This step filters out those results with low classification accuracy by setting a confidence threshold, thereby improving the accuracy of the overall classification. This not only reduces the probability of misclassification, but also ensures that the model can focus on those defect types with high classification confidence, thereby improving the reliability of the classification results. The optimized classification result data is precisely calibrated at the pixel level of the defect position using the region growing algorithm, thereby obtaining defect position thermal mapping data. The region growing algorithm further improves the positioning accuracy of the defect by accurately calibrating the boundary and position of the defect area by expanding the area from the initial seed point. This process supports pixel-level calibration of defects, making subsequent inspection results more refined and more accurately reflecting the specific location of defects in the image. The defect location thermal mapping data and optimized classification result data are integrated to obtain gasket defect classification data. By integrating thermal mapping data and optimized classification results, a comprehensive defect classification data is finally generated, which can simultaneously display defect type and location and provide complete defect information. This process ensures the comprehensiveness and accuracy of defect detection and provides a detailed reference for subsequent quality control and production optimization.
[0018] Preferably, step S4 comprises the following steps:
[0019] Step S41: performing multi-angle imaging processing on the defect area according to the defect mask enhanced image, so as to obtain multi-view defect image data;
[0020] Step S42: performing signal-to-noise ratio optimization analysis on the multi-view defect image data, and integrating feature information of the multi-view defect images through an image depth fusion algorithm, thereby generating defect area depth fusion data;
[0021] Step S43: Perform product qualification judgment on the gasket to be inspected according to the defect area depth fusion data and the gasket defect classification data and the preset gasket quality standard, so as to obtain gasket inspection judgment result data.
[0022] The present invention can obtain more image information from different directions and perspectives by performing multi-angle imaging on the defect area, which helps to comprehensively analyze the defects from multiple dimensions. Multi-angle image data can effectively capture the defect details that may be missed by single-angle imaging, thereby enhancing the comprehensiveness of the detection. Defect images obtained at multiple perspectives usually contain noise and redundant information to varying degrees. Through signal-to-noise ratio optimization analysis, unnecessary noise can be removed and the image quality can be improved. Afterwards, the image deep fusion algorithm effectively integrates the image feature information from multiple perspectives to ensure that the important features extracted from each perspective are uniformly displayed and enhanced. This process makes the defect information clearer and further improves the accuracy of detection. Based on the deeply fused defect image data and classification results, the product qualification is determined in combination with the quality standards of the gasket to ensure a comprehensive evaluation of each gasket. This process not only ensures the high accuracy of the detection, but also ensures that only products that meet the standards are judged as qualified by comparison with the quality standards, thereby avoiding unqualified products from entering the market.
[0023] The present invention also provides an automatic optical detection system based on gasket surface defects, which is used to perform the above-mentioned automatic optical detection method based on gasket surface defects. The automatic optical detection system based on gasket surface defects includes:
[0024] The parameter extraction and calibration module is used to extract parameters of the gasket to be tested, obtain the inner and outer diameters, thickness and tolerance range information of the gasket, and obtain the gasket structure parameter data; match, calibrate and store the gasket structure parameter data according to the preset component parameter library to obtain the gasket component parameter library;
[0025] The image acquisition and enhancement module is used to use a visual sensor to scan the surface of the gasket to be inspected to generate raw image data; perform multi-channel optical imaging processing on the raw image data, and use high dynamic range technology to compensate for uneven illumination to obtain enhanced surface image data; perform image preprocessing on the enhanced surface image data to obtain gasket surface inspection image data;
[0026] The defect recognition and classification module is used to perform defect mask recognition on the gasket surface inspection image data based on multi-scale Top-Hat transformation and Hessian matrix eigenvalues to obtain a defect mask enhanced image, wherein the defect mask enhanced image includes a gasket front inspection image and a gasket back inspection image; perform morphological processing on the defect mask enhanced image, extract defect areas, and generate defect feature vector data; perform defect classification processing on the defect feature vector data based on a convolutional neural network, and perform regional positioning to obtain gasket defect classification data;
[0027] The quality judgment module is used to perform multi-angle imaging processing on the defect area according to the defect mask enhanced image, and perform signal-to-noise ratio optimization analysis to obtain deep fusion data of the defect area; perform qualification judgment based on the deep fusion data of the defect area and the gasket defect classification data and the preset gasket quality standard to obtain gasket detection judgment result data;
[0028] The sorting and traceability module is used to sort products according to the gasket detection and judgment result data, and put unqualified products into the NG channel and qualified products into the OK channel to obtain product sorting data; the gasket defect classification data and product sorting data are stored in the gasket component parameter library to realize the traceability of the detection and judgment results.
[0029] The present invention significantly improves the detection accuracy and quality control efficiency of gaskets through a series of precise modular operations. First, the parameter extraction and calibration module accurately extracts the inner and outer diameters, thickness and tolerance range information of the gasket, and ensures the accuracy of the gasket structural parameters through matching and calibration with the preset component parameter library, providing reliable benchmark data for subsequent detection. Then, the image acquisition and enhancement module scans the gasket surface through a visual sensor to obtain high-quality original images, and effectively compensates for uneven illumination through multi-channel optical imaging and high dynamic range technology, improves the detail performance of the image, ensures the high quality and high contrast of the image data, and helps to accurately detect. Subsequently, the defect recognition and classification module uses advanced image processing technology, including multi-scale Top-Hat transformation and Hessian matrix eigenvalue calculation, to extract defect features, and classifies and locates defects through convolutional neural networks, ensuring accurate identification and analysis of different defect types, and providing a solid foundation for subsequent quality assessment. On this basis, the quality judgment module uses multi-angle imaging and signal-to-noise ratio optimization technology to deeply fuse and comprehensively analyze the defect area, further improving the accuracy of defect detection, and ensuring the qualification of the product by comparing with the gasket quality standard. Finally, the sorting and traceability module sorts products according to the test results and isolates unqualified products, thereby improving the efficiency of the production line and the accuracy of product quality control. At the same time, the test and classification results are stored in the gasket component parameter library, realizing the product traceability function, which is helpful for subsequent quality tracing and problem analysis. Overall, these steps form a closed-loop quality control system, which effectively improves production efficiency, product quality and reduces human errors, and realizes intelligent and automated gasket defect detection and quality control. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments thereof made with reference to the following drawings:
[0031] Figure 1It is a schematic diagram of the steps of the automatic optical detection method of gasket surface defects according to the present invention;
[0032] Figure 2 for Figure 1 Detailed step flow diagram of step S1;
[0033] Figure 3 for Figure 1 Detailed step flow chart of step S2 in FIG. DETAILED DESCRIPTION
[0034] The technical method of the present invention is described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by technicians in this field without creative work are within the scope of protection of the present invention.
[0035] In addition, the accompanying drawings are only schematic illustrations of the present invention and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. The functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor methods and / or microcontroller methods.
[0036] It should be understood that, although the terms "first", "second", etc. may be used herein to describe various units, these units should not be limited by these terms. These terms are used only to distinguish one unit from another unit. For example, without departing from the scope of the exemplary embodiments, the first unit may be referred to as the second unit, and similarly the second unit may be referred to as the first unit. The term "and / or" used herein includes any and all combinations of one or more of the listed associated items.
[0037] To achieve this, please refer to Figures 1 to 3 The present invention provides a method for automatic optical detection of gasket surface defects, the method comprising the following steps:
[0038] Step S1: extract parameters of the gasket to be tested, obtain the inner and outer diameters, thickness and tolerance range information of the gasket, and obtain gasket structural parameter data; match, calibrate and store the gasket structural parameter data according to a preset component parameter library to obtain a gasket component parameter library;
[0039] Step S2: Use a visual sensor to scan the surface of the gasket to be inspected to generate raw image data; perform multi-channel optical imaging processing on the raw image data, and use high dynamic range technology to compensate for uneven illumination to obtain enhanced surface image data; perform image preprocessing on the enhanced surface image data to obtain gasket surface inspection image data;
[0040] Step S3: performing defect mask recognition based on multi-scale Top-Hat transformation and Hessian matrix eigenvalues on the gasket surface detection image data to obtain a defect mask enhanced image, wherein the defect mask enhanced image includes a gasket front detection image and a gasket back detection image; performing morphological processing on the defect mask enhanced image, extracting defect areas, and generating defect feature vector data; performing defect classification processing based on a convolutional neural network on the defect feature vector data, and performing regional positioning to obtain gasket defect classification data;
[0041] Step S4: Perform multi-angle imaging processing on the defect area according to the defect mask enhanced image, and perform signal-to-noise ratio optimization analysis to obtain deep fusion data of the defect area; perform qualification determination according to the deep fusion data of the defect area and the gasket defect classification data and the preset gasket quality standard to obtain gasket detection determination result data;
[0042] Step S5: sort products according to the gasket detection result data, put unqualified products into the NG channel, and store qualified products in the OK channel to obtain product sorting data; store the gasket defect classification data and product sorting data into the gasket component parameter library to achieve traceability of the detection and judgment results.
[0043] In the embodiment of the present invention, reference Figure 1 As shown, it is a schematic diagram of the steps of an automatic optical detection method for gasket surface defects according to the present invention. In this example, the automatic optical detection method for gasket surface defects comprises the following steps:
[0044] Step S1: extract parameters of the gasket to be tested, obtain the inner and outer diameters, thickness and tolerance range information of the gasket, and obtain gasket structural parameter data; match, calibrate and store the gasket structural parameter data according to a preset component parameter library to obtain a gasket component parameter library;
[0045] The embodiment of the present invention places the gasket to be tested on a precision measuring device, uses a three-coordinate measuring instrument to perform high-precision measurements on the inner diameter, outer diameter and thickness of the gasket, and records the obtained data. Use a digital micrometer and an electronic caliper to measure and check the tolerance range of the gasket to obtain the gasket structural parameter data. The above data is input into a preset component parameter library, and the structural parameters of the gasket are calibrated through an automatic matching algorithm to correct data deviations caused by measurement errors or environmental factors to ensure that the parameters are consistent with the component parameter library standards. After the calibration is completed, the structural parameter data of the gasket is stored in the gasket component parameter library to form basic data of the gasket component that can be used for subsequent detection.
[0046] Step S2: Use a visual sensor to scan the surface of the gasket to be inspected to generate raw image data; perform multi-channel optical imaging processing on the raw image data, and use high dynamic range technology to compensate for uneven illumination to obtain enhanced surface image data; perform image preprocessing on the enhanced surface image data to obtain gasket surface inspection image data;
[0047] The embodiment of the present invention places the gasket to be inspected on the scanning platform of the visual inspection equipment, and uses a high-resolution visual sensor (such as a 5-megapixel industrial camera) to perform a 360° scan on the gasket surface to generate multiple high-precision original image data. The original image data is subjected to multi-spectral image fusion processing through a multi-channel optical imaging system (including infrared, visible light and ultraviolet light) to enhance the surface features. High dynamic range technology (HDR) is used to perform illumination balance compensation to eliminate the uneven image brightness caused by reflection or shadow on the gasket surface, and generate enhanced surface image data. Subsequently, the enhanced surface image data is processed by image filtering and binarization preprocessing methods (such as median filtering and morphological opening and closing operations) to remove background noise and enhance edge features, thereby generating gasket surface detection image data.
[0048] Step S3: performing defect mask recognition based on multi-scale Top-Hat transformation and Hessian matrix eigenvalues on the gasket surface detection image data to obtain a defect mask enhanced image, wherein the defect mask enhanced image includes a gasket front detection image and a gasket back detection image; performing morphological processing on the defect mask enhanced image, extracting defect areas, and generating defect feature vector data; performing defect classification processing based on a convolutional neural network on the defect feature vector data, and performing regional positioning to obtain gasket defect classification data;
[0049] The embodiment of the present invention uses a method based on multi-scale Top-Hat transformation to process the gasket surface inspection image data, separate the local light and dark features in the image, and extract possible defect areas therefrom. Subsequently, the edge shape and directional characteristics of the defect are analyzed by the eigenvalue of the Hessian matrix to generate a defect mask enhanced image, including the front detection image and the back detection image of the gasket. The morphological processing methods of expansion and corrosion are used for the defect mask enhanced image to further highlight the defect area features and remove isolated noise points. Then, a defect extraction algorithm (such as local gradient analysis) is used to generate feature vector data containing defect information. The defect feature vector data is input into a pre-trained convolutional neural network (such as a ResNet-50 model), the defects are classified and identified, the defect type and severity are output, and the defect position is accurately marked through a regional positioning algorithm (such as a YOLO framework) to generate gasket defect classification data.
[0050] Step S4: Perform multi-angle imaging processing on the defect area according to the defect mask enhanced image, and perform signal-to-noise ratio optimization analysis to obtain deep fusion data of the defect area; perform qualification determination according to the deep fusion data of the defect area and the gasket defect classification data and the preset gasket quality standard to obtain gasket detection determination result data;
[0051] The embodiment of the present invention targets the defect area in the defect mask enhancement image, utilizes a multi-angle imaging device (such as a multi-light source oblique light imaging system) to obtain depth image information from different directions, performs signal-to-noise ratio optimization processing on the imaging data at each angle, enhances the image quality through an adaptive denoising algorithm, and generates clear depth fusion data of the defect area. Based on the fused data and combined with the gasket defect classification data, each defect characteristic is compared item by item with the preset gasket quality standard, and it is calculated whether the defect size, depth, position and other parameters meet the standard threshold. Finally, the detection results are output through the quality judgment algorithm, including the qualified or unqualified judgment of each gasket, and the gasket detection judgment result data is generated.
[0052] Step S5: sort products according to the gasket detection result data, put unqualified products into the NG channel, and store qualified products in the OK channel to obtain product sorting data; store the gasket defect classification data and product sorting data into the gasket component parameter library to achieve traceability of the detection and judgment results.
[0053] The embodiment of the present invention starts the automatic sorting device control system according to the gasket detection result data, grabs the qualified gaskets through the mechanical arm and puts them into the OK channel, and puts the unqualified gaskets into the NG channel to complete the sorting operation. The product information of each sorting is recorded to generate product sorting data. The sorting data and the corresponding gasket defect classification data are stored in the gasket component parameter library, and the sorting date and detection equipment number are marked in the component library to realize the traceability management of the detection and judgment results, which is convenient for subsequent quality statistics and abnormal tracking.
[0054] The present invention measures the key dimensional parameters such as the inner diameter, outer diameter, thickness and tolerance range of the gasket to be detected by a detection device, and matches and calibrates them with the standard parameters in the preset component parameter library. The calibration process can eliminate the errors that may exist in the detection process, such as the deviation caused by different measuring equipment, so as to ensure the accuracy of the data. Finally, the calibrated gasket structure parameter data is stored in the gasket component parameter library to provide high-quality basic data for subsequent detection and analysis. This step ensures that the geometric dimension data of the gasket is consistent with the standard parameters, improves the accuracy of the detection process, and realizes the standardized management of parameters through data storage, providing a basis for subsequent traceability. The gasket surface is scanned by a visual sensor to generate raw image data, and the uneven illumination is compensated by multi-channel optical imaging combined with high dynamic range (HDR) technology, thereby improving the image brightness and contrast, and obtaining enhanced surface image data. Then, the image data is pre-processed such as denoising, grayscale equalization, edge enhancement, etc. to generate gasket surface detection image data suitable for subsequent analysis. The use of multi-channel imaging and HDR technology greatly improves the imaging quality of gasket surface detection and reduces the detection error caused by uneven illumination. The image preprocessing step further optimizes the data quality and ensures the accuracy of subsequent defect identification. The combination of multi-scale Top-Hat transform and Hessian matrix eigenvalues is used to accurately identify the defect area of the enhanced surface image data. These methods can highlight the concave and convex features or scratches on the gasket surface. The defect area is extracted through morphological processing to generate defect feature vector data with spatial positioning attributes. Then, the convolutional neural network (CNN) is used to classify the defect features, achieve accurate regional positioning, and generate gasket defect classification data. The combination of Top-Hat transform and Hessian matrix eigenvalues can effectively detect complex defect types. At the same time, the CNN classification model greatly improves the efficiency and accuracy of defect identification and classification, and can quickly adapt to the detection needs of various defects. According to the defect mask image, multi-angle imaging technology is used to analyze the defect area more carefully, and the image quality is improved by signal-to-noise ratio optimization to obtain deep fusion data of the defect area. Then, the fusion data is compared with the preset quality standard, combined with the defect classification data, and the qualification judgment is made, and finally the gasket detection judgment result data is generated. Multi-angle imaging and deep fusion analysis effectively overcome the possible misjudgment of defects caused by a single imaging angle, and signal-to-noise ratio optimization further improves the availability of data, thereby ensuring the reliability and authority of the detection results. According to the judgment results, unqualified gaskets are sorted to the NG channel, and qualified gaskets are stored in the OK channel. At the same time, the sorting data and defect classification data are updated to the gasket component parameter library, forming a complete detection record chain and realizing the traceability of the detection results.Product sorting and data updating realize intelligent production processes, improve sorting efficiency, and provide strong data support for subsequent production quality analysis through complete parameter library records, further improving the traceability and maintainability of the detection system. This method realizes all-round detection and management of gasket quality through the collaborative work of structural parameter extraction, surface image enhancement, accurate defect identification and classification, deep analysis and fusion judgment, and intelligent sorting and traceability, which not only improves detection efficiency and accuracy, but also provides a solid technical foundation for subsequent process optimization.
[0055] Preferably, step S1 comprises the following steps:
[0056] Step S11: measuring the inner diameter, outer diameter, thickness, roundness and surface flatness of the gasket to be inspected, thereby obtaining original geometric measurement data;
[0057] Step S12: performing dimensional tolerance analysis on the original geometric measurement data to obtain standardized geometric parameter data;
[0058] Step S13: performing material attribute recognition on the standardized geometric parameter data to obtain material attribute recognition data;
[0059] Step S14: merging the standardized geometric parameter data and the material property identification data into gasket structure parameter data;
[0060] Step S15: Match, calibrate and store the gasket structure parameter data according to the preset component parameter library to obtain the gasket component parameter library.
[0061] As an embodiment of the present invention, refer to Figure 2 As shown, Figure 1 Detailed step flow diagram of step S1 in the embodiment of the present invention, step S1 includes the following steps:
[0062] Step S11: measuring the inner diameter, outer diameter, thickness, roundness and surface flatness of the gasket to be inspected, thereby obtaining original geometric measurement data;
[0063] The embodiment of the present invention places the gasket to be tested on a precision geometric measuring device, uses a three-dimensional coordinate measuring machine (CMM) to perform non-contact laser scanning measurement on the inner diameter and outer diameter of the gasket, and records the data of each measurement to improve the measurement accuracy; uses a high-precision thickness measuring instrument (such as a digital micrometer) to perform multi-point measurement of the gasket thickness to eliminate the deviation caused by single-point measurement; uses a roundness measuring instrument to perform a 360° rotation scan on the roundness of the gasket, and uses the extreme value deviation method to analyze the roundness error; uses an optical surface interferometer to perform three-dimensional morphology measurement on the surface flatness of the gasket to obtain surface microscopic contour features and flatness data. All measurement data are integrated to generate the original geometric measurement data of the gasket for subsequent analysis.
[0064] Step S12: performing dimensional tolerance analysis on the original geometric measurement data to obtain standardized geometric parameter data;
[0065] The embodiment of the present invention inputs the original geometric measurement data into the dimensional tolerance analysis system (such as PC-DMIS software) and performs tolerance analysis according to the design tolerance requirements of the gasket. Specifically, the system compares the measurement data with the set tolerance range item by item, such as whether the inner diameter is within the range of ±0.02mm, whether the thickness error is less than ±0.01mm, etc., and the data exceeding the tolerance will be marked as an abnormal point. At the same time, the roundness error and surface flatness data are standardized through statistical analysis software, and the measured values are converted into standardized geometric parameter data that meet the design specifications. Each parameter output is accompanied by deviation and compliance evaluation results.
[0066] Step S13: performing material attribute recognition on the standardized geometric parameter data to obtain material attribute recognition data;
[0067] The embodiment of the present invention inputs the standardized geometric parameter data into the material property identification system, and uses a spectrometer (such as an XRF energy scattering spectrometer) to detect the material composition of the gasket, and extracts the content information of the main alloy components (such as carbon content 0.8%, chromium content 1.2%, etc.). At the same time, the hardness value of the gasket is tested by a hardness tester (such as a Vickers hardness tester), and compared with the matching value in the standard material database to identify the material type to which the gasket belongs. In addition, a conductivity meter is used to detect the electrical conductivity of the gasket to further verify its material properties. Through comprehensive analysis, material property identification data including material type, alloy ratio and physical properties is generated.
[0068] Step S14: merging the standardized geometric parameter data and the material property identification data into gasket structure parameter data;
[0069] The embodiment of the present invention combines the standardized geometric parameter data with the material attribute identification data, and uses a unified data structure (such as JSON format) to store all parameter and attribute information. The data entry of each gasket includes inner diameter, outer diameter, thickness, roundness error, surface flatness, material type, hardness value and conductivity, etc. After the data is merged, the data integrity and consistency are confirmed by an automatic inspection algorithm to ensure that all information can be seamlessly matched. Finally, the gasket structure parameter data is formed as the basis for subsequent matching calibration and component parameter library update.
[0070] Step S15: Match, calibrate and store the gasket structure parameter data according to the preset component parameter library to obtain the gasket component parameter library.
[0071] The embodiment of the present invention inputs the gasket structural parameter data into the component parameter matching calibration system, and compares it item by item with the preset component parameter library. The calibration system adopts a weighted matching algorithm to perform hierarchical matching of geometric parameters and material properties. For example, for the matching of inner diameter and outer diameter, the system prioritizes checking whether the dimensional deviation is less than the allowable threshold; for the matching of material properties, the material type and key performance indicators are prioritized. After calibration, a report of successful or failed matching is generated, and the calibration results are recorded. The successfully matched data will be directly stored in the gasket component parameter library, and grouped and managed according to the type and batch of the gasket for subsequent detection, traceability and analysis.
[0072] This method obtains comprehensive original geometric measurement data by high-precision measurement of the inner diameter, outer diameter, thickness, roundness and surface flatness of the gasket to be tested, and combines multi-point sampling technology to improve measurement accuracy and ensure data reliability. Subsequently, by comparing the measured data with the design specifications or industry standards, dimensional tolerance analysis is carried out, and standardized processing is performed to generate standardized geometric parameter data in a unified format, thereby improving the efficiency and applicability of subsequent processing. Next, the material properties of the gasket are identified using technologies such as spectral analysis, hardness testing or density measurement, and material attribute identification data including material type, component ratio and mechanical properties are generated, providing key support for quality assessment. On this basis, the standardized geometric parameter data and material attribute identification data are integrated into gasket structural parameter data to comprehensively describe the geometric and material properties of the gasket, ensuring the integrity and applicability of the data. Finally, the gasket structural parameter data is matched and calibrated with the preset component parameter library, potential errors are eliminated through calibration, and the calibrated data is stored in the gasket component parameter library, providing systematic data support for subsequent inspection, quality management and data traceability. The entire process achieves accurate quantification and standardized management of gasket structural characteristics, improves the scientificity and efficiency of testing, and ensures the integrity, reliability and traceability of data, which has significant practical value.
[0073] Preferably, step S2 comprises the following steps:
[0074] Step S21: Scan the surface of the gasket to be inspected using a visual sensor to obtain original image data under different angles and lighting conditions;
[0075] Step S22: performing multi-channel optical imaging processing on the original image data to obtain a multi-channel fused image, wherein the multi-channel optical imaging processing includes image fusion of RGB, grayscale, and infrared channels;
[0076] Step S23: using high dynamic range technology to perform illumination non-uniformity compensation processing on the multi-channel fused image based on dynamic adjustment of image brightness and contrast, thereby obtaining enhanced surface image data;
[0077] Step S24: performing image denoising and grayscale equalization on the enhanced surface image data, thereby obtaining image preprocessing data;
[0078] Step S25: extracting gasket surface feature information from the image preprocessing data, thereby generating gasket surface detection image data.
[0079] As an embodiment of the present invention, refer to Figure 3 As shown, Figure 1 Detailed step flow diagram of step S2 in the embodiment of the present invention, step S2 includes the following steps:
[0080] Step S21: Scan the surface of the gasket to be inspected using a visual sensor to obtain original image data under different angles and lighting conditions;
[0081] The embodiment of the present invention places the gasket to be inspected on a high-precision rotating platform, and the platform is connected to a visual sensor array (such as the industrial-grade camera Basler ace series). The rotating platform is started and rotated at intervals of 5°. The visual sensor captures the gasket surface image from different angles, while adjusting the brightness and angle of the LED ring light source to simulate a variety of lighting conditions. By triggering the synchronization mechanism, it is ensured that the image capture at each angle and lighting condition is completed synchronously, and multiple sets of raw image data are generated. The system uses a high-resolution image format (such as 4096×3000 pixels) to ensure the complete recording of the gasket details.
[0082] Step S22: performing multi-channel optical imaging processing on the original image data to obtain a multi-channel fused image, wherein the multi-channel optical imaging processing includes image fusion of RGB, grayscale, and infrared channels;
[0083] The embodiment of the present invention inputs the original image data obtained in step S21 into a multi-channel optical imaging processing system, and performs multi-scale fusion processing on the images of RGB, grayscale and infrared channels respectively. Specifically, the RGB image is used to record the color information of the gasket surface, the grayscale image is used to enhance the texture information, and the infrared image is used to identify potential internal defects. Through a multi-channel fusion algorithm based on wavelet transform, the significant feature areas of each channel are extracted, and the pixel-level weighted average method is used to achieve fusion to generate a multi-channel fused image. The system dynamically adjusts the weights during the fusion process to take into account both color fidelity and texture enhancement effects.
[0084] Step S23: using high dynamic range technology to perform illumination non-uniformity compensation processing on the multi-channel fused image based on dynamic adjustment of image brightness and contrast, thereby obtaining enhanced surface image data;
[0085] The embodiment of the present invention inputs the multi-channel fused image into the high dynamic range (HDR) processing module, and uses the brightness compensation algorithm based on histogram equalization to compensate for the uneven illumination of the image. First, the local brightness distribution of the image is calculated to identify the areas where the illumination is too dark or too bright; then, by adjusting the contrast and brightness values of these areas, the dynamic range of the entire image is expanded to between 0 and 255 to ensure that the details are clearly visible. The contrast adjustment uses gamma correction technology to enhance the visibility of subtle surface features, and finally generates enhanced surface image data with uniform brightness and optimized contrast.
[0086] Step S24: performing image denoising and grayscale equalization on the enhanced surface image data, thereby obtaining image preprocessing data;
[0087] The embodiment of the present invention applies an image denoising method based on a combination of median filtering and bilateral filtering to the enhanced surface image data. Median filtering is used to remove isolated high-frequency noise points, while bilateral filtering reduces background noise while retaining edge features. In addition, CLAHE (adaptive histogram equalization) technology is used to perform grayscale equalization processing on the image, significantly enhancing local contrast and ensuring that surface details in low-brightness areas are fully displayed. The processed image preprocessing data has the characteristics of low noise and uniform grayscale distribution, providing high-quality input for feature extraction.
[0088] Step S25: extracting gasket surface feature information from the image preprocessing data, thereby generating gasket surface detection image data.
[0089] The embodiment of the present invention inputs the image preprocessing data into the surface feature information extraction module, and adopts a combined method based on Canny edge detection and HOG (Histogram of Oriented Gradients) feature analysis to extract the key surface feature information of the gasket. First, the Canny algorithm is used to identify the surface texture and edge contour of the gasket, and then the directional gradient features of the surface are extracted through HOG to characterize the microscopic defects (such as scratches or pits) that may exist on the gasket surface. Finally, this information is converted into a vectorized data format through a feature descriptor to generate gasket surface detection image data, which contains detailed surface geometry and defect information for subsequent analysis and processing.
[0090] The present invention uses a visual sensor to perform surface scanning on the gasket to be inspected, obtains comprehensive original image data under different angles and lighting conditions, ensures comprehensive coverage of the gasket surface features, and improves the comprehensiveness and accuracy of the detection. On this basis, the original image data is subjected to multi-channel optical imaging processing, and by fusing the image data of RGB, grayscale and infrared channels, the image's detail expression ability and the perception ability of various surface defects are enhanced by using multi-spectral information, which significantly improves the presentation effect of the gasket surface information. Subsequently, the multi-channel fused image is compensated for illumination non-uniformity by using high dynamic range (HDR) technology, and the image quality inconsistency problem caused by changes in illumination conditions is solved by dynamically adjusting the image brightness and contrast, generating enhanced surface image data with clearer details. Furthermore, the enhanced surface image data is denoised to eliminate irrelevant information introduced by sensor noise or environmental interference, and the image brightness distribution is optimized by grayscale equalization, which improves the image contrast and detail resolution, and obtains image preprocessing data that is more suitable for feature analysis. Finally, the gasket surface feature information is extracted from the image preprocessing data to accurately capture the key features of the gasket surface and generate high-quality gasket surface inspection image data, providing accurate and reliable input data for subsequent defect detection and classification. The entire step comprehensively utilizes multi-angle, multi-channel imaging and advanced image enhancement and preprocessing technology to achieve high-quality acquisition and optimization of gasket surface information, providing important guarantees for the comprehensiveness, accuracy and reliability of gasket detection.
[0091] Preferably, step S22 includes the following steps:
[0092] Step S221: performing channel separation processing on the original image data to extract image feature data of RGB, grayscale, and infrared spectrum channels respectively;
[0093] The embodiment of the present invention imports the original image data into the channel separation processing module, and uses the image processing library (such as OpenCV) to extract RGB, grayscale and infrared spectrum channel images respectively. The RGB channel is used to record the color and reflection characteristics of the gasket, the grayscale channel enhances the sensitivity to the surface structure by removing the color information, and the infrared spectrum channel is used to capture the thermal radiation characteristics of the material. The specific processing method includes first separating the three RGB channels from the original data, then converting the RGB image into a grayscale image by a weighted method, and finally extracting the infrared image as an independent spectral channel. The separated image feature data are stored as matrix files for subsequent analysis.
[0094] Step S222: performing image enhancement preprocessing including contrast adjustment, edge sharpening and noise suppression on the separated image feature data, thereby obtaining enhanced image feature data;
[0095] The embodiment of the present invention inputs the image feature data separated in step S221 into the image enhancement module, first performs contrast adjustment, and uses the adaptive histogram equalization (CLAHE) algorithm to enhance the detail performance of the low-brightness area in the image; then uses the edge sharpening algorithm based on the Sobel operator to enhance the image boundary features; finally, uses the median filter and Gaussian filter combined method to suppress the image noise and eliminate isolated noise points and background noise. Each channel image is enhanced independently, and the processed image details are clearer and the features are more prominent, generating enhanced image feature data.
[0096] Step S223: performing multi-channel image feature matching based on accurate registration and spatial calibration of images of different spectral channels according to the enhanced image feature data, thereby obtaining feature matching result data;
[0097] The embodiment of the present invention inputs the enhanced image feature data into the multispectral image registration module, extracts key points in different spectral channels based on the ORB (OrientedFAST and Rotated BRIEF) feature detection algorithm, and performs feature point matching through the FLANN (Fast Library for Approximate Nearest Neighbors) matching algorithm. For the optimization of matching accuracy, a spatial calibration method based on RANSAC (random sampling consistency) is used to filter mismatched points, and image geometry correction is performed to fully align the images of each channel in space. The feature matching result data generated after processing includes accurate feature point coordinates and matching relationship matrix, which lays the foundation for subsequent image fusion.
[0098] Step S224: Based on the feature matching result data, weighted information fusion based on complementary feature information of different channels is performed on the image feature data to obtain a multi-channel fused image.
[0099] The embodiment of the present invention inputs the feature matching result data into the weighted fusion module, and uses a weighted algorithm based on the complementary feature information of different spectral channels to fuse the image feature data. The specific method is to assign weights according to the superiority of different channels in specific features, for example, assigning a weight of 0.5 to the RGB channel in color information, a weight of 0.3 to the grayscale channel in texture information, and a weight of 0.2 to the infrared channel in thermal characteristic information. The fusion adopts the pixel-level weighted superposition method, and the generated multi-channel fused image has high contrast, clear edges and thermal characteristic information at the same time, which can fully reflect the multi-dimensional characteristics of the gasket surface.
[0100] The present invention extracts the image feature data of RGB, grayscale and infrared spectral channels respectively through channel separation processing of the original image data, so that the specific information of each spectral channel can be retained independently, laying the foundation for subsequent analysis. On this basis, the separated image feature data is subjected to image enhancement preprocessing, including contrast adjustment, edge sharpening and noise suppression, which significantly improves the recognizability of image features, makes key information more prominent, and effectively suppresses noise interference, ensuring high-quality data input. Subsequently, multi-channel image feature matching is performed on the enhanced image feature data through precise registration and spatial calibration processing based on images of different spectral channels, ensuring the consistency of each channel data in space and the uniformity of feature expression, generating accurate feature matching result data, and improving the accuracy and reliability of multi-channel data fusion. Finally, based on the feature matching result data, the feature information of each channel is weightedly fused, making full use of the complementary characteristics of different channels, realizing the construction of a multi-channel fused image, so that the fused image has both multi-spectral characteristics and global consistency, and significantly improving the comprehensive feature expression ability of the image. The overall process fully explores and integrates the data potential of multi-spectral channels through the organic combination of separation, enhancement, registration and fusion, providing high-resolution and high-accuracy input data for subsequent gasket detection, effectively improving the accuracy and reliability of detection.
[0101] Preferably, step S3 comprises the following steps:
[0102] Step S31: performing multi-scale Top-Hat transformation preprocessing on the gasket surface detection image data to extract background and detail information in the image, thereby obtaining scale-enhanced image data;
[0103] The embodiment of the present invention inputs the gasket surface detection image data into the multi-scale Top-Hat transformation processing module, and first selects the appropriate structure element size (such as 3×3, 5×5 and 7×7 rectangular kernels) according to the image resolution and the target defect size. A Top-Hat transformation operation is performed on each scale, including a white top-hat transformation to highlight the detail features of the bright area and a black top-hat transformation to extract the background information of the dark area. The transformation results of different scales are linearly superimposed and normalized to obtain scale-enhanced image data with enhanced background and detail features. This step can be implemented through the image processing library of MATLAB or Python, and is suitable for defect detection on complex texture surfaces.
[0104] Step S32: Calculate the Hessian matrix eigenvalues of the scale-enhanced image data, and perform feature enhancement and non-maximum suppression processing on the eigenvalues, so as to obtain preliminary defect feature response data;
[0105] The embodiment of the present invention inputs the scale-enhanced image data into the Hessian matrix calculation module, generates the Hessian matrix using the second-order partial derivatives, and extracts the local curvature change characteristics in the image by solving the eigenvalues (λ1 and λ2). In order to enhance the defect response, the eigenvalues are nonlinearly mapped, and the pseudo-response points are removed in combination with the non-maximum suppression algorithm, retaining the significant defect feature response. Finally, the preliminary defect feature response data is output, in which the value of each pixel represents its possible defect intensity. This process can adopt an implementation method based on the OpenCV or Scikit-Image library, which is suitable for scenes with small defects and prominent edge features.
[0106] Step S33: generating a defect mask according to the preliminary defect feature response data, and performing adaptive threshold segmentation on the defect mask, thereby obtaining a defect mask enhanced image, wherein the defect mask enhanced image includes a gasket front surface detection image and a gasket back surface detection image;
[0107] The embodiment of the present invention inputs the preliminary defect feature response data into the defect mask generation module, uses the adaptive threshold segmentation algorithm to dynamically set the segmentation threshold, and generates a defect mask image. The specific method is to calculate the optimal segmentation threshold based on the distribution of local pixel intensity, and optimize the mask boundary in combination with morphological processing. The generated defect mask enhanced image includes the front and back detection images of the gasket, and each mask image clearly identifies the potential defect area. This process is suitable for gasket detection tasks with different lighting conditions or complex surface textures.
[0108] Step S34: performing morphological opening and closing operations on the defect mask enhanced image, and extracting connected defect regions, thereby generating defect region binary image data;
[0109] In the embodiment of the present invention, the defect mask enhanced image is input into the morphological processing module, and the morphological opening operation is first performed to remove small noise points, and the defect areas that may be broken are connected by closing operation to further optimize the mask structure. Then all connected areas are extracted to generate binary image data, where the connected areas correspond to the boundaries and shapes of the defects. This step is completed by combining the morphological operator with the connectivity analysis algorithm, which is suitable for defect area extraction in complex backgrounds.
[0110] Step S35: extracting defect feature vectors including area, perimeter, shape factor, texture features and geometric features according to the binary image data of the defect area, thereby obtaining defect feature vector data;
[0111] The embodiment of the present invention inputs the binary image data of the defect area into the feature extraction module, extracts geometric features such as area, perimeter, shape factor, etc. for each connected area, and uses the gray level co-occurrence matrix (GLCM) to calculate texture features, including contrast, entropy, and uniformity. At the same time, the geometric features are extracted in combination with the gradient direction distribution of the region to generate complete defect feature vector data. The feature extraction results are stored as multidimensional vectors for subsequent classification. This process is suitable for comprehensive feature description of complex surface defects.
[0112] Step S36: Use the pre-trained convolutional neural network to perform multi-classification processing on the defect feature vector data, identify the defect type, and locate the defect area to obtain gasket defect classification data.
[0113] The embodiment of the present invention inputs the defect feature vector data into a pre-trained convolutional neural network model (such as ResNet or Inception), and classifies the defect features through multiple classification layers. The classification process includes inputting feature vectors for feature mapping, generating category probability distribution, and selecting the category with the highest probability as the defect type. At the same time, the feature mapping of the last layer of the network is used to locate the coordinates of the defect area, and the defect classification data is output. The TensorFlow or PyTorch framework is used for model training, and the training data includes typical defect samples of gaskets, such as cracks, scratches, pits, etc., which can accurately identify multiple defect types and locate areas.
[0114] The present invention realizes accurate identification and classification of gasket surface defects through a series of refined image processing and intelligent classification steps. First, step S31 uses multi-scale Top-Hat transform preprocessing to extract background information and detail information of gasket surface detection image data, and generates scale-enhanced image data, which effectively improves the contrast of the image, makes the details clearer, and provides high-quality basic data for subsequent defect detection. Step S32 further uses the Hessian matrix eigenvalue calculation to enhance the local features in the scale-enhanced image data, and effectively highlights the response characteristics of the defect area through feature enhancement and non-maximum suppression, and obtains preliminary defect feature response data, which significantly improves the sensitivity and accuracy of defect detection. In step S33, a defect mask is generated according to the preliminary defect feature response data, and the defect area is accurately separated by adaptive threshold segmentation. The generated defect mask enhanced image includes a complete detection image of the front and back of the gasket, ensuring full coverage of surface defects. In step S34, the defect mask enhanced image is optimized through morphological opening and closing operations to effectively remove noise interference, and at the same time, the connected defect area is extracted to generate binary image data of the defect area, which further improves the integrity and coherence of the defect area. Next, step S35 extracts feature vectors from the binary image data of the defect area, including the calculation of key parameters such as area, perimeter, shape factor, texture features and geometric features, so as to generate defect feature vector data, which fully captures the physical and geometric characteristics of the defects and provides high-dimensional feature input for intelligent classification of defects. Finally, step S36 uses a pre-trained convolutional neural network to perform multi-classification processing on the defect feature vector data. Based on the efficiency and generalization ability of the deep learning model, it realizes the accurate identification of defect types and the precise positioning of defect areas, and generates gasket defect classification data, laying the foundation for subsequent quality assessment and classification processing. The overall method fully mines the defect information in the gasket surface inspection image by combining multi-scale transformation, feature enhancement, morphological processing and deep learning technology. It not only improves the accuracy and refinement of detection, but also realizes the automation and intelligence of defect classification and positioning, greatly improving the detection efficiency and reliability.
[0115] Preferably, step S33 includes the following steps:
[0116] Step S331: determining the segmentation threshold of the defect area according to the preliminary defect characteristic response data by using an adaptive threshold algorithm, thereby obtaining defect area segmentation data;
[0117] The embodiment of the present invention inputs the preliminary defect feature response data into the adaptive threshold algorithm module, and calculates the local optimal threshold according to the pixel intensity distribution of the response data. The specific method is to dynamically adjust the segmentation threshold of each area using the Otsu method or the local weighted mean algorithm to ensure that the details and boundaries of different areas are accurately segmented. After segmentation, defect area segmentation data is generated, which is represented in the form of a binary image, with the white area being the defect area and the black area being the background. This method is suitable for gasket surfaces with complex surface textures and significant defect brightness contrast differences.
[0118] Step S332: Processing the defect region segmentation data using a region growing algorithm to accurately extract the defect region and reconstruct its boundaries, thereby obtaining defect boundary reconstruction data;
[0119] In the embodiment of the present invention, the defect region segmentation data is input into the region growing algorithm module, and the central pixel of each segmented region is used as the seed point, and the region boundary is expanded by setting the similarity threshold. The specific operation includes calculating the grayscale difference of the pixels around the seed point and dynamically adjusting the expansion range to ensure the accuracy of the boundary. After the region growing is completed, the boundary is polynomially fitted to reconstruct the precise shape of the defect and generate defect boundary reconstruction data. This process is implemented using the OpenCV library in Python and can be adapted to the extraction of defect regions with complex edges or irregular shapes.
[0120] Step S333: spatially registering and mapping the front and back images of the extracted defect area according to the defect boundary reconstruction data, thereby obtaining initial defect mask data including the front detection image and the back detection image of the gasket;
[0121] The embodiment of the present invention inputs the defect boundary reconstruction data into the image registration module, and performs spatial registration on the front and back detection images through a method based on feature point matching. The specific method is to use the ORB (Oriented FAST and Rotated BRIEF) feature point extraction algorithm to identify key points, match them through FLANN (Fast Library for Approximate Nearest Neighbors), and calculate the affine transformation matrix for image mapping. After registration, the front and back images are superimposed to generate initial defect mask data to ensure that the position and shape of the defect area in the images on both sides are consistent. This method is suitable for scenes with high detection accuracy requirements.
[0122] Step S334: performing spatial connectivity analysis on the initial defect mask data, identifying and marking continuous defect areas, and extracting topological features of the defect areas, thereby obtaining topological feature data;
[0123] In the embodiment of the present invention, the initial defect mask data is input into the spatial connectivity analysis module, and the eight-neighborhood connectivity algorithm is used to mark all continuous defect areas. Topological feature extraction is performed on each connected area, including calculating its topological properties such as Euler number, number of boundaries, and hole distribution. Combined with the geometric shape characteristics of the area, the accuracy of feature extraction is further optimized to generate topological feature data. This step can be implemented through the bwconncomp function in MATLAB or the scipy.ndimage module in Python, which is suitable for detailed analysis of complex defect areas.
[0124] Step S335: performing probability-based enhancement processing on the defect mask according to the topological feature data, so as to obtain a defect mask enhanced image, wherein the defect mask enhanced image includes a gasket front surface detection image and a gasket back surface detection image.
[0125] The embodiment of the present invention inputs the topological feature data into the defect mask enhancement module, and calculates the confidence probability of each defect area according to the geometric and topological features of the area. The pixel weights of the mask area are dynamically adjusted using a probability-based enhancement method to enhance the contrast and boundary clarity of the defect area. The specific method includes applying a Gaussian weight distribution to each pixel to smooth the transition while retaining the sharp features of the boundary to generate a defect mask enhanced image. The final result includes the front and back inspection images of the gasket, which can significantly improve the visualization of the defect area and facilitate subsequent analysis and classification.
[0126] The method of the present invention accurately segments, reconstructs boundaries and enhances features of the gasket surface defect area through a series of refined image segmentation and feature enhancement steps, providing high-precision data support for subsequent detection and analysis. First, an adaptive threshold algorithm is used to dynamically determine the segmentation threshold according to the preliminary defect feature response data to generate defect area segmentation data. This process effectively overcomes the influence of image brightness and background complexity on segmentation accuracy and achieves accurate separation of defect areas. The regional growing algorithm is applied to the defect area segmentation data to accurately extract the defect area and reconstruct its boundary to generate defect boundary reconstruction data, which not only enhances the boundary clarity, but also retains the geometric structure of complex defects and ensures the integrity of defect feature information. Based on the defect boundary reconstruction data, spatial registration and mapping of the front and back images are performed to generate initial defect mask data containing the front and back detection images of the gasket. This step ensures the detection consistency of the front and back surfaces of the gasket surface through spatial calibration, laying the foundation for comprehensive analysis of gasket surface defects. Further spatial connectivity analysis is performed on the initial defect mask data to identify and mark continuous defect areas, and at the same time extract the topological feature data of these areas to describe the distribution, shape and connection characteristics of the defect areas in detail, providing support for accurate defect classification and further analysis. Based on the topological feature data, probability enhancement processing is performed on the defect mask to generate a defect mask enhanced image, which contains high-quality detection images of the front and back sides of the gasket. This enhancement process further optimizes the detail performance of the defect area and significantly improves the contrast and information content of the detection image, thereby ensuring the robustness and accuracy of subsequent analysis. The overall process innovatively combines adaptive threshold algorithm, region growing, spatial registration, connectivity analysis and probability enhancement processing, which not only achieves efficient and high-precision defect detection, but also provides a reliable basis for in-depth analysis and accurate classification of complex defects, significantly improving the intelligence and practicality of gasket surface detection.
[0127] Preferably, step S34 includes the following steps:
[0128] Step S341: performing a morphological opening operation with an adaptive structure element on the defect mask enhanced image to remove small area noise points and isolated pixels in the image, thereby obtaining a denoised defect image;
[0129] The embodiment of the present invention inputs the defect mask enhanced image into the morphological opening module, and selects an adaptive structural element for operation. The specific method is to dynamically adjust the size and shape of the structural element according to the size and shape of the defect area in the image. For example, when the defect area is elongated, an elliptical structural element is used; when the defect area is relatively regular, a circular structural element is used. The morphological opening operation is used to remove isolated noise points and small non-defective areas in the image to generate a denoised defect image. The operation is implemented through the cv2.morphologyEx function in OpenCV, which is suitable for detection scenarios where there is a complex texture background on the gasket surface.
[0130] Step S342: performing a closing operation on the denoised defect image to eliminate small holes and discontinuities inside the defect area, and connecting similar defect areas to obtain a defect area connected image;
[0131] The embodiment of the present invention inputs the denoised defect image into the morphological closing operation module, eliminates small holes and discontinuous areas inside the defect area by setting appropriate structural elements, and connects adjacent defect areas at the same time. The specific method is to select a circular structural element with a diameter of 5 pixels to ensure that small discontinuous areas can be closed without affecting the morphological integrity of large areas. The closing operation result generates a connected image of the defect area, which helps to improve the coherence and recognition accuracy of the defect area. The operation can be implemented through the imclose function in MATLAB or the cv2.morphologyEx function in OpenCV, which is suitable for detecting scenes with blurred boundaries or dense defect distribution.
[0132] Step S343: using the eight-connected domain labeling algorithm to perform connected region analysis on the defect region connection image, extracting and labeling the defect connected regions in the image, thereby obtaining defect connected region data;
[0133] In the embodiment of the present invention, the defect area connection image is input into the eight-connected domain labeling algorithm module, and each defect connected area is marked by using the eight-neighborhood connectivity rule by scanning all the pixels in the image. The specific operation is to assign a unique label value to each connected area, and count the number and position of pixels in each area. The generated defect connected area data includes the label matrix of the area and the coordinate list of the connected area. This process is implemented by the scipy.ndimage.label function in Python or the cv2.connectedComponents function in OpenCV, which is suitable for defect area analysis with complex topological features.
[0134] Step S344: Calculate the area, perimeter, shape factor, convex hull, and minimum circumscribed rectangle of each defect region of the defect connected region data, thereby obtaining regional geometric feature data;
[0135] The embodiment of the present invention performs geometric feature calculation on the defect connected area data, and calculates the area, perimeter, shape factor (4π area / perimeter2), convex hull area and aspect ratio of the minimum circumscribed rectangle of each defect area. The specific method includes: obtaining the area by pixel counting, calculating the perimeter by a boundary tracing algorithm, generating a convex hull area by a convex hull calculation method and extracting its area, and obtaining the aspect ratio of each area by a minimum circumscribed rectangle method. The result is stored as a regional geometric feature data matrix, and each column represents a characteristic parameter of a defect area. The operation can be implemented through OpenCV or scikit-image library, which is suitable for evaluating the shape and distribution characteristics of defect areas.
[0136] Step S345: performing area, shape and texture constraints on the defective region according to the preset defective region screening criteria and the regional geometric feature data, thereby generating a binary image of the defective region.
[0137] The embodiment of the present invention inputs the regional geometric feature data into the screening module, and performs constrained screening on the defective area according to the preset defect screening criteria (for example, the area is between 50 and 500 pixels, the shape factor is greater than 0.75, the texture uniformity is greater than 0.8, etc.). The specific method is to screen each defective area item by item, eliminate the areas that do not meet the standards, and only retain the defective areas that meet the screening conditions. The results are output in the form of a binary image, each retained defective area is displayed in white, and the background is black, and a binary image of the defective area is generated. This operation is suitable for scenarios where gasket defects are classified and refined for analysis, and can significantly improve the reliability and accuracy of detection.
[0138] The present invention effectively improves the accurate identification and classification of defective areas through a series of morphological processing, regional analysis and feature extraction, ensuring the efficiency and accuracy of gasket defect detection. The morphological opening operation of the adaptive structural element is used to remove small area noise points and isolated pixels in the image to obtain a noise-reduced defect image. This processing step effectively suppresses the interference of background noise and isolated pixels, and provides clearer image data for subsequent defective area extraction. Through closed operation processing, small holes and discontinuities inside the defective area are eliminated, and similar defective areas are connected to obtain a defective area connection image. This step connects the real defective area by filling the holes and breaks in the defective area, improves the integrity and accuracy of the defective area, and lays the foundation for accurate regional analysis. The eight-connected domain labeling algorithm is used to perform connected area analysis, extract and mark the defective connected areas in the image, and generate defective connected area data. Through the analysis of the connected areas, the spatial relationship between different defects can be identified and calibrated, and the scope and position of each defective area can be further confirmed, effectively reducing misjudgment and missed judgment. The defect connected area data is calculated to extract the geometric feature data such as the area, perimeter, shape factor, convex hull, minimum circumscribed rectangle, etc. of each defect area. This process enhances the accurate description of the defect morphology by quantifying the geometric features of the defect area, which helps to provide a reliable basis for the classification and screening of defects. According to the preset defect area screening criteria and regional geometric feature data, the area, shape and texture of the defect area are constrained to generate a binary image of the defect area. By strictly constraining the geometric and texture features of the defect area, the accuracy and stability of defect detection are further improved, and false detection due to image complexity or interference factors is avoided. Overall, these steps improve the accurate identification and screening capabilities of defect areas through progressive morphological processing, regional analysis and geometric feature extraction, ensure the accuracy and stability of gasket defect detection, and provide a solid foundation for subsequent defect classification and quality control.
[0139] Preferably, step S36 includes the following steps:
[0140] Step S361: using a pre-trained deep convolutional neural network to perform multi-classification training on the normalized feature data, and setting classification labels for multiple defect types including surface scratches, holes, burrs, and bubbles, thereby obtaining neural network classification result data;
[0141] The embodiment of the present invention inputs the defect feature data extracted and normalized in the early stage into a pre-trained deep convolutional neural network (such as ResNet50 or MobileNetV2) for multi-classification training. The training phase is based on a predefined defect category label set, including surface scratches, holes, burrs, bubbles and other types. By matching each feature data with the actual classification label, the cross entropy loss function is calculated to optimize the network parameters. The classification model uses the Adam optimizer, and the initial learning rate is set to 0.001. The learning rate is dynamically adjusted during the training process to avoid overfitting. After the training is completed, the model can output the corresponding classification results for the input normalized feature data, including category labels and confidence scores, and generate neural network classification result data, which is suitable for quickly identifying various gasket surface defects in industrial environments.
[0142] Step S362: performing defect classification accuracy screening based on confidence threshold on the neural network classification result data, thereby obtaining optimized classification result data;
[0143] The embodiment of the present invention performs confidence screening on the neural network classification result data, and uses the confidence threshold method to retain the classification results with high confidence. Specifically, the classification confidence threshold is set to 0.85, the defect classification results with confidence higher than the threshold are screened out, and the results with confidence lower than the threshold are marked as "unclassified" or "need further testing". In the screening process, the soft maximum (softmax) output is introduced as the confidence basis, the confidence of each type of defect is analyzed, the low confidence results that may cause misclassification are eliminated, and the optimized classification result data is generated. This process improves the reliability of classification and is suitable for scenarios with high requirements for classification accuracy in automated quality control systems.
[0144] Step S363: using a region growing algorithm to accurately calibrate the defect position at the pixel level on the optimized classification result data, thereby obtaining thermal mapping data of the defect position;
[0145] The embodiment of the present invention uses a region growing algorithm to perform pixel-level calibration on the defect position based on the optimized classification result data. The specific operation is to use the central pixel of the defect area in the classification result as the seed point, expand to the surrounding area according to the grayscale value or texture feature similarity conditions, and gradually calibrate the complete defect area. The expansion conditions include that the grayscale value difference is less than 20 or the texture correlation coefficient is greater than 0.9, ensuring that the calibration range accurately covers the defect boundary. The calibration result is output in the form of a thermal map. The brightness or color intensity in the thermal map indicates the severity and location distribution of the defect, and generates thermal mapping data of the defect location. This method is suitable for detecting large-area or unevenly distributed surface defects, and can provide accurate location information.
[0146] Step S364: Integrate the defect location thermal mapping data and the optimization classification result data to obtain gasket defect classification data.
[0147] The embodiment of the present invention integrates the defect location thermal mapping data with the optimization classification result data, and generates complete gasket defect classification data through the binding relationship between the mapping area and the classification label. The integration process includes appending the defect classification label corresponding to each thermal mapping area to the optimization result, and saving the classification and location information in a matrix or JSON format. The final data output includes the precise location, area, classification label and related confidence score of each type of defect, which can support subsequent quality analysis and production process optimization. The integrated data is suitable for real-time defect monitoring and control of the production line, and provides a detailed basis for further defect statistical analysis.
[0148] The present invention uses a pre-trained deep convolutional neural network to perform multi-classification training on the normalized feature data, and sets classification labels for multiple defect types, thereby obtaining neural network classification result data. By applying deep learning technology, especially convolutional neural network (CNN), it is possible to process complex image features and match them with preset defect types (such as surface scratches, holes, burrs, and bubbles, etc.). CNN can automatically extract and learn high-order features in the image, thereby achieving accurate classification of different defect types, providing a solid foundation for subsequent defect identification. The neural network classification result data is subjected to defect classification accuracy based on confidence threshold screening, thereby obtaining optimized classification result data. This step filters out those results with low classification accuracy by setting a confidence threshold, thereby improving the accuracy of the overall classification. This not only reduces the probability of misclassification, but also ensures that the model can focus on those defect types with high classification confidence, thereby improving the reliability of the classification results. The optimized classification result data is precisely calibrated at the pixel level of the defect position using the region growing algorithm, thereby obtaining defect position thermal mapping data. The region growing algorithm further improves the positioning accuracy of the defect by accurately calibrating the boundary and position of the defect area by expanding the area from the initial seed point. This process supports pixel-level calibration of defects, making subsequent inspection results more refined and more accurately reflecting the specific location of defects in the image. The defect location thermal mapping data and optimized classification result data are integrated to obtain gasket defect classification data. By integrating thermal mapping data and optimized classification results, a comprehensive defect classification data is finally generated, which can simultaneously display defect type and location and provide complete defect information. This process ensures the comprehensiveness and accuracy of defect detection and provides a detailed reference for subsequent quality control and production optimization.
[0149] Preferably, step S4 comprises the following steps:
[0150] Step S41: performing multi-angle imaging processing on the defect area according to the defect mask enhanced image, so as to obtain multi-view defect image data;
[0151] The embodiment of the present invention performs multi-angle imaging processing on the defect area according to the defect mask enhancement image, and uses a rotating platform or a multi-view camera array to perform a comprehensive scan of the gasket to be inspected. In this process, at least three different angles (for example, 0°, 45° and 90°) are selected to shoot the gasket surface to ensure that different characteristics of the defect can be obtained at different angles. When shooting at each angle, a high-resolution camera (such as 5MP or above) is used in combination with a ring light source to ensure the clarity and uniformity of the image and avoid the influence of reflections and shadows on the image quality. Through image stitching technology, combined with the calibration data of the camera, the images of each angle are seamlessly connected to generate complete multi-view defect image data. This method is suitable for surface defect detection of gaskets with complex shapes, and can reveal defects that are difficult to see from a single perspective through different perspectives.
[0152] Step S42: performing signal-to-noise ratio optimization analysis on the multi-view defect image data, and integrating feature information of the multi-view defect images through an image depth fusion algorithm, thereby generating defect area depth fusion data;
[0153] The embodiment of the present invention performs signal-to-noise ratio optimization analysis on multi-view defect image data. First, the signal-to-noise ratio (SNR) of each image is calculated, and the image quality is sorted according to the signal-to-noise ratio value. A denoising algorithm (such as a Wiener filter or a wavelet transform) is applied to images with a low signal-to-noise ratio to reduce noise interference. Subsequently, the image feature information from multiple perspectives is integrated using an image deep fusion algorithm (such as feature-level fusion based on a convolutional neural network). Specifically, the key features of each image, such as edge, texture, and shape information, are first extracted, and then multi-channel feature fusion is performed through a deep learning model (such as U-Net or VGG) to generate a deep fusion image with a higher signal-to-noise ratio and richer information. This process optimizes the information fusion effect from different perspectives and is suitable for improving the detection accuracy and robustness of small-size defects.
[0154] Step S43: Perform product qualification judgment on the gasket to be inspected according to the defect area depth fusion data and the gasket defect classification data and the preset gasket quality standard, so as to obtain gasket inspection judgment result data.
[0155] The embodiment of the present invention determines the product qualification by comparing the deep fusion data of the defect area with the gasket defect classification data with the preset gasket quality standard. First, the deep fusion defect image is input into the preset quality standard judgment model, which determines whether the gasket meets the quality requirements based on the severity and size standard of each defect type. For example, if the defect area exceeds the preset maximum allowable value (such as 1cm2 ), it is judged as unqualified. Combined with the preset gasket quality standards (such as ISO 9001, GB / T standards), the product judgment is performed through the threshold judgment method to obtain the qualified or unqualified results of each detected gasket. The final output is the test judgment result data, including the qualified or unqualified label and related defect information (such as location, category and size). This method is widely used in automated quality control systems and is suitable for rapid screening of qualified products in mass production processes.
[0156] The present invention can obtain more image information from different directions and perspectives by performing multi-angle imaging on the defect area, which helps to comprehensively analyze the defects from multiple dimensions. Multi-angle image data can effectively capture the defect details that may be missed by single-angle imaging, thereby enhancing the comprehensiveness of the detection. Defect images obtained at multiple perspectives usually contain noise and redundant information to varying degrees. Through signal-to-noise ratio optimization analysis, unnecessary noise can be removed and the image quality can be improved. Afterwards, the image deep fusion algorithm effectively integrates the image feature information from multiple perspectives to ensure that the important features extracted from each perspective are uniformly displayed and enhanced. This process makes the defect information clearer and further improves the accuracy of detection. Based on the deeply fused defect image data and classification results, the product qualification is determined in combination with the quality standards of the gasket to ensure a comprehensive evaluation of each gasket. This process not only ensures the high accuracy of the detection, but also ensures that only products that meet the standards are judged as qualified by comparison with the quality standards, thereby avoiding unqualified products from entering the market.
[0157] The present invention also provides an automatic optical detection system based on gasket surface defects, which is used to perform the above-mentioned automatic optical detection method based on gasket surface defects. The automatic optical detection system based on gasket surface defects includes:
[0158] The parameter extraction and calibration module is used to extract parameters of the gasket to be tested, obtain the inner and outer diameters, thickness and tolerance range information of the gasket, and obtain the gasket structure parameter data; match, calibrate and store the gasket structure parameter data according to the preset component parameter library to obtain the gasket component parameter library;
[0159] The image acquisition and enhancement module is used to use a visual sensor to scan the surface of the gasket to be inspected to generate raw image data; perform multi-channel optical imaging processing on the raw image data, and use high dynamic range technology to compensate for uneven illumination to obtain enhanced surface image data; perform image preprocessing on the enhanced surface image data to obtain gasket surface inspection image data;
[0160] The defect recognition and classification module is used to perform defect mask recognition on the gasket surface inspection image data based on multi-scale Top-Hat transformation and Hessian matrix eigenvalues to obtain a defect mask enhanced image, wherein the defect mask enhanced image includes a gasket front inspection image and a gasket back inspection image; perform morphological processing on the defect mask enhanced image, extract defect areas, and generate defect feature vector data; perform defect classification processing on the defect feature vector data based on a convolutional neural network, and perform regional positioning to obtain gasket defect classification data;
[0161] The quality judgment module is used to perform multi-angle imaging processing on the defect area according to the defect mask enhanced image, and perform signal-to-noise ratio optimization analysis to obtain deep fusion data of the defect area; perform qualification judgment based on the deep fusion data of the defect area and the gasket defect classification data and the preset gasket quality standard to obtain gasket detection judgment result data;
[0162] The sorting and traceability module is used to sort products according to the gasket detection and judgment result data, and put unqualified products into the NG channel and qualified products into the OK channel to obtain product sorting data; the gasket defect classification data and product sorting data are stored in the gasket component parameter library to realize the traceability of the detection and judgment results.
[0163] The present invention significantly improves the detection accuracy and quality control efficiency of gaskets through a series of precise modular operations. First, the parameter extraction and calibration module accurately extracts the inner and outer diameters, thickness and tolerance range information of the gasket, and ensures the accuracy of the gasket structural parameters through matching and calibration with the preset component parameter library, providing reliable benchmark data for subsequent detection. Then, the image acquisition and enhancement module scans the gasket surface through a visual sensor to obtain high-quality original images, and effectively compensates for uneven illumination through multi-channel optical imaging and high dynamic range technology, improves the detail performance of the image, ensures the high quality and high contrast of the image data, and helps to accurately detect. Subsequently, the defect recognition and classification module uses advanced image processing technology, including multi-scale Top-Hat transformation and Hessian matrix eigenvalue calculation, to extract defect features, and classifies and locates defects through convolutional neural networks, ensuring accurate identification and analysis of different defect types, and providing a solid foundation for subsequent quality assessment. On this basis, the quality judgment module uses multi-angle imaging and signal-to-noise ratio optimization technology to deeply fuse and comprehensively analyze the defect area, further improving the accuracy of defect detection, and ensuring the qualification of the product by comparing with the gasket quality standard. Finally, the sorting and traceability module sorts products according to the test results and isolates unqualified products, thereby improving the efficiency of the production line and the accuracy of product quality control. At the same time, the test and classification results are stored in the gasket component parameter library, realizing the product traceability function, which is helpful for subsequent quality tracing and problem analysis. Overall, these steps form a closed-loop quality control system, which effectively improves production efficiency, product quality and reduces human errors, and realizes intelligent and automated gasket defect detection and quality control.
[0164] Therefore, the embodiments should be regarded as illustrative and non-restrictive from all points, and the scope of the present invention is limited by the appended claims rather than the above description, and it is therefore intended that all changes falling within the meaning and range of equivalent elements of the application documents are included in the present invention.
[0165] The above description is only a specific embodiment of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but should conform to the widest scope consistent with the principles and novel features invented herein.
Claims
1. An automatic optical detection method based on gasket surface defects, characterized in that: The following steps are involved: Step S1: extracting parameters of the gasket to be inspected, obtaining the inner and outer diameters, thickness and tolerance range information of the gasket, and obtaining the gasket structural parameter data; Match, calibrate and store the gasket structure parameter data according to the preset component parameter library to obtain the gasket component parameter library; Step S2: Scan the surface of the gasket to be inspected using a visual sensor to generate raw image data; perform multi-channel optical imaging processing on the raw image data, and use high dynamic range technology to compensate for uneven illumination to obtain enhanced surface image data; Performing image preprocessing on the enhanced surface image data to obtain gasket surface detection image data; Step S3: performing defect mask recognition based on multi-scale Top-Hat transformation and Hessian matrix eigenvalues on the gasket surface inspection image data to obtain a defect mask enhanced image, wherein the defect mask enhanced image includes a gasket front inspection image and a gasket back inspection image; Perform morphological processing on the defect mask enhanced image, extract the defect area, and generate defect feature vector data; The defect feature vector data is processed by defect classification based on convolutional neural network, and the area is located to obtain gasket defect classification data; Step S4: performing multi-angle imaging processing on the defect area according to the defect mask enhanced image, and performing signal-to-noise ratio optimization analysis to obtain deep fusion data of the defect area; The gasket inspection result data is obtained by performing qualification judgment based on the deep fusion data of the defect area, the gasket defect classification data and the preset gasket quality standard; Step S5: sort products according to the gasket detection result data, put unqualified products into the NG channel, and store qualified products in the OK channel to obtain product sorting data; store the gasket defect classification data and product sorting data into the gasket component parameter library to achieve traceability of the detection and judgment results.
2. The automatic optical detection method based on gasket surface defects according to claim 1 is characterized in that: Step S1 includes the following steps: Step S11: measuring the inner diameter, outer diameter, thickness, roundness and surface flatness of the gasket to be inspected, thereby obtaining original geometric measurement data; Step S12: performing dimensional tolerance analysis on the original geometric measurement data to obtain standardized geometric parameter data; Step S13: performing material attribute recognition on the standardized geometric parameter data to obtain material attribute recognition data; Step S14: merging the standardized geometric parameter data and the material property identification data into gasket structure parameter data; Step S15: Match, calibrate and store the gasket structure parameter data according to the preset component parameter library to obtain the gasket component parameter library.
3. The automatic optical detection method based on gasket surface defects according to claim 2 is characterized in that: Step S2 includes the following steps: Step S21: Scan the surface of the gasket to be inspected using a visual sensor to obtain original image data under different angles and lighting conditions; Step S22: performing multi-channel optical imaging processing on the original image data to obtain a multi-channel fused image, wherein the multi-channel optical imaging processing includes image fusion of RGB, grayscale, and infrared channels; Step S23: using high dynamic range technology to perform illumination non-uniformity compensation processing on the multi-channel fused image based on dynamic adjustment of image brightness and contrast, thereby obtaining enhanced surface image data; Step S24: performing image denoising and grayscale equalization on the enhanced surface image data, thereby obtaining image preprocessing data; Step S25: extracting gasket surface feature information from the image preprocessing data, thereby generating gasket surface detection image data.
4. The automatic optical detection method based on gasket surface defects according to claim 3 is characterized in that: Step S22 includes the following steps: Step S221: performing channel separation processing on the original image data to extract image feature data of RGB, grayscale, and infrared spectrum channels respectively; Step S222: performing image enhancement preprocessing including contrast adjustment, edge sharpening and noise suppression on the separated image feature data, thereby obtaining enhanced image feature data; Step S223: performing multi-channel image feature matching based on accurate registration and spatial calibration of images of different spectral channels according to the enhanced image feature data, thereby obtaining feature matching result data; Step S224: Based on the feature matching result data, weighted information fusion based on complementary feature information of different channels is performed on the image feature data to obtain a multi-channel fused image.
5. The automatic optical detection method based on gasket surface defects according to claim 4 is characterized in that: Step S3 includes the following steps: Step S31: performing multi-scale Top-Hat transformation preprocessing on the gasket surface detection image data to extract background and detail information in the image, thereby obtaining scale-enhanced image data; Step S32: Calculate the Hessian matrix eigenvalues of the scale-enhanced image data, and perform feature enhancement and non-maximum suppression processing on the eigenvalues, so as to obtain preliminary defect feature response data; Step S33: generating a defect mask according to the preliminary defect feature response data, and performing adaptive threshold segmentation on the defect mask, thereby obtaining a defect mask enhanced image, wherein the defect mask enhanced image includes a gasket front surface detection image and a gasket back surface detection image; Step S34: performing morphological opening and closing operations on the defect mask enhanced image, and extracting connected defect regions, thereby generating defect region binary image data; Step S35: extracting defect feature vectors including area, perimeter, shape factor, texture features and geometric features according to the binary image data of the defect area, thereby obtaining defect feature vector data; Step S36: Use the pre-trained convolutional neural network to perform multi-classification processing on the defect feature vector data, identify the defect type, and locate the defect area to obtain gasket defect classification data.
6. The automatic optical detection method based on gasket surface defects according to claim 5 is characterized in that: Step S33 includes the following steps: Step S331: determining the segmentation threshold of the defect area according to the preliminary defect characteristic response data by using an adaptive threshold algorithm, thereby obtaining defect area segmentation data; Step S332: Processing the defect region segmentation data using a region growing algorithm to accurately extract the defect region and reconstruct its boundaries, thereby obtaining defect boundary reconstruction data; Step S333: spatially registering and mapping the front and back images of the extracted defect area according to the defect boundary reconstruction data, thereby obtaining initial defect mask data including the front detection image and the back detection image of the gasket; Step S334: performing spatial connectivity analysis on the initial defect mask data, identifying and marking continuous defect areas, and extracting topological features of the defect areas, thereby obtaining topological feature data; Step S335: performing probability-based enhancement processing on the defect mask according to the topological feature data, so as to obtain a defect mask enhanced image, wherein the defect mask enhanced image includes a gasket front surface detection image and a gasket back surface detection image.
7. The automatic optical detection method based on gasket surface defects according to claim 6 is characterized in that: Step S34 includes the following steps: Step S341: performing a morphological opening operation with an adaptive structure element on the defect mask enhanced image to remove small area noise points and isolated pixels in the image, thereby obtaining a denoised defect image; Step S342: performing a closing operation on the denoised defect image to eliminate small holes and discontinuities inside the defect area, and connecting similar defect areas to obtain a defect area connected image; Step S343: using the eight-connected domain labeling algorithm to perform connected region analysis on the defect region connection image, extracting and labeling the defect connected regions in the image, thereby obtaining defect connected region data; Step S344: Calculate the area, perimeter, shape factor, convex hull, and minimum circumscribed rectangle of each defect region of the defect connected region data, thereby obtaining regional geometric feature data; Step S345: performing area, shape and texture constraints on the defective region according to the preset defective region screening criteria and the regional geometric feature data, thereby generating a binary image of the defective region.
8. The automatic optical detection method based on gasket surface defects according to claim 7 is characterized in that: Step S36 includes the following steps: Step S361: using a pre-trained deep convolutional neural network to perform multi-classification training on the normalized feature data, and setting classification labels for multiple defect types including surface scratches, holes, burrs, and bubbles, thereby obtaining neural network classification result data; Step S362: performing defect classification accuracy screening based on confidence threshold on the neural network classification result data, thereby obtaining optimized classification result data; Step S363: using a region growing algorithm to accurately calibrate the defect position at the pixel level on the optimized classification result data, thereby obtaining thermal mapping data of the defect position; Step S364: Integrate the defect location thermal mapping data and the optimization classification result data to obtain gasket defect classification data.
9. The automatic optical detection method based on gasket surface defects according to claim 8, characterized in that: Step S4 includes the following steps: Step S41: performing multi-angle imaging processing on the defect area according to the defect mask enhanced image, so as to obtain multi-view defect image data; Step S42: performing signal-to-noise ratio optimization analysis on the multi-view defect image data, and integrating feature information of the multi-view defect images through an image depth fusion algorithm, thereby generating defect area depth fusion data; Step S43: Perform product qualification judgment on the gasket to be inspected according to the defect area depth fusion data and the gasket defect classification data and the preset gasket quality standard, so as to obtain gasket inspection judgment result data.
10. An automatic optical inspection system for gasket surface defects, characterized in that: Used to perform the gasket surface defect automatic optical detection method according to claim 1, the gasket surface defect automatic optical detection system comprises: The parameter extraction and calibration module is used to extract parameters of the gasket to be tested, obtain the inner and outer diameters, thickness and tolerance range information of the gasket, and obtain the gasket structure parameter data; match, calibrate and store the gasket structure parameter data according to the preset component parameter library to obtain the gasket component parameter library; The image acquisition and enhancement module is used to use a visual sensor to scan the surface of the gasket to be inspected to generate raw image data; perform multi-channel optical imaging processing on the raw image data, and use high dynamic range technology to compensate for uneven illumination to obtain enhanced surface image data; perform image preprocessing on the enhanced surface image data to obtain gasket surface inspection image data; The defect recognition and classification module is used to perform defect mask recognition on the gasket surface inspection image data based on multi-scale Top-Hat transformation and Hessian matrix eigenvalues to obtain a defect mask enhanced image, wherein the defect mask enhanced image includes a gasket front inspection image and a gasket back inspection image; perform morphological processing on the defect mask enhanced image, extract defect areas, and generate defect feature vector data; perform defect classification processing on the defect feature vector data based on a convolutional neural network, and perform regional positioning to obtain gasket defect classification data; The quality judgment module is used to perform multi-angle imaging processing on the defect area according to the defect mask enhanced image, and perform signal-to-noise ratio optimization analysis to obtain deep fusion data of the defect area; perform qualification judgment based on the deep fusion data of the defect area and the gasket defect classification data and the preset gasket quality standard to obtain gasket detection judgment result data; The sorting and traceability module is used to sort products according to the gasket detection and judgment result data, and put unqualified products into the NG channel and qualified products into the OK channel to obtain product sorting data; the gasket defect classification data and product sorting data are stored in the gasket component parameter library to realize the traceability of the detection and judgment results.
Citation Information
Patent Citations
Polyethylene pipeline hot-melt welding joint detection apparatus
CN110726384A
Copper strip surface defect detection method and system based on machine vision
CN112304958A
Cited By
On-line detection method and system for coating quality of automobile skylight glass
CN119915841A
Pipeline magnetic flux leakage signal metal loss detection method based on weak labeling
CN120375374A
Metal loss detection method of pipeline magnetic leakage signal based on weak annotation
CN120375374B
Wallpaper surface defect detection method
CN120407826A
Printing defect detection method and system based on computer vision
CN120411060A