A foamed silicone rubber surface detection method based on image visual recognition
By employing an image-based visual recognition method, utilizing polarization filters and grayscale statistical techniques to adaptively shield against high-light interference, and combining this with a region growing algorithm, we have achieved efficient and accurate defect detection on the surface of foamed silicone rubber. This solves the problems of high light reflection and micropore identification in existing technologies, adapts to different lighting conditions, and generates accurate quality inspection reports.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG LEXUS NEW ENERGY TECH CO LTD
- Filing Date
- 2025-07-07
- Publication Date
- 2026-05-15
AI Technical Summary
Existing methods for detecting the surface of foamed silicone rubber are not effective in identifying defects such as high light reflection, uneven color, and micropores. Furthermore, they are computationally complex and cannot meet the requirements for real-time performance and adaptability to industrial environments.
A method based on image visual recognition is adopted, which uses a polarization filter to eliminate specular interference, combines local grayscale statistics and region growing algorithms to adaptively extract abnormal color blocks and microbubbles, generates a diffuse reflection mask through polarization difference, performs grayscale correction and meshing processing, and generates the final defect localization mask by combining an eight-neighborhood region growing algorithm.
It effectively shields against high-light interference, improves the accuracy and robustness of detection, reduces computational complexity, adapts to different lighting conditions, enhances the real-time performance and versatility of detection, and ensures accurate defect location and quantitative reporting.
Smart Images

Figure CN120894286B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of foamed silicone rubber surface inspection technology, specifically a foamed silicone rubber surface inspection method based on image visual recognition. Background Technology
[0002] Foamed silicone rubber is an important material widely used in industrial applications such as sealing, cushioning, and heat insulation. Its surface quality directly affects the performance and service life of products. In the existing production and inspection processes, manual visual inspection or simple brightness and color comparison inspection methods are mainly used. These methods are easily affected by the subjective judgment of the inspectors and changes in the lighting environment, resulting in low inspection efficiency and low accuracy. In particular, when faced with complex defects such as high surface reflection, uneven color, and localized micropores, traditional inspection methods often cannot effectively identify them. Automatic inspection technology for defects such as pores and abnormal color patches still has many shortcomings.
[0003] Existing image processing-based detection methods often rely on traditional threshold segmentation and template matching algorithms. These methods are highly sensitive to illumination uniformity and image reflection interference. For highlight areas, existing technologies often cannot effectively mask them, leading to false detections. In addition, for the detection of color unevenness and micropores, existing technologies often use empirical thresholds or training-based deep learning algorithms. However, these methods rely on a large number of pre-trained samples, have poor versatility, and are computationally complex, making it difficult to meet the requirements of real-time performance and industrial environment adaptability.
[0004] For foamed silicone rubber, a material with complex surface reflections and inconspicuous local defects, existing detection methods cannot simultaneously address the issues of high-light interference, color anomaly identification, and accurate extraction of microbubbles and pores. Therefore, this paper proposes an image-based visual recognition-based method for detecting the surface of foamed silicone rubber. This method can eliminate high-light interference in real time using a polarizing filter, and adaptively extract abnormal color patches and microbubbles by combining local grayscale statistics and region growing algorithms. It possesses good real-time performance, versatility, and detection accuracy, and can effectively solve the shortcomings of existing detection technologies in terms of reflection interference, complex defect identification, and real-time quality inspection. Summary of the Invention
[0005] This invention provides a method for detecting the surface of foamed silicone rubber based on image visual recognition, which helps to solve the problems mentioned in the background art.
[0006] This invention provides the following technical solution: a method for detecting the surface of foamed silicone rubber based on image visual recognition, comprising:
[0007] An industrial camera was used to acquire RGB color images of the surface of the foamed silicone rubber being tested, and the color images were converted into grayscale images.
[0008] Perform linear normalization on the grayscale image to output the illumination-corrected grayscale image. ;
[0009] Images of the foamed silicone rubber surface were repeatedly acquired at the same location by mounting horizontal and vertical polarizing filters on an industrial camera. The acquired images were then sequentially converted to grayscale and linearly normalized, resulting in two corrected grayscale images. , ;
[0010] Calculate the polarization difference and use its global statistics to generate a diffuse reflection effective region mask. ;
[0011] exist Statistical correction grayscale image within the region global mean with standard deviation ;
[0012] Grayscale correction image Mesh processing is performed to detect local grayscale deviations, identify abnormal color block regions, and generate abnormal color block masks. ;
[0013] In the region and The grayscale value is at its minimum in the =0 region. As a seed threshold, the initial seed point set is extracted;
[0014] For each seed point, perform eight-neighborhood region growth, with the growth condition being that the gray-level difference is less than a preset threshold. It also removes connected regions with an area smaller than the predetermined number of pixels to generate a pore / microbubble mask. ;
[0015] The three types of masks are combined to obtain the final defect localization mask. ;
[0016] according to The area and quantity of defective areas are statistically analyzed to generate a quality inspection report.
[0017] Optionally, the step of using an industrial camera to acquire RGB color images of the surface of the foamed silicone rubber under test and converting the color images into grayscale images includes:
[0018] The acquired RGB color images are converted to grayscale using the following formula:
[0019]
[0020] in: , , Represents the three-channel pixel values of a color image, range ; This represents the pixel value after grayscale conversion;
[0021] The grayscale image is linearly normalized to output a grayscale image after illumination correction. ,include:
[0022] Iterate through the pixel values of each pixel in the grayscale image, and filter out the maximum and minimum values, denoted as _____. , ;
[0023] The grayscale image is linearly normalized using the following formula:
[0024]
[0025] Where: 255 represents the maximum grayscale value; This represents the pixel values of the grayscale image after illumination normalization, ranging from... .
[0026] Optionally, the polarization difference is calculated, and a diffuse reflection effective region mask is generated using its global statistics. ,include:
[0027] Calculate polarization difference:
[0028]
[0029] in: , These represent the corrected grayscale images under horizontal and vertical polarization, respectively. Indicates the polarization difference value; This indicates the absolute value;
[0030] Calculate the global mean :
[0031]
[0032] Calculate the global standard deviation :
[0033]
[0034] in: Representing the difference plot The total number of all pixels;
[0035] Generate a diffuse reflection effective area mask based on the mean and standard deviation of the entire image:
[0036]
[0037] in: This represents the effective area mask for diffuse reflection; 1 indicates the reserved area, and 0 indicates the shielded area.
[0038] Optionally, the above in Statistical correction grayscale image within the region global mean with standard deviation ,include:
[0039] Calculate the global mean :
[0040]
[0041] Calculate the global standard deviation :
[0042]
[0043] in: express The total number of pixels within the area; This means only for those that satisfy Statistical calculations are performed on the pixels.
[0044] Optionally, the grayscale correction image Mesh processing is performed to detect local grayscale deviations, identify abnormal color block regions, and generate abnormal color block masks. ,include:
[0045] Divide the image into A grid, where each sub-block is denoted as ;
[0046] Calculate the average gray level for each sub-block :
[0047]
[0048] in: Indicates that the sub-block satisfies The number of pixels; This indicates summing of pixels within a sub-block that have a mask value of 1;
[0049] Calculate the grayscale difference between adjacent sub-blocks :
[0050]
[0051] in: , This indicates two adjacent sub-blocks; This indicates the absolute value;
[0052] Calculate the mean of the grayscale difference between adjacent sub-blocks worldwide. with standard deviation :
[0053]
[0054]
[0055] in: This represents the total number of all adjacent sub-block pairs;
[0056] Set the threshold for determining whether a sub-block's color is abnormal. ;
[0057] Perform sub-block level anomaly detection:
[0058]
[0059] Where 1 represents a sub-block A color block is identified as abnormal; 0 indicates normal. It indicates logical "existence";
[0060] Map sub-block level anomalies back to the pixel level to generate anomaly color block masks. Specifically:
[0061] For each sub-block :like Then all pixels within that sub-block The pixel-level mask is set to 1 if it is not set to 0 otherwise.
[0062] Optionally, the region and The grayscale value is at its minimum in the =0 region. As a seed threshold, an initial set of seed points is extracted, including:
[0063] Get grayscale image global mean with standard deviation ;
[0064] Seed point set for detecting grayscale minimum values:
[0065]
[0066] in: This represents the seed threshold for the minimum value.
[0067] Optionally, the eight-neighborhood region growing is performed on each seed point, with the growing condition being that the gray-level difference is less than a preset threshold. It also removes connected regions with an area smaller than the predetermined number of pixels to generate a pore / microbubble mask. ,include:
[0068] Set a connectivity grayscale difference threshold to determine whether a connection is connected. ;
[0069] Create an access marker matrix for each pixel Initially, all values are 0;
[0070] Create a collection to store all connected components. Initially, it is an empty set;
[0071] For each Perform region growth:
[0072] like If so, skip it;
[0073] Otherwise, create a new current region. , and mark ;
[0074] Initialize the growth queue ;
[0075] S1, when If the array is not empty, take the first element from it and denote it as . and remove it from the queue Delete;
[0076] S2, for Iterate through its eight neighborhood pixels in sequence:
[0077]
[0078] S3, For each neighboring point If the neighboring points are satisfied Located within the image, neighboring points Corresponding tag matrix , , , Then Join the current region , and mark and will Joining the team ;
[0079] in: Indicates will Join In, and update the set , This indicates that the result on the right is updated to the current set. , The union operation represents the set operation; This indicates the pixels that currently meet the growth conditions. Add to queue middle, This indicates that a new element is added to the end of the queue;
[0080] Repeat steps S1-S3 until the queue is reached. Clear the elements in the set and output the set. As a connected region;
[0081] Set a threshold for detecting noise. ;
[0082] Get Collection The number of elements in the middle, if the number is less than Then the set If it is determined to be noise, it will be discarded; otherwise, it will be aggregated. join in ;
[0083] Generate pore / microbubble mask :
[0084]
[0085] in: Indicates determining the current pixel Does it belong to all reserved connected regions? any region Setting it to 1 indicates that the current pixel belongs to the detected defect area, while setting it to 0 indicates that the current pixel belongs to the non-defect area.
[0086] Optionally, the three types of masks are combined to obtain the final defect localization mask. ,include:
[0087] The three types of masks are combined according to the following formula to obtain the final defect localization mask:
[0088]
[0089] in: This indicates a logical AND operation. This indicates a logical OR.
[0090] Optionally, the basis The report analyzes the area and quantity of defective areas, generates a quality inspection report, and includes:
[0091] statistics The number of connected regions present in the foam is used as the number of defective regions in the currently detected foamed silicone rubber;
[0092] Obtain the area of each pixel in the image, and denote it as the area of a single pixel;
[0093] For each defective region, count the number of pixels present in it, and multiply the number by the area of a single pixel to obtain the area of the defective region;
[0094] Add up the areas of all defective regions to obtain the total area of defective regions in the foamed silicone rubber currently being inspected;
[0095] The number of defective areas and the total area of the defective areas in the foamed silicone rubber currently being tested will be used as the quality inspection report for the foamed silicone rubber currently being tested.
[0096] The present invention has the following beneficial effects:
[0097] 1. Diffuse reflection mask generated by statistical thresholding based on polarization difference This masking strategy ensures complete detection within the diffuse reflection area while effectively eliminating specular reflection and specular interference. It is deeply coupled with subsequent sub-algorithms, with all chromatic aberration and porosity detection occurring only within the target area. Regional execution significantly reduces the overall computational load; simultaneously, by masking specular highlights, color difference detection based on stable diffuse reflection signals for grayscale mesh statistics is more accurate, and the region growing algorithm is not misled by specular edges when extracting connected regions in clear diffuse reflection areas; compared to directly using edge detection or brightness thresholding methods on the entire image, this step gives the system higher anti-interference and robustness; in addition, this mask can be dynamically updated to adapt to different lighting angles and surface gloss levels, greatly improving the versatility of the solution;
[0098] 2. The acquired RGB color images are combined into grayscale images according to preset coefficients, which not only significantly reduces the complexity of subsequent calculations, but also removes redundant information between different color channels while preserving the surface texture features of the target. Since surface defects of foamed silicone rubber (such as micropores and color differences) are more intuitive and stable in grayscale images, grayscale processing can balance brightness sensitivity and contrast enhancement without losing detail contrast. Compared with direct channel-by-channel detection in the RGB space, grayscale only requires thresholding and statistical analysis of single-channel pixel values, which significantly improves processing speed and reduces memory and bandwidth usage. At the same time, this method does not rely on complex color calibration or multi-channel fusion algorithms, has lower requirements for the channel response consistency of industrial cameras, and simplifies the calibration process of the front-end system.
[0099] 3. By traversing the grayscale image to obtain the maximum and minimum grayscale values and linearly mapping them to the full dynamic range, this step can adaptively eliminate the brightness shift caused by uneven lighting and environmental interference. In industrial settings, the position, intensity, and reflective characteristics of the light source may change at any time, and traditional fixed threshold segmentation is easily affected by overall brightness deviation. The linear normalization scheme uses the current image's own extreme value as a parameter, without the need for a preset standard whiteboard or manual calibration, and adjusts the overall grayscale distribution in real time, so that the background grayscale, shadow level, and highlight distribution of each image can be mapped to a fixed range of [0, 255]. The normalized image has a consistent grayscale benchmark for subsequent polarization difference, region growing, and other algorithms, avoiding the complexity of multiple thresholds or dynamic threshold adjustments for a single image, ensuring the stability of subsequent algorithms under various lighting conditions, and effectively reducing misjudgments and missed detections.
[0100] 4. By assembling horizontal and vertical polarizing filters and taking images sequentially, a diffuse reflection effective area mask is generated using the grayscale difference between the two images, significantly reducing the interference of specular highlight artifacts on defect extraction; local specular reflection often appears on the surface of foamed silicone rubber, especially under high temperature or humid conditions, and under normal lighting, highlight areas are easily misjudged as color difference or voids; polarization imaging technology can distinguish between diffuse and specular reflection components through the difference formula. This method directly suppresses specular components co-occurring in two polarization images, retaining only diffuse reflection components. It requires no complex specular models or adaptive filters, achieving specular masking through a simple pixel-level subtraction and statistical thresholding. The resulting diffuse reflection mask... It can efficiently cover various highlight areas and integrate with grayscale images. Orthogonal combination significantly reduces the false detection rate in subsequent color difference detection and region growth processes; at the same time, polarization suppression operation has low hardware requirements and can be directly implemented using simple polarizers or beam splitters, thereby enabling rapid deployment on the production line and improving the overall solution's detection rate and positioning accuracy for high-reflectivity surface defects.
[0101] 5. Apply a global mean to the corrected grayscale image within the effective diffuse reflection region. with standard deviation The statistics provide accurate distribution parameters for subsequent extraction of minimum seed points and gridded color difference detection. Traditional local or empirical thresholds often fail to simultaneously take into account the grayscale differences of different batches and products with different processes. However, the adaptive threshold based on the internal statistics of the image can be dynamically set according to the actual image distribution, ensuring that the detection algorithm can maintain high stability under different background grayscale and different material formulations. This eliminates the dependence on external calibration or manual threshold setting, and improves the ease of use and reliability of the system.
[0102] 6. Arrange the diffuse image according to... The system divides the area into grids, calculates the average gray level for each region, compares adjacent regions, and then calculates the global mean of the gray level differences. with standard deviation This method is used to identify local color difference anomalies. It can suppress noise interference while maintaining local sensitivity. Unlike pixel-level threshold segmentation, which is affected by isolated pixel anomalies, this gridded detection aggregates the statistics of multiple pixels, making it more robust to real defects. The gridded design can also adaptively adjust the block size according to the product size and resolution, so as to achieve the optimal balance between detection accuracy and computational efficiency. It has a significant detection effect on problems such as local contamination, color spots, and surface stickiness.
[0103] 7. After color difference determination is completed at the sub-block level, abnormal sub-blocks are marked and mapped to pixel-level masks, which helps to refine the coarse-grained detection results to the pixel level. This mapping is simple and efficient, and can be completed with a single sub-block scan and pixel assignment, avoiding the computational overhead of secondary thresholding or deep learning segmentation of the entire image. At the same time, it can be directly used for subsequent connected region growth or superimposed on the final mask to achieve seamless connection between multiple modules. It retains the noise resistance of sub-block level statistics while taking into account the accuracy of pixel-level positioning.
[0104] 8. Based on parameters Thresholding extraction of grayscale minima can quickly locate the darkest areas in an image, which typically correspond to pores, microbubbles, or surface depressions. This method requires only one traversal and threshold judgment to obtain the seed point set, making it highly efficient and easy to parallelize. At the same time, statistical thresholding ensures high recall and suppresses interference from a large number of normal background dark points, providing a precise starting point for subsequent region growth.
[0105] 9. By performing eight-neighborhood region growth, starting from the selected minimum seed point, the eight-neighborhood structure ensures that each pixel is included in the adjacency relationship in the horizontal, vertical, and two diagonal directions, effectively avoiding the unrealistic breakage problem that may occur when only four-neighborhood is used. This omnidirectional connectivity ensures that the connected regions are closer to the actual morphology of pores or microbubbles during the extraction process, especially for pores with complex shapes or tortuous boundaries, which have higher extraction integrity. Secondly, the eight-neighborhood region growth adopts gray-level difference constraints to ensure that the gray levels of each grown pixel and the growth core point are consistent. The difference is less than a set threshold, avoiding excessive growth caused by unconstrained diffusion, thus effectively suppressing the pseudo-connectivity phenomenon caused by local noise or illumination fluctuations. In addition, compared with methods based on simple contour extraction or edge detection, the region growing algorithm can automatically adapt to the gray-scale changes inside the target and does not rely on obvious boundary transitions, making it suitable for defect detection scenarios with low contrast and blurred boundaries on the surface of foamed silicone rubber. At the same time, by introducing a minimum connected region area screening mechanism, the interference of small isolated noise on the detection results is further eliminated, significantly improving the accuracy of defect localization and the repeatability of the results.
[0106] 12. Logically combine the diffuse reflection mask, color block mask, and porosity mask using AND-OR operations to form the final defect localization mask. This achieves comprehensive extraction of defects from multiple dimensions and types; finally, based on... By counting the number of connected regions and pixel area and multiplying them by the actual area of a single pixel, accurate area and quantity indicators can be output. This statistical process is fully automated and compatible with different resolutions and different detection standards. The generated quality inspection report can provide quantitative basis for real-time monitoring of the production line, process improvement and quality traceability. Attached Figure Description
[0107] Figure 1 This is a schematic diagram of the basic process of the present invention. Detailed Implementation
[0108] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0109] Example: A method for detecting the surface of foamed silicone rubber based on image visual recognition, referring to... Figure 1 ,include:
[0110] An industrial camera was used to acquire RGB color images of the surface of the foamed silicone rubber being tested, and the color images were converted into grayscale images.
[0111] Perform linear normalization on the grayscale image to output the illumination-corrected grayscale image. ;
[0112] Images of the foamed silicone rubber surface were repeatedly acquired at the same location by mounting horizontal and vertical polarizing filters on an industrial camera. The acquired images were then sequentially converted to grayscale and linearly normalized, resulting in two corrected grayscale images. , ;
[0113] Calculate the polarization difference and use its global statistics to generate a diffuse reflection effective region mask. Diffuse reflection mask generated by statistical thresholding based on polarization difference This masking strategy ensures complete detection within the diffuse reflection area while effectively eliminating specular reflection and specular interference. It is deeply coupled with subsequent sub-algorithms, with all chromatic aberration and porosity detection occurring only within the target area. Regional execution significantly reduces the overall computational load; simultaneously, by masking specular highlights, color difference detection based on stable diffuse reflection signals for grayscale mesh statistics is more accurate, and the region growing algorithm is not misled by specular edges when extracting connected regions in clear diffuse reflection areas; compared to directly using edge detection or brightness thresholding methods on the entire image, this step gives the system higher anti-interference and robustness; in addition, this mask can be dynamically updated to adapt to different lighting angles and surface gloss levels, greatly improving the versatility of the solution;
[0114] exist Statistical correction grayscale image within the region global mean with standard deviation ;
[0115] Grayscale correction image Mesh processing is performed to detect local grayscale deviations, identify abnormal color block regions, and generate abnormal color block masks. ;
[0116] In the region and The grayscale value is at its minimum in the =0 region. As a seed threshold, the initial seed point set is extracted;
[0117] For each seed point, perform eight-neighborhood region growth, with the growth condition being that the gray-level difference is less than a preset threshold. It also removes connected regions with an area smaller than the predetermined number of pixels to generate a pore / microbubble mask. ;
[0118] The three types of masks are combined to obtain the final defect localization mask. ;
[0119] according to The area and quantity of defective areas are statistically analyzed to generate a quality inspection report.
[0120] The process of acquiring RGB color images of the tested foamed silicone rubber surface using an industrial camera and converting the color images to grayscale includes:
[0121] The acquired RGB color images are converted to grayscale using the following formula:
[0122]
[0123] in: , , Represents the three-channel pixel values of a color image, range ; This method represents the pixel value after grayscale conversion. The acquired RGB color images are combined into a grayscale image according to preset coefficients, which not only significantly reduces the complexity of subsequent calculations but also removes redundant information between different color channels while preserving the surface texture features of the target. Since surface defects of foamed silicone rubber (such as micropores and color differences) are more intuitively and stably represented in grayscale images, grayscale conversion can balance brightness sensitivity and contrast enhancement without sacrificing detail contrast. Compared to direct channel-by-channel detection in the RGB space, grayscale conversion only requires thresholding and statistical analysis of single-channel pixel values, significantly improving processing speed and reducing memory and bandwidth usage. Furthermore, this method does not rely on complex color calibration or multi-channel fusion algorithms, has lower requirements for the channel response consistency of industrial cameras, and simplifies the calibration process of the front-end system.
[0124] The grayscale image is linearly normalized to output a grayscale image after illumination correction. ,include:
[0125] Iterate through the pixel values of each pixel in the grayscale image, and filter out the maximum and minimum values, denoted as _____. , ;
[0126] The grayscale image is linearly normalized using the following formula:
[0127]
[0128] Where: 255 represents the maximum grayscale value; This represents the pixel values of the grayscale image after illumination normalization, ranging from... By traversing the grayscale image to obtain the maximum and minimum grayscale values and linearly mapping them to the full dynamic range, this step can adaptively eliminate brightness shifts caused by uneven lighting and environmental interference. In industrial settings, the position, intensity, and reflectivity of the light source and finished products may change at any time, and traditional fixed threshold segmentation is easily affected by overall brightness deviations. The linear normalization scheme uses the current image's own extreme values as parameters, eliminating the need for a preset standard whiteboard or manual calibration, and adjusts the overall grayscale distribution in real time, so that the background grayscale, shadow levels, and highlight distribution of each image can be mapped to a fixed range of [0, 255]. The normalized image has a consistent grayscale benchmark for subsequent polarization difference, region growing, and other algorithms, avoiding the complexity of multiple thresholds or dynamic threshold adjustments for a single image, ensuring the stability of subsequent algorithms under various lighting conditions, and effectively reducing misjudgments and missed detections.
[0129] The polarization difference is calculated, and a diffuse reflection effective area mask is generated using its global statistics. ,include:
[0130] Calculate polarization difference:
[0131]
[0132] in: , These represent the corrected grayscale images under horizontal and vertical polarization, respectively. Indicates the polarization difference value; This indicates the absolute value;
[0133] Calculate the global mean :
[0134]
[0135] Calculate the global standard deviation :
[0136]
[0137] in: Representing the difference plot The total number of all pixels;
[0138] Generate a diffuse reflection effective area mask based on the mean and standard deviation of the entire image:
[0139]
[0140] in: The mask represents the effective diffuse reflection area, with 1 indicating the reserved area and 0 indicating the shielded area. The polarization difference values of the actual diffuse reflection signal (i.e., pixels without specular interference) generally follow an approximately normal distribution. Under a normal distribution, approximately 95.4% of the data falls within the range of... Within the range, therefore, As an upper limit threshold, approximately 95% of true diffuse reflection pixels are correctly preserved. Points exceeding this range are highly likely to be specular interference or anomalous artifacts. The value 2 represents two standard deviations, used to treat points exceeding the mean by more than two standard deviations as "abnormal" (spectral) and remove them. For stricter or more lenient requirements, values such as 1.5 or 2.5 can be adjusted. By assembling horizontal and vertical polarizing filters and taking images sequentially, a diffuse reflection effective area mask is generated using the grayscale difference between the two images, significantly reducing the interference of specular highlight artifacts on defect extraction. Foamed silicone rubber surfaces often exhibit localized specular reflection, especially under high temperature or humid conditions. Under normal lighting, highlight areas are easily misjudged as color differences or voids. Polarization imaging technology can distinguish between diffuse and specular reflection components through the difference formula. This method directly suppresses specular components co-occurring in two polarization images, retaining only diffuse reflection components. It requires no complex specular models or adaptive filters, achieving specular masking through a simple pixel-level subtraction and statistical thresholding. The resulting diffuse reflection mask... It can efficiently cover various highlight areas and integrate with grayscale images. Orthogonal combination significantly reduces the false detection rate in subsequent color difference detection and region growth processes; at the same time, polarization suppression operation has low hardware requirements and can be directly implemented using simple polarizers or beam splitters, thereby enabling rapid deployment on the production line and improving the overall solution's detection rate and positioning accuracy for high-reflectivity surface defects.
[0141] The above Statistical correction grayscale image within the region global mean with standard deviation ,include:
[0142] Calculate the global mean :
[0143]
[0144] Calculate the global standard deviation :
[0145]
[0146] in: express The total number of pixels within the area; This means only for those that satisfy Statistical calculations are performed on the pixels. A global mean is applied to the corrected grayscale image within the effective diffuse reflection region. with standard deviation The statistics provide accurate distribution parameters for subsequent extraction of minimum seed points and gridded color difference detection. Traditional local or empirical thresholds often fail to simultaneously take into account the grayscale differences of different batches and products with different processes. However, the adaptive threshold based on the internal statistics of the image can be dynamically set according to the actual image distribution, ensuring that the detection algorithm can maintain high stability under different background grayscale and different material formulations. This eliminates the dependence on external calibration or manual threshold setting, and improves the ease of use and reliability of the system.
[0147] The grayscale correction image Mesh processing is performed to detect local grayscale deviations, identify abnormal color block regions, and generate abnormal color block masks. ,include:
[0148] Divide the image into A grid, where each sub-block is denoted as The aforementioned and The value can be dynamically adjusted according to the actual workpiece size and camera resolution on the production line. The smaller the value is set, the smaller the final sub-blocks will be, and noise will be easily misjudged as color difference, resulting in a decrease in anti-interference ability. The larger the value is set, the larger the final sub-blocks will be, and local color differences will be easily smoothed, leading to missed detection.
[0149] Calculate the average gray level for each sub-block :
[0150]
[0151] in: Indicates that the sub-block satisfies The number of pixels; This indicates summing of pixels within a sub-block that have a mask value of 1;
[0152] Calculate the grayscale difference between adjacent sub-blocks :
[0153]
[0154] in: , This indicates two adjacent sub-blocks; This indicates the absolute value;
[0155] Calculate the mean of the grayscale difference between adjacent sub-blocks worldwide. with standard deviation :
[0156]
[0157]
[0158] in: This represents the total number of all adjacent sub-block pairs;
[0159] Set the threshold for determining whether a sub-block's color is abnormal. The threshold value of 2.5 is a balance between ensuring high recall and controlling low false positive rate, and can be fine-tuned according to the actual sample distribution.
[0160] Perform sub-block level anomaly detection:
[0161]
[0162] Where 1 represents a sub-block A color block is identified as abnormal; 0 indicates normal. To indicate logical "existence"; to divide diffuse images according to The system divides the area into grids, calculates the average gray level for each region, compares adjacent regions, and then calculates the global mean of the gray level differences. with standard deviation This method is used to identify local color difference anomalies. It can suppress noise interference while maintaining local sensitivity. Unlike pixel-level threshold segmentation, which is affected by isolated pixel anomalies, this gridded detection aggregates the statistics of multiple pixels, making it more robust to real defects. The gridded design can also adaptively adjust the block size according to the product size and resolution, so as to achieve the optimal balance between detection accuracy and computational efficiency. It has a significant detection effect on problems such as local contamination, color spots, and surface stickiness.
[0163] Map sub-block level anomalies back to the pixel level to generate anomaly color block masks. Specifically:
[0164] For each sub-block :like Then all pixels within that sub-block The pixel-level mask is set to 1 if the color difference is determined at the sub-block level, and 0 otherwise. After color difference determination is completed at the sub-block level, the abnormal sub-blocks are mapped to pixel-level masks, which helps to refine the coarse-grained detection results to the pixel level. This mapping is simple and efficient, and can be completed with a single sub-block scan and pixel assignment, avoiding the computational overhead of secondary thresholding or deep learning segmentation of the entire image. At the same time, it can be directly used for subsequent connected region growth or superimposed on the final mask to achieve seamless connection between multiple modules. It retains the noise resistance of sub-block level statistics while taking into account the accuracy of pixel-level localization.
[0165] The area and The grayscale value is at its minimum in the =0 region. As a seed threshold, an initial set of seed points is extracted, including:
[0166] Get grayscale image global mean with standard deviation ;
[0167] Seed point set for detecting grayscale minimum values:
[0168]
[0169] in: The minimum seed threshold is used to initially identify pixels below this threshold as pore seed points. The grayscale values in the image approximate a normal distribution, with approximately 95.4% of the pixel grayscale values concentrated in the minimum value range. ,Pick As a lower threshold, points with gray levels significantly below the normal range are identified as potential pore / microbubble seed points. The value 2 represents twice the standard deviation, used to select the extreme region with the smallest value in the distribution. This threshold setting ensures high recall for extremely low gray-level pixels such as deep recesses and holes, while avoiding misclassification of points with slight fluctuations in normal gray levels as pores. The value 2 can be adaptively adjusted according to requirements; based on parameters... Thresholding extraction of grayscale minima can quickly locate the darkest areas in an image, which typically correspond to pores, microbubbles, or surface depressions. This method requires only one traversal and threshold judgment to obtain the seed point set, making it highly efficient and easy to parallelize. At the same time, statistical thresholding ensures high recall and suppresses interference from a large number of normal background dark points, providing a precise starting point for subsequent region growth.
[0170] The eight-neighborhood region growing process is performed on each seed point, with the growth condition being that the gray-level difference is less than a preset threshold. It also removes connected regions with an area smaller than the predetermined number of pixels to generate a pore / microbubble mask. ,include:
[0171] Set a connectivity grayscale difference threshold to determine whether a connection is connected. ;
[0172] Create an access marker matrix for each pixel Initially, all values are 0;
[0173] Create a collection to store all connected components. Initially, it is an empty set;
[0174] For each Perform region growth:
[0175] like If the seed point is already covered by the connected regions of other seed points, then skip it.
[0176] Otherwise, create a new current region. , and mark ;
[0177] Initialize the growth queue ;
[0178] S1, when If the array is not empty, take the first element from it and denote it as . and remove it from the queue Delete;
[0179] S2, for Iterate through its eight neighborhood pixels in sequence:
[0180]
[0181] S3, For each neighboring point If the neighboring points are satisfied Located within the image, neighboring points Corresponding tag matrix , , , Then Join the current region , and mark and will Joining the team ;
[0182] in: Indicates will Join In, and update the set , This indicates that the result on the right is updated to the current set. , The union operation represents the set operation; This indicates the pixels that currently meet the growth conditions. Add to queue middle, This indicates that a new element is added to the end of the queue;
[0183] Repeat steps S1-S3 until the queue is reached. Clear the elements in the set and output the set. As a connected region, by performing eight-neighborhood region growth, starting from the selected minimum seed point, the eight-neighborhood structure ensures that each pixel is included in the adjacency relationship in the horizontal, vertical, and two diagonal directions, effectively avoiding the unrealistic breakage problem that may occur when only four-neighborhood is used. This omnidirectional connectivity ensures that the connected region is closer to the morphology of actual pores or microbubbles during the extraction process, especially for pores with complex shapes or tortuous boundaries, which have higher extraction integrity. Secondly, the eight-neighborhood region growth adopts gray-level difference constraints to ensure that each grown pixel is adjacent to the growth core point. The grayscale difference between regions is less than a set threshold, avoiding excessive growth caused by unconstrained diffusion, thus effectively suppressing pseudo-connectivity caused by local noise or illumination fluctuations. In addition, compared with methods based on simple contour extraction or edge detection, the region growing algorithm can automatically adapt to grayscale changes inside the target and does not rely on obvious boundary transitions, making it suitable for defect detection scenarios with low contrast and blurred boundaries on the surface of foamed silicone rubber. At the same time, by introducing a minimum connected region area screening mechanism, the interference of small isolated noise on the detection results is further eliminated, significantly improving the accuracy of defect localization and the repeatability of results.
[0184] Set a threshold for detecting noise. ;
[0185] Get Collection The number of elements in the middle, if the number is less than Then the set If it is determined to be noise, it will be discarded; otherwise, it will be aggregated. join in ;
[0186] Generate pore / microbubble mask :
[0187]
[0188] in: Indicates determining the current pixel Does it belong to all reserved connected regions? any region Setting it to 1 indicates that the current pixel belongs to the detected defect area, while setting it to 0 indicates that the current pixel belongs to the non-defect area.
[0189] The three types of masks are combined to obtain the final defect localization mask. ,include:
[0190] The three types of masks are combined according to the following formula to obtain the final defect localization mask:
[0191]
[0192] in: This indicates a logical AND operation. This indicates a logical OR.
[0193] According to The report analyzes the area and quantity of defective areas, generates a quality inspection report, and includes:
[0194] statistics The number of connected regions present in the foam is used as the number of defective regions in the currently detected foamed silicone rubber;
[0195] Obtain the area of each pixel in the image, and denote it as the area of a single pixel;
[0196] For each defective region, count the number of pixels present in it, and multiply the number by the area of a single pixel to obtain the area of the defective region;
[0197] Add up the areas of all defective regions to obtain the total area of defective regions in the foamed silicone rubber currently being inspected;
[0198] The number and total area of defective regions in the currently inspected foamed silicone rubber are used as the basis for the quality inspection report. The diffuse reflection mask, color block mask, and pore mask are logically ANDed / ORed to form the final defect localization mask. This achieves comprehensive extraction of defects from multiple dimensions and types; finally, based on... By counting the number of connected regions and pixel area and multiplying them by the actual area of a single pixel, accurate area and quantity indicators can be output. This statistical process is fully automated and compatible with different resolutions and different detection standards. The generated quality inspection report can provide quantitative basis for real-time monitoring of the production line, process improvement and quality traceability.
[0199] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0200] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for detecting the surface of foamed silicone rubber based on image visual recognition, characterized in that, include: An industrial camera was used to acquire RGB color images of the surface of the foamed silicone rubber being tested, and the color images were converted into grayscale images. Perform linear normalization on the grayscale image to output the illumination-corrected grayscale image. ; Images of the foamed silicone rubber surface were repeatedly acquired at the same location by mounting horizontal and vertical polarizing filters on an industrial camera. The acquired images were then sequentially converted to grayscale and linearly normalized, resulting in two corrected grayscale images. , ; Calculate the polarization difference and use its global statistics to generate a diffuse reflection effective region mask. This includes: calculating polarization difference: ; in: , These represent the corrected grayscale images under horizontal and vertical polarization, respectively. Indicates the polarization difference value; This indicates the absolute value; Calculate the global mean : ; Calculate the global standard deviation : ; in: Representing the difference plot The total number of all pixels; Generate a diffuse reflection effective area mask based on the mean and standard deviation of the entire image: in: This represents the effective area mask for diffuse reflection; 1 indicates the reserved area, and 0 indicates the shielded area. exist Statistical correction grayscale image within the region global mean with standard deviation ; Grayscale correction image Mesh processing is performed to detect local grayscale deviations, identify abnormal color block regions, and generate abnormal color block masks. ,include: Divide the image into A grid, where each sub-block is denoted as ; Calculate the average gray level for each sub-block : ; in: Indicates that the sub-block satisfies The number of pixels; This indicates summing of pixels within a sub-block that have a mask value of 1; Calculate the grayscale difference between adjacent sub-blocks : ; in: , This indicates two adjacent sub-blocks; This indicates the absolute value; Calculate the mean of the grayscale difference between adjacent sub-blocks worldwide. with standard deviation : ; ; in: This represents the total number of all adjacent sub-block pairs; Set the threshold for determining whether a sub-block's color is abnormal. ; Perform sub-block level anomaly detection: Where 1 represents a sub-block A color block is identified as abnormal; 0 indicates normal. It indicates logical "existence"; Map sub-block level anomalies back to the pixel level to generate anomaly color block masks. Specifically: For each sub-block :like Then all pixels within that sub-block The pixel-level mask is set to 1 if it is not set to 0 otherwise. In the region and The grayscale value is at its minimum in the =0 region. As a seed threshold, the initial seed point set is extracted; For each seed point, perform eight-neighborhood region growth, with the growth condition being that the gray-level difference is less than a preset threshold. It also removes connected regions with an area smaller than the predetermined number of pixels to generate a pore / microbubble mask. ; The three types of masks are combined to obtain the final defect localization mask. ; according to The area and quantity of defective areas are statistically analyzed to generate a quality inspection report.
2. The method for detecting the surface of foamed silicone rubber based on image visual recognition according to claim 1, characterized in that, The process of acquiring RGB color images of the tested foamed silicone rubber surface using an industrial camera and converting the color images to grayscale includes: The acquired RGB color images are converted to grayscale using the following formula: in: , , Represents the three-channel pixel values of a color image, range ; This represents the pixel value after grayscale conversion; The grayscale image is linearly normalized to output a grayscale image after illumination correction. ,include: Iterate through the pixel values of each pixel in the grayscale image, and filter out the maximum and minimum values, denoted as _____. , ; The grayscale image is linearly normalized using the following formula: Where: 255 represents the maximum grayscale value; This represents the pixel values of the grayscale image after illumination normalization, ranging from... .
3. The method for detecting the surface of foamed silicone rubber based on image visual recognition according to claim 1, characterized in that, The above Statistical correction grayscale image within the region global mean with standard deviation ,include: Calculate the global mean : Calculate the global standard deviation : in: express The total number of pixels within the area; This means only for those that satisfy Statistical calculations are performed on the pixels.
4. The method for detecting the surface of foamed silicone rubber based on image visual recognition according to claim 3, characterized in that, The area and The grayscale value is at its minimum in the =0 region. As a seed threshold, an initial set of seed points is extracted, including: Get grayscale image global mean with standard deviation ; Seed point set for detecting grayscale minimum values: in: This represents the seed threshold for the minimum value.
5. The method for detecting the surface of foamed silicone rubber based on image visual recognition according to claim 4, characterized in that, The eight-neighborhood region growing process is performed on each seed point, with the growth condition being that the gray-level difference is less than a preset threshold. It also removes connected regions with an area smaller than the predetermined number of pixels to generate a pore / microbubble mask. ,include: Set a connectivity grayscale difference threshold to determine whether a connection is connected. ; Create an access marker matrix for each pixel Initially, all values are 0; Create a collection to store all connected components. Initially, it is an empty set; For each Perform region growth: like If so, skip it; Otherwise, create a new current region. , and mark ; Initialize the growth queue ; S1, when If the array is not empty, take the first element from it and denote it as . and remove it from the queue Delete; S2, for Iterate through its eight neighborhood pixels in sequence: S3, For each neighboring point If the neighboring points are satisfied Located within the image, neighboring points Corresponding tag matrix , , , Then Join the current region , and mark and will Joining the team ; in: Indicates will Join In, and update the set , This indicates that the result on the right is updated to the current set. , The union operation represents the set operation; This indicates the pixels that currently meet the growth conditions. Add to queue middle, This indicates that a new element is added to the end of the queue; Repeat steps S1-S3 until the queue is reached. Clear the elements in the set and output the set. As a connected region; Set a threshold for detecting noise. ; Get Collection The number of elements in the middle, if the number is less than Then the set If it is determined to be noise, it will be discarded; otherwise, it will be aggregated. join in ; Generate pore / microbubble mask : in: Indicates determining the current pixel Does it belong to all reserved connected regions? any region Setting it to 1 indicates that the current pixel belongs to the detected defect area, while setting it to 0 indicates that the current pixel belongs to the non-defect area.
6. The method for detecting the surface of foamed silicone rubber based on image visual recognition according to claim 1, characterized in that, The three types of masks are combined to obtain the final defect localization mask. ,include: The three types of masks are combined according to the following formula to obtain the final defect localization mask: in: This indicates a logical AND operation. This indicates a logical OR.
7. The method for detecting the surface of foamed silicone rubber based on image visual recognition according to claim 1, characterized in that, According to The report analyzes the area and quantity of defective areas, generates a quality inspection report, and includes: statistics The number of connected regions present in the foam is used as the number of defective regions in the currently detected foamed silicone rubber; Obtain the area of each pixel in the image, and denote it as the area of a single pixel; For each defective region, count the number of pixels present in it, and multiply the number by the area of a single pixel to obtain the area of the defective region; Add up the areas of all defective regions to obtain the total area of defective regions in the foamed silicone rubber currently being inspected; The number of defective areas and the total area of the defective areas in the foamed silicone rubber currently being tested will be used as the quality inspection report for the foamed silicone rubber currently being tested.