Adhesive tape transparent defect detection system and method based on image enhancement
By using multi-angle polarization optical image processing and background feature modeling, composite defect enhancement images are generated, which solves the problems of false alarms and false negatives in the detection of transparent materials and improves the detection accuracy and stability.
Patent Information
- Application Number
- CN202511094924.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-06
- Publication Date
- 2025-11-14
AI Technical Summary
Existing technologies are difficult to effectively detect defects in transparent materials or internal structures, especially in industrial tapes with high transparency and low contrast. False alarms or missed alarms are common, and fluctuations in background texture and changes in lighting make detection difficult.
A polarization information acquisition module is used to acquire multi-angle polarized optical images, Stokes parameters are calculated to generate stress distribution polarization maps, and background feature modeling and local divergence scoring are combined to generate composite defect enhanced images through multi-dimensional feature fusion.
It improves the accuracy and stability of transparent defect detection in tape, reduces false detection and false negative rates, and enhances the contrast between the defect area and the background area.
Smart Images

Figure CN120953227A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image enhancement technology, and in particular to a system and method for detecting transparent defects in adhesive tape based on image enhancement. Background Technology
[0002] Image enhancement technology is an important part of the field of digital image processing, involving techniques for processing raw images to improve image quality and visual effects.
[0003] Existing technologies, through grayscale stretching, contrast adjustment, and filtering for noise reduction, lack specific design for transparent materials or internal structural defects. When detecting objects with high transparency and low contrast, such as industrial tape, they struggle to highlight subtle differences between defect areas and the background. Furthermore, existing technologies often ignore normal texture fluctuations, lighting variations, or process-related inhomogeneities in the background area, applying a uniform enhancement strategy to the entire image. This can easily amplify subtle differences in the background as abnormal areas, leading to increased false positives and false negatives. Therefore, improvements are needed. Summary of the Invention
[0004] The purpose of this invention is to overcome the shortcomings of the existing technology and to propose an image enhancement-based system and method for detecting transparent defects in adhesive tape.
[0005] To achieve the above objectives, the present invention adopts the following technical solution: An image enhancement-based adhesive tape transparency defect detection system includes: The polarization information acquisition module sets the polarizer to rotate to three angles: 0 degrees, 45 degrees, and 90 degrees. It then acquires three polarization optical images for each polarization optical image. For each pixel, based on the corresponding pixel intensity value of the three polarization optical images, it calculates the Stokes parameters S0, S1, and S2 to generate a stress distribution polarization map. The background feature modeling module selects a background area without bubbles, impurities, and uneven adhesive residue from the input original tape image, obtains the original pixel gray intensity sequence and the corresponding local gray variance sequence, and performs kernel density estimation on the original pixel gray intensity sequence and the corresponding local gray variance sequence to obtain the background reference probability distribution. The local divergence scoring module sets up a sliding window to traverse the original tape image and obtain the local probability distribution to be tested. For the center pixel of each window, the corresponding local probability distribution to be tested and the background reference probability distribution are extracted, the anomaly score is calculated, and the statistical divergence anomaly score map is obtained. The multi-dimensional feature fusion module sets pixel-level fusion weight values for the two images based on the stress distribution polarization map and the statistical divergence anomaly scoring map, forming a fusion weight parameter set. Based on the fusion weight parameter set, it calculates and generates a composite defect enhancement image.
[0006] Preferably, the step of obtaining the stress distribution polarization map is as follows: The polarizer is rotated to 0 degrees, 45 degrees and 90 degrees respectively. A polarized optical image is acquired for each angle. The pixel intensity value in each polarized optical image is extracted pixel by pixel. The pixel intensity value combination of the three polarized optical images corresponding to each pixel position is established to generate the pixel intensity value combination of the three polarized optical images. Based on the pixel intensity value combination of the three polarized optical images, the corresponding pixel intensity values of the three polarized optical images are called for each pixel position. Through the superposition and difference operation of the combined values, the Stokes parameters S0, S1 and S2 values corresponding to the position are calculated pixel by pixel to form the Stokes parameter value combination. Based on the Stokes parameter value combination, the Stokes parameter values S0, S1 and S2 of each pixel position are called one by one, and the linear polarization degree value and polarization angle value are calculated pixel by pixel. The linear polarization degree value and polarization angle value of each pixel position are fused to obtain the gray value corresponding to each pixel position, forming a stress distribution polarization map.
[0007] Preferably, the steps for obtaining the original pixel grayscale intensity sequence and the corresponding local grayscale variance sequence are as follows: In the input original tape image, locate a continuous background region in the image area that is free of bubbles and particulate impurities and has a uniform distribution of adhesive residue texture. Extract the gray intensity value of each pixel in the background region one by one, and construct a neighborhood window of a fixed size with the pixel as the center. Perform standard deviation square operation on all pixel gray values in the neighborhood to obtain the local gray variance, and generate the original pixel gray intensity sequence and the corresponding local gray variance sequence.
[0008] Preferably, the step of obtaining the background reference probability distribution is as follows: Based on the original pixel grayscale intensity sequence and the corresponding local grayscale variance sequence, the weighted kernel density estimate is calculated. Based on the weighted kernel density estimate, the corresponding kernel density estimate is extracted for each value point within the gray intensity range. The density values of each point are arranged in order of gray intensity from low to high to form a continuous probability curve, thereby generating a background reference probability distribution.
[0009] Preferably, the step of obtaining the local probability distribution to be tested is as follows: Set a fixed-size sliding window to traverse the original tape image sequentially with the same length. Read the grayscale intensity value of each pixel in each sliding window, and count the frequency of the grayscale value in the window and divide it by the total number of pixels to obtain the local probability distribution of the current sliding window.
[0010] Preferably, the steps for obtaining the statistical divergence anomaly scoring map are as follows: Based on the local probability distribution to be tested, the same gray level probability of the background reference probability distribution is extracted by gray level index as a reference template. At the same time, the mean and variance of the probabilities corresponding to all gray level values of the background reference probability distribution are recorded to obtain the combination relationship between the local probability distribution to be tested and the background reference probability distribution. Based on the combined relationship between the local probability distribution to be tested and the background reference probability distribution, the anomaly score of the center pixel is calculated. All anomaly scores are integrated and mapped according to their positions to form a statistical divergence anomaly score map.
[0011] Preferably, the step of obtaining the fusion weight parameter set is as follows: Based on the stress distribution polarization map and the statistical divergence anomaly scoring map, the gray value of the stress distribution polarization map is extracted for each pixel position, and the absolute value of the difference between the gray value and the mean gray value of all pixels in the stress distribution polarization map is calculated to generate the polarization significance measure corresponding to each pixel position. Extract the anomaly score from the statistical divergence anomaly score map for each pixel location, and calculate the absolute value of the difference between the anomaly score and the mean of the anomaly scores of all pixels in the statistical divergence anomaly score map to generate the divergence significance measure for each pixel location. Based on the polarization saliency measure and divergence saliency measure corresponding to each pixel position, the sum of the two saliency measures is calculated for each pixel position. Then, the sum of the two measures is divided by the polarization saliency measure and the divergence saliency measure respectively to generate the fusion weight parameter set.
[0012] Preferably, the step of acquiring the composite defect enhanced image is as follows: Based on the fusion weight parameter set, the gray value of the stress distribution polarization map at each pixel position is multiplied by the corresponding polarization weight factor, the anomaly score of the statistical divergence anomaly scoring map is multiplied by the corresponding divergence weight factor, and then added up position by position to generate a composite defect enhancement image.
[0013] This invention also provides a method for detecting transparency defects in adhesive tape, comprising the following steps: The polarizer is rotated to three angles: 0 degrees, 45 degrees, and 90 degrees. Three polarization optical images are acquired for each polarization optical image. For each pixel, Stokes parameters S0, S1, and S2 are calculated based on the corresponding pixel intensity values of the three polarization optical images to generate a stress distribution polarization map. In the input original tape image, a background area without bubbles, impurities, and uneven adhesive residue is selected to obtain the original pixel gray intensity sequence and the corresponding local gray variance sequence. Kernel density estimation is performed on the original pixel gray intensity sequence and the corresponding local gray variance sequence to obtain the background reference probability distribution. Set up a sliding window to traverse the original tape image and obtain the local probability distribution to be tested. For the center pixel of each window, extract the corresponding local probability distribution to be tested and the background reference probability distribution, calculate the anomaly score, and obtain the statistical divergence anomaly score map. Based on the stress distribution polarization map and the statistical divergence anomaly score map, pixel-level fusion weight values are set for the two images to form a fusion weight parameter set. Based on the fusion weight parameter set, a composite defect enhancement image is calculated and generated.
[0014] Compared with the prior art, the advantages and positive effects of the present invention are as follows: In this invention, by acquiring multiple polarized optical images from specific angles and calculating stress distribution using Stokes parameters, the transparent defect features inside the tape, which cannot be captured by ordinary optical imaging, are precisely captured. By introducing kernel density estimation calculations based on the original pixel grayscale intensity and local grayscale variance of the tape background area, the background reference probability distribution is accurately obtained, effectively reducing the false positive rate caused by background non-uniformity. A sliding window is used to calculate the local probability distribution to be tested, and adaptive divergence scoring is performed with the background reference probability distribution to enhance the detection sensitivity of abnormal defect areas. Pixel-level fusion is performed based on the polarization map and the abnormal score map, and the adaptive weight values are set to optimize the combination of effective information from each feature map, effectively improving the contrast between the tape defect area and the background area. Finally, a composite defect enhancement image with greater visual prominence and recognition accuracy is generated, improving the detection accuracy and stability of transparent defects in tape and reducing false positives and false negatives caused by background interference in industrial inspection environments. Attached Figure Description
[0015] Figure 1 This is a system flowchart of the present invention. Detailed Implementation
[0016] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0017] Please see Figure 1 The present invention provides a technical solution: an image enhancement-based adhesive tape transparency defect detection system comprising: The polarization information acquisition module sets the polarizer to rotate to three angles: 0 degrees, 45 degrees, and 90 degrees. It then acquires three polarization optical images for each polarization optical image. For each pixel, based on the corresponding pixel intensity value of the three polarization optical images, it calculates the Stokes parameters S0, S1, and S2 to generate a stress distribution polarization map. The background feature modeling module selects a background area without bubbles, impurities, or uneven adhesive residue from the input original tape image, obtains the original pixel gray intensity sequence and the corresponding local gray variance sequence, performs kernel density estimation on the original pixel gray intensity sequence and the corresponding local gray variance sequence, and obtains the background reference probability distribution. The local divergence scoring module sets up a sliding window to traverse the original tape image and obtain the local probability distribution to be tested. For the center pixel of each window, the corresponding local probability distribution to be tested and the background reference probability distribution are extracted, the anomaly score is calculated, and the statistical divergence anomaly score map is obtained. The multi-dimensional feature fusion module sets pixel-level fusion weight values for the two images based on the stress distribution polarization map and the statistical divergence anomaly score map, forming a fusion weight parameter set. Based on the fusion weight parameter set, a composite defect enhancement image is calculated and generated.
[0018] The steps for obtaining the stress distribution polarization map are as follows: The polarizer is rotated to 0 degrees, 45 degrees and 90 degrees respectively. A polarized optical image is acquired for each angle. The pixel intensity value in each polarized optical image is extracted pixel by pixel. The pixel intensity value combination of the three polarized optical images corresponding to each pixel position is established to generate the pixel intensity value combination of the three polarized optical images. Based on the pixel intensity values of three polarized optical images, the corresponding pixel intensity values of the three polarized optical images are called for each pixel position. Through the superposition and difference operation of the combined values, the Stokes parameters S0, S1 and S2 values corresponding to the position are calculated pixel by pixel to form the Stokes parameter value combination. Based on the combination of Stokes parameter values, the Stokes parameter values S0, S1, and S2 at each pixel location are called one by one, and the linear polarization degree value and polarization angle value are calculated pixel by pixel. The linear polarization degree value and polarization angle value at each pixel location are fused to obtain the gray value corresponding to each pixel location, forming a stress distribution polarization map.
[0019] Specifically, after acquiring one polarization optical image for each angle, these three polarization optical images, each with a resolution of 1920x1080 pixels, are processed: Image A (0 degrees), Image B (45 degrees), and Image C (90 degrees). First, pixel-level alignment calibration is performed on these three images to ensure that any coordinate (x, y) corresponds to the exact same physical position in all three images during subsequent processing. Next, a data processing queue is established for each pixel position (x, y), where x ranges from 0 to 1919 and y ranges from 0 to 1079. In this queue, the program sequentially accesses Image A, Image B, and Image C, and reads the pixel grayscale intensity values at the corresponding coordinates (x, y). These values are typically 8-bit unsigned integers, ranging from 0 to 255, denoted as I_0(x, y), I_45(x, y), and I_90(x, y). Subsequently, these three independent grayscale intensity values, namely I_0(x, y), I_45(x, y), and I_90(x, y), are processed. The data points I_0(x, y) and I_45(x, y), I_90(x, y) are organized as a single data unit. Specifically, this is implemented by constructing a triplet structure, such as (I_0(x, y), I_45(x, y), I_90(x, y)). This triplet is mapped to the pixel coordinates (x, y). For example, for pixel (100, 200), if its grayscale values in the three images are 150, 180, and 140 respectively, the system will generate a record with the key (100, 200) and values (150, 180, y). 140), this process is accomplished by traversing all pixels of the image through a double nested loop. The outer loop traverses y from 0 to 1079, and the inner loop traverses x from 0 to 1919. The above reading and combination operations are performed on each pixel. Finally, when all the triples of the pixels are created and stored, a logical data structure with the same size as the original image but a depth of 3 will be formed. This structure is the combination of the pixel intensity values of the three polarized optical images.
[0020] Based on the pixel intensity values of three polarized optical images, a pixel-by-pixel calculation process is initiated. This process iterates through each pixel position (x, y) and retrieves the corresponding pixel intensity values of the three polarized optical images, namely I_0(x, y), I_45(x, y), and I_90(x, y), from the data structure generated in the previous step. Then, using these intensity values, the Stokes parameters S0, S1, and S2 of the pixel are calculated using a predefined linear transformation formula, as follows: ; ; ; in, , and These represent the pixel grayscale intensity values collected at pixel positions (x, y) when the polarizer angle is 0 degrees, 45 degrees, and 90 degrees, respectively. This represents the total light intensity of that pixel. This represents the difference in polarization components between the horizontal and vertical directions. This represents the difference in polarization components between the +45° and -45° directions. For example, for pixel (512, 512), if the read intensity values are (180, 165, 120), the Stokes parameter calculation for that point is: S0 = 180 + 120 = 300, S1 = 180 - 120 = 60, S2 = 2 * 165 - (180 + 120) = 330 - 300 = 30. Therefore, the Stokes parameter value corresponding to pixel (512, 512) is (300, 60, ...). 30) This calculation process is performed independently for each pixel in the image. Since the calculation of each pixel is independent of each other, this process can be accelerated by parallel computing. After the calculation is completed, a two-dimensional data matrix is generated for each Stokes parameter (S0, S1, S2). The dimension of the matrix is the same as that of the original image. The value of each element in the matrix is the parameter value calculated for the corresponding pixel position. These three two-dimensional data matrices together constitute the Stokes parameter value combination.
[0021] Based on the Stokes parameter values, the system continues to process each pixel position (x, y). By calling the three values S0(x, y), S1(x, y), and S2(x, y) generated in the previous step, it calculates two key physical quantities: the degree of linear polarization (DoLP) and the angle of polarization (AoP). The specific calculation formulas are as follows: ; ; in, This is the linear polarization degree value, with a range of [0, 1], representing the proportion of linearly polarized light in the light wave. This is the polarization angle value, typically ranging from [-π / 2, +π / 2] to [0, π], representing the angle between the vibration direction of linearly polarized light and the reference coordinate axis. It is a bivariate arctangent function used to correctly determine the quadrant in which an angle lies. This is a very small positive number (e.g., 1e-9) used to avoid division by zero when S0 is zero. After calculation, each pixel (x, y) will receive a linear polarization degree value and a polarization angle value. Next, these two values are fused to generate a single grayscale value. The fusion process uses the HSV (hue, saturation, brightness) color space as an intermediate medium. First, the polarization angle... Linear mapping to the components of hue H, for example, mapping the range [-π / 2, +π / 2] to [0, 1], is expressed by the formula: Secondly, the linear polarization degree It is directly used as a component of saturation S, that is Finally, the total luminous intensity S0(x, y) is normalized and used as a component of the brightness V. The normalization method is as follows: ,in This is the maximum value in the entire S0 parameter matrix. Thus, each pixel corresponds to an HSV triplet (H, S, V). Then, a standard color space conversion algorithm is applied to convert each HSV pixel value to an RGB value (R, G, B). Finally, a weighted average method is used to convert the RGB values to the final grayscale value. The calculation formula is as follows: The values of 0.299, 0.587, and 0.114 are calculated based on internationally standardized fixed weights for different color sensitivities of the human eye, representing grayscale values obtained from all pixels. The stress distribution polarization diagram is formed by rearranging the stresses according to their original coordinate positions (x, y).
[0022] The steps for obtaining the original pixel grayscale intensity sequence and the corresponding local grayscale variance sequence are as follows: In the input original tape image, locate a continuous background region in the image area that is free of bubbles and particulate impurities and has a uniform distribution of adhesive residue texture. Extract the gray intensity value of each pixel in the background region one by one, and construct a neighborhood window of a fixed size with the pixel as the center. Perform standard deviation square operation on all pixel gray values in the neighborhood to obtain the local gray variance, and generate the original pixel gray intensity sequence and the corresponding local gray variance sequence.
[0023] Specifically, in the input raw tape image, the system first performs automatic background region localization. This process divides the complete raw tape image (e.g., 2048x2048 pixels) into 128x128 pixel non-overlapping sub-blocks. For each sub-block, two core metrics are calculated: grayscale mean and grayscale variance. Through pre-analysis of a large number of qualified tape samples, the grayscale mean range of normal background regions is determined, for example, 180 to 220 (at grayscale levels 0-255), and the upper limit of grayscale variance, for example, below 50. The system then traverses all sub-blocks, filters out sub-blocks that simultaneously meet both conditions, and merges these conditional sub-blocks to form one or more irregular but continuous background regions. To ensure the representativeness of the selected regions, the system selects the largest continuous region as the final background region. Then, within this determined background region, the system initiates pixel-level... The data extraction process iterates through every pixel in the background region. For each pixel, its 8-bit grayscale intensity value is read and stored in a one-dimensional array, which forms the original pixel grayscale intensity sequence. Simultaneously, a neighborhood window of fixed size (7x7 pixels) is constructed centered on the current pixel, containing 49 pixels. The system reads all grayscale values of these 49 pixels and calculates their standard deviation. The calculated standard deviation is then squared to obtain the local grayscale variance of the central pixel. This variance is stored in another one-dimensional array parallel to the original pixel grayscale intensity sequence, with its index corresponding to a pixel. This process is repeated for all pixels in the background region without omission until the traversal is complete, ultimately generating an original pixel grayscale intensity sequence and a corresponding local grayscale variance sequence of equal length.
[0024] The steps to obtain the background reference probability distribution are as follows: Based on the original pixel grayscale intensity sequence and the corresponding local grayscale variance sequence, the weighted kernel density estimate is calculated using the following formula: ; in, The grayscale intensity is The weighted kernel density estimate at that time. This represents the total number of pixels in the background area. For the first The grayscale intensity value of each pixel. For core bandwidth, It is a symmetric kernel function. In pixels The local gray-level variance within the central neighborhood. This represents the maximum local grayscale variance among all pixels. This is the index weighting control coefficient. To avoid the denominator being zero, use extremely small positive numbers. Let be the normalization factor, satisfying the probability integral of 1, and its expression is: ; Based on the weighted kernel density estimate, the corresponding kernel density estimate is extracted for each value within the gray intensity range. The density values of each point are arranged in order of gray intensity from low to high to form a continuous probability curve, generating a background reference probability distribution.
[0025] Specifically, the formula: The advantage of the formula lies in the introduction of an exponential weighting term based on local gray-level variance. Traditional kernel density estimation treats all sample points equally, while this formula can dynamically adjust its contribution to probability distribution modeling based on the texture uniformity of the pixel neighborhood. Specifically, for background points with uniform and smooth glue residue texture (whose local gray-level variance...), the formula can adjust its contribution to probability distribution modeling based on the texture uniformity of the pixel neighborhood. Smaller values (with a weight close to 1) contribute significantly to the final background reference probability distribution. Conversely, smaller values contribute less to the distribution of subtle texture fluctuations or noise points that are difficult for the human eye to detect in the background region. When the weight of a background model is relatively large, its weight decreases exponentially, and its contribution is significantly suppressed. This mechanism makes the generated background model more robust to subtle non-uniformities within the background and can more accurately characterize the grayscale distribution characteristics of an ideal, pure background.
[0026] This represents the total number of pixels in the background region. This parameter is obtained directly by counting the pixels in the background region determined in the previous step. After locating a continuous background region free of bubbles, particles, and with a uniform distribution of adhesive residue texture, the system calculates the total number of pixels contained in that region. This value reflects the scale of the background sample used for modeling, and its magnitude directly affects the stability and accuracy of subsequent probability distribution estimation. A larger value... The value implies that the background model is based on richer statistical information, thus having better generalization ability. In practice, if the selected background area is a 256x256 pixel square area, then... The value is For example, if the system analyzes a 2048x2048 image and identifies an area of 80,000 pixels as a valid background region, then... The value is set to 80000.
[0027] For the first The grayscale intensity value of each pixel is derived from the original pixel grayscale intensity sequence generated in the previous step. Each element in this sequence corresponds to the brightness information of a specific pixel in the background region. For an 8-bit grayscale image, The value of is an integer between 0 and 255. When calculating the weighted kernel density estimate, the system will traverse the index. From 1 to In each iteration, the first pixel grayscale intensity sequence is extracted from the original pixel grayscale intensity sequence. each element as The current value of this value is the core data point used to construct the probability distribution, representing a specific observation sample of the background. For example, when processing the 100th pixel in the background region (i.e., ... The system reads the stored value from the 100th position of the original pixel grayscale intensity sequence. If the value is 198, then in this iteration, The value was set to 198.
[0028] The kernel bandwidth is a parameter that controls the smoothness of the kernel density estimation. Its value has a significant impact on the shape of the final probability distribution curve. A value that is too small... This can lead to excessive peaks in the curve, resulting in overfitting, and excessively large peaks can also cause the curve to have too many sharp peaks. This would result in over-smoothing, masking the true structure of the distribution. In this system, The value of is determined using the optimization method of Scott's rule, and the calculation formula is as follows: ,in It is the grayscale value of all pixels in the background area. standard deviation It is the total number of background pixels, for example, in a... When analyzing the background region, the standard deviation of its original pixel grayscale intensity sequence is first calculated to obtain... Then substitute the values into the formula to perform the calculation: To ensure computational robustness and appropriate smoothness of results, the system rounds the calculation result up and sets a lower limit of no less than 1. Therefore, in this example, the final kernel bandwidth used is... It is set to 1.
[0029] The Gaussian kernel function is a symmetric kernel function, a weighting function used to smooth data points. It defines how a single data point contributes to the probability density of its surrounding neighborhood. This system chooses the Gaussian kernel function because it has infinitely differentiable smoothing properties and can produce smooth probability density estimation curves. The specific expression of the Gaussian kernel function is as follows: ,in These are input variables; in this formula, the input variables are... This expression measures the point to be estimated. With sample points The distance between them, and determined by the kernel bandwidth. Scaling is performed when and When they are equal, The maximum value of the Gaussian kernel function indicates that... right The probability density at the point has the largest contribution, and the contribution decreases exponentially as the distance between the two points increases.
[0030] In pixels The local grayscale variance within the central neighborhood is derived from the corresponding local grayscale variance sequence generated in the previous step. It quantifies the texture complexity or non-uniformity of the neighborhood surrounding each background pixel. A low variance value indicates that the pixel is located in a smooth area with very uniform color and brightness, a typical feature of an ideal background. Conversely, a relatively high variance value may indicate that the pixel is on the edge of a glue-mark texture or has slight material non-uniformity, even though the area is generally considered background. During the calculation, the system traverses the index... From 1 to And extract the first from the corresponding local gray-scale variance sequence each element as The current value, for example, when processing the 100th pixel (i.e. The system reads the stored value from the 100th position of the corresponding local gray-level variance sequence. If the value is 15.7, then in this iteration, The value was set to 15.7.
[0031] This is the maximum local gray-level variance among all pixels. This parameter is determined by traversing the entire sequence after generating the corresponding local gray-level variance sequence. Its function is to act as a normalization factor, averaging the local gray-level variances across all pixels. Scaling to a controllable range, specifically, the system obtains information containing... After obtaining the local gray-level variance sequence corresponding to each variance value, a search operation will be performed to find the maximum value in the sequence. This will be used as the denominator for all exponential weight terms in the calculation formula, ensuring the ratio. The value range is between [0, 1]. This helps maintain the numerical stability of the weight calculation and allows the exponential weight control coefficient to be within a certain range. The regulatory effect is more consistent and predictable. For example, after the system analyzes a background region containing 65,536 pixels, the maximum value in the corresponding local gray-level variance sequence is 85.4. The value was set to 85.4.
[0032] The exponential weight control coefficient is a key adjustment parameter used to control the influence of local gray-level variance on pixel weights. Its value is set based on testing and optimization results on a large number of known samples (including normal backgrounds and minor defects). The setting process is as follows: Select a validation dataset containing various representative tape samples. For each sample image, manually mark several standard background areas and several minor defect areas. Then, set a... The candidate value range, for example, from 1 to 20, with a step size of 1, is used for each candidate value. The system uses this value to construct a background reference probability distribution and calculates anomaly scores for all standard background pixels and minor defect pixels in the validation dataset (details of the method are provided in subsequent steps). Finally, by comparing different... At this value, the discrimination between background and defect pixel anomaly scores (e.g., by calculating the area under the receiver operating characteristic curve, i.e., the AUC value) is selected, maximizing the AUC value. As the final optimal parameter, after testing 1000 tape images, it was found that... At this time, the system achieves an optimal balance between sensitivity and specificity in detecting minute defects such as uneven glue residue. The value is set to 8.
[0033] To avoid zero denominators for extremely small positive numbers, this is a constant used to ensure the stability of numerical calculations. When a computer performs floating-point operations, dividing by zero can lead to program errors or produce an infinity (Inf) result, thus interrupting the calculation process. The value is set to This value is small enough that it will not have any noticeable effect on the normal calculation results, but it can effectively avoid the occurrence of division by zero anomalies.
[0034] The normalization factor is used to ensure that the final calculated weighted kernel density estimate is accurate. The integral over the entire grayscale range yields 1, making it a valid probability density function, whose expression is... show, It is the reciprocal of the sum of all pixel weights, in the calculation Previously, the system would first calculate all background pixels (from arrive The exponential weights of the terms are summed up, and then the reciprocal is taken to obtain the result. The value of this The value will be applied to all gray levels subsequently. calculate The time remains constant, serving as a common scaling factor. For example, if a background region has only 3 pixels, and their weights are calculated to be 0.9, 0.8, and 0.6 respectively, then the sum of the weights is... Then the normalization factor The value is .
[0035] Calculation process: To calculate the grayscale intensity Weighted kernel density estimate at time Here, we take a three-pixel array as an example. The following explanation uses a miniature background area as an example, and all parameter values are derived from the example of the parameter acquisition steps mentioned above.
[0036] The known parameters are as follows: , , , , .
[0037] Background pixel data is: Point 1: , ; Point 2: , ; Point 3: , (A point with uneven texture); The kernel function used is a Gaussian kernel: ; Step 1: Calculate the normalization factor .
[0038] First, calculate the exponential weight of each point. .
[0039] ; ; ; Weighted sum .
[0040] Normalization factor .
[0041] Step 2: Calculation .
[0042] The formula is .
[0043] Calculate each term in the summation term separately: Item 1 ( ): ; Item 2 ( ): ; Item 3 ( ): ; Summation of terms: .
[0044] Step 3: Calculate the final result.
[0045] .
[0046] The results show that in the constructed weighted background model, the probability density estimate of a point with a gray value of 198 is 0.2422. This value itself represents the relative probability of this gray value appearing in an ideal background. A higher value means that the gray value is a typical feature of the background, and vice versa. This calculation process requires considering all possible gray values. Repeat the process (from 0 to 255) to obtain a complete sequence containing 256 probability density values.
[0047] Based on the weighted kernel density estimate, the system enters the background reference probability distribution generation stage. In the previous stage, the system had already calculated the background reference probability distribution for each possible grayscale intensity value using a formula. (For 8-bit images, The values of (0, 1, 2, ..., 255) all yielded a corresponding weighted kernel density estimate. These estimates form a numerical array of length 256. The core task at this stage is to transform this discrete numerical array into a structured, easily queryable background reference probability distribution. Specifically, the system creates a data structure, typically a lookup table or an associative array, where the keys are grayscale intensity values (0 to 255) and the values are the corresponding weighted kernel density estimates. Subsequently, the system arranges these 256 (key, value) pairs in ascending order of grayscale intensity (i.e., from 0 to 255). During the arrangement process, to ensure its validity as a probability distribution, the system performs a final normalization check, i.e., calculates all 256 values. The sum of values, and using each Dividing the value by this sum ensures that the sum of all probability values is strictly equal to 1, thus eliminating minor deviations that may be caused by accumulated errors in floating-point operations. This sorted and finally normalized sequence of values, when plotted in a coordinate system with grayscale intensity on the horizontal axis and probability density on the vertical axis, forms a continuous probability curve. This curve precisely describes the probability of any grayscale level occurring in an area considered as the standard background. Finally, this ordered array containing 256 precise probability values is stored to generate the background reference probability distribution.
[0048] The steps to obtain the local probability distribution to be tested are as follows: Set a fixed-size sliding window to traverse the original tape image sequentially with the same length. Read the grayscale intensity value of each pixel in each sliding window, and count the frequency of the grayscale value in the window and divide it by the total number of pixels to obtain the local probability distribution of the current sliding window.
[0049] Specifically, a fixed sliding window size of 31x31 pixels is first set. This size is chosen based on statistical analysis of defect sizes in a large number of tape samples, ensuring that the window can completely cover most small defects (such as bubbles and impurities) without excessively smoothing local features due to excessive size, which would reduce detection sensitivity. The step size is set to 1 pixel, which means that the window will move pixel by pixel in both the horizontal and vertical directions, performing a centering analysis on each pixel in the original tape image to achieve full-coverage dense scanning. The traversal process starts from the top left pixel of the image (coordinates (15,15) as the center of the first window), moves to the right, and moves to the next row after reaching the end of the row, until the last position in the bottom right corner can be used as the center of the window. For each fixed sliding window position, the system initializes an integer array of length 256 as a histogram counter, with all elements of the array initially set to zero. Next, the system accesses all 961 pixels within the 31x31 window one by one, reading the 8-bit grayscale intensity value of each pixel. This value is an integer between 0 and 255. The system updates the histogram counter based on the read grayscale value. For example, if the grayscale value of a pixel is read as 188, the value of the element with index 188 in the histogram array is incremented by 1. After completing the statistics of all 961 pixels in the window, the histogram array stores the specific frequency of each grayscale level from 0 to 255 in the window. Finally, the system divides each element value (i.e., frequency) in the histogram array by the total number of pixels in the window, 961, converting the frequency into a probability. This results in a floating-point array of length 256. The value of each element in this array represents the probability of the corresponding grayscale level appearing in the current window. This probability array is the local probability distribution to be tested corresponding to the center pixel position of the current sliding window.
[0050] The steps to obtain the statistical divergence anomaly score map are as follows: Based on the local probability distribution to be tested, the same gray level probability of the background reference probability distribution is extracted by gray level index as a reference template. At the same time, the mean and variance of the probabilities corresponding to all gray level values of the background reference probability distribution are recorded to obtain the combination relationship between the local probability distribution to be tested and the background reference probability distribution. Based on the combined relationship between the local probability distribution of the target pixel and the background reference probability distribution, the anomaly score of the center pixel is calculated. After integrating all anomaly scores, a statistical divergence anomaly score map is formed by mapping the positions. The calculation formula is as follows: ; in, Indicates the center pixel position of the sliding window Abnormal scores, Indicates the pixel position The first in the sliding window Local probability values of individual grayscale values Indicates the first The probability value of each grayscale value in the background reference probability distribution. This represents the weighted average of the probabilities of all gray values in the background reference probability distribution. This represents the weighted variance of the probabilities of all gray values in the background reference probability distribution. This is an enhancement factor used to amplify the degree of deviation. To avoid extremely small constants with a denominator of zero, This represents the total number of grayscale values (i.e., the distribution dimension).
[0051] Specifically, based on the local probability distribution generated for each sliding window in the previous step, the system retrieves the background reference probability distribution, which was globally generated and stored during the background feature modeling stage, in parallel. This background reference probability distribution is a floating-point array of length 256, where the index represents the grayscale value (0-255), and the array element value is the probability of that grayscale value appearing in an ideal background. The system uses this background reference probability distribution as a benchmark for comparison with each local probability distribution to be tested. Specifically, for a given local probability distribution to be tested (set as an array...), The system sequentially selects each grayscale value from the background reference probability distribution (set as an array) according to its grayscale index (from 0 to 255). Extract the probability values with the same index from the local probability distribution to be measured, thus forming a probability distribution that matches the local probability distribution to be measured. Parallel probability sequences serving as reference templates Meanwhile, the system references the probability distribution of the background. The system performs a one-time statistical characteristic calculation, which is only performed once when processing the first image or after the background model is updated, and records the results for reuse in all subsequent windows. The calculation includes the mean and variance of all 256 probability values in the distribution. Specifically, the mean is obtained by adding the 256 probability values in the background reference probability distribution array and dividing by 256. Then, the square of the difference between each probability value and the mean is calculated, and the variance is obtained by adding these 256 squared differences and dividing by 256. These two scalar values (mean and variance) are recorded. Finally, for any sliding window, the system organizes the local probability distribution to be tested in the current window, the background reference probability distribution as a reference template, and the calculated probability mean and variance of the background reference probability distribution into a data set. This set completely describes the probability-level correspondence and difference between the local region and the global background, and obtains the combined relationship between the local probability distribution to be tested and the background reference probability distribution.
[0052] formula: The advantage of the formula lies in the standard KL divergence. This formula treats all differences in gray levels equally, and introduces a dynamic weighting term. It amplifies gray values that are rarely seen in the background (i.e., far from the average gray value of the background). grayscale value The KL divergence component corresponding to the defect in the tape, such as air bubbles and impurities, often has a grayscale value that deviates significantly from the grayscale range of the normal background. Through this weight design, when a local area (by...) (Description) When such rare grayscale values appear, their corresponding divergence term is disproportionately amplified, resulting in an abnormal score in the final result. The response to these key defect features is more intense, improving the signal-to-noise ratio of detection and the ability to identify subtle defects.
[0053] Indicates the pixel position The first in the sliding window The local probability value of each grayscale value is the core carrier of local information and is directly derived from the "Steps for Obtaining the Local Probability Distribution to be Measured" in this application. For each pixel in the image... The system constructs a sliding window centered on the pixel and calculates the grayscale histogram of all pixels within the window. Then, the histogram is normalized to obtain a histogram containing... An array of probability values (256 for an 8-bit image), i.e. , of which element The grayscale value is... The proportion of pixels within a window dynamically reflects the local texture and grayscale characteristics of each tiny region of the image, and is a direct basis for judging whether the region is abnormal. For example, in a window with pixels... Within a 31x31 window centered on the pixel, a pixel with a grayscale value of 50 appeared 96 times. Therefore, the corresponding pixel in this window... The value is .
[0054] Indicates the first The probability value of each grayscale value in the background reference probability distribution, which is the benchmark of global background information, is derived from the "Steps for Obtaining Background Reference Probability Distribution" in this application. The system constructs a global probability distribution model representing the ideal background state by performing weighted kernel density estimation on a pre-selected clean background region in the image that does not contain any defects. The model is a length of An array of (256), where the first... element Indicates grayscale value The probability of a pixel appearing in a standard background is static and remains unchanged throughout the processing of an image, serving as the "gold standard" for comparison across all local regions. For example, after background modeling, the system determines that the probability of a grayscale value of 180 is highest in an ideal background. The value is 0.085, while pixels with a grayscale value of 50 are extremely rare. The value may be as low as 0.0001.
[0055] This parameter represents the weighted average of the probabilities of all gray values in the background reference probability distribution. The described average gray level is a core measure of central tendency of background gray-level characteristics, and it is calculated by considering all possible gray values. (From 0 to Its probability of occurrence in the background Summing the products, for example, if the background reference probability distribution... There is a noticeable peak around a grayscale value of 190, with lower probability in other areas, calculated using the above formula. The value will be very close to 190, for example, obtained by modeling the background of a specific tape sample. The distribution is calculated to obtain .
[0056] This parameter represents the weighted variance of the probabilities of all gray values in the background reference probability distribution. It quantifies how the background gray values revolve around their mean. The degree of dispersion or range of variation reflects the uniformity of the background texture, and its calculation formula is as follows: A smaller one This value indicates that the background is very uniform and the grayscale values are highly concentrated. Nearby, while a larger value indicates that the background itself has a certain degree of texture fluctuation, and... Similarly, this value is also obtained when the background reference probability distribution is acquired. The result, calculated once and used in subsequent anomaly scoring calculations, serves as the denominator in the weighting terms, acting as a standardization mechanism. This ensures that the measurement of grayscale value deviation is unaffected by the fluctuation range of the background itself. For example, based on the above... and background distribution Calculation .
[0057] The enhancement coefficient, used to amplify the degree of deviation, is a hyperparameter used to adjust the sensitivity of the weighting term, i.e., to control the severity of the penalty for deviations from rare grayscale values. The settings are determined through a validation set-based optimization process: First, a validation set is prepared containing hundreds of manually labeled tape images with defect locations. For each image, a validation set is set. Candidate values (e.g., from 0.5 to 5.0, with a step size of 0.1) are selected and a statistical divergence anomaly score map of the entire image is calculated. Then, the average anomaly score of pixels within all labeled defect regions is calculated. and the average anomaly score of all non-defective region pixels The ratio or difference between the two is calculated as an evaluation index, and this process is repeated to iterate through all candidates. The value that ultimately maximizes this evaluation index is selected. The value serves as the final configuration of the system; for example, it is found during testing that when... At that time, the score difference between defects and background was most significant, therefore it was determined that... .
[0058] To avoid extremely small constants with a denominator of zero, its value is set to... .
[0059] The total number of grayscale values (i.e., the distribution dimension) defines the dimension of the probability distribution, which is directly determined by the quantization depth of the image. For a standard 8-bit grayscale image, the grayscale value of a pixel can take 256 different integer values from 0 to 255. Therefore, the total number of grayscale values... The value is fixed at 256; this value determines the range of the summation operation in the formula, as well as the probability distribution array (such as...). and The length of ).
[0060] Calculation process: With a 4 gray level ( , For example, calculate the center point of a window. Abnormal scoring .
[0061] Known parameters: , , .
[0062] Background reference probability distribution : ; Local probability distribution of the test (A window containing defects): ; Step 1: Calculate the mean of the background distribution and variance .
[0063] ; ; ; ; Step 2: Calculate the weighted KL divergence for each item.
[0064] for : Weight ; divergence term ; Weighted divergence term ; for : Weight ; divergence term ; Weighted divergence term ; for : Weight ; divergence term ; Weighted divergence term ; for : because , Since the value of this item is 0, its contribution is 0.
[0065] Step 3: Sum the results to obtain the final anomaly score.
[0066] ; This result indicates that the location is... The anomaly score for the pixel is 40.195, which is a relatively high positive value. The magnitude of this value comprehensively reflects the degree of difference between the local area and the background. A score value much greater than zero, such as 40.195 in this example, indicates that there is a significant anomaly in the area, which is likely a defect. If the calculated score is a value close to zero or negative, it means that the area is highly similar to the background and is a normal area. By repeating this calculation for each pixel in the image, all the anomaly scores obtained at the end together constitute the statistical divergence anomaly score map.
[0067] The steps for obtaining the fusion weight parameter set are as follows: Based on the stress distribution polarization map and the statistical divergence anomaly score map, the gray value of the stress distribution polarization map is extracted for each pixel position, and the absolute value of the difference between the gray value and the mean gray value of all pixels in the stress distribution polarization map is calculated to generate the polarization significance measure corresponding to each pixel position. Extract the anomaly score from the statistical divergence anomaly score map for each pixel location, and calculate the absolute value of the difference between the anomaly score and the mean of the anomaly scores of all pixels in the statistical divergence anomaly score map to generate the divergence significance measure for each pixel location. Based on the polarization saliency measure and divergence saliency measure corresponding to each pixel position, the sum of the two saliency measures is calculated for each pixel position. Then, the sum of the two measures is divided by the polarization saliency measure and the divergence saliency measure respectively to generate the fusion weight parameter set.
[0068] Specifically, based on the stress distribution polarization map and the statistical divergence anomaly scoring map, the system first performs a global statistical analysis on the entire stress distribution polarization map, calculating the average grayscale value of all pixels in the map. This process is achieved by accumulating the grayscale values (range 0-255) of each pixel in the image, and then dividing the sum by the total number of pixels in the image (e.g., for a 1920x1080 image, the total number of pixels is 2,073,600) to obtain a global average grayscale value, such as 135.7. This average value represents the background reference brightness of the entire stress distribution polarization map. Subsequently, the system starts a pixel-by-pixel processing loop, traversing each pixel position in the stress distribution polarization map. For any pixel with coordinates (x, y), the system first extracts the grayscale value of that point, denoted as G(x, y). Then, it calculates the absolute value of the difference between this grayscale value G(x, y) and the previously calculated global average grayscale value of 135.7, i.e., |G(x, y) - The calculated non-negative value of 135.7 is defined as the polarization saliency measure of that pixel location. It quantifies the degree to which the polarization characteristics of that point deviate from the average level of the entire image. A larger value indicates a more abnormal stress state at that point. For example, if the gray value of a pixel is 210, its polarization saliency measure is |210 - 135.7| = 74.3. Conversely, if the gray value of another pixel is 140, its polarization saliency measure is |140 - 135.7| = 4.3. This calculation process is performed on all pixels in the image without exception, and finally generates a new data matrix with the same size as the original stress distribution polarization map, where the value of each element is the polarization saliency measure of the corresponding location.
[0069] Next, a similar processing flow is performed on the statistical divergence anomaly scoring map. First, the global average anomaly score of all pixels in the statistical divergence anomaly scoring map is calculated. This process involves summing the anomaly score (a floating-point number) at each pixel location in the image, and then dividing the sum by the total number of pixels to obtain a baseline score representing the average anomaly level of the entire image, for example, 22.5. This average value reflects the overall texture complexity of the image and the average deviation from the background model. Then, the system traverses the statistical divergence anomaly scoring map pixel by pixel. For each pixel with coordinates (x, y), the system extracts the anomaly score for that point, denoted as D(x, y). Then, the absolute value of the difference between this anomaly score D(x, y) and the global average anomaly score of 22.5 is calculated, i.e., |D(x, y) - 22.5|. The result 22.5 is defined as the divergence significance measure for that pixel location. This measure characterizes the degree to which the texture statistics of the local region where the pixel is located deviate from the global average. A higher divergence significance measure means that the gray-level distribution of the region where the point is located is extremely unusual. For example, if a pixel has an anomaly score of 150.8, its divergence significance measure is |150.8 - 22.5| = 128.3, which indicates that the point is a highly suspicious anomaly. Conversely, if a point has an anomaly score of 25.0, its divergence significance measure is only |25.0 - 22.5| = 2.5, which means that it is close to the average level. After this calculation is performed on all pixels in the image, another data matrix with the same size as the original image is generated. Each element of this matrix is the divergence significance measure of the corresponding location.
[0070] Based on the polarization saliency and divergence saliency measures generated for each pixel location in the first two steps, the system enters the fusion weight calculation stage. This stage is also performed pixel-by-pixel; for any pixel location (x, y) in the image, the system simultaneously calls the polarization saliency measure value at that location (denoted as...). ) and the significance measure of divergence (denoted as First, add the two metrics together to obtain the total saliency metric for that pixel location. To prevent division by zero errors in the rare case where both saliency measures of a pixel are exactly zero, a very small positive number (e.g., 1e-9) is added to the denominator in actual calculations. Next, the system calculates the normalized weights for the polarization channel and the divergence channel, respectively. The polarization weight factor is calculated using a polarization significance measure. Divide by the total significance measure, i.e. The divergence weighting factor is calculated using the divergence significance measure. Divide by the total significance measure, i.e. For example, at pixel (300, 500), the calculated polarization significance metric is 74.3, the divergence significance metric is 128.3, and the total significance metric is 202.6. The corresponding polarization weighting factor is... The divergence weighting factor is The sum of these two weighting factors is always 1. After this calculation process is completed for all pixels, a fusion weight parameter set is generated. This parameter set is actually composed of two weight maps of the same size as the original image: a polarization weight map and a divergence weight map.
[0071] The steps for obtaining enhanced images of composite defects are as follows: Based on the fusion weight parameter set, the gray value of the stress distribution polarization map at each pixel location is multiplied by the corresponding polarization weight factor, the anomaly score of the statistical divergence anomaly scoring map is multiplied by the corresponding divergence weight factor, and then added up position by position to generate a composite defect enhancement image.
[0072] Specifically, based on the fusion weight parameter set, the system begins the final image fusion step. Before weighted fusion, the system first normalizes the numerical range of the input stress distribution polarization map and statistical divergence anomaly scoring map, mapping them uniformly to a grayscale range of 0 to 255. For the stress distribution polarization map, which is already in the 0-255 range, its original grayscale value is used directly. For the statistical divergence anomaly scoring map, whose numerical range is not fixed, a minimum-maximum normalization method is used, that is, the minimum value in the entire scoring map is found first. and maximum value Then score each pixel. Application formula The system performs a transformation to obtain a normalized scoring image. Next, it performs a weighted summation pixel by pixel. For each pixel location (x, y), the system extracts the grayscale value of the stress distribution polarization map at that location. And the numerical values of the normalized statistical divergence anomaly score plot. Simultaneously, the polarization weight factor corresponding to that position is retrieved from the fusion weight parameter set. and divergence weighting factor Then, calculate the weighted sum, using the formula: For example, for pixel (300, 500), its polarization grayscale value is 210, and its normalized divergence score is 230. The corresponding weighting factors are 0.367 and 0.633, respectively. The final composite grayscale value is... The calculation result is rounded to 223, and this value is used as the pixel gray value at position (300, 500) in the output image. After performing this operation on all pixels, a composite defect enhancement image is generated.
Claims
1. An image enhancement-based adhesive tape transparency defect detection system, characterized in that, The system includes: The polarization information acquisition module sets the polarizer to rotate to three angles: 0 degrees, 45 degrees, and 90 degrees. It then acquires three polarization optical images for each polarization optical image. For each pixel, based on the corresponding pixel intensity value of the three polarization optical images, it calculates the Stokes parameters S0, S1, and S2 to generate a stress distribution polarization map. The background feature modeling module selects a background area without bubbles, impurities, and uneven adhesive residue from the input original tape image, obtains the original pixel gray intensity sequence and the corresponding local gray variance sequence, and performs kernel density estimation on the original pixel gray intensity sequence and the corresponding local gray variance sequence to obtain the background reference probability distribution. The local divergence scoring module sets up a sliding window to traverse the original tape image and obtain the local probability distribution to be tested. For the center pixel of each window, the corresponding local probability distribution to be tested and the background reference probability distribution are extracted, the anomaly score is calculated, and the statistical divergence anomaly score map is obtained. The multi-dimensional feature fusion module sets pixel-level fusion weight values for the two images based on the stress distribution polarization map and the statistical divergence anomaly scoring map, forming a fusion weight parameter set. Based on the fusion weight parameter set, it calculates and generates a composite defect enhancement image.
2. The image enhancement-based tape transparency defect detection system according to claim 1, characterized in that, The steps for obtaining the stress distribution polarization map are as follows: The polarizer is rotated to 0 degrees, 45 degrees and 90 degrees respectively. A polarized optical image is acquired for each angle. The pixel intensity value in each polarized optical image is extracted pixel by pixel. The pixel intensity value combination of the three polarized optical images corresponding to each pixel position is established to generate the pixel intensity value combination of the three polarized optical images. Based on the pixel intensity value combination of the three polarized optical images, the corresponding pixel intensity values of the three polarized optical images are called for each pixel position. Through the superposition and difference operation of the combined values, the Stokes parameters S0, S1 and S2 values corresponding to the position are calculated pixel by pixel to form the Stokes parameter value combination. Based on the Stokes parameter value combination, the Stokes parameter values S0, S1 and S2 of each pixel position are called one by one, and the linear polarization degree value and polarization angle value are calculated pixel by pixel. The linear polarization degree value and polarization angle value of each pixel position are fused to obtain the gray value corresponding to each pixel position, forming a stress distribution polarization map.
3. The image enhancement-based tape transparency defect detection system according to claim 1, characterized in that, The steps for obtaining the original pixel grayscale intensity sequence and the corresponding local grayscale variance sequence are as follows: In the input original tape image, locate a continuous background region in the image area that is free of bubbles and particulate impurities and has a uniform distribution of adhesive residue texture. Extract the gray intensity value of each pixel in the background region one by one, and construct a neighborhood window of a fixed size with the pixel as the center. Perform standard deviation square operation on all pixel gray values in the neighborhood to obtain the local gray variance, and generate the original pixel gray intensity sequence and the corresponding local gray variance sequence.
4. The image enhancement-based tape transparency defect detection system according to claim 1, characterized in that, The steps for obtaining the background reference probability distribution are as follows: Based on the original pixel grayscale intensity sequence and the corresponding local grayscale variance sequence, the weighted kernel density estimate is calculated. Based on the weighted kernel density estimate, the corresponding kernel density estimate is extracted for each value point within the gray intensity range. The density values of each point are arranged in order of gray intensity from low to high to form a continuous probability curve, thereby generating a background reference probability distribution.
5. The image enhancement-based tape transparency defect detection system according to claim 1, characterized in that, The steps for obtaining the local probability distribution to be tested are as follows: Set a fixed-size sliding window to traverse the original tape image sequentially with the same length. Read the grayscale intensity value of each pixel in each sliding window, and count the frequency of the grayscale value in the window and divide it by the total number of pixels to obtain the local probability distribution of the current sliding window.
6. The image enhancement-based tape transparency defect detection system according to claim 1, characterized in that, The steps for obtaining the statistical divergence anomaly scoring map are as follows: Based on the local probability distribution to be tested, the same gray level probability of the background reference probability distribution is extracted by gray level index as a reference template. At the same time, the mean and variance of the probabilities corresponding to all gray level values of the background reference probability distribution are recorded to obtain the combination relationship between the local probability distribution to be tested and the background reference probability distribution. Based on the combined relationship between the local probability distribution to be tested and the background reference probability distribution, the anomaly score of the center pixel is calculated. All anomaly scores are integrated and mapped according to their positions to form a statistical divergence anomaly score map.
7. The image enhancement-based tape transparency defect detection system according to claim 1, characterized in that, The steps for obtaining the fusion weight parameter set are as follows: Based on the stress distribution polarization map and the statistical divergence anomaly scoring map, the gray value of the stress distribution polarization map is extracted for each pixel position, and the absolute value of the difference between the gray value and the mean gray value of all pixels in the stress distribution polarization map is calculated to generate the polarization significance measure corresponding to each pixel position. Extract the anomaly score from the statistical divergence anomaly score map for each pixel location, and calculate the absolute value of the difference between the anomaly score and the mean of the anomaly scores of all pixels in the statistical divergence anomaly score map to generate the divergence significance measure for each pixel location. Based on the polarization saliency measure and divergence saliency measure corresponding to each pixel position, the sum of the two saliency measures is calculated for each pixel position. Then, the sum of the two measures is divided by the polarization saliency measure and the divergence saliency measure respectively to generate the fusion weight parameter set.
8. The image enhancement-based tape transparency defect detection system according to claim 1, characterized in that, The steps for obtaining the composite defect enhanced image are as follows: Based on the fusion weight parameter set, the gray value of the stress distribution polarization map at each pixel position is multiplied by the corresponding polarization weight factor, the anomaly score of the statistical divergence anomaly scoring map is multiplied by the corresponding divergence weight factor, and then added up position by position to generate a composite defect enhancement image.
9. The method for detecting transparent defects in adhesive tape using an image enhancement-based adhesive tape transparency defect detection system according to any one of claims 1-8, characterized in that, Includes the following steps: The polarizer is rotated to three angles: 0 degrees, 45 degrees, and 90 degrees. Three polarization optical images are acquired for each polarization optical image. For each pixel, Stokes parameters S0, S1, and S2 are calculated based on the corresponding pixel intensity values of the three polarization optical images to generate a stress distribution polarization map. In the input original tape image, a background area without bubbles, impurities, and uneven adhesive residue is selected to obtain the original pixel gray intensity sequence and the corresponding local gray variance sequence. Kernel density estimation is performed on the original pixel gray intensity sequence and the corresponding local gray variance sequence to obtain the background reference probability distribution. Set up a sliding window to traverse the original tape image and obtain the local probability distribution to be tested. For the center pixel of each window, extract the corresponding local probability distribution to be tested and the background reference probability distribution, calculate the anomaly score, and obtain the statistical divergence anomaly score map. Based on the stress distribution polarization map and the statistical divergence anomaly score map, pixel-level fusion weight values are set for the two images to form a fusion weight parameter set. Based on the fusion weight parameter set, a composite defect enhancement image is calculated and generated.